Search in sources :

Example 1 with RequestGroupActionComponent

use of org.hl7.fhir.dstu3.model.RequestGroup.RequestGroupActionComponent in project cqf-ruler by DBCG.

the class Session method resolveActions.

private CarePlan resolveActions(RequestDetails theRequest, Session session) {
    for (PlanDefinition.PlanDefinitionActionComponent action : session.getPlanDefinition().getAction()) {
        // TODO - Apply input/output dataRequirements?
        if (meetsConditions(theRequest, session, action)) {
            Resource result = resolveDefinition(theRequest, session, action);
            RequestGroupActionComponent currentActionTarget = null;
            if (result != null) {
                currentActionTarget = new RequestGroupActionBuilder().buildResource(new Reference("#" + result.getId())).build();
                session.getRequestGroupBuilder().buildContained(result).addAction(currentActionTarget);
            }
            resolveDynamicActions(theRequest, session, currentActionTarget, action);
        }
    }
    RequestGroup result = session.getRequestGroupBuilder().build();
    if (result.getId() == null) {
        result.setId(UUID.randomUUID().toString());
    }
    session.getCarePlanBuilder().buildContained(result).buildActivity(new CarePlanActivityBuilder().buildReference(new Reference("#" + result.getId())).build());
    return session.getCarePlan();
}
Also used : RequestGroupActionComponent(org.hl7.fhir.dstu3.model.RequestGroup.RequestGroupActionComponent) RequestGroupActionBuilder(org.opencds.cqf.ruler.cr.dstu3.builder.RequestGroupActionBuilder) Reference(org.hl7.fhir.dstu3.model.Reference) RequestGroup(org.hl7.fhir.dstu3.model.RequestGroup) DomainResource(org.hl7.fhir.dstu3.model.DomainResource) Resource(org.hl7.fhir.dstu3.model.Resource) PlanDefinition(org.hl7.fhir.dstu3.model.PlanDefinition) CarePlanActivityBuilder(org.opencds.cqf.ruler.cr.dstu3.builder.CarePlanActivityBuilder)

Example 2 with RequestGroupActionComponent

use of org.hl7.fhir.dstu3.model.RequestGroup.RequestGroupActionComponent in project cqf-ruler by DBCG.

the class Session method resolveActions.

private CarePlan resolveActions(Session session, RequestDetails theRequest) {
    RequestGroup theRequestGroup = session.getRequestGroupBuilder().build();
    for (PlanDefinition.PlanDefinitionActionComponent action : session.getPlanDefinition().getAction()) {
        // TODO - Apply input/output dataRequirements?
        if (meetsConditions(session, action, theRequest)) {
            Resource result = resolveDefinition(session, action, theRequest);
            RequestGroupActionComponent currentActionTarget = null;
            if (result != null) {
                currentActionTarget = new RequestGroupActionBuilder().buildResource(new Reference("#" + result.getId())).build();
                session.getRequestGroupBuilder().buildContained(result).addAction(currentActionTarget);
            }
            resolveDynamicActions(session, action, currentActionTarget, theRequest);
        }
    }
    if (theRequestGroup.getId() == null) {
        theRequestGroup.setId(UUID.randomUUID().toString());
    }
    session.getCarePlanBuilder().buildContained(theRequestGroup).buildActivity(new CarePlanActivityBuilder().buildReference(new Reference("#" + theRequestGroup.getId())).build());
    return session.getCarePlan();
}
Also used : RequestGroupActionComponent(org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent) RequestGroupActionBuilder(org.opencds.cqf.ruler.cr.r4.builder.RequestGroupActionBuilder) RequestGroup(org.hl7.fhir.r4.model.RequestGroup) Reference(org.hl7.fhir.r4.model.Reference) Resource(org.hl7.fhir.r4.model.Resource) DomainResource(org.hl7.fhir.r4.model.DomainResource) PlanDefinition(org.hl7.fhir.r4.model.PlanDefinition) CarePlanActivityBuilder(org.opencds.cqf.ruler.cr.r4.builder.CarePlanActivityBuilder)

Aggregations

DomainResource (org.hl7.fhir.dstu3.model.DomainResource)1 PlanDefinition (org.hl7.fhir.dstu3.model.PlanDefinition)1 Reference (org.hl7.fhir.dstu3.model.Reference)1 RequestGroup (org.hl7.fhir.dstu3.model.RequestGroup)1 RequestGroupActionComponent (org.hl7.fhir.dstu3.model.RequestGroup.RequestGroupActionComponent)1 Resource (org.hl7.fhir.dstu3.model.Resource)1 DomainResource (org.hl7.fhir.r4.model.DomainResource)1 PlanDefinition (org.hl7.fhir.r4.model.PlanDefinition)1 Reference (org.hl7.fhir.r4.model.Reference)1 RequestGroup (org.hl7.fhir.r4.model.RequestGroup)1 RequestGroupActionComponent (org.hl7.fhir.r4.model.RequestGroup.RequestGroupActionComponent)1 Resource (org.hl7.fhir.r4.model.Resource)1 CarePlanActivityBuilder (org.opencds.cqf.ruler.cr.dstu3.builder.CarePlanActivityBuilder)1 RequestGroupActionBuilder (org.opencds.cqf.ruler.cr.dstu3.builder.RequestGroupActionBuilder)1 CarePlanActivityBuilder (org.opencds.cqf.ruler.cr.r4.builder.CarePlanActivityBuilder)1 RequestGroupActionBuilder (org.opencds.cqf.ruler.cr.r4.builder.RequestGroupActionBuilder)1