-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
During the de-serialization process, a contained resource 'resourceType' is lost. I believe the issue to be present for all fhir version supported by the parser.
@BeforeEach
void beforeEachTest() {
iParser = FhirContext.forR4().newJsonParser();
iParser.setPrettyPrint(true);
}
@Test
void serializeDeserialiseContainedResource(){
String expectedRequestGroupId = "RequestGroup/1";
RequestGroup requestGroup = new RequestGroup();
requestGroup.setId(expectedRequestGroupId);
assertEquals(expectedRequestGroupId, requestGroup.getIdElement().getValueAsString());
CarePlan carePlan = new CarePlan();
carePlan.addContained(requestGroup);
String carePlanAsString = iParser.encodeResourceToString(carePlan);
ourLog.info(carePlanAsString);
CarePlan parsedCarePlan = iParser.parseResource(CarePlan.class, carePlanAsString);
Resource containedResource = parsedCarePlan.getContained().get(0);
assertEquals(expectedRequestGroupId, containedResource.getIdElement().getValueAsString());
}
Metadata
Metadata
Assignees
Labels
No labels