Rework MDM tests
This commit is contained in:
@@ -77,8 +77,7 @@ public class ExampleServerR4IT {
|
|||||||
|
|
||||||
// Wait until the MDM message has been processed
|
// Wait until the MDM message has been processed
|
||||||
await().until(() -> getPatients().size(), equalTo(2));
|
await().until(() -> getPatients().size(), equalTo(2));
|
||||||
List<Patient> persons = getPatients();
|
Patient goldenRecord = getGoldenResourcePatient();
|
||||||
Patient goldenRecord = persons.get(0);
|
|
||||||
|
|
||||||
// Verify that a golden record Patient was created
|
// Verify that a golden record Patient was created
|
||||||
assertNotNull(goldenRecord.getMeta().getTag("http://hapifhir.io/fhir/NamingSystem/mdm-record-status", "GOLDEN_RECORD"));
|
assertNotNull(goldenRecord.getMeta().getTag("http://hapifhir.io/fhir/NamingSystem/mdm-record-status", "GOLDEN_RECORD"));
|
||||||
@@ -90,6 +89,17 @@ public class ExampleServerR4IT {
|
|||||||
retVal.sort(comparing(o -> ((Patient) o).getMeta().getLastUpdated()).reversed());
|
retVal.sort(comparing(o -> ((Patient) o).getMeta().getLastUpdated()).reversed());
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
private Patient getGoldenResourcePatient() {
|
||||||
|
Bundle bundle = ourClient.search()
|
||||||
|
.forResource(Patient.class)
|
||||||
|
.withTag("http://hapifhir.io/fhir/NamingSystem/mdm-record-status", "GOLDEN_RECORD")
|
||||||
|
.cacheControl(new CacheControlDirective().setNoCache(true)).returnBundle(Bundle.class).execute();
|
||||||
|
if (bundle.getEntryFirstRep() != null) {
|
||||||
|
return (Patient) bundle.getEntryFirstRep().getResource();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Order(1)
|
@Order(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user