Skip to content

Commit

Permalink
test: add oBDS batch test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Delpy committed Jul 2, 2024
1 parent b67fcd8 commit 3af0a4f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/test/java/de/samply/obds2fhir/Obds2fhirTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,30 @@ public void compareErrorPatient () throws IOException {
}
@Test
@Order(4)
public void compareBatch () throws IOException {
public void compareBatchADT () throws IOException {
String filename = DigestUtils.sha256Hex("testpatient-ADT-1"+System.getenv().getOrDefault("SALT","")).substring(48);
String result = "tmp/FHIR_Patients/FHIR_batch_Patient_"+filename+"_ADT_1.xml";
String expected = "FHIR_batch_ADT_Expected-File-1.xml";
assertTrue(compare(result, expected));
}
@Test
@Order(5)
public void compareBatchOBDS () throws IOException {
String filename = DigestUtils.sha256Hex("testpatient-oBDS-1"+System.getenv().getOrDefault("SALT","")).substring(48);
String result = "tmp/FHIR_Patients/FHIR_batch_Patient_"+filename+"_oBDS_4.xml";
String expected = "FHIR_batch_oBDS_Expected-File-1.xml";
assertTrue(compare(result, expected));
}
@Test
@Order(6)
public void comparePatientSyntheticADT () throws IOException {
String filename = DigestUtils.sha256Hex("testpatient-ADT-3"+System.getenv().getOrDefault("SALT","")).substring(48);
String result = "tmp/FHIR_Patients/FHIR_Patient_"+filename+"_ADT_3.xml";
String expected = "FHIR_ADT_Expected-File-3.xml";
assertTrue(compare(result, expected));
}
@Test
@Order(6)
@Order(7)
public void comparePatientSyntheticOBDS () throws IOException {
String filename = DigestUtils.sha256Hex("testpatient-oBDS-1"+System.getenv().getOrDefault("SALT","")).substring(48);
String result = "tmp/FHIR_Patients/FHIR_Patient_"+filename+"_oBDS_4.xml";
Expand Down
36 changes: 36 additions & 0 deletions src/test/resources/FHIR_batch_oBDS_Expected-File-1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Bundle xmlns="http://hl7.org/fhir" xmlns:hash="java:de.samply.obds2fhir">
<id value="1302b6d11c5b628d"/>
<type value="batch"/>
<entry>
<fullUrl value="http://example.com/Observation/vital1302b6d11c5b628d"/>
<resource>
<Observation>
<id value="vital1302b6d11c5b628d"/>
<meta>
<profile value="http://dktk.dkfz.de/fhir/StructureDefinition/onco-core-Observation-Vitalstatus"/>
</meta>
<status value="registered"/>
<code>
<coding>
<system value="http://loinc.org"/>
<code value="75186-7"/>
</coding>
</code>
<subject>
<reference value="Patient/1302b6d11c5b628d"/>
</subject>
<effectiveDateTime value="2024-07-20"/>
<valueCodeableConcept>
<coding>
<system value="http://dktk.dkfz.de/fhir/onco/core/CodeSystem/VitalstatusCS"/>
<code value="verstorben"/>
</coding>
</valueCodeableConcept>
</Observation>
</resource>
<request>
<method value="PUT"/>
<url value="Observation/vital1302b6d11c5b628d"/>
</request>
</entry>
</Bundle>

0 comments on commit 3af0a4f

Please sign in to comment.