Skip to content

Instantly share code, notes, and snippets.

@cmoesel
Last active April 26, 2022 00:32
Show Gist options
  • Save cmoesel/54137a61b86cf2b28188fc87bdf81620 to your computer and use it in GitHub Desktop.
Save cmoesel/54137a61b86cf2b28188fc87bdf81620 to your computer and use it in GitHub Desktop.
Patient Profile Exercise - Step 7
/*
╭───────────────────────── PATIENT PROFILE TUTORIAL ──────────────────────────╮
│ Welcome to this introductory FSH tutorial exercise for building a simple │
│ patient profile. This exercise is designed to work in FSH Online: │
│ https://fshschool.org/FSHOnline/#/gist/f6579b504a25491ed03f1f2d036545fd │
╰─────────────────────────────────────────────────────────────────────────────╯
──────────────── STEP 7: CREATE EXAMPLE INSTANCE OF PROFILE ──────────────────
Let's finish by making an example that conforms to our profile. Create an
instance of PatientProfile in FSH named "PatientExample". Give the instance
a title and short description (used for documentation purposes only).
The patient should be named Sally Jones. Sally was born on October 26, 1972.
She was assigned female at birth and continues to identify as female today.
See Defining Instances in the FSH Spec:
- http://hl7.org/fhir/uv/shorthand/reference.html#defining-instances
For help referring to the extension, see Extension Paths:
- http://hl7.org/fhir/uv/shorthand/reference.html#extension-paths
When you're done, click "Convert to JSON" to see the results (and any errors).
Since you're creating more than one item in FSH Online now, you'll need to use
the navigation on the right-hand side to choose which JSON definition to view.
Congratulations! You're done! If you'd like, you can click the link icon in
your FSH editor to share your solution with a friend. Or download your FSH
and JSON files by clicking the "Save All" link in the header!
To check your work, take a look at the full solution here:
- https://fshschool.org/FSHOnline/#/gist/698322e8763e9fa6f04ed3da00f047ed
──────────────────────────────────────────────────────────────────────────────
*/
Alias: $GENDER = http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender
Alias: $NULL = http://terminology.hl7.org/CodeSystem/v3-NullFlavor
Profile: PatientProfile
Parent: Patient
Id: patient-profile
Title: "A Patient Profile"
Description: "Defines constraints and extensions on the patient resource."
* extension contains BirthSexExtension named birthsex 0..1 MS
* name 1..* MS
* name.family MS
* name.given MS
* gender 1..1 MS
* birthDate MS
ValueSet: BirthSex
Id: birthsex
Title: "Birth Sex"
Description: "Codes for assigning sex at birth"
* include codes from system $GENDER
* $NULL#UNK "Unknown"
Extension: BirthSexExtension
Id: birthsex-extension
Title: "Birth Sex Extension"
Description: "A code classifying the person's sex assigned at birth"
* value[x] only CodeableConcept
* value[x] from BirthSex
/*
╭────────────────────────────── PREVIOUS STEPS ───────────────────────────────╮
│ STEP 1: DEFINE PROFILE METADATA: │
│ - https://fshschool.org/FSHOnline/#/gist/f6579b504a25491ed03f1f2d036545fd │
│ STEP 2: CARDINALITY CONSTRAINTS: │
│ - https://fshschool.org/FSHOnline/#/gist/9c47ed295938e66c9cd29c87eb7969e9 │
│ STEP 3: MUST SUPPORT FLAGS: │
│ - https://fshschool.org/FSHOnline/#/gist/0e5b22c7f2069e0cd008ae30ccea094a │
│ STEP 4: BIRTH SEX VALUE SET: │
│ - https://fshschool.org/FSHOnline/#/gist/d931516c0c6823fbf6e964650fcd249d │
│ STEP 5: BIRTH SEX EXTENSION │
│ - https://fshschool.org/FSHOnline/#/gist/95eab22f052975fc6d00170b6a69fc91 │
│ STEP 6: ADD BIRTHSEX EXTENSION TO PROFILE │
│ - https://fshschool.org/FSHOnline/#/gist/214ac4af4907ea24246050b51d7324f3 │
╰─────────────────────────────────────────────────────────────────────────────╯
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment