Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rmrlangford committed Feb 17, 2024
1 parent 1acb8ca commit a1f8745
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions input/fsh/examples.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Description: "Is used to document demographics and other administrative informat
* name[=].given[+] = "Maria"

* name[+].use = #nickname
* name[=].given[+] = "Smitty"
* name[=].text = "Smitty"

* birthDate = "1990-12-12"
* birthDate.extension[birthTime].valueDateTime = "1983-05-22T16:40:17+02:00"
Expand All @@ -40,7 +40,7 @@ Description: "The husband or wife, considered in relation to the patient."
* name[=].family = "Jones"
* name[=].given[+] = "Mike"
* telecom[+][phone].system = #phone
* telecom[=][phone].value = "083-123-1234"
* telecom[=][phone].value = "+26095705784"
* relationship = $PARENT_RELATIONSHIP_CODES#SPS

Instance: PatientEducationalLevelObservationExample
Expand Down
20 changes: 15 additions & 5 deletions input/fsh/smartcare.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ Severity: #error

Invariant: PatientName-Smartcare-1
Description: "If name.use is NOT nickname then name.family SHALL be present."
Expression: "use.exists() and use != 'nickname' implies family.exists()"
Expression: "use.exists() and use != 'nickname' implies family.exists() and given.exists()"
Severity: #error

Invariant: PatientName-Smartcare-2
Description: "If name.use is nickname then name.text SHALL be present."
Expression: "use.exists() and use = 'nickname' implies text.exists()"
Severity: #error

Invariant: PHONE-1
Description: "Only special characters (dash) and numbers are allowed. For example: 083-123-1234"
Expression: "$this.matches('[0-9]{1,3}-[0-9]{1,3}-[0-9]{4}')"
Description: "Only special characters (+) and numbers are allowed. For example: 0831231234, +27831231234"
Expression: "$this.matches('^[+]?{1}[0-9]{10,12}$')"
Severity: #error

Profile: ImmunizationPatient
Expand Down Expand Up @@ -46,12 +51,17 @@ Description: "Is used to document demographics and other administrative informat
* identifier[NRC].system = "http://openhie.org/fhir/zambia-immunizations/identifier/patient-nrc"

* name 1..*
* obeys PatientName-Smartcare-1
* name.given 1..*
* obeys PatientName-Smartcare-1 and PatientName-Smartcare-2
* name.given 0..* MS
* name.given ^definition =
"reason(s) why this should be supported."
* name.family 0..1 MS
* name.family ^definition =
"reason(s) why this should be supported."
* name.use 1..1
* name.text 0..1 MS
* name.text ^definition =
"Used to capture the patient's nickname."
/** name ^slicing.discriminator.type = #value
* name ^slicing.discriminator.path = "use"
* name ^slicing.rules = #open
Expand Down

0 comments on commit a1f8745

Please sign in to comment.