Search in sources :

Example 71 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.

the class RespiratoryTherapies method createProcedure.

private Procedure createProcedure(ItemData generalCoding, ItemData answerCoding) {
    var procedure = (Procedure) new Procedure().addIdentifier(createIdentifier(PROCEDURE, generalCoding)).setPerformed(// TODO Set actual DateTime value
    UNKNOWN_DATE_TIME).setCategory(createCodeableConcept(createCoding(SNOMED_CT, "277132007", "Therapeutic procedure (procedure)"))).setMeta(createMeta(RESPIRATORY_THERAPIES));
    createCodings(answerCoding).stream().map(Coding::getCode).filter(code -> equalsAny(code, INPROGRESS.toCode(), NOTDONE.toCode(), ProcedureStatus.UNKNOWN.toCode())).map(ProcedureStatus::fromCode).forEach(procedure::setStatus);
    var codeableConcept = createCodeableConcept(generalCoding);
    return codeableConcept.isEmpty() ? new Procedure() : procedure.setCode(codeableConcept);
}
Also used : Procedure(org.hl7.fhir.r4.model.Procedure)

Example 72 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.

the class Anticoagulation method createMedicationStatement.

private MedicationStatement createMedicationStatement(ItemData generalCoding, ItemData specificCoding, ItemData accurateCodingOrText, ItemData dateCoding, ItemData reasonCoding) {
    var medicationStatement = (MedicationStatement) new MedicationStatement().addIdentifier(createIdentifier(MEDICATIONSTATEMENT, specificCoding)).setEffective(createDateTimeType(dateCoding)).addReasonCode(createCodeableConcept(!reasonCoding.isEmpty() ? createCoding(reasonCoding) : createCoding(SNOMED_CT, "373808002", "Curative - procedure intent (qualifier value)"))).setMeta(createMeta(PHARMACOLOGICAL_THERAPY_ANTICOAGULANTS));
    var medicationCodeableConcept = createCodeableConcept(generalCoding);
    for (var coding : createCodings(specificCoding)) {
        switch(coding.getCode()) {
            case // Answer = YES
            "410605003":
                medicationStatement.setStatus(MedicationStatementStatus.ACTIVE);
                break;
            case // Answer = NO
            "410594000":
                medicationStatement.setStatus(NOTTAKEN);
                break;
            case // Answer = Unknown
            "261665006":
                medicationStatement.setStatus(MedicationStatementStatus.UNKNOWN);
                break;
            case // Answer = Sonstige/Other
            "385432009":
                medicationCodeableConcept.addCoding(coding.setDisplay("Not applicable (qualifier value)"));
                if (endsWith(accurateCodingOrText.getItemOID(), "_textfeld") && !accurateCodingOrText.isEmpty()) {
                    medicationCodeableConcept.setText(accurateCodingOrText.getValue());
                }
                break;
            default:
                // add Medication Codes
                if (accurateCodingOrText.isEmpty()) {
                    medicationCodeableConcept.addCoding(coding);
                }
                break;
        }
    }
    // insert coding of used medication
    if (!accurateCodingOrText.isEmpty() && !endsWith(accurateCodingOrText.getItemOID(), "_textfeld")) {
        for (var coding : createCodings(accurateCodingOrText)) {
            medicationCodeableConcept.addCoding(coding);
        }
    }
    return medicationCodeableConcept.isEmpty() ? new MedicationStatement() : medicationStatement.setMedication(medicationCodeableConcept);
}
Also used : MedicationStatement(org.hl7.fhir.r4.model.MedicationStatement)

Example 73 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.

the class Apheresis method createProcedure.

private Procedure createProcedure(ItemData generalCoding, ItemData answerCoding) {
    var procedure = (Procedure) new Procedure().addIdentifier(createIdentifier(PROCEDURE, generalCoding)).setPerformed(// TODO Set actual DateTime value
    UNKNOWN_DATE_TIME).setCategory(createCodeableConcept(createCoding(SNOMED_CT, "277132007", "Therapeutic procedure (procedure)"))).setCode(createCodeableConcept(generalCoding).setText("Apheresis")).setMeta(createMeta(APHERESIS));
    createCodings(answerCoding).forEach(coding -> {
        if (ProcedureStatus.UNKNOWN.getSystem().equals(coding.getSystem())) {
            procedure.setStatus(ProcedureStatus.fromCode(coding.getCode()));
        } else {
            procedure.setPerformed((DateTimeType) new DateTimeType().addExtension(createExtension(coding)));
        }
    });
    return procedure;
}
Also used : DateTimeType(org.hl7.fhir.r4.model.DateTimeType) Procedure(org.hl7.fhir.r4.model.Procedure)

Example 74 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.

the class DialysisHemofiltration method createProcedure.

private Procedure createProcedure(ItemData generalCoding, ItemData answerCoding) {
    var procedure = (Procedure) new Procedure().addIdentifier(createIdentifier(PROCEDURE, generalCoding)).setPerformed(// TODO Set actual DateTime value
    UNKNOWN_DATE_TIME).setCategory(createCodeableConcept(createCoding(SNOMED_CT, "277132007", "Therapeutic procedure (procedure)"))).setCode(createCodeableConcept(generalCoding).setText("Dialysis")).setMeta(createMeta(DIALYSIS));
    createCodings(answerCoding).forEach(coding -> {
        if (ProcedureStatus.UNKNOWN.getSystem().equals(coding.getSystem())) {
            procedure.setStatus(ProcedureStatus.fromCode(coding.getCode()));
        } else {
            procedure.setPerformed((DateTimeType) new DateTimeType().addExtension(createExtension(coding)));
        }
    });
    return procedure;
}
Also used : DateTimeType(org.hl7.fhir.r4.model.DateTimeType) Procedure(org.hl7.fhir.r4.model.Procedure)

Example 75 with PROCEDURE

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project odm2fhir by num-codex.

the class PronePosition method createProcedure.

private Procedure createProcedure(ItemData generalCoding, ItemData answerCoding) {
    var procedure = (Procedure) new Procedure().addIdentifier(createIdentifier(PROCEDURE, generalCoding)).setPerformed(// TODO Set actual DateTime value
    UNKNOWN_DATE_TIME).setCategory(createCodeableConcept(createCoding(SNOMED_CT, "225287004", "Procedures relating to positioning and support (procedure)"))).setCode(createCodeableConcept(generalCoding).setText("Prone position")).setMeta(createMeta(PRONE_POSITION));
    createCodings(answerCoding).forEach(coding -> {
        if (ProcedureStatus.UNKNOWN.getSystem().equals(coding.getSystem())) {
            procedure.setStatus(ProcedureStatus.fromCode(coding.getCode()));
        } else {
            procedure.setPerformed((DateTimeType) new DateTimeType().addExtension(createExtension(coding)));
        }
    });
    return procedure;
}
Also used : DateTimeType(org.hl7.fhir.r4.model.DateTimeType) Procedure(org.hl7.fhir.r4.model.Procedure)

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