Skip to content

Commit

Permalink
FM2-638: Mapping OpenMRS Drug Order instructions to FHIR Dosage instr…
Browse files Browse the repository at this point in the history
…uctions
  • Loading branch information
mogoodrich committed Aug 14, 2024
1 parent da2e53e commit 08f8292
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import lombok.AccessLevel;
import lombok.Setter;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.Dosage;
import org.hl7.fhir.r4.model.Quantity;
Expand Down Expand Up @@ -53,9 +52,7 @@ public Dosage toFhirResource(@Nonnull DrugOrder drugOrder) {
dosage.setTiming(timingTranslator.toFhirResource(drugOrder));

if (drugOrder.getInstructions() != null) {
CodeableConcept additionalInstructions = new CodeableConcept();
additionalInstructions.setText(drugOrder.getInstructions());
dosage.addAdditionalInstruction(additionalInstructions);
dosage.addAdditionalInstruction().setText(drugOrder.getInstructions());
}

if (drugOrder.getDose() != null) {
Expand All @@ -81,7 +78,7 @@ public Dosage toFhirResource(@Nonnull DrugOrder drugOrder) {
public DrugOrder toOpenmrsType(@Nonnull DrugOrder drugOrder, @Nonnull Dosage dosage) {
drugOrder.setDosingInstructions(dosage.getText());

if (!dosage.getAdditionalInstruction().isEmpty()) {
if (dosage.hasAdditionalInstruction()) {
drugOrder.setInstructions(dosage.getAdditionalInstructionFirstRep().getText());
}

Expand Down

0 comments on commit 08f8292

Please sign in to comment.