-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/FHIR/fhir-test-cases
- Loading branch information
Showing
208 changed files
with
20,709 additions
and
10,838 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
map "http://hl7.org/fhir/StructureMap/ActivityDefinition3to4" = "R3 to R4 Conversions for ActivityDefinition" | ||
|
||
uses "http://hl7.org/fhir/3.0/StructureDefinition/ActivityDefinition" alias ActivityDefinitionR3 as source | ||
uses "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" alias ActivityDefinition as target | ||
|
||
imports "http://hl7.org/fhir/StructureMap/*3to4" | ||
|
||
group ActivityDefinition(source src : ActivityDefinitionR3, target tgt : ActivityDefinition) extends DomainResource <<type+>> { | ||
src.url -> tgt.url; | ||
src.identifier -> tgt.identifier; | ||
src.version -> tgt.version; | ||
src.name -> tgt.name; | ||
src.title -> tgt.title; | ||
src.subtitle -> tgt.subtitle; | ||
src.status -> tgt.status; | ||
src.experimental -> tgt.experimental; | ||
src.subject -> tgt.subject; | ||
src.date -> tgt.date; | ||
src.publisher -> tgt.publisher; | ||
src.contact -> tgt.contact; | ||
src.description -> tgt.description; | ||
src.useContext -> tgt.useContext; | ||
src.jurisdiction -> tgt.jurisdiction; | ||
src.purpose -> tgt.purpose; | ||
src.usage -> tgt.usage; | ||
src.copyright -> tgt.copyright; | ||
src.approvalDate -> tgt.approvalDate; | ||
src.lastReviewDate -> tgt.lastReviewDate; | ||
src.effectivePeriod -> tgt.effectivePeriod; | ||
src.topic -> tgt.topic; | ||
src.contributor as vs where type = 'author' -> tgt.author as vt then Contributor(vs, vt); | ||
src.contributor as vs where type = 'editor' -> tgt.editor as vt then Contributor(vs, vt); | ||
src.contributor as vs where type = 'reviewer' -> tgt.reviewer as vt then Contributor(vs, vt); | ||
src.contributor as vs where type = 'endorser' -> tgt.endorser as vt then Contributor(vs, vt); | ||
src.relatedArtifact -> tgt.relatedArtifact; | ||
src.library -> tgt.library; | ||
src.kind as v -> tgt.kind = translate(v, 'http://hl7.org/fhir/StructureMap/ConceptMaps3to4#ResourceTypeMap', 'code'); | ||
src.code -> tgt.code; | ||
src.doNotPerform -> tgt.doNotPerform; | ||
src.timing -> tgt.timing; | ||
src.location -> tgt.location; | ||
src.participant as s -> tgt.participant as t then ActivityDefinitionParticipant(s, t); | ||
src.product -> tgt.product; | ||
src.quantity -> tgt.quantity; | ||
src.dosage -> tgt.dosage; | ||
src.bodySite -> tgt.bodySite; | ||
src.specimenRequirement -> tgt.specimenRequirement; | ||
src.transform -> tgt.transform; | ||
src.dynamicValue as s -> tgt.dynamicValue as t then ActivityDefinitionDynamicValue(s, t); | ||
} | ||
|
||
group ActivityDefinitionParticipant(source src, target tgt) extends BackboneElement { | ||
src.type -> tgt.type; | ||
src.role -> tgt.role; | ||
} | ||
|
||
group ActivityDefinitionDynamicValue(source src, target tgt) extends BackboneElement { | ||
src.path -> tgt.path; | ||
src as vs where vs.type.exists().not() -> tgt.expression = create('Expression') as vt then { | ||
vs.description -> vt.description; | ||
vs.language -> vt.language; | ||
vs.expression -> vt.expression; | ||
} "expression"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
map "http://ahdis.ch/matchbox/fml/cast" = "cast" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Observation" alias Observation as target | ||
|
||
group qrtocobs(source src : QuestionnaireResponse, target tgt : Observation) { | ||
src.extension as ext where (url = 'urn:implicitstring') then { | ||
ext.value as value -> tgt.extension as ext, ext.url="urn:implicitstring", ext.value = value "item"; | ||
} "implictstring"; | ||
src.extension as ext where (url = 'urn:explicitstring') then { | ||
ext.value as value -> tgt.extension as ext, ext.url="urn:explicitstring", ext.value = cast(value,'string') "item"; | ||
} "implictstring"; | ||
src.extension as ext where (url = 'urn:positiveInt') then { | ||
ext.value as value -> tgt.extension as ext, ext.url="urn:positiveInt", ext.value = value "item"; | ||
} "positiveInt"; | ||
src.extension as ext where (url = 'urn:positiveIntString') then { | ||
ext.value as value -> tgt.extension as ext, ext.url="urn:positiveIntString", ext.value = cast(value,'positiveInt') "item"; | ||
} "positiveInt"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<fml-tests> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2patassignment" source="qr.json" map="qr2pat-assignment.map" output="qr2pat-assignment-res.json" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2patgender" source="qr.json" map="qr2pat-gender.map" output="qr2pat-gender-res.json" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2pathumannametwice" source="qr.json" map="qr2pat-humannametwice.map" output="qr2pat-humannametwice-res.json" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2pathumannameshared" source="qr.json" map="qr2pat-humannameshared.map" output="qr2pat-humannameshared-res.json" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/reference" source="qr.json" map="qr2reference.map" output="qr2reference-res.json" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2pat-gender-conformstoqr" source="qr.json" map="qr2pat-gender-conformstoqr.map" output="qr2pat-gender-res.json" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2cda" source="qr.json" map="qr2cda.map" output="qr2cda-res.xml" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2cdaxsi" source="qr.json" map="qr2cdaxsi.map" output="qr2cdaxsi-res.xml" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2cd-eval-json" source="qr.json" map="qr2cda-eval.json" output="qr2cda-eval-res.xml" /> | ||
<test name="http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r5.tests/qr2cd-eval-fml" source="qr.json" map="qr2cda-eval.map" output="qr2cda-eval-res.xml" /> | ||
|
||
</fml-tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"id" : "12345", | ||
"resourceType": "QuestionnaireResponse", | ||
"status": "in-progress", | ||
"item": [ | ||
{ | ||
"linkId": "patient", | ||
"text": "Patient", | ||
"item": [ | ||
{ | ||
"linkId": "patient.lastname", | ||
"text": "Name", | ||
"answer": [ | ||
{ | ||
"valueString": "Brönnimann-Bertholet" | ||
} | ||
] | ||
}, | ||
{ | ||
"linkId": "patient.firstname", | ||
"text": "Vorname", | ||
"answer": [ | ||
{ | ||
"valueString": "Elisabeth" | ||
} | ||
] | ||
}, | ||
{ | ||
"linkId": "patient.sex", | ||
"text": "Geschlecht", | ||
"answer": [ | ||
{ | ||
"valueString": "female" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<ClinicalDocument xmlns="urn:hl7-org:v3-test"> | ||
<title>Hello CDA</title> | ||
</ClinicalDocument> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"resourceType" : "StructureMap", | ||
"url" : "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2cda", | ||
"name" : "qr2cda", | ||
"structure" : [{ | ||
"url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse", | ||
"mode" : "source", | ||
"alias" : "QuestionnaireResponse" | ||
}, | ||
{ | ||
"url" : "http://hl7.org/fhir/cdatest/StructureDefinition/ClinicalDocument", | ||
"mode" : "target", | ||
"alias" : "ClinicalDocument" | ||
}], | ||
"group" : [{ | ||
"name" : "QuestionnaireResponse", | ||
"input" : [{ | ||
"name" : "src", | ||
"type" : "QuestionnaireResponse", | ||
"mode" : "source" | ||
}, | ||
{ | ||
"name" : "tgt", | ||
"type" : "ClinicalDocument", | ||
"mode" : "target" | ||
}], | ||
"rule" : [{ | ||
"name" : "eval", | ||
"source" : [{ | ||
"context" : "src" | ||
}], | ||
"target" : [{ | ||
"context" : "tgt", | ||
"element" : "title", | ||
"variable" : "title" | ||
}, | ||
{ | ||
"context" : "title", | ||
"element" : "data", | ||
"transform" : "evaluate", | ||
"parameter" : [{ | ||
"valueId" : "src" | ||
}, | ||
{ | ||
"valueString" : "iif(src.is(QuestionnaireResponse), 'Hello CDA', 'badbadbad')" | ||
}] | ||
}] | ||
}] | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
map "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2cda" = "qr2cda" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/cdatest/StructureDefinition/ClinicalDocument" alias ClinicalDocument as target | ||
|
||
group QuestionnaireResponse(source src : QuestionnaireResponse, target tgt : ClinicalDocument) { | ||
src -> tgt.title as title, title.data= evaluate(src, iif(src.is(QuestionnaireResponse),"Hello CDA","badbadbad")) "eval"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<ClinicalDocument xmlns="urn:hl7-org:v3-test"> | ||
<title>Hello CDA</title> | ||
</ClinicalDocument> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
map "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2cda" = "qr2cda" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/cdatest/StructureDefinition/ClinicalDocument" alias ClinicalDocument as target | ||
|
||
group QuestionnaireResponse(source src : QuestionnaireResponse, target tgt : ClinicalDocument) { | ||
src -> tgt.title as title, title.data = 'Hello CDA' "hellocda"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ClinicalDocument xmlns="urn:hl7-org:v3-test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<code code="1"> | ||
<translation xsi:type="CD" code="1" /> | ||
</code> | ||
</ClinicalDocument> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
map "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2cdaxsi" = "qr2cdaxsi" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/cdatest/StructureDefinition/ClinicalDocument" alias ClinicalDocument as target | ||
uses "http://hl7.org/fhir/cdatest/StructureDefinition/CD" alias CD as target | ||
|
||
group QuestionnaireResponse(source src : QuestionnaireResponse, target tgt : ClinicalDocument) { | ||
src -> tgt.code as code, code.code = "1", code.translation = create('CD') as translation, translation.code="1" "codes"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"resourceType" : "Patient", | ||
"gender" : "female" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
map "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2patassignment" = "qr2patassignment" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target | ||
|
||
group QuestionnaireResponse(source src : QuestionnaireResponse, target tgt : Patient) { | ||
src -> tgt.gender = 'female' "Simple Assignment"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
map "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2pat-gender-conformstoqr" = "qr2pat-gender-conformstoqr" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target | ||
|
||
// we want to check if source conformsTo works | ||
group QuestionnaireResponse(source src : QuestionnaireResponse, target tgt : Patient) { | ||
src where conformsTo('http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse')-> tgt as patient, patient.gender = 'female' "conformsToCheck"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"resourceType" : "Patient", | ||
"gender" : "female" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
map "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2patgender" = "qr2patgender" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target | ||
|
||
group QuestionnaireResponse(source src : QuestionnaireResponse, target tgt : Patient) { | ||
src.item as item -> tgt as patient then item(item, patient); | ||
} | ||
|
||
group item(source src, target tgt: Patient) { | ||
src.item as item where linkId.value in ('patient.sex') -> tgt.gender = (item.answer.valueString); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"resourceType" : "Patient", | ||
"name" : [{ | ||
"family" : "Brönnimann-Bertholet", | ||
"given" : ["Elisabeth"] | ||
}], | ||
"gender" : "female" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
map "http://github.com/hapifhir/org.hl7.fhir.core/org.hl7.fhir.r4.tests/qr2pathumannameshared" = "qr2pathumannametwice" | ||
|
||
uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source | ||
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target | ||
|
||
group entry(source src : QuestionnaireResponse, target tgt : Patient) { | ||
src.item as item then item(item, tgt); | ||
} | ||
|
||
group item(source src, target tgt) { | ||
src.item as item then item(item, tgt); | ||
src.item as item where linkId.value = 'patient.lastname' -> tgt.name as name share patientName then humanNameFamily(item, name); | ||
src.item as item where linkId.value = 'patient.firstname' -> tgt.name as name share patientName then humanNameGiven(item, name); | ||
src.item as item where linkId.value = 'patient.sex' -> tgt.gender = (item.answer.valueString); | ||
} | ||
|
||
group humanNameFamily(source src, target tgt: HumanName) { | ||
src.answer as answer -> tgt.family = (answer.valueString); | ||
} | ||
group humanNameGiven(source src, target tgt: HumanName) { | ||
src.answer as answer -> tgt.given = (answer.valueString); | ||
} | ||
|
||
group administrativeGender(source src, target tgt: code) { | ||
src.answer as answer -> tgt = (answer.valueString); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"resourceType" : "Patient", | ||
"name" : [{ | ||
"family" : "Brönnimann-Bertholet" | ||
}, | ||
{ | ||
"given" : ["Elisabeth"] | ||
}], | ||
"gender" : "female" | ||
} |
Oops, something went wrong.