use of org.hl7.fhir.r4.model.DeviceRequest in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeDeviceRequest.
protected void composeDeviceRequest(Complex parent, String parentType, String name, DeviceRequest element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "DeviceRequest", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "DeviceRequest", "identifier", element.getIdentifier().get(i), i);
for (int i = 0; i < element.getDefinition().size(); i++) composeReference(t, "DeviceRequest", "definition", element.getDefinition().get(i), i);
for (int i = 0; i < element.getBasedOn().size(); i++) composeReference(t, "DeviceRequest", "basedOn", element.getBasedOn().get(i), i);
for (int i = 0; i < element.getPriorRequest().size(); i++) composeReference(t, "DeviceRequest", "priorRequest", element.getPriorRequest().get(i), i);
if (element.hasGroupIdentifier())
composeIdentifier(t, "DeviceRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
if (element.hasStatusElement())
composeEnum(t, "DeviceRequest", "status", element.getStatusElement(), -1);
if (element.hasIntent())
composeCodeableConcept(t, "DeviceRequest", "intent", element.getIntent(), -1);
if (element.hasPriorityElement())
composeEnum(t, "DeviceRequest", "priority", element.getPriorityElement(), -1);
if (element.hasCode())
composeType(t, "DeviceRequest", "code", element.getCode(), -1);
if (element.hasSubject())
composeReference(t, "DeviceRequest", "subject", element.getSubject(), -1);
if (element.hasContext())
composeReference(t, "DeviceRequest", "context", element.getContext(), -1);
if (element.hasOccurrence())
composeType(t, "DeviceRequest", "occurrence", element.getOccurrence(), -1);
if (element.hasAuthoredOnElement())
composeDateTime(t, "DeviceRequest", "authoredOn", element.getAuthoredOnElement(), -1);
if (element.hasRequester())
composeDeviceRequestDeviceRequestRequesterComponent(t, "DeviceRequest", "requester", element.getRequester(), -1);
if (element.hasPerformerType())
composeCodeableConcept(t, "DeviceRequest", "performerType", element.getPerformerType(), -1);
if (element.hasPerformer())
composeReference(t, "DeviceRequest", "performer", element.getPerformer(), -1);
for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "DeviceRequest", "reasonCode", element.getReasonCode().get(i), i);
for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "DeviceRequest", "reasonReference", element.getReasonReference().get(i), i);
for (int i = 0; i < element.getSupportingInfo().size(); i++) composeReference(t, "DeviceRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "DeviceRequest", "note", element.getNote().get(i), i);
for (int i = 0; i < element.getRelevantHistory().size(); i++) composeReference(t, "DeviceRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
}
use of org.hl7.fhir.r4.model.DeviceRequest in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeDeviceRequest.
protected void composeDeviceRequest(Complex parent, String parentType, String name, DeviceRequest element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "DeviceRequest", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "DeviceRequest", "identifier", element.getIdentifier().get(i), i);
for (int i = 0; i < element.getInstantiatesCanonical().size(); i++) composeCanonical(t, "DeviceRequest", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
for (int i = 0; i < element.getInstantiatesUri().size(); i++) composeUri(t, "DeviceRequest", "instantiatesUri", element.getInstantiatesUri().get(i), i);
for (int i = 0; i < element.getBasedOn().size(); i++) composeReference(t, "DeviceRequest", "basedOn", element.getBasedOn().get(i), i);
for (int i = 0; i < element.getPriorRequest().size(); i++) composeReference(t, "DeviceRequest", "priorRequest", element.getPriorRequest().get(i), i);
if (element.hasGroupIdentifier())
composeIdentifier(t, "DeviceRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
if (element.hasStatusElement())
composeEnum(t, "DeviceRequest", "status", element.getStatusElement(), -1);
if (element.hasIntentElement())
composeEnum(t, "DeviceRequest", "intent", element.getIntentElement(), -1);
if (element.hasPriorityElement())
composeEnum(t, "DeviceRequest", "priority", element.getPriorityElement(), -1);
if (element.hasCode())
composeType(t, "DeviceRequest", "code", element.getCode(), -1);
for (int i = 0; i < element.getParameter().size(); i++) composeDeviceRequestDeviceRequestParameterComponent(t, "DeviceRequest", "parameter", element.getParameter().get(i), i);
if (element.hasSubject())
composeReference(t, "DeviceRequest", "subject", element.getSubject(), -1);
if (element.hasEncounter())
composeReference(t, "DeviceRequest", "encounter", element.getEncounter(), -1);
if (element.hasOccurrence())
composeType(t, "DeviceRequest", "occurrence", element.getOccurrence(), -1);
if (element.hasAuthoredOnElement())
composeDateTime(t, "DeviceRequest", "authoredOn", element.getAuthoredOnElement(), -1);
if (element.hasRequester())
composeReference(t, "DeviceRequest", "requester", element.getRequester(), -1);
if (element.hasPerformerType())
composeCodeableConcept(t, "DeviceRequest", "performerType", element.getPerformerType(), -1);
if (element.hasPerformer())
composeReference(t, "DeviceRequest", "performer", element.getPerformer(), -1);
for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "DeviceRequest", "reasonCode", element.getReasonCode().get(i), i);
for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "DeviceRequest", "reasonReference", element.getReasonReference().get(i), i);
for (int i = 0; i < element.getInsurance().size(); i++) composeReference(t, "DeviceRequest", "insurance", element.getInsurance().get(i), i);
for (int i = 0; i < element.getSupportingInfo().size(); i++) composeReference(t, "DeviceRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "DeviceRequest", "note", element.getNote().get(i), i);
for (int i = 0; i < element.getRelevantHistory().size(); i++) composeReference(t, "DeviceRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
}
use of org.hl7.fhir.r4.model.DeviceRequest in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeDeviceRequestDeviceRequestParameterComponent.
protected void composeDeviceRequestDeviceRequestParameterComponent(Complex parent, String parentType, String name, DeviceRequest.DeviceRequestParameterComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "parameter", name, element, index);
if (element.hasCode())
composeCodeableConcept(t, "DeviceRequest", "code", element.getCode(), -1);
if (element.hasValue())
composeType(t, "DeviceRequest", "value", element.getValue(), -1);
}
use of org.hl7.fhir.r4.model.DeviceRequest in project CRD by HL7-DaVinci.
the class FhirRequestProcessor method addSupportingInfoToRequest.
public static IBaseResource addSupportingInfoToRequest(IBaseResource request, Reference reference) {
IBaseResource output = request;
switch(request.fhirType()) {
case "DeviceRequest":
DeviceRequest deviceRequest = ((DeviceRequest) request).copy();
deviceRequest.addSupportingInfo(reference);
output = deviceRequest;
break;
case "MedicationRequest":
MedicationRequest medicationRequest = ((MedicationRequest) request).copy();
medicationRequest.addSupportingInformation(reference);
output = medicationRequest;
break;
case "MedicationDispense":
MedicationDispense medicationDispense = ((MedicationDispense) request).copy();
medicationDispense.addSupportingInformation(reference);
output = medicationDispense;
break;
case "ServiceRequest":
ServiceRequest serviceRequest = ((ServiceRequest) request).copy();
serviceRequest.addSupportingInfo(reference);
output = serviceRequest;
break;
case "Appointment":
Appointment appointment = ((Appointment) request).copy();
appointment.addSupportingInformation(reference);
output = appointment;
break;
case "NutritionOrder":
case "SupplyRequest":
case "Encounter":
default:
logger.info("Unsupported fhir R4 resource type (" + request.fhirType() + ") when adding note");
throw new RuntimeException("Unsupported fhir R4 resource type " + request.fhirType());
}
return output;
}
use of org.hl7.fhir.r4.model.DeviceRequest in project CRD by HL7-DaVinci.
the class FhirRequestProcessor method addNoteToRequest.
public static IBaseResource addNoteToRequest(IBaseResource request, Annotation note) {
IBaseResource output = request;
switch(request.fhirType()) {
case "DeviceRequest":
DeviceRequest deviceRequest = ((DeviceRequest) request).copy();
deviceRequest.addNote(note);
output = deviceRequest;
break;
case "MedicationRequest":
MedicationRequest medicationRequest = ((MedicationRequest) request).copy();
medicationRequest.addNote(note);
output = medicationRequest;
break;
case "MedicationDispense":
MedicationDispense medicationDispense = ((MedicationDispense) request).copy();
medicationDispense.addNote(note);
output = medicationDispense;
break;
case "ServiceRequest":
ServiceRequest serviceRequest = ((ServiceRequest) request).copy();
serviceRequest.addNote(note);
output = serviceRequest;
break;
case "NutritionOrder":
NutritionOrder nutritionOrder = ((NutritionOrder) request).copy();
nutritionOrder.addNote(note);
output = nutritionOrder;
break;
case "SupplyRequest":
case "Appointment":
case "Encounter":
default:
logger.info("Unsupported fhir R4 resource type (" + request.fhirType() + ") when adding note");
throw new RuntimeException("Unsupported fhir R4 resource type " + request.fhirType());
}
return output;
}
Aggregations