Search in sources :

Example 26 with ClaimResponse

use of org.hl7.fhir.r4.model.ClaimResponse in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeClaimResponseNoteComponent.

protected void composeClaimResponseNoteComponent(Complex parent, String parentType, String name, ClaimResponse.NoteComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "processNote", name, element, index);
    if (element.hasNumberElement())
        composePositiveInt(t, "ClaimResponse", "number", element.getNumberElement(), -1);
    if (element.hasTypeElement())
        composeEnum(t, "ClaimResponse", "type", element.getTypeElement(), -1);
    if (element.hasTextElement())
        composeString(t, "ClaimResponse", "text", element.getTextElement(), -1);
    if (element.hasLanguage())
        composeCodeableConcept(t, "ClaimResponse", "language", element.getLanguage(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 27 with ClaimResponse

use of org.hl7.fhir.r4.model.ClaimResponse in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeClaimInsuranceComponent.

protected void composeClaimInsuranceComponent(Complex parent, String parentType, String name, Claim.InsuranceComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "insurance", name, element, index);
    if (element.hasSequenceElement())
        composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
    if (element.hasFocalElement())
        composeBoolean(t, "Claim", "focal", element.getFocalElement(), -1);
    if (element.hasIdentifier())
        composeIdentifier(t, "Claim", "identifier", element.getIdentifier(), -1);
    if (element.hasCoverage())
        composeReference(t, "Claim", "coverage", element.getCoverage(), -1);
    if (element.hasBusinessArrangementElement())
        composeString(t, "Claim", "businessArrangement", element.getBusinessArrangementElement(), -1);
    for (int i = 0; i < element.getPreAuthRef().size(); i++) composeString(t, "Claim", "preAuthRef", element.getPreAuthRef().get(i), i);
    if (element.hasClaimResponse())
        composeReference(t, "Claim", "claimResponse", element.getClaimResponse(), -1);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 28 with ClaimResponse

use of org.hl7.fhir.r4.model.ClaimResponse in project beneficiary-fhir-data by CMSgov.

the class McsClaimResponseTransformerV2 method transformClaim.

/**
 * @param claimGroup the {@link PreAdjMcsClaim} to transform
 * @return a FHIR {@link ClaimResponse} resource that represents the specified {@link
 *     PreAdjMcsClaim}
 */
private static ClaimResponse transformClaim(PreAdjMcsClaim claimGroup) {
    ClaimResponse claim = new ClaimResponse();
    claim.setId("m-" + claimGroup.getIdrClmHdIcn());
    claim.setContained(List.of(getContainedPatient(claimGroup)));
    claim.setExtension(getExtension(claimGroup));
    claim.setIdentifier(getIdentifier(claimGroup));
    claim.setStatus(getStatus(claimGroup));
    claim.setOutcome(getOutcome(claimGroup));
    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/m-%s", claimGroup.getIdrClmHdIcn())));
    claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated())));
    claim.setCreated(new Date());
    return claim;
}
Also used : Meta(org.hl7.fhir.r4.model.Meta) Identifier(org.hl7.fhir.r4.model.Identifier) ClaimResponse(org.hl7.fhir.r4.model.ClaimResponse) Reference(org.hl7.fhir.r4.model.Reference) Date(java.util.Date)

Example 29 with ClaimResponse

use of org.hl7.fhir.r4.model.ClaimResponse in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeExplanationOfBenefit.

protected void composeExplanationOfBenefit(Complex parent, String parentType, String name, ExplanationOfBenefit element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeDomainResource(t, "ExplanationOfBenefit", name, element, index);
    for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "ExplanationOfBenefit", "identifier", element.getIdentifier().get(i), i);
    if (element.hasClaim())
        composeType(t, "ExplanationOfBenefit", "claim", element.getClaim(), -1);
    if (element.hasClaimResponse())
        composeType(t, "ExplanationOfBenefit", "claimResponse", element.getClaimResponse(), -1);
    for (int i = 0; i < element.getSubType().size(); i++) composeCoding(t, "ExplanationOfBenefit", "subType", element.getSubType().get(i), i);
    if (element.hasRuleset())
        composeCoding(t, "ExplanationOfBenefit", "ruleset", element.getRuleset(), -1);
    if (element.hasOriginalRuleset())
        composeCoding(t, "ExplanationOfBenefit", "originalRuleset", element.getOriginalRuleset(), -1);
    if (element.hasCreatedElement())
        composeDateTime(t, "ExplanationOfBenefit", "created", element.getCreatedElement(), -1);
    if (element.hasBillablePeriod())
        composePeriod(t, "ExplanationOfBenefit", "billablePeriod", element.getBillablePeriod(), -1);
    if (element.hasDispositionElement())
        composeString(t, "ExplanationOfBenefit", "disposition", element.getDispositionElement(), -1);
    if (element.hasProvider())
        composeType(t, "ExplanationOfBenefit", "provider", element.getProvider(), -1);
    if (element.hasOrganization())
        composeType(t, "ExplanationOfBenefit", "organization", element.getOrganization(), -1);
    if (element.hasFacility())
        composeType(t, "ExplanationOfBenefit", "facility", element.getFacility(), -1);
    for (int i = 0; i < element.getRelated().size(); i++) composeExplanationOfBenefitRelatedClaimsComponent(t, "ExplanationOfBenefit", "related", element.getRelated().get(i), i);
    if (element.hasPrescription())
        composeType(t, "ExplanationOfBenefit", "prescription", element.getPrescription(), -1);
    if (element.hasOriginalPrescription())
        composeType(t, "ExplanationOfBenefit", "originalPrescription", element.getOriginalPrescription(), -1);
    if (element.hasPayee())
        composeExplanationOfBenefitPayeeComponent(t, "ExplanationOfBenefit", "payee", element.getPayee(), -1);
    if (element.hasReferral())
        composeType(t, "ExplanationOfBenefit", "referral", element.getReferral(), -1);
    for (int i = 0; i < element.getOccurrenceCode().size(); i++) composeCoding(t, "ExplanationOfBenefit", "occurrenceCode", element.getOccurrenceCode().get(i), i);
    for (int i = 0; i < element.getOccurenceSpanCode().size(); i++) composeCoding(t, "ExplanationOfBenefit", "occurenceSpanCode", element.getOccurenceSpanCode().get(i), i);
    for (int i = 0; i < element.getValueCode().size(); i++) composeCoding(t, "ExplanationOfBenefit", "valueCode", element.getValueCode().get(i), i);
    for (int i = 0; i < element.getDiagnosis().size(); i++) composeExplanationOfBenefitDiagnosisComponent(t, "ExplanationOfBenefit", "diagnosis", element.getDiagnosis().get(i), i);
    for (int i = 0; i < element.getProcedure().size(); i++) composeExplanationOfBenefitProcedureComponent(t, "ExplanationOfBenefit", "procedure", element.getProcedure().get(i), i);
    for (int i = 0; i < element.getSpecialCondition().size(); i++) composeCoding(t, "ExplanationOfBenefit", "specialCondition", element.getSpecialCondition().get(i), i);
    if (element.hasPatient())
        composeType(t, "ExplanationOfBenefit", "patient", element.getPatient(), -1);
    if (element.hasPrecedenceElement())
        composePositiveInt(t, "ExplanationOfBenefit", "precedence", element.getPrecedenceElement(), -1);
    if (element.hasCoverage())
        composeExplanationOfBenefitCoverageComponent(t, "ExplanationOfBenefit", "coverage", element.getCoverage(), -1);
    if (element.hasAccidentDateElement())
        composeDate(t, "ExplanationOfBenefit", "accidentDate", element.getAccidentDateElement(), -1);
    if (element.hasAccidentType())
        composeCoding(t, "ExplanationOfBenefit", "accidentType", element.getAccidentType(), -1);
    if (element.hasAccidentLocation())
        composeType(t, "ExplanationOfBenefit", "accidentLocation", element.getAccidentLocation(), -1);
    for (int i = 0; i < element.getInterventionException().size(); i++) composeCoding(t, "ExplanationOfBenefit", "interventionException", element.getInterventionException().get(i), i);
    for (int i = 0; i < element.getOnset().size(); i++) composeExplanationOfBenefitOnsetComponent(t, "ExplanationOfBenefit", "onset", element.getOnset().get(i), i);
    if (element.hasEmploymentImpacted())
        composePeriod(t, "ExplanationOfBenefit", "employmentImpacted", element.getEmploymentImpacted(), -1);
    if (element.hasHospitalization())
        composePeriod(t, "ExplanationOfBenefit", "hospitalization", element.getHospitalization(), -1);
    for (int i = 0; i < element.getItem().size(); i++) composeExplanationOfBenefitItemsComponent(t, "ExplanationOfBenefit", "item", element.getItem().get(i), i);
    for (int i = 0; i < element.getAddItem().size(); i++) composeExplanationOfBenefitAddedItemComponent(t, "ExplanationOfBenefit", "addItem", element.getAddItem().get(i), i);
    for (int i = 0; i < element.getMissingTeeth().size(); i++) composeExplanationOfBenefitMissingTeethComponent(t, "ExplanationOfBenefit", "missingTeeth", element.getMissingTeeth().get(i), i);
    if (element.hasTotalCost())
        composeQuantity(t, "ExplanationOfBenefit", "totalCost", element.getTotalCost(), -1);
    if (element.hasUnallocDeductable())
        composeQuantity(t, "ExplanationOfBenefit", "unallocDeductable", element.getUnallocDeductable(), -1);
    if (element.hasTotalBenefit())
        composeQuantity(t, "ExplanationOfBenefit", "totalBenefit", element.getTotalBenefit(), -1);
    if (element.hasPaymentAdjustment())
        composeQuantity(t, "ExplanationOfBenefit", "paymentAdjustment", element.getPaymentAdjustment(), -1);
    if (element.hasPaymentAdjustmentReason())
        composeCoding(t, "ExplanationOfBenefit", "paymentAdjustmentReason", element.getPaymentAdjustmentReason(), -1);
    if (element.hasPaymentDateElement())
        composeDate(t, "ExplanationOfBenefit", "paymentDate", element.getPaymentDateElement(), -1);
    if (element.hasPaymentAmount())
        composeQuantity(t, "ExplanationOfBenefit", "paymentAmount", element.getPaymentAmount(), -1);
    if (element.hasPaymentRef())
        composeIdentifier(t, "ExplanationOfBenefit", "paymentRef", element.getPaymentRef(), -1);
    if (element.hasReserved())
        composeCoding(t, "ExplanationOfBenefit", "reserved", element.getReserved(), -1);
    if (element.hasForm())
        composeCoding(t, "ExplanationOfBenefit", "form", element.getForm(), -1);
    for (int i = 0; i < element.getNote().size(); i++) composeExplanationOfBenefitNotesComponent(t, "ExplanationOfBenefit", "note", element.getNote().get(i), i);
    for (int i = 0; i < element.getBenefitBalance().size(); i++) composeExplanationOfBenefitBenefitBalanceComponent(t, "ExplanationOfBenefit", "benefitBalance", element.getBenefitBalance().get(i), i);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 30 with ClaimResponse

use of org.hl7.fhir.r4.model.ClaimResponse in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeClaimResponseDetailAdjudicationComponent.

protected void composeClaimResponseDetailAdjudicationComponent(Complex parent, String parentType, String name, ClaimResponse.DetailAdjudicationComponent 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);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Aggregations

Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)16 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)15 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)13 ClaimResponse (org.hl7.fhir.r4.model.ClaimResponse)4 Test (org.junit.jupiter.api.Test)3 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)2 Date (java.util.Date)2 Identifier (org.hl7.fhir.r4.model.Identifier)2 Meta (org.hl7.fhir.r4.model.Meta)2 Reference (org.hl7.fhir.r4.model.Reference)2 FhirResource (org.hl7.davinci.endpoint.database.FhirResource)1 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)1 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)1