Search in sources :

Example 16 with CommunicationRequest

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;
}
Also used : IBaseResource(org.hl7.fhir.instance.model.api.IBaseResource)

Aggregations

Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)5 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)3 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)2 Reference (org.hl7.fhir.r4.model.Reference)2 StringType (org.hl7.fhir.r4.model.StringType)2 InternalErrorException (ca.uhn.fhir.rest.server.exceptions.InternalErrorException)1 ActivityDefinition (org.hl7.fhir.dstu3.model.ActivityDefinition)1 BooleanType (org.hl7.fhir.dstu3.model.BooleanType)1 CommunicationRequest (org.hl7.fhir.dstu3.model.CommunicationRequest)1 Reference (org.hl7.fhir.dstu3.model.Reference)1 Resource (org.hl7.fhir.dstu3.model.Resource)1 StringType (org.hl7.fhir.dstu3.model.StringType)1 Turtle (org.hl7.fhir.dstu3.utils.formats.Turtle)1 FHIRException (org.hl7.fhir.exceptions.FHIRException)1 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)1 ActivityDefinition (org.hl7.fhir.r4.model.ActivityDefinition)1 Attachment (org.hl7.fhir.r4.model.Attachment)1 BooleanType (org.hl7.fhir.r4.model.BooleanType)1 CommunicationRequest (org.hl7.fhir.r4.model.CommunicationRequest)1 RelatedArtifact (org.hl7.fhir.r4.model.RelatedArtifact)1