Search in sources :

Example 86 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeClaimProcedureComponent.

protected void composeClaimProcedureComponent(Complex parent, String parentType, String name, Claim.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, "Claim", "sequence", element.getSequenceElement(), -1);
    if (element.hasDateElement())
        composeDateTime(t, "Claim", "date", element.getDateElement(), -1);
    if (element.hasProcedure())
        composeType(t, "Claim", "procedure", element.getProcedure(), -1);
}
Also used : Complex(org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)

Example 87 with PROCEDURE

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);
    for (int i = 0; i < element.getType().size(); i++) composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType().get(i), i);
    if (element.hasDateElement())
        composeDateTime(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
    if (element.hasProcedure())
        composeType(t, "ExplanationOfBenefit", "procedure", element.getProcedure(), -1);
    for (int i = 0; i < element.getUdi().size(); i++) composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 88 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent.

protected void composeMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent(Complex parent, String parentType, String name, MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent 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.hasIdentifier())
        composeIdentifier(t, "MedicinalProductAuthorization", "identifier", element.getIdentifier(), -1);
    if (element.hasType())
        composeCodeableConcept(t, "MedicinalProductAuthorization", "type", element.getType(), -1);
    if (element.hasDate())
        composeType(t, "MedicinalProductAuthorization", "date", element.getDate(), -1);
    for (int i = 0; i < element.getApplication().size(); i++) composeMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent(t, "MedicinalProductAuthorization", "application", element.getApplication().get(i), i);
}
Also used : Complex(org.hl7.fhir.r4.utils.formats.Turtle.Complex)

Example 89 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.

the class ArgonautConverter method processProcedureSection.

private void processProcedureSection(CDAUtilities cda, Convert convert, Element sect, Context context) throws Exception {
    scanSection("Procedures", sect);
    ListResource list = new ListResource();
    list.setId(context.getBaseId() + "-list-procedures");
    // list.setUserData("profile", "") none?
    list.setSubject(context.getSubjectRef());
    list.setCode(inspectCode(convert.makeCodeableConceptFromCD(cda.getChild(sect, "code")), null));
    list.setTitle(cda.getChild(sect, "title").getTextContent());
    list.setStatus(ListStatus.CURRENT);
    list.setMode(ListMode.SNAPSHOT);
    list.setDateElement(context.getNow());
    list.setSource(context.getAuthorRef());
    buildNarrative(list, cda.getChild(sect, "text"));
    int i = 0;
    for (Element c : cda.getChildren(sect, "entry")) {
        Element p = cda.getChild(c, "procedure");
        Procedure proc = new Procedure();
        proc.setId(context.getBaseId() + "-procedure-" + i);
        proc.setUserData("profile", "http://hl7.org/fhir/StructureDefinition/procedure-daf-dafprocedure");
        i++;
        proc.setSubject(context.getSubjectRef());
        proc.setContext(new Reference().setReference("Encounter/" + context.getEncounter().getId()));
        list.addEntry().setItem(new Reference().setReference("Procedure/" + proc.getId()));
        proc.setCode(inspectCode(convert.makeCodeableConceptFromCD(cda.getChild(p, "code")), null));
        recordProcedureCode(proc.getCode());
        for (Element e : cda.getChildren(p, "id")) proc.getIdentifier().add(convert.makeIdentifierFromII(e));
        proc.setStatus(determineProcedureStatus(cda.getChild(p, "statusCode")));
        buildNarrative(proc, cda.getChild(p, "text"));
        proc.setPerformed(convert.makeDateTimeFromTS(cda.getChild(p, "effectiveTime")));
        for (Element e : cda.getChildren(p, "performer")) {
            ProcedurePerformerComponent part = proc.addPerformer();
            Practitioner pp = processPerformer(cda, convert, context, e, "assignedEntity", "assignedPerson");
            Reference ref = new Reference().setReference("Practitioner/" + pp.getId()).setDisplay(pp.getUserString("display"));
            part.setActor(ref);
        }
        saveResource(proc);
    }
    saveResource(list);
}
Also used : Element(org.w3c.dom.Element) ProcedurePerformerComponent(org.hl7.fhir.dstu3.model.Procedure.ProcedurePerformerComponent)

Example 90 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project org.hl7.fhir.core by hapifhir.

the class CCDAConverter method processProceduresSection.

protected SectionComponent processProceduresSection(Element section) throws Exception {
    ListResource list = new ListResource();
    for (Element entry : cda.getChildren(section, "entry")) {
        Element procedure = cda.getlastChild(entry);
        if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.14")) {
            processProcedure(list, procedure, ProcedureType.Procedure);
        } else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.13")) {
            processProcedure(list, procedure, ProcedureType.Observation);
        } else if (cda.hasTemplateId(procedure, "2.16.840.1.113883.10.20.22.4.12")) {
            processProcedure(list, procedure, ProcedureType.Act);
        } else
            throw new Exception("Unhandled Section template ids: " + cda.showTemplateIds(procedure));
    }
    // todo: text
    SectionComponent s = new Composition.SectionComponent();
    s.setCode(convert.makeCodeableConceptFromCD(cda.getChild(section, "code")));
    // todo: check subject
    s.addEntry(Factory.makeReference(addReference(list, "Procedures", makeUUIDReference())));
    return s;
}
Also used : Element(org.w3c.dom.Element) SectionComponent(org.hl7.fhir.dstu3.model.Composition.SectionComponent)

Aggregations

Procedure (org.hl7.fhir.r4.model.Procedure)22 Test (org.junit.jupiter.api.Test)19 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)14 Coding (org.hl7.fhir.r4.model.Coding)14 ArrayList (java.util.ArrayList)12 Bundle (org.hl7.fhir.r4.model.Bundle)11 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)11 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)9 Reference (org.hl7.fhir.r4.model.Reference)9 ExplanationOfBenefit (org.hl7.fhir.dstu3.model.ExplanationOfBenefit)8 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)8 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)8 CCWProcedure (gov.cms.bfd.server.war.commons.CCWProcedure)7 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)7 Coding (org.hl7.fhir.dstu3.model.Coding)7 Date (java.util.Date)6 List (java.util.List)6 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)6 Diagnosis (gov.cms.bfd.server.war.commons.Diagnosis)5 Collectors (java.util.stream.Collectors)5