Skip to content

Commit

Permalink
A1208102423475700 | Enable Add to Drug Chart if order is dispensed (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjun-Go authored Aug 29, 2024
1 parent 4798888 commit 03b4703
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package org.openmrs.module.ipd.contract;

import lombok.*;
import org.openmrs.module.bahmniemrapi.drugorder.contract.BahmniOrderAttribute;
import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction;
import org.openmrs.module.ipd.model.IPDDrugOrder;

import java.util.List;

@Getter
@Setter
@Builder
Expand All @@ -14,11 +17,14 @@ public class IPDDrugOrderResponse {
private EncounterTransaction.DrugOrder drugOrder;
private EncounterTransaction.Provider provider;
private DrugOrderScheduleResponse drugOrderSchedule;
private List<BahmniOrderAttribute> drugOrderAttributes;


public static IPDDrugOrderResponse createFrom(IPDDrugOrder ipdDrugOrder) {
IPDDrugOrderResponse ipdDrugOrderResponse= IPDDrugOrderResponse.builder().
drugOrder(ipdDrugOrder.getBahmniDrugOrder().getDrugOrder())
.provider(ipdDrugOrder.getBahmniDrugOrder().getProvider())
.drugOrderAttributes(ipdDrugOrder.getBahmniDrugOrder().getOrderAttributes())
.build();
if (ipdDrugOrder.getDrugOrderSchedule() != null){
ipdDrugOrderResponse.setDrugOrderSchedule(DrugOrderScheduleResponse.createFrom(ipdDrugOrder.getDrugOrderSchedule()));
Expand Down

0 comments on commit 03b4703

Please sign in to comment.