use of org.hl7.fhir.dstu3.model.MedicationRequest.MedicationRequestRequesterComponent in project gpconnect-demonstrator by nhsconnect.
the class MedicationRequestResourceProvider method getRequesterComponent.
// TODO - spec needs to clarify whether this should be populated or not
private MedicationRequestRequesterComponent getRequesterComponent(MedicationRequestDetail requestDetail) {
MedicationRequestRequesterComponent requesterComponent = new MedicationRequestRequesterComponent();
switch(requestDetail.getRequesterUrl()) {
case (SystemURL.SD_GPC_PATIENT):
requesterComponent.setAgent(new Reference(new IdType("Patient", requestDetail.getRequesterId())));
break;
case (SystemURL.SD_GPC_PRACTITIONER):
requesterComponent.setAgent(new Reference(new IdType("Practitioner", requestDetail.getRequesterId())));
break;
case (SystemURL.SD_GPC_ORGANIZATION):
requesterComponent.setAgent(new Reference(new IdType("Organization", requestDetail.getRequesterId())));
break;
default:
break;
}
requesterComponent.setOnBehalfOf(new Reference(new IdType("Organization", requestDetail.getDispenseRequestOrganizationId())));
return requesterComponent;
}
Aggregations