diff --git a/input/fsh/instances/patient/ElisabethBroennimannByBFH.fsh b/input/fsh/instances/patient/ElisabethBroennimannByBFH.fsh index 45ea2fb..c26b650 100644 --- a/input/fsh/instances/patient/ElisabethBroennimannByBFH.fsh +++ b/input/fsh/instances/patient/ElisabethBroennimannByBFH.fsh @@ -15,10 +15,60 @@ Description: "Patient with insurance card number as identifier, contact details, * telecom[=].value = "elisabeth@broennimann.today" * gender = #female * birthDate = "1937-05-03" -* address.use = #home -* address.line = "Kreuzweg 11" -* address.city = "Biel/Bienne" -* address.postalCode = "2500" +// [0] ch-addr-2 correct +* address[0].use = #home +* address[=].line = "Kreuzweg 11" +* address[=].city = "Biel/Bienne" +* address[=].postalCode = "2500" +* address[=].state = "BE" +* address[=].country = "Schweiz" +* address[=].country.extension.url = "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding" +* address[=].country.extension.valueCoding = urn:iso:std:iso:3166#CH +/* test cases for invariant ch-addr-2 +// [1] ch-addr-2 correct +* address[+].use = #home +* address[=].line = "Kreuzweg 11" +* address[=].city = "Biel/Bienne" +* address[=].postalCode = "2500" +* address[=].state = "BE" +* address[=].country = "Schweiz" +* address[=].country.extension.url = "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding" +* address[=].country.extension.valueCoding = urn:iso:std:iso:3166#CHE +// [2] ch-addr-2 correct +* address[+].use = #home +* address[=].line = "Kreuzweg 11" +* address[=].city = "Biel/Bienne" +* address[=].postalCode = "2500" +* address[=].state = "BE" +* address[=].country = "Schweiz" +// [3] ch-addr-2 correct +* address[+].use = #home +* address[=].line = "Kreuzweg 11" +* address[=].city = "Biel/Bienne" +* address[=].postalCode = "2500" +* address[=].state = "BE" +* address[=].country = "Schweiz" +* address[=].country.extension.url = "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding" +* address[=].country.extension.valueCoding = urn:iso:std:iso:3166#DE +// [4] ch-addr-2 incorrect +* address[+].use = #home +* address[=].line = "Kreuzweg 11" +* address[=].city = "Biel/Bienne" +* address[=].postalCode = "2500" +* address[=].state = "Bern" +* address[=].country = "Schweiz" +* address[=].country.extension.url = "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding" +* address[=].country.extension.valueCoding = urn:iso:std:iso:3166#CH +// [5] ch-addr-2correct +* address[+].use = #home +* address[=].line = "Kreuzweg 11" +* address[=].city = "Biel/Bienne" +* address[=].postalCode = "2500" +* address[=].state = "Bern" +* address[=].country = "Schweiz" +* address[=].country.extension.url = "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding" +* address[=].country.extension.valueCoding = urn:iso:std:iso:3166#DE +*/ * maritalStatus.coding[0] = $ech-11-maritalstatus#2 "verheiratet" * maritalStatus.coding[+] = $v3-MaritalStatus#M "married" * generalPractitioner.reference = "Practitioner/HanspeterWengerByBFH" \ No newline at end of file diff --git a/input/fsh/invariants/ch-addr-1.fsh b/input/fsh/invariants/ch-addr-1.fsh deleted file mode 100644 index 11d1765..0000000 --- a/input/fsh/invariants/ch-addr-1.fsh +++ /dev/null @@ -1,4 +0,0 @@ -Invariant: ch-addr-1 -Description: "ISO Country Alpha-2 or ISO Country Alpha-3 code" -Severity: #error -Expression: "((value.code.length()=2) and value.code.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-2')) or ((value.code.length() = 3) and value.code.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-3'))" \ No newline at end of file diff --git a/input/fsh/invariants/ch-addr.fsh b/input/fsh/invariants/ch-addr.fsh new file mode 100644 index 0000000..29138c9 --- /dev/null +++ b/input/fsh/invariants/ch-addr.fsh @@ -0,0 +1,13 @@ +Invariant: ch-addr-1 +Description: "ISO Country Alpha-2 or ISO Country Alpha-3 code" +Severity: #error +Expression: "((value.code.length()=2) and value.code.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-2')) or ((value.code.length() = 3) and value.code.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-3'))" + + +Invariant: ch-addr-2 +Description: "For a Swiss address, a canton abbreviation from the value set 'eCH-0007 Canton Abbreviation' must be used." +Severity: #error +Expression: "country.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding').empty() or + (country.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding').value.code.startsWith('CH') = false) or + (country.extension.where(url = 'http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding').value.code.startsWith('CH').exists() and + (state.empty() or state.memberOf('http://fhir.ch/ig/ch-core/ValueSet/ech-7-cantonabbreviation')))" diff --git a/input/fsh/profiles/CHCoreAddress.fsh b/input/fsh/profiles/CHCoreAddress.fsh index c0b68a8..71e2e16 100644 --- a/input/fsh/profiles/CHCoreAddress.fsh +++ b/input/fsh/profiles/CHCoreAddress.fsh @@ -5,6 +5,7 @@ Title: "CH Core Address" Description: "address incorporating eCH-0010 postal address extensions" * . ^short = "An address expressed using postal conventions (as opposed to GPS or other location definition formats)" +* obeys ch-addr-2 * line.extension ^slicing.discriminator[0].type = #value * line.extension ^slicing.discriminator[=].path = "url" * line.extension ^slicing.discriminator[+].type = #value @@ -42,7 +43,7 @@ Description: "address incorporating eCH-0010 postal address extensions" * city.extension ^slicing.rules = #open * city.extension contains ECH007MunicipalityId named bfs 0..1 - +* state ^short = "Use values from eCH-0007 Canton Abbreviation (incl. FL) for a Swiss address" * country.extension ^slicing.discriminator[0].type = #value * country.extension ^slicing.discriminator[=].path = "url" * country.extension ^slicing.rules = #open diff --git a/input/fsh/terminology/ECH007CantonFLAbbreviation.fsh b/input/fsh/terminology/ECH007CantonFLAbbreviation.fsh new file mode 100644 index 0000000..7971c2d --- /dev/null +++ b/input/fsh/terminology/ECH007CantonFLAbbreviation.fsh @@ -0,0 +1,55 @@ +// https://www.ech.ch/de/ech/ech-0007/6.0 +// https://www.ech.ch/sites/default/files/imce/eCH-Dossier/0001-0030/eCH-0007/6.00/Beilagen/eCH-0007-6-0.xsd + +CodeSystem: ECH007CantonFLAbbreviation +Id: ech-7-cantonflabbreviation +Title: "eCH-0007 Canton Abbreviation incl. FL (Fürstentum Liechtenstein)" +Description: "eCH-0007 defines cantonAbbreviation/cantonFLAbbreviation (Kantonskürzel inkl. Fürstentum Liechtenstein), see [here](https://www.ech.ch/de/ech/ech-0007/6.0)." +* ^experimental = false +* ^caseSensitive = true +* ^content = #complete +* #AG +* #AR +* #AI +* #BL +* #BS +* #BE +* #FR +* #GE +* #GL +* #GR +* #JU +* #LU +* #NE +* #NW +* #OW +* #SH +* #SZ +* #SO +* #SG +* #TI +* #TG +* #UR +* #VD +* #VS +* #ZG +* #ZH +* #FL + + + +ValueSet: ECH007CantonAbbreviation +Id: ech-7-cantonabbreviation +Title: "eCH-0007 Canton Abbreviation" +Description: "eCH-0007: Each municipality has a unique cantonal affiliation, which can be defined by the cantonal abbreviation commonly used in Switzerland." +* ^experimental = false +* include codes from system ECH007CantonFLAbbreviation +* exclude http://fhir.ch/ig/ch-core/CodeSystem/ech-7-cantonflabbreviation#FL + + +ValueSet: ECH007CantonFLAbbreviation +Id: ech-7-cantonflabbreviation +Title: "eCH-0007 Canton Abbreviation incl. FL (Fürstentum Liechtenstein)" +Description: "eCH-0007: Analogous to cantonAbbreviation, but contains the entry 'FL' for the Principality of Liechtenstein in addition to the actual cantons. " +* ^experimental = false +* include codes from system ECH007CantonFLAbbreviation diff --git a/input/pagecontent/changelog.md b/input/pagecontent/changelog.md index 8f21582..aebe994 100644 --- a/input/pagecontent/changelog.md +++ b/input/pagecontent/changelog.md @@ -3,6 +3,7 @@ All significant changes to this FHIR implementation guide will be documented on ### STU 4 (planned for 2023-12) #### Added +* [#233](https://github.com/hl7ch/ch-core/issues/233): CH Core Address: Include eCH-0007 cantonAbbreviation #### Changed / Updated