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);
}
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);
}
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;
}
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;
}
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;
}
Aggregations