Search in sources :

Example 96 with Task

use of org.hl7.fhir.r4.model.Task in project Gravity-SDOH-Exchange-RI by FHIR.

the class PatientTaskUpdateBundleFactory method createUpdateBundle.

public Bundle createUpdateBundle() {
    Assert.notNull(task, "Task can't be null.");
    Bundle updateBundle = new Bundle();
    updateBundle.setType(Bundle.BundleType.TRANSACTION);
    updateTask(updateBundle);
    updateBundle.addEntry(FhirUtil.createPutEntry(task));
    return updateBundle;
}
Also used : Bundle(org.hl7.fhir.r4.model.Bundle)

Example 97 with Task

use of org.hl7.fhir.r4.model.Task in project Gravity-SDOH-Exchange-RI by FHIR.

the class TaskUpdateBundleFactory method createUpdateBundle.

public Bundle createUpdateBundle() {
    Assert.notNull(task, "Task can't be null.");
    Bundle updateBundle = new Bundle();
    updateBundle.setType(Bundle.BundleType.TRANSACTION);
    updateTask(updateBundle);
    updateBundle.addEntry(FhirUtil.createPutEntry(task));
    return updateBundle;
}
Also used : Bundle(org.hl7.fhir.r4.model.Bundle)

Example 98 with Task

use of org.hl7.fhir.r4.model.Task in project Gravity-SDOH-Exchange-RI by FHIR.

the class PatientMakeContactTaskBundleFactory method createTask.

protected Task createTask() {
    Task task = super.createTask();
    task.getCode().addCoding(PatientTaskCode.MAKE_CONTACT.toCoding());
    task.addPartOf(new Reference(referralTask.getIdElement().toUnqualifiedVersionless()));
    Task.ParameterComponent input = task.addInput();
    input.getType().addCoding(new Coding(SDOHTemporaryCode.SYSTEM, SDOHTemporaryCode.CONTACT_CODE.getCode(), SDOHTemporaryCode.CONTACT_CODE.getDisplay()));
    input.setValue(new Reference(contactInfo.getIdElement().toUnqualifiedVersionless()));
    return task;
}
Also used : Task(org.hl7.fhir.r4.model.Task) Coding(org.hl7.fhir.r4.model.Coding) Reference(org.hl7.fhir.r4.model.Reference)

Example 99 with Task

use of org.hl7.fhir.r4.model.Task in project Gravity-SDOH-Exchange-RI by FHIR.

the class PatientTaskBundleFactory method createTask.

protected Task createTask() {
    Task task = new Task();
    task.getMeta().addProfile(SDOHProfiles.PATIENT_TASK);
    task.setStatus(Task.TaskStatus.READY);
    task.setIntent(Task.TaskIntent.ORDER);
    task.setPriority(priority.getTaskPriority());
    task.setAuthoredOnElement(DateTimeType.now());
    task.setLastModifiedElement(DateTimeType.now());
    task.setDescription(name);
    task.setFor(getPatientReference());
    task.setOwner(getPatientReference());
    if (occurrence.isPeriod()) {
        task.setExecutionPeriod(new Period().setStartElement(occurrence.getStart()).setEndElement(occurrence.getEnd()));
    } else {
        task.setExecutionPeriod(new Period().setEndElement(occurrence.getEnd()));
    }
    task.setRequester(requester);
    if (!Strings.isNullOrEmpty(comment)) {
        task.addNote().setText(comment).setTimeElement(DateTimeType.now()).setAuthor(new Reference(new IdType(user.getUserType(), user.getId())).setDisplay(user.getName()));
    }
    return task;
}
Also used : Task(org.hl7.fhir.r4.model.Task) Reference(org.hl7.fhir.r4.model.Reference) Period(org.hl7.fhir.r4.model.Period) IdType(org.hl7.fhir.r4.model.IdType)

Example 100 with Task

use of org.hl7.fhir.r4.model.Task in project org.hl7.fhir.core by hapifhir.

the class RdfParser method composeTaskTaskOutputComponent.

protected void composeTaskTaskOutputComponent(Complex parent, String parentType, String name, Task.TaskOutputComponent element, int index) {
    if (element == null)
        return;
    Complex t;
    if (Utilities.noString(parentType))
        t = parent;
    else {
        t = parent.predicate("fhir:" + parentType + '.' + name);
    }
    composeBackboneElement(t, "output", name, element, index);
    if (element.hasNameElement())
        composeString(t, "Task", "name", element.getNameElement(), -1);
    if (element.hasValue())
        composeType(t, "Task", "value", element.getValue(), -1);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Aggregations

Test (org.junit.Test)127 Task (org.hl7.fhir.r4.model.Task)120 FhirTask (org.openmrs.module.fhir2.model.FhirTask)59 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)46 Bundle (org.hl7.fhir.r4.model.Bundle)40 Reference (org.hl7.fhir.r4.model.Reference)28 ServiceRequest (org.hl7.fhir.r4.model.ServiceRequest)24 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)23 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)22 Task (org.hl7.fhir.dstu3.model.Task)21 IdType (org.hl7.fhir.r4.model.IdType)21 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)17 Date (java.util.Date)16 ArrayList (java.util.ArrayList)13 List (java.util.List)13 SearchParameterMap (org.openmrs.module.fhir2.api.search.param.SearchParameterMap)13 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)12 TokenAndListParam (ca.uhn.fhir.rest.param.TokenAndListParam)11 TokenParam (ca.uhn.fhir.rest.param.TokenParam)11 Collectors (java.util.stream.Collectors)11