Rework MDM tests
This commit is contained in:
@@ -77,8 +77,7 @@ public class ExampleServerR4IT {
|
||||
|
||||
// Wait until the MDM message has been processed
|
||||
await().until(() -> getPatients().size(), equalTo(2));
|
||||
List<Patient> persons = getPatients();
|
||||
Patient goldenRecord = persons.get(0);
|
||||
Patient goldenRecord = getGoldenResourcePatient();
|
||||
|
||||
// Verify that a golden record Patient was created
|
||||
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());
|
||||
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
|
||||
@Order(1)
|
||||
|
||||
Reference in New Issue
Block a user