use of org.hl7.fhir.dstu3.model.ProcedureRequest in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeProcedureRequest.
protected void composeProcedureRequest(Complex parent, String parentType, String name, ProcedureRequest element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "ProcedureRequest", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "ProcedureRequest", "identifier", element.getIdentifier().get(i), i);
if (element.hasSubject())
composeReference(t, "ProcedureRequest", "subject", element.getSubject(), -1);
if (element.hasCode())
composeCodeableConcept(t, "ProcedureRequest", "code", element.getCode(), -1);
for (int i = 0; i < element.getBodySite().size(); i++) composeCodeableConcept(t, "ProcedureRequest", "bodySite", element.getBodySite().get(i), i);
if (element.hasReason())
composeType(t, "ProcedureRequest", "reason", element.getReason(), -1);
if (element.hasScheduled())
composeType(t, "ProcedureRequest", "scheduled", element.getScheduled(), -1);
if (element.hasEncounter())
composeReference(t, "ProcedureRequest", "encounter", element.getEncounter(), -1);
if (element.hasPerformer())
composeReference(t, "ProcedureRequest", "performer", element.getPerformer(), -1);
if (element.hasStatusElement())
composeEnum(t, "ProcedureRequest", "status", element.getStatusElement(), -1);
for (int i = 0; i < element.getNotes().size(); i++) composeAnnotation(t, "ProcedureRequest", "notes", element.getNotes().get(i), i);
if (element.hasAsNeeded())
composeType(t, "ProcedureRequest", "asNeeded", element.getAsNeeded(), -1);
if (element.hasOrderedOnElement())
composeDateTime(t, "ProcedureRequest", "orderedOn", element.getOrderedOnElement(), -1);
if (element.hasOrderer())
composeReference(t, "ProcedureRequest", "orderer", element.getOrderer(), -1);
if (element.hasPriorityElement())
composeEnum(t, "ProcedureRequest", "priority", element.getPriorityElement(), -1);
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeProcedureRequestProcedureRequestRequesterComponent.
protected void composeProcedureRequestProcedureRequestRequesterComponent(Complex parent, String parentType, String name, ProcedureRequest.ProcedureRequestRequesterComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "requester", name, element, index);
if (element.hasAgent())
composeReference(t, "ProcedureRequest", "agent", element.getAgent(), -1);
if (element.hasOnBehalfOf())
composeReference(t, "ProcedureRequest", "onBehalfOf", element.getOnBehalfOf(), -1);
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeProcedureRequest.
protected void composeProcedureRequest(Complex parent, String parentType, String name, ProcedureRequest element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "ProcedureRequest", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "ProcedureRequest", "identifier", element.getIdentifier().get(i), i);
for (int i = 0; i < element.getDefinition().size(); i++) composeReference(t, "ProcedureRequest", "definition", element.getDefinition().get(i), i);
for (int i = 0; i < element.getBasedOn().size(); i++) composeReference(t, "ProcedureRequest", "basedOn", element.getBasedOn().get(i), i);
for (int i = 0; i < element.getReplaces().size(); i++) composeReference(t, "ProcedureRequest", "replaces", element.getReplaces().get(i), i);
if (element.hasRequisition())
composeIdentifier(t, "ProcedureRequest", "requisition", element.getRequisition(), -1);
if (element.hasStatusElement())
composeEnum(t, "ProcedureRequest", "status", element.getStatusElement(), -1);
if (element.hasIntentElement())
composeEnum(t, "ProcedureRequest", "intent", element.getIntentElement(), -1);
if (element.hasPriorityElement())
composeEnum(t, "ProcedureRequest", "priority", element.getPriorityElement(), -1);
if (element.hasDoNotPerformElement())
composeBoolean(t, "ProcedureRequest", "doNotPerform", element.getDoNotPerformElement(), -1);
for (int i = 0; i < element.getCategory().size(); i++) composeCodeableConcept(t, "ProcedureRequest", "category", element.getCategory().get(i), i);
if (element.hasCode())
composeCodeableConcept(t, "ProcedureRequest", "code", element.getCode(), -1);
if (element.hasSubject())
composeReference(t, "ProcedureRequest", "subject", element.getSubject(), -1);
if (element.hasContext())
composeReference(t, "ProcedureRequest", "context", element.getContext(), -1);
if (element.hasOccurrence())
composeType(t, "ProcedureRequest", "occurrence", element.getOccurrence(), -1);
if (element.hasAsNeeded())
composeType(t, "ProcedureRequest", "asNeeded", element.getAsNeeded(), -1);
if (element.hasAuthoredOnElement())
composeDateTime(t, "ProcedureRequest", "authoredOn", element.getAuthoredOnElement(), -1);
if (element.hasRequester())
composeProcedureRequestProcedureRequestRequesterComponent(t, "ProcedureRequest", "requester", element.getRequester(), -1);
if (element.hasPerformerType())
composeCodeableConcept(t, "ProcedureRequest", "performerType", element.getPerformerType(), -1);
if (element.hasPerformer())
composeReference(t, "ProcedureRequest", "performer", element.getPerformer(), -1);
for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "ProcedureRequest", "reasonCode", element.getReasonCode().get(i), i);
for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "ProcedureRequest", "reasonReference", element.getReasonReference().get(i), i);
for (int i = 0; i < element.getSupportingInfo().size(); i++) composeReference(t, "ProcedureRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
for (int i = 0; i < element.getSpecimen().size(); i++) composeReference(t, "ProcedureRequest", "specimen", element.getSpecimen().get(i), i);
for (int i = 0; i < element.getBodySite().size(); i++) composeCodeableConcept(t, "ProcedureRequest", "bodySite", element.getBodySite().get(i), i);
for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "ProcedureRequest", "note", element.getNote().get(i), i);
for (int i = 0; i < element.getRelevantHistory().size(); i++) composeReference(t, "ProcedureRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ProcedureRequestMapperTest method mapProcedureRequestWithNoOptionalFields.
@Test
public void mapProcedureRequestWithNoOptionalFields() {
var ehrExtract = unmarshallCodeElement("no_optional_data_example.xml");
var planStatement = getPlanStatement(ehrExtract);
ProcedureRequest procedureRequest = procedureRequestMapper.mapToProcedureRequest(ehrExtract, getEhrComposition(ehrExtract), planStatement, SUBJECT, ENCOUNTERS, PRACTISE_CODE);
assertFixedValues(planStatement, procedureRequest);
assertThat(procedureRequest.getOccurrence()).isNull();
assertThat(procedureRequest.getAuthoredOn()).isNull();
assertThat(procedureRequest.getNoteFirstRep()).isNull();
}
use of org.hl7.fhir.dstu3.model.ProcedureRequest in project nia-patient-switching-standard-adaptor by NHSDigital.
the class ProcedureRequestMapperTest method mapProcedureRequestWithEhrCompositionAvailabilityTime.
@Test
public void mapProcedureRequestWithEhrCompositionAvailabilityTime() {
var ehrExtract = unmarshallCodeElement("ehr_composition_availability_time_example.xml");
var ehrComposition = getEhrComposition(ehrExtract);
var planStatement = getPlanStatement(ehrExtract);
setUpCodeableConceptMock();
ProcedureRequest procedureRequest = procedureRequestMapper.mapToProcedureRequest(ehrExtract, getEhrComposition(ehrExtract), planStatement, SUBJECT, ENCOUNTERS, PRACTISE_CODE);
assertFixedValues(planStatement, procedureRequest);
assertThat(procedureRequest.getAuthoredOn()).isEqualTo(DateFormatUtil.parseToDateTimeType(ehrComposition.getAvailabilityTime().getValue()).getValue());
assertThat(procedureRequest.getReasonCodeFirstRep().getCodingFirstRep().getDisplay()).isEqualTo(planStatement.getCode().getDisplayName());
assertThat(procedureRequest.getContext().getResource().getIdElement().getValue()).isEqualTo(ENCOUNTER_ID);
}
Aggregations