use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeSpecimenSpecimenProcessingComponent.
protected void composeSpecimenSpecimenProcessingComponent(Complex parent, String parentType, String name, Specimen.SpecimenProcessingComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "processing", name, element, index);
if (element.hasDescriptionElement())
composeString(t, "Specimen", "description", element.getDescriptionElement(), -1);
if (element.hasProcedure())
composeCodeableConcept(t, "Specimen", "procedure", element.getProcedure(), -1);
for (int i = 0; i < element.getAdditive().size(); i++) composeReference(t, "Specimen", "additive", element.getAdditive().get(i), i);
if (element.hasTime())
composeType(t, "Specimen", "time", element.getTime(), -1);
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE 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.hasStatusElement())
composeEnum(t, "ExplanationOfBenefit", "status", element.getStatusElement(), -1);
if (element.hasType())
composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
for (int i = 0; i < element.getSubType().size(); i++) composeCodeableConcept(t, "ExplanationOfBenefit", "subType", element.getSubType().get(i), i);
if (element.hasPatient())
composeReference(t, "ExplanationOfBenefit", "patient", element.getPatient(), -1);
if (element.hasBillablePeriod())
composePeriod(t, "ExplanationOfBenefit", "billablePeriod", element.getBillablePeriod(), -1);
if (element.hasCreatedElement())
composeDateTime(t, "ExplanationOfBenefit", "created", element.getCreatedElement(), -1);
if (element.hasEnterer())
composeReference(t, "ExplanationOfBenefit", "enterer", element.getEnterer(), -1);
if (element.hasInsurer())
composeReference(t, "ExplanationOfBenefit", "insurer", element.getInsurer(), -1);
if (element.hasProvider())
composeReference(t, "ExplanationOfBenefit", "provider", element.getProvider(), -1);
if (element.hasOrganization())
composeReference(t, "ExplanationOfBenefit", "organization", element.getOrganization(), -1);
if (element.hasReferral())
composeReference(t, "ExplanationOfBenefit", "referral", element.getReferral(), -1);
if (element.hasFacility())
composeReference(t, "ExplanationOfBenefit", "facility", element.getFacility(), -1);
if (element.hasClaim())
composeReference(t, "ExplanationOfBenefit", "claim", element.getClaim(), -1);
if (element.hasClaimResponse())
composeReference(t, "ExplanationOfBenefit", "claimResponse", element.getClaimResponse(), -1);
if (element.hasOutcome())
composeCodeableConcept(t, "ExplanationOfBenefit", "outcome", element.getOutcome(), -1);
if (element.hasDispositionElement())
composeString(t, "ExplanationOfBenefit", "disposition", element.getDispositionElement(), -1);
for (int i = 0; i < element.getRelated().size(); i++) composeExplanationOfBenefitRelatedClaimComponent(t, "ExplanationOfBenefit", "related", element.getRelated().get(i), i);
if (element.hasPrescription())
composeReference(t, "ExplanationOfBenefit", "prescription", element.getPrescription(), -1);
if (element.hasOriginalPrescription())
composeReference(t, "ExplanationOfBenefit", "originalPrescription", element.getOriginalPrescription(), -1);
if (element.hasPayee())
composeExplanationOfBenefitPayeeComponent(t, "ExplanationOfBenefit", "payee", element.getPayee(), -1);
for (int i = 0; i < element.getInformation().size(); i++) composeExplanationOfBenefitSupportingInformationComponent(t, "ExplanationOfBenefit", "information", element.getInformation().get(i), i);
for (int i = 0; i < element.getCareTeam().size(); i++) composeExplanationOfBenefitCareTeamComponent(t, "ExplanationOfBenefit", "careTeam", element.getCareTeam().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);
if (element.hasPrecedenceElement())
composePositiveInt(t, "ExplanationOfBenefit", "precedence", element.getPrecedenceElement(), -1);
if (element.hasInsurance())
composeExplanationOfBenefitInsuranceComponent(t, "ExplanationOfBenefit", "insurance", element.getInsurance(), -1);
if (element.hasAccident())
composeExplanationOfBenefitAccidentComponent(t, "ExplanationOfBenefit", "accident", element.getAccident(), -1);
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++) composeExplanationOfBenefitItemComponent(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);
if (element.hasTotalCost())
composeMoney(t, "ExplanationOfBenefit", "totalCost", element.getTotalCost(), -1);
if (element.hasUnallocDeductable())
composeMoney(t, "ExplanationOfBenefit", "unallocDeductable", element.getUnallocDeductable(), -1);
if (element.hasTotalBenefit())
composeMoney(t, "ExplanationOfBenefit", "totalBenefit", element.getTotalBenefit(), -1);
if (element.hasPayment())
composeExplanationOfBenefitPaymentComponent(t, "ExplanationOfBenefit", "payment", element.getPayment(), -1);
if (element.hasForm())
composeCodeableConcept(t, "ExplanationOfBenefit", "form", element.getForm(), -1);
for (int i = 0; i < element.getProcessNote().size(); i++) composeExplanationOfBenefitNoteComponent(t, "ExplanationOfBenefit", "processNote", element.getProcessNote().get(i), i);
for (int i = 0; i < element.getBenefitBalance().size(); i++) composeExplanationOfBenefitBenefitBalanceComponent(t, "ExplanationOfBenefit", "benefitBalance", element.getBenefitBalance().get(i), i);
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeProcedureProcedurePerformerComponent.
protected void composeProcedureProcedurePerformerComponent(Complex parent, String parentType, String name, Procedure.ProcedurePerformerComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "performer", name, element, index);
if (element.hasRole())
composeCodeableConcept(t, "Procedure", "role", element.getRole(), -1);
if (element.hasActor())
composeReference(t, "Procedure", "actor", element.getActor(), -1);
if (element.hasOnBehalfOf())
composeReference(t, "Procedure", "onBehalfOf", element.getOnBehalfOf(), -1);
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeExplanationOfBenefitProcedureComponent.
protected void composeExplanationOfBenefitProcedureComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.ProcedureComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "procedure", name, element, index);
if (element.hasSequenceElement())
composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
if (element.hasDateElement())
composeDateTime(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
if (element.hasProcedure())
composeType(t, "ExplanationOfBenefit", "procedure", element.getProcedure(), -1);
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.
the class Procedure10_40Test method testProcedureConversion.
@Test
@DisplayName("Test 10_40 Procedure conversion")
public void testProcedureConversion() throws IOException {
InputStream dstu2_input = this.getClass().getResourceAsStream("/0_procedure_10.json");
InputStream r4_exepected_input = this.getClass().getResourceAsStream("/0_procedure_40.json");
org.hl7.fhir.dstu2.model.Procedure dstu2 = (org.hl7.fhir.dstu2.model.Procedure) new org.hl7.fhir.dstu2.formats.JsonParser().parse(dstu2_input);
BaseAdvisor_10_40 advisor = new IGR2ConvertorAdvisor();
org.hl7.fhir.r4.model.Resource r4_actual = VersionConvertorFactory_10_40.convertResource(dstu2, advisor);
org.hl7.fhir.r4.formats.JsonParser r4_parser = new org.hl7.fhir.r4.formats.JsonParser();
org.hl7.fhir.r4.model.Resource r4_expected = r4_parser.parse(r4_exepected_input);
Assertions.assertTrue(r4_expected.equalsDeep(r4_actual), "Failed comparing\n" + r4_parser.composeString(r4_actual) + "\nand\n" + r4_parser.composeString(r4_expected));
}
Aggregations