use of uk.gov.hscic.model.medication.MedicationOrderDetails in project gpconnect-demonstrator by nhsconnect.
the class MedicationOrderEntityToMedicationOrderDetailsTransformer method transform.
@Override
public MedicationOrderDetails transform(MedicationOrderEntity item) {
MedicationOrderDetails medicationOrderDetails = new MedicationOrderDetails();
medicationOrderDetails.setId(item.getId());
medicationOrderDetails.setDateWritten(item.getDateWritten());
medicationOrderDetails.setOrderStatus(item.getOrderStatus());
medicationOrderDetails.setPatientId(item.getPatientId());
medicationOrderDetails.setAutherId(item.getAutherId());
medicationOrderDetails.setMedicationId(item.getMedicationId());
medicationOrderDetails.setDosageText(item.getDosageText());
medicationOrderDetails.setDispenseQuantityText(item.getDispenseQuantityText());
medicationOrderDetails.setDispenseReviewDate(item.getDispenseReviewDate());
medicationOrderDetails.setDispenseMedicationId(item.getDispenseMedicationId());
medicationOrderDetails.setDispenseRepeatsAllowed(item.getDispenseRepeatsAllowed());
medicationOrderDetails.setLastUpdated(item.getLastUpdated());
return medicationOrderDetails;
}
use of uk.gov.hscic.model.medication.MedicationOrderDetails in project gpconnect-demonstrator by nhsconnect.
the class MedicationOrderResourceProvider method getMedicationOrdersForPatientId.
@Search
public List<MedicationRequest> getMedicationOrdersForPatientId(@RequiredParam(name = "patient") String patientId) {
ArrayList<MedicationRequest> medicationOrders = new ArrayList<>();
List<MedicationOrderDetails> medicationOrderDetailsList = medicationOrderSearch.findMedicationOrdersForPatient(Long.parseLong(patientId));
if (medicationOrderDetailsList != null && !medicationOrderDetailsList.isEmpty()) {
for (MedicationOrderDetails medicationOrderDetails : medicationOrderDetailsList) {
medicationOrders.add(medicationOrderDetailsToMedicationOrderResourceConverter(medicationOrderDetails));
}
}
return medicationOrders;
}
use of uk.gov.hscic.model.medication.MedicationOrderDetails in project gpconnect-demonstrator by nhsconnect.
the class MedicationOrderResourceProvider method getMedicationOrderById.
@Read()
public MedicationRequest getMedicationOrderById(@IdParam IdType medicationOrderId) {
MedicationOrderDetails medicationOrderDetails = medicationOrderSearch.findMedicationOrderByID(medicationOrderId.getIdPartAsLong());
if (medicationOrderDetails == null) {
OperationOutcome operationalOutcome = new OperationOutcome();
operationalOutcome.addIssue().setSeverity(IssueSeverity.ERROR).setDiagnostics("No medicationOrder details found for ID: " + medicationOrderId.getIdPart());
throw new InternalErrorException("No medicationOrder details found for ID: " + medicationOrderId.getIdPart(), operationalOutcome);
}
return medicationOrderDetailsToMedicationOrderResourceConverter(medicationOrderDetails);
}
Aggregations