Skip to content

Commit

Permalink
[WIP] Implement ValueSet References
Browse files Browse the repository at this point in the history
Closes: #110
  • Loading branch information
alexanderkiel committed Nov 30, 2024
1 parent 6342ed6 commit 5aa89f4
Show file tree
Hide file tree
Showing 72 changed files with 2,407 additions and 221 deletions.
1 change: 1 addition & 0 deletions .clj-kondo/root/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
blaze.middleware.fhir.db db
blaze.rest-api.header header
blaze.scheduler sched
blaze.terminology-service ts
blaze.test-util tu
blaze.util u
buddy.auth auth
Expand Down
1 change: 1 addition & 0 deletions .github/value-set-expand/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions .github/value-set-expand/AbrechnungsDiagnoseProzedur.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"http://fhir.de/CodeSystem/KontaktDiagnoseProzedur","hospital-main-diagnosis"
"http://fhir.de/CodeSystem/KontaktDiagnoseProzedur","principle-DRG"
"http://fhir.de/CodeSystem/KontaktDiagnoseProzedur","secondary-DRG"
25 changes: 25 additions & 0 deletions .github/value-set-expand/Abrechnungsart.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","AOP"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","HSA"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","PIA"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","SPZ"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","ASV"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","KIA"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","DRG"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","PEPP"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","VNSB"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","AP"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","SPB"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","WLU"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","WLA"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","PS"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","SZ"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","KV"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","BG"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","SL"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","KEK"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","IA"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","MVZ"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","IV"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","DMP"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","REHA"
"http://fhir.de/CodeSystem/dkgev/Abrechnungsart","PSY"
6 changes: 6 additions & 0 deletions .github/value-set-expand/Diagnosesubtyp.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"http://fhir.de/CodeSystem/KontaktDiagnoseProzedur","surgery-diagnosis"
"http://fhir.de/CodeSystem/KontaktDiagnoseProzedur","department-main-diagnosis"
"http://fhir.de/CodeSystem/KontaktDiagnoseProzedur","infection-control-diagnosis"
"http://fhir.de/CodeSystem/KontaktDiagnoseProzedur","cause-of-death"
"http://terminology.hl7.org/CodeSystem/diagnosis-role","AD"
"http://terminology.hl7.org/CodeSystem/diagnosis-role","DD"
48 changes: 48 additions & 0 deletions .github/value-set-expand/expand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash -e

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
. "$SCRIPT_DIR/../scripts/util.sh"

BASE="http://localhost:8080/fhir"

expand() {
curl -sfH "Accept: application/fhir+json" "$BASE/ValueSet/\$expand?url=$1" | jq -r '.expansion.contains[] | [.system, .code] | @csv'
}

test() {
if [ "$2" = "$(cat "$SCRIPT_DIR/$1.csv")" ]; then
echo "✅ the $1 matches"
else
echo "🆘 the $1 is $2, expected $(cat "$SCRIPT_DIR/$1.csv")"
exit 1
fi
}

test "Abrechnungsart" "$(expand "http://fhir.de/ValueSet/dkgev/Abrechnungsart")"
test "AbrechnungsDiagnoseProzedur" "$(expand "http://fhir.de/ValueSet/AbrechnungsDiagnoseProzedur")"
test "Diagnosesubtyp" "$(expand "http://fhir.de/ValueSet/Diagnosesubtyp")"

test "identifier-type-codes" "$(expand "https://www.medizininformatik-initiative.de/fhir/core/modul-fall/ValueSet/identifier-type-codes")"
test "location-physical-type" "$(expand "https://www.medizininformatik-initiative.de/fhir/core/modul-fall/ValueSet/location-physical-type")"
test "mii-vs-consent-answer" "$(expand "https://www.medizininformatik-initiative.de/fhir/modul-consent/ValueSet/mii-vs-consent-answer")"
test "mii-vs-consent-policy" "$(expand "https://www.medizininformatik-initiative.de/fhir/modul-consent/ValueSet/mii-vs-consent-policy")"
test "mii-vs-consent-signaturetypes" "$(expand "https://www.medizininformatik-initiative.de/fhir/modul-consent/ValueSet/mii-vs-consent-signaturetypes")"

for url in $(blazectl --server "$BASE" download ValueSet -q "_elements=url&_count=500" 2>/dev/null | jq -r '.url'); do
if [[ "$url" == "http://dicom.nema.org/"* ]]; then
continue
elif [[ "$url" == "http://terminology.hl7.org/ValueSet/"* ]]; then
continue
elif [[ "$url" == "http://hl7.org/fhir/ValueSet/"* ]]; then
continue
elif [[ "$url" == "http://loinc.org/"* ]]; then
continue
elif [[ "$url" == "http://ihe.net/fhir/"* ]]; then
continue
elif [[ "$url" == "http://ihe-d.de/ValueSets/"* ]]; then
continue
else
echo "Expand ValueSet with URL: $url"
curl -sfH "Accept: application/fhir+json" -o /dev/null "$BASE/ValueSet/\$expand?url=$url"
fi
done
19 changes: 19 additions & 0 deletions .github/value-set-expand/identifier-type-codes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"http://terminology.hl7.org/CodeSystem/v2-0203","ACSN"
"http://terminology.hl7.org/CodeSystem/v2-0203","BRN"
"http://terminology.hl7.org/CodeSystem/v2-0203","DL"
"http://terminology.hl7.org/CodeSystem/v2-0203","DR"
"http://terminology.hl7.org/CodeSystem/v2-0203","EN"
"http://terminology.hl7.org/CodeSystem/v2-0203","FILL"
"http://terminology.hl7.org/CodeSystem/v2-0203","JHN"
"http://terminology.hl7.org/CodeSystem/v2-0203","MCN"
"http://terminology.hl7.org/CodeSystem/v2-0203","MD"
"http://terminology.hl7.org/CodeSystem/v2-0203","MR"
"http://terminology.hl7.org/CodeSystem/v2-0203","NIIP"
"http://terminology.hl7.org/CodeSystem/v2-0203","PLAC"
"http://terminology.hl7.org/CodeSystem/v2-0203","PPN"
"http://terminology.hl7.org/CodeSystem/v2-0203","PRN"
"http://terminology.hl7.org/CodeSystem/v2-0203","SB"
"http://terminology.hl7.org/CodeSystem/v2-0203","SNO"
"http://terminology.hl7.org/CodeSystem/v2-0203","TAX"
"http://terminology.hl7.org/CodeSystem/v2-0203","UDI"
"http://terminology.hl7.org/CodeSystem/v2-0203","VN"
3 changes: 3 additions & 0 deletions .github/value-set-expand/location-physical-type.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"http://terminology.hl7.org/CodeSystem/location-physical-type","wa"
"http://terminology.hl7.org/CodeSystem/location-physical-type","ro"
"http://terminology.hl7.org/CodeSystem/location-physical-type","bd"
3 changes: 3 additions & 0 deletions .github/value-set-expand/mii-vs-consent-answer.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.2","2.16.840.1.113883.3.1937.777.24.5.2.3"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.2","2.16.840.1.113883.3.1937.777.24.5.2.2"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.2","2.16.840.1.113883.3.1937.777.24.5.2.1"
13 changes: 13 additions & 0 deletions .github/value-set-expand/mii-vs-consent-policy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.1"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.44"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.48"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.10"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.14"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.18"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.24"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.50"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.54"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.26"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.30"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.32"
"urn:oid:2.16.840.1.113883.3.1937.777.24.5.3","2.16.840.1.113883.3.1937.777.24.5.3.35"
2 changes: 2 additions & 0 deletions .github/value-set-expand/mii-vs-consent-signaturetypes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"urn:iso-astm:E1762-95:2013","1.2.840.10065.1.12.1.7"
"urn:iso-astm:E1762-95:2013","1.2.840.10065.1.12.1.11"
Loading

0 comments on commit 5aa89f4

Please sign in to comment.