Skip to content

Commit

Permalink
#286 fix cda observation examples
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveregger committed Oct 7, 2024
1 parent c9b4e82 commit d12698c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,7 @@ public org.hl7.fhir.r5.elementmodel.Element transform(ByteProvider source, FhirF

org.hl7.fhir.r5.elementmodel.ParserBase parser = Manager.makeParser(context, cntType);
StructureDefinition sd = context.fetchResource(StructureDefinition.class, canonicalSource);
// The QName 'urn:hl7-org:v3::Observation' does not match the expected QName 'urn:hl7-org:v3::observation' at line 0 col 0
if (sd.getKind() == StructureDefinitionKind.LOGICAL && sd.getUrl()!=null && !sd.getUrl().startsWith("http://hl7.org/cda/stds/core")) {
if (sd.getKind() == StructureDefinitionKind.LOGICAL) {
parser.setLogical(sd);
}
org.hl7.fhir.r5.elementmodel.Element src = parser.parseSingle(new ByteArrayInputStream(source.getBytes()), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,6 @@ void TestFhirPath() throws FHIRException, IOException {
assertEquals("F028", getEngine().evaluateFhirPath(cdaLabItaly, false, "practiceSettingCode.code"));
}

@Test
void TestFhirPathObservationIt() throws FHIRException, IOException {
InputStream in = getResourceAsStream("cda-it-observation.xml");
String observationIt = IOUtils.toString(in, StandardCharsets.UTF_8);
assertEquals("2022-03-01T22:11:22+01:00",
getEngine().evaluateFhirPath(observationIt, false, "value.high.value"));
}

@Test
void TestInitial() throws FHIRException, IOException {
String result = getEngine().transform(cdaLabItaly,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
<observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:lab="urn:oid:1.3.6.1.4.1.19376.1.3.2" xmlns:sdtc="urn:hl7-org:sdtc" moodCode="EVN"
classCode="OBS">
<value xsi:type="CD" code="60975-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Resistenza Vascolare"/>
</Observation>
</observation>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
<observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:lab="urn:oid:1.3.6.1.4.1.19376.1.3.2" xmlns:sdtc="urn:hl7-org:sdtc" moodCode="EVN"
classCode="OBS">
Expand All @@ -10,4 +10,4 @@
<statusCode code="completed"/>
<effectiveTime value="20220203092200+0200"/>
<value xsi:type="CS" code="completed"/>
</Observation>
</observation>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
<observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:lab="urn:oid:1.3.6.1.4.1.19376.1.3.2" xmlns:sdtc="urn:hl7-org:sdtc" moodCode="EVN"
classCode="OBS">
Expand All @@ -10,4 +10,4 @@
<statusCode code="completed"/>
<effectiveTime value="20220203092200+0200"/>
<value xsi:type="ST">Nessun Trauma riscontrato</value>
</Observation>
</observation>
4 changes: 2 additions & 2 deletions matchbox-engine/src/test/resources/cda/cda-it-observation.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
<observation xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:lab="urn:oid:1.3.6.1.4.1.19376.1.3.2" xmlns:sdtc="urn:hl7-org:sdtc" moodCode="EVN"
classCode="OBS">
Expand Down Expand Up @@ -40,4 +40,4 @@
</lab:precondition>
</observationRange>
</referenceRange>
</Observation>
</observation>

0 comments on commit d12698c

Please sign in to comment.