use of org.hl7.fhir.dstu3.model.HealthcareService in project Gravity-SDOH-Exchange-RI by FHIR.
the class PatientTaskService method createMakeContactTaskBundleFactory.
private PatientMakeContactTaskBundleFactory createMakeContactTaskBundleFactory(UserDto user, NewMakeContactTaskRequestDto makeContactTaskRequest) {
PatientMakeContactTaskPrepareBundleFactory taskPrepareBundleFactory = new PatientMakeContactTaskPrepareBundleFactory(SmartOnFhirContext.get().getPatient(), user.getId(), makeContactTaskRequest.getHealthcareServiceId(), makeContactTaskRequest.getReferralTaskId());
Bundle taskRelatedResources = ehrClient.transaction().withBundle(taskPrepareBundleFactory.createPrepareBundle()).execute();
PatientMakeContactTaskPrepareBundleExtractor.PatientMakeContactTaskPrepareInfoHolder taskPrepareInfoHolder = new PatientMakeContactTaskPrepareBundleExtractor().extract(taskRelatedResources);
PatientMakeContactTaskBundleFactory taskBundleFactory = new PatientMakeContactTaskBundleFactory();
taskBundleFactory.setName(makeContactTaskRequest.getName());
taskBundleFactory.setPatient(taskPrepareInfoHolder.getPatient());
taskBundleFactory.setPriority(makeContactTaskRequest.getPriority());
taskBundleFactory.setOccurrence(makeContactTaskRequest.getOccurrence());
taskBundleFactory.setRequester(taskPrepareInfoHolder.getPerformer());
// TODO verify whether the passed Task instance is related to the Patient
taskBundleFactory.setReferralTask(taskPrepareInfoHolder.getReferralTask());
taskBundleFactory.setComment(makeContactTaskRequest.getComment());
taskBundleFactory.setUser(user);
// TODO verify whether the passed HealthcareService instance is related to the task
taskBundleFactory.setContactInfo(taskPrepareInfoHolder.getHealthcareService());
return taskBundleFactory;
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project integration-adaptor-111 by nhsconnect.
the class EncounterReportBundleService method createEncounterBundle.
public Bundle createEncounterBundle(POCDMT000002UK01ClinicalDocument1 clinicalDocument, ItkReportHeader header, String messageId) throws XmlException {
Bundle bundle = createBundle(clinicalDocument);
MessageHeader messageHeader = messageHeaderService.createMessageHeader(header, messageId, clinicalDocument.getEffectiveTime().getValue());
List<HealthcareService> healthcareServiceList = healthcareServiceMapper.mapHealthcareService(clinicalDocument);
List<PractitionerRole> authorPractitionerRoles = practitionerRoleMapper.mapAuthorRoles(clinicalDocument.getAuthorArray());
Optional<PractitionerRole> responsibleParty = practitionerRoleMapper.mapResponsibleParty(clinicalDocument);
Encounter encounter = encounterMapper.mapEncounter(clinicalDocument, authorPractitionerRoles, responsibleParty, messageHeader.getEvent());
Consent consent = consentMapper.mapConsent(clinicalDocument, encounter);
List<QuestionnaireResponse> questionnaireResponseList = pathwayUtil.getQuestionnaireResponses(clinicalDocument, encounter.getSubject(), resourceUtil.createReference(encounter));
Condition condition = conditionMapper.mapCondition(clinicalDocument, encounter, questionnaireResponseList);
List<CarePlan> carePlans = carePlanMapper.mapCarePlan(clinicalDocument, encounter, condition);
Device device = deviceMapper.mapDevice();
ReferralRequest referralRequest = referralRequestMapper.mapReferralRequest(clinicalDocument, encounter, healthcareServiceList, resourceUtil.createReference(condition), resourceUtil.createReference(device));
Composition composition = compositionMapper.mapComposition(clinicalDocument, encounter, carePlans, questionnaireResponseList, referralRequest, authorPractitionerRoles);
List<Observation> observations = observationMapper.mapObservations(clinicalDocument, encounter);
RelatedPerson relatedPerson = relatedPersonMapper.createEmergencyContactRelatedPerson(clinicalDocument, encounter);
addMessageHeader(bundle, messageHeader);
addEncounter(bundle, encounter);
addServiceProvider(bundle, encounter);
addParticipants(bundle, encounter);
addLocation(bundle, encounter);
addSubject(bundle, encounter);
addHealthcareService(bundle, healthcareServiceList);
addIncomingReferral(bundle, referralRequest);
addAppointment(bundle, encounter);
addEntry(bundle, composition);
addCarePlan(bundle, carePlans);
addEntry(bundle, consent);
addEntry(bundle, condition);
addQuestionnaireResponses(bundle, questionnaireResponseList);
addObservations(bundle, observations);
addPractitionerRoles(bundle, authorPractitionerRoles, responsibleParty);
addRelatedPerson(bundle, relatedPerson);
addEntry(bundle, device);
ListResource listResource = getReferenceFromBundle(bundle, clinicalDocument, encounter, device);
addEntry(bundle, listResource);
return bundle;
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project integration-adaptor-111 by nhsconnect.
the class HealthcareServiceMapper method mapSingleHealthcareService.
private HealthcareService mapSingleHealthcareService(POCDMT000002UK01InformationRecipient informationRecipient) {
POCDMT000002UK01IntendedRecipient intendedRecipient = informationRecipient.getIntendedRecipient();
HealthcareService healthcareService = new HealthcareService().setActive(true);
healthcareService.setIdElement(resourceUtil.newRandomUuid());
Organization organization = new Organization();
if (intendedRecipient.isSetReceivedOrganization()) {
POCDMT000002UK01Organization receivedOrganization = intendedRecipient.getReceivedOrganization();
organization = organizationMapper.mapOrganization(informationRecipient);
healthcareService.setProvidedBy(resourceUtil.createReference(organization));
healthcareService.setProvidedByTarget(organization);
if (receivedOrganization.sizeOfNameArray() > 0) {
ON name = receivedOrganization.getNameArray(0);
healthcareService.setName(nodeUtil.getAllText(name.getDomNode()));
}
}
Location location = locationMapper.mapRecipientToLocation(intendedRecipient, organization);
healthcareService.addLocation(resourceUtil.createReference(location));
if (intendedRecipient.sizeOfTelecomArray() > 0) {
for (TEL tel : intendedRecipient.getTelecomArray()) {
healthcareService.addTelecom(contactPointMapper.mapContactPoint(tel));
}
}
return healthcareService;
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project integration-adaptor-111 by nhsconnect.
the class ListMapperTest method setUp.
@BeforeEach
public void setUp() {
effectiveTime.setValue(EFFECTIVE_DATE);
HealthcareService healthcareService = new HealthcareService();
healthcareService.setId("123456");
QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse();
questionnaireResponse.setId("654321");
resourcesCreated = asList(healthcareService, questionnaireResponse);
when(clinicalDocument.getSetId()).thenReturn(ii);
when(ii.getRoot()).thenReturn("411910CF-1A76-4330-98FE-C345DDEE5553");
when(resourceUtil.newRandomUuid()).thenReturn(new IdType(RANDOM_UUID));
when(clinicalDocument.getEffectiveTime()).thenReturn(effectiveTime);
}
use of org.hl7.fhir.dstu3.model.HealthcareService in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeHealthcareService.
protected void composeHealthcareService(Complex parent, String parentType, String name, HealthcareService element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "HealthcareService", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "HealthcareService", "identifier", element.getIdentifier().get(i), i);
if (element.hasProvidedBy())
composeReference(t, "HealthcareService", "providedBy", element.getProvidedBy(), -1);
if (element.hasServiceCategory())
composeCodeableConcept(t, "HealthcareService", "serviceCategory", element.getServiceCategory(), -1);
for (int i = 0; i < element.getServiceType().size(); i++) composeCodeableConcept(t, "HealthcareService", "serviceType", element.getServiceType().get(i), i);
for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "HealthcareService", "specialty", element.getSpecialty().get(i), i);
for (int i = 0; i < element.getLocation().size(); i++) composeReference(t, "HealthcareService", "location", element.getLocation().get(i), i);
if (element.hasServiceNameElement())
composeString(t, "HealthcareService", "serviceName", element.getServiceNameElement(), -1);
if (element.hasCommentElement())
composeString(t, "HealthcareService", "comment", element.getCommentElement(), -1);
if (element.hasExtraDetailsElement())
composeString(t, "HealthcareService", "extraDetails", element.getExtraDetailsElement(), -1);
if (element.hasPhoto())
composeAttachment(t, "HealthcareService", "photo", element.getPhoto(), -1);
for (int i = 0; i < element.getTelecom().size(); i++) composeContactPoint(t, "HealthcareService", "telecom", element.getTelecom().get(i), i);
for (int i = 0; i < element.getCoverageArea().size(); i++) composeReference(t, "HealthcareService", "coverageArea", element.getCoverageArea().get(i), i);
for (int i = 0; i < element.getServiceProvisionCode().size(); i++) composeCodeableConcept(t, "HealthcareService", "serviceProvisionCode", element.getServiceProvisionCode().get(i), i);
if (element.hasEligibility())
composeCodeableConcept(t, "HealthcareService", "eligibility", element.getEligibility(), -1);
if (element.hasEligibilityNoteElement())
composeString(t, "HealthcareService", "eligibilityNote", element.getEligibilityNoteElement(), -1);
for (int i = 0; i < element.getProgramName().size(); i++) composeString(t, "HealthcareService", "programName", element.getProgramName().get(i), i);
for (int i = 0; i < element.getCharacteristic().size(); i++) composeCodeableConcept(t, "HealthcareService", "characteristic", element.getCharacteristic().get(i), i);
for (int i = 0; i < element.getReferralMethod().size(); i++) composeCodeableConcept(t, "HealthcareService", "referralMethod", element.getReferralMethod().get(i), i);
if (element.hasPublicKeyElement())
composeString(t, "HealthcareService", "publicKey", element.getPublicKeyElement(), -1);
if (element.hasAppointmentRequiredElement())
composeBoolean(t, "HealthcareService", "appointmentRequired", element.getAppointmentRequiredElement(), -1);
for (int i = 0; i < element.getAvailableTime().size(); i++) composeHealthcareServiceHealthcareServiceAvailableTimeComponent(t, "HealthcareService", "availableTime", element.getAvailableTime().get(i), i);
for (int i = 0; i < element.getNotAvailable().size(); i++) composeHealthcareServiceHealthcareServiceNotAvailableComponent(t, "HealthcareService", "notAvailable", element.getNotAvailable().get(i), i);
if (element.hasAvailabilityExceptionsElement())
composeString(t, "HealthcareService", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
}
Aggregations