use of org.hl7.fhir.r4.model.ClaimResponse in project beneficiary-fhir-data by CMSgov.
the class FissClaimResponseTransformerV2 method transformClaim.
/**
* @param claimGroup the {@link PreAdjFissClaim} to transform
* @return a FHIR {@link ClaimResponse} resource that represents the specified {@link
* PreAdjFissClaim}
*/
private static ClaimResponse transformClaim(PreAdjFissClaim claimGroup) {
ClaimResponse claim = new ClaimResponse();
claim.setId("f-" + claimGroup.getDcn());
claim.setContained(List.of(getContainedPatient(claimGroup)));
claim.setExtension(getExtension(claimGroup));
claim.setIdentifier(getIdentifier(claimGroup));
claim.setStatus(ClaimResponse.ClaimResponseStatus.ACTIVE);
claim.setOutcome(STATUS_TO_OUTCOME.get(Character.toLowerCase(claimGroup.getCurrStatus())));
claim.setType(getType());
claim.setUse(ClaimResponse.Use.CLAIM);
claim.setInsurer(new Reference().setIdentifier(new Identifier().setValue("CMS")));
claim.setPatient(new Reference("#patient"));
claim.setRequest(new Reference(String.format("Claim/f-%s", claimGroup.getDcn())));
claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated())));
claim.setCreated(new Date());
return claim;
}
use of org.hl7.fhir.r4.model.ClaimResponse in project beneficiary-fhir-data by CMSgov.
the class R4ClaimResponseResourceProviderIT method shouldGetCorrectFissClaimResponseResourceById.
@Test
void shouldGetCorrectFissClaimResponseResourceById() {
IGenericClient fhirClient = ServerTestUtils.get().createFhirClientV2();
ClaimResponse claimResult = fhirClient.read().resource(ClaimResponse.class).withId("f-123456").execute();
String expected = testUtils.expectedResponseFor("claimResponseFissRead");
String actual = FhirContext.forR4().newJsonParser().encodeResourceToString(claimResult);
AssertUtils.assertJsonEquals(expected, actual, IGNORE_PATTERNS);
}
use of org.hl7.fhir.r4.model.ClaimResponse in project beneficiary-fhir-data by CMSgov.
the class R4ClaimResponseResourceProviderIT method shouldGetCorrectMcsClaimResponseResourceById.
@Test
void shouldGetCorrectMcsClaimResponseResourceById() {
IGenericClient fhirClient = ServerTestUtils.get().createFhirClientV2();
ClaimResponse claimResult = fhirClient.read().resource(ClaimResponse.class).withId("m-654321").execute();
String expected = testUtils.expectedResponseFor("claimResponseMcsRead");
String actual = FhirContext.forR4().newJsonParser().encodeResourceToString(claimResult);
AssertUtils.assertJsonEquals(expected, actual, IGNORE_PATTERNS);
}
use of org.hl7.fhir.r4.model.ClaimResponse in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeClaimResponseItemAdjudicationComponent.
protected void composeClaimResponseItemAdjudicationComponent(Complex parent, String parentType, String name, ClaimResponse.ItemAdjudicationComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "adjudication", name, element, index);
if (element.hasCategory())
composeCoding(t, "ClaimResponse", "category", element.getCategory(), -1);
if (element.hasReason())
composeCoding(t, "ClaimResponse", "reason", element.getReason(), -1);
if (element.hasAmount())
composeQuantity(t, "ClaimResponse", "amount", element.getAmount(), -1);
if (element.hasValueElement())
composeDecimal(t, "ClaimResponse", "value", element.getValueElement(), -1);
}
use of org.hl7.fhir.r4.model.ClaimResponse in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeClaimResponseAddedItemsDetailComponent.
protected void composeClaimResponseAddedItemsDetailComponent(Complex parent, String parentType, String name, ClaimResponse.AddedItemsDetailComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "detail", name, element, index);
if (element.hasService())
composeCoding(t, "ClaimResponse", "service", element.getService(), -1);
if (element.hasFee())
composeQuantity(t, "ClaimResponse", "fee", element.getFee(), -1);
for (int i = 0; i < element.getAdjudication().size(); i++) composeClaimResponseAddedItemDetailAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
}
Aggregations