use of org.hl7.fhir.dstu3.model.CommunicationRequest in project CRD by HL7-DaVinci.
the class FhirRequestProcessor method addExtensionToRequest.
public static IBaseResource addExtensionToRequest(IBaseResource request, Extension extension) {
IBaseResource output = request;
switch(request.fhirType()) {
case "DeviceRequest":
case "MedicationRequest":
case "CommunicationRequest":
case "ServiceRequest":
case "NutritionOrder":
case "Appointment":
case "Encounter":
DomainResource domainResource = ((DomainResource) request);
domainResource.addExtension(extension);
output = domainResource;
break;
default:
logger.info("Unsupported fhir R4 resource type (" + request.fhirType() + ") when adding extension");
throw new RuntimeException("Unsupported fhir R4 resource type " + request.fhirType());
}
return output;
}
Aggregations