Skip to content

Commit

Permalink
Merge pull request #120 from ahdis/oe_118
Browse files Browse the repository at this point in the history
#118 observation.value depending on leading code
  • Loading branch information
oliveregger authored Oct 21, 2024
2 parents 9b47740 + 2b3d2a1 commit b4796c6
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 0 deletions.
10 changes: 10 additions & 0 deletions input/fsh/invariants.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ Description: "If Observation.code is mapped in http://fhir.ch/ig/ch-elm/ConceptM
Severity: #error
Expression: "'http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-interpretation-code'.resolve().group.where(source='http://snomed.info/sct').element.where(code=%context.code.coding.where(system='http://snomed.info/sct').first().code).exists() implies interpretation.memberOf('http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-interpretation-code'.resolve().group.where(source='http://snomed.info/sct').element.where(code=%context.code.coding.where(system='http://snomed.info/sct').first().code).target.first().code)"

Invariant: ch-elm-observation-profile-loinc
Description: "If Observation.code is mapped in http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-observation-profile', then the observation must be conform to the mapped profile"
Severity: #error
Expression: "'http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-observation-profile'.resolve().group.where(source='http://loinc.org').element.where(code=%context.code.coding.where(system='http://loinc.org').first().code).exists() implies conformsTo('http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-observation-profile'.resolve().group.where(source='http://loinc.org').element.where(code=%context.code.coding.where(system='http://loinc.org').first().code).target.first().code)"

Invariant: ch-elm-observation-profile-snomedct
Description: "If Observation.code is mapped in http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-observation-profile', then the observation must be conform to the mapped profile"
Severity: #error
Expression: "'http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-observation-profile'.resolve().group.where(source='http://snomed.info/sct').element.where(code=%context.code.coding.where(system='http://snomed.info/sct').first().code).exists() implies conformsTo('http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-observation-profile'.resolve().group.where(source='http://snomed.info/sct').element.where(code=%context.code.coding.where(system='http://snomed.info/sct').first().code).target.first().code)"

Invariant: name-initials
Description: "a name with initials"
Severity: #error
Expand Down
17 changes: 17 additions & 0 deletions input/fsh/profiles/Observation.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Description: "This CH ELM base profile constrains the Observation resource for t
* obeys ch-elm-patient-name-representation-initial-snomedct
* obeys ch-elm-patient-name-representation-initial-or-vctcode-loinc
* obeys ch-elm-patient-name-representation-initial-or-vctcode-snomedct
* obeys ch-elm-observation-profile-loinc
* obeys ch-elm-observation-profile-snomedct
* . ^short = "CH ELM Observation Results: Laboratory"
* status = #final
* code from ChElmResultsLaboratoryObservation (extensible)
Expand Down Expand Up @@ -43,3 +45,18 @@ Id: ch-elm-observation-results-laboratory-strict
Title: "CH ELM Observation Results: Laboratory (strict)"
Description: "CH ELM profile for the Observation resource with a stricter validation mechanism than the base profile via binding strength reinforcement for the leading code element."
* code from ChElmResultsLaboratoryObservation (required)

Profile: ChElmObservationPq
Parent: Observation
Id: ch-elm-observation-pq
* valueQuantity 1..1

Profile: ChElmObservationRto
Parent: Observation
Id: ch-elm-observation-rto
* valueRatio 1..1

Profile: ChElmObservationTxt
Parent: Observation
Id: ch-elm-observation-txt
* valueString 1..1
3 changes: 3 additions & 0 deletions input/pagecontent/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
All significant changes to this FHIR implementation guide will be documented on this page.
### 1.6.0 - unreleased

* [#118](https://github.com/ahdis/ch-elm/issues/118)Observation.value depending on leading code

* [#117](https://github.com/ahdis/ch-elm/issues/117) New Interpretation Valueset «avidity»

Expand Down
34 changes: 34 additions & 0 deletions input/resources/CodeSystem-ch-elm-observation-profile-vs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"resourceType": "CodeSystem",
"id": "ch-elm-observation-profile-vs",
"url": "http://fhir.ch/ig/ch-elm/CodeSystem/ch-elm-observation-profile-vs",
"version": "2024-10-17",
"name": "ChElmObservationProfileVs",
"title": "CH ELM Observation Profile Vs",
"status": "active",
"experimental": false,
"description": "The codes contained in this code system represent URLs of Profile Observations that can be used as target codes in ConceptMaps. These profiles defines the Observation in relation to the leading code.",
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "CHE"
}
]
}
],
"caseSensitive": false,
"content": "complete",
"concept": [
{
"code": "http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-observation-txt"
},
{
"code": "http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-observation-rto"
},
{
"code": "http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-observation-pq"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"resourceType": "ConceptMap",
"id": "ch-elm-results-to-observation-profile",
"url": "http://fhir.ch/ig/ch-elm/ConceptMap/ch-elm-results-to-observation-profile",
"version": "2024-10-17",
"name": "ChElmResultsToObservationProfile",
"title": "CH ELM Results To Observation Profile",
"status": "active",
"experimental": false,
"description": "This CH ELM concept map specifies the observation profile for each leading code",
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "CHE"
}
]
}
],
"sourceCanonical": "http://fhir.ch/ig/ch-elm/ValueSet/ch-elm-results-laboratory-observation",
"targetCanonical": "http://fhir.ch/ig/ch-elm/ValueSet/ch-elm-observation-profile-vs",
"group": [
{
"source": "http://loinc.org",
"target": "http://fhir.ch/ig/ch-elm/CodeSystem/ch-elm-observation-profile-vs",
"element": [
{
"code": "56475-7",
"display": "Salmonella sp antigenic formula [Identifier] in Isolate by Agglutination",
"target": [
{
"code": "http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-observation-txt",
"equivalence": "relatedto"
}
]
}
]
}
]
}
29 changes: 29 additions & 0 deletions input/resources/ValueSet-ch-elm-observation-profile-vs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"resourceType": "ValueSet",
"id": "ch-elm-observation-profile-vs",
"url": "http://fhir.ch/ig/ch-elm/ValueSet/ch-elm-observation-profile-vs",
"version": "2024-10-17",
"name": "ChElmObservationProfileVs",
"title": "CH ELM Observation Profile Vs",
"status": "active",
"experimental": false,
"description": "This CH ELM value set includes the profile URLs as codes to map in the concept maps the leading codes, which specify how the observation value must be provided.",
"compose": {
"include": [
{
"system": "http://fhir.ch/ig/ch-elm/CodeSystem/ch-elm-observation-profile-vs",
"concept": [
{
"code": "http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-observation-txt"
},
{
"code": "http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-observation-rto"
},
{
"code": "http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-observation-pq"
}
]
}
]
}
}
27 changes: 27 additions & 0 deletions tests/updateterminology.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ curl --request GET \
--key $KEY \
-o ../input/resources/ValueSet-$VALUESET.json

VALUESET="ch-elm-observation-profile-vs"
curl --request GET \
--url https://ws.infreport-a.bag.admin.ch/ch-elm/v1/fhir/ValueSet/$VALUESET \
--header 'accept: application/fhir+json' \
--header 'user-agent: vscode-restclient' \
--cert $CERT \
--key $KEY \
-o ../input/resources/ValueSet-$VALUESET.json

CONCEPTMAP="ch-elm-expecting-organism-specification-to-results-completion-vs"
curl --request GET \
--url https://ws.infreport-a.bag.admin.ch/ch-elm/v1/fhir/ConceptMap/$CONCEPTMAP \
Expand Down Expand Up @@ -309,6 +318,15 @@ curl --request GET \
--key $KEY \
-o ../input/resources/ConceptMap-$CONCEPTMAP.json

CONCEPTMAP="ch-elm-results-to-observation-profile"
curl --request GET \
--url https://ws.infreport-a.bag.admin.ch/ch-elm/v1/fhir/ConceptMap/$CONCEPTMAP \
--header 'accept: application/fhir+json' \
--header 'user-agent: vscode-restclient' \
--cert $CERT \
--key $KEY \
-o ../input/resources/ConceptMap-$CONCEPTMAP.json

CODESYSTEM="ch-elm-foph-business-rules"
curl --request GET \
--url https://ws.infreport-a.bag.admin.ch/ch-elm/v1/fhir/CodeSystem/$CODESYSTEM \
Expand Down Expand Up @@ -345,6 +363,15 @@ curl --request GET \
--key $KEY \
-o ../input/resources/CodeSystem-$CODESYSTEM.json

CODESYSTEM="ch-elm-observation-profile-vs"
curl --request GET \
--url https://ws.infreport-a.bag.admin.ch/ch-elm/v1/fhir/CodeSystem/$CODESYSTEM \
--header 'accept: application/fhir+json' \
--header 'user-agent: vscode-restclient' \
--cert $CERT \
--key $KEY \
-o ../input/resources/CodeSystem-$CODESYSTEM.json

for file in ../input/resources/*.json
do
pcregrep -Mv '"text":(.|\n)+?\},' "$file" > temp && mv temp "$file"
Expand Down

0 comments on commit b4796c6

Please sign in to comment.