diff --git a/src/test/java/edu/ohsu/cmp/ecp/sds/ForeignPartitionTest.java b/src/test/java/edu/ohsu/cmp/ecp/sds/ForeignPartitionTest.java index f6fb5ad..d417a6b 100644 --- a/src/test/java/edu/ohsu/cmp/ecp/sds/ForeignPartitionTest.java +++ b/src/test/java/edu/ohsu/cmp/ecp/sds/ForeignPartitionTest.java @@ -16,6 +16,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.util.BundleBuilder; @@ -88,10 +89,11 @@ void canStoreAndRetrieveConditionResourceInForeignPartition() { IGenericClient client = clientTargetingPartition( FOREIGN_PARTITION_NAME ); Patient pat = initPatient( "0123456789" ) ; - IIdType patId = client.update().resource(pat).execute().getId(); + client.update().resource(pat).execute(); - Condition condition = initCondition( patId, "0123456789-001" ) ; - IIdType conditionId = client.create().resource(condition).execute().getId(); + Condition condition = initCondition( pat.getIdElement(), "0123456789-001" ) ; + condition.setId( new IdType( "Condition", createTestSpecificId() ) ) ; + IIdType conditionId = client.update().resource(condition).execute().getId(); Condition readCondition = client.read().resource(Condition.class).withId(conditionId).execute(); diff --git a/src/test/java/edu/ohsu/cmp/ecp/sds/PatientAppClientForeignPartitionTest.java b/src/test/java/edu/ohsu/cmp/ecp/sds/PatientAppClientForeignPartitionTest.java index d5d32a6..0b51d45 100644 --- a/src/test/java/edu/ohsu/cmp/ecp/sds/PatientAppClientForeignPartitionTest.java +++ b/src/test/java/edu/ohsu/cmp/ecp/sds/PatientAppClientForeignPartitionTest.java @@ -93,6 +93,8 @@ void canStorePatientWithoutAdditionalSetup() { private Condition createHealthConcern( Reference subjectRef, String codeAsPlainText ) { Condition condition = new Condition() ; + condition.setId( new IdType("Condition", createTestSpecificId()) ) ; + condition.setSubject( subjectRef ) ; CodeableConcept healthConcernCategory = new CodeableConcept(); @@ -110,11 +112,11 @@ void canStoreConditionWhereSubjectIsClaimedPatientWithoutAdditionalSetup() { Patient subjectPatient = new Patient() ; subjectPatient.setId( new IdType( "Patient", subjectPatientId ) ) ; - IIdType claimedPatientId = patientAppClient.update().resource(subjectPatient).execute().getId(); + patientAppClient.update().resource(subjectPatient).execute(); - Condition condition = createHealthConcern( new Reference(claimedPatientId), "my health concern" ) ; + Condition condition = createHealthConcern( new Reference( subjectPatient.getIdElement() ), "my health concern" ) ; - IIdType conditionId = patientAppClient.create().resource(condition).execute().getId(); + IIdType conditionId = patientAppClient.update().resource(condition).execute().getId(); Condition readQuestResp = patientAppClient.read().resource(Condition.class).withId(conditionId).execute();