use of org.hl7.fhir.r4.model.MedicationStatement in project fhir-bridge by ehrbase.
the class AceHemmerBeliebigesEreignisPointEventConverter method convertInternal.
@Override
protected AceHemmerBeliebigesEreignisPointEvent convertInternal(MedicationStatement medicationStatement) {
AceHemmerBeliebigesEreignisPointEvent aceHemmerBeliebigesEreignisPointEvent = new AceHemmerBeliebigesEreignisPointEvent();
for (Coding coding : medicationStatement.getMedicationCodeableConcept().getCoding()) {
if (coding.getSystem().equals("http://fhir.de/CodeSystem/bfarm/atc")) {
DvCodedTextParser.getInstance().parseFHIRCoding(coding).ifPresent(aceHemmerBeliebigesEreignisPointEvent::setArzneimittelName);
}
}
getGrundDefiningCode(medicationStatement).ifPresent(aceHemmerBeliebigesEreignisPointEvent::setGrund);
return aceHemmerBeliebigesEreignisPointEvent;
}
use of org.hl7.fhir.r4.model.MedicationStatement in project fhir-bridge by ehrbase.
the class AceHemmerObservationConverter method convertInternal.
@Override
protected AceHemmerObservation convertInternal(MedicationStatement resource) {
AceHemmerObservation aceHemmerObservation = new AceHemmerObservation();
List<AceHemmerBeliebigesEreignisChoice> ereignisList = new ArrayList<>();
for (Coding coding : resource.getMedicationCodeableConcept().getCoding()) {
if (coding.getSystem().equals("http://fhir.de/CodeSystem/bfarm/atc")) {
ereignisList.add(new AceHemmerBeliebigesEreignisPointEventConverter().convert(resource));
}
}
aceHemmerObservation.setBeliebigesEreignis(ereignisList);
return aceHemmerObservation;
}
use of org.hl7.fhir.r4.model.MedicationStatement in project fhir-bridge by ehrbase.
the class Covid19TherapieBeliebigesEreignisPointEventConverter method convertInternal.
@Override
protected Covid19TherapieBeliebigesEreignisPointEvent convertInternal(MedicationStatement resource) {
Covid19TherapieBeliebigesEreignisPointEvent covid19TherapieBeliebigesEreignisPointEvent = new Covid19TherapieBeliebigesEreignisPointEvent();
for (Coding coding : resource.getMedicationCodeableConcept().getCoding()) {
if (coding.getSystem().equals("http://fhir.de/CodeSystem/bfarm/atc")) {
DvCodedTextParser.getInstance().parseFHIRCoding(coding).ifPresent(covid19TherapieBeliebigesEreignisPointEvent::setArzneimittelName);
}
}
getGrundDefiningCode(resource).ifPresent(covid19TherapieBeliebigesEreignisPointEvent::setGrund);
return covid19TherapieBeliebigesEreignisPointEvent;
}
use of org.hl7.fhir.r4.model.MedicationStatement in project fhir-bridge by ehrbase.
the class ProvideMedicationStatementTransactionIT method provideMedicationStatementConditionalUpdate.
@Test
void provideMedicationStatementConditionalUpdate() throws IOException {
MethodOutcome outcome;
outcome = create("MedicationStatement/transactions/provide-medication-statement-create.json");
var id = outcome.getId();
outcome = update("MedicationStatement/transactions/provide-medication-statement-update.json", "MedicationStatement?_id=" + id.getIdPart() + "&subject.identifier=" + PATIENT_ID);
Assertions.assertEquals(id.getIdPart(), outcome.getId().getIdPart());
Assertions.assertEquals(id.getVersionIdPartAsLong() + 1, outcome.getId().getVersionIdPartAsLong());
var medicationStatement = (MedicationStatement) outcome.getResource();
Assertions.assertEquals(PATIENT_ID, medicationStatement.getSubject().getIdentifier().getValue());
Assertions.assertEquals(MedicationStatement.MedicationStatementStatus.ONHOLD, medicationStatement.getStatus());
}
use of org.hl7.fhir.r4.model.MedicationStatement 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);
}
Aggregations