use of org.hl7.fhir.r4.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();
}
use of org.hl7.fhir.r4.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();
}
Aggregations