use of org.hl7.fhir.instance.model.api.IIdType in project gpconnect-demonstrator by nhsconnect.
the class PopulateMedicationBundle method getOrganisationIds.
private Set<String> getOrganisationIds(List<MedicationRequest> allMedReqs) {
Set<String> orgIds = new HashSet<>();
for (MedicationRequest medReq : allMedReqs) {
IIdType performerOrganizationRef = medReq.getDispenseRequest().getPerformer().getReferenceElement();
IIdType requesterOnBehalfOfOrganizationRef = medReq.getRequester().getOnBehalfOf().getReferenceElement();
if (performerOrganizationRef != null && performerOrganizationRef.getIdPart() != null) {
orgIds.add(performerOrganizationRef.getIdPart());
}
if (requesterOnBehalfOfOrganizationRef != null && requesterOnBehalfOfOrganizationRef.getIdPart() != null) {
orgIds.add(requesterOnBehalfOfOrganizationRef.getIdPart());
}
}
return orgIds;
}
Aggregations