Created ExplanationOfBenefit object which have organization in the contained list. When I parse the object using FhirContext.forR4(). I don’t see the contained list in the json string.
Creating ExplanationOfBenefit object:
Organization organization = new Organization();
organization.setId(“o1”);
explanationOfBenefit.getContained().add(organization);
Parsing
FhirContext.forR4().newJsonParser().encodeResourceToString(explanationOfBenefit)
output:
{
“resourceType”: “ExplanationOfBenefit”,
“id”: “100101A0000000”
}
expected
{ “resourceType”: “ExplanationOfBenefit”,
“contained”: [{
“resourceType”: “Organization”,
“id”: “o1”,
}],
“id”: “100101A0000000”
}