Stream: workflow
Topic: Nested PlanDefinitions
Grey Faulkenberry (Oct 10 2021 at 21:18):
I was wondering if it would be reasonable to nest series of PlanDefinitions inside a single PlanDefinition to define which one to use by age categories.
For instance, I have a series of pediatric questionnaires by age group.
- I create a ServiceRequest for a child that instantiates a PlanDefinition
- That PlanDefinition has a list of PlanDefinitions (in definitionCanonical)
- Each of those PlanDefinitions has a timingAge that specifies what age the child should be for that PlanDefinition to apply
- Then I have a service that polls for new ServiceRequests (eventually will be pub-sub, I hope)
- When it finds a ServiceRequest, it gets the Patient & the overall PlanDefinition, it checks the patients age against the timeAges for the PlanDefinitions
- It finds the correct PlanDefinition for the age, and then looks in that PlanDefinition
- That PlanDefinition has a list of Questionnaires that we want the parent to fill out for the child
Does this seem like a reasonable approach or is there a better one someone could recommend?
Lloyd McKenzie (Oct 10 2021 at 23:28):
@Bryn Rhodes
Bryn Rhodes (Oct 13 2021 at 14:24):
Hi @Grey Faulkenberry , yes the PlanDefinition structure allows for nesting for these types of use cases. Using the timingElement is reasonable, but for that type of application, I've used an applicability condition that tests the patient's age against the range using a FHIRPath or CQL expression in the "condition" element.
Grey Faulkenberry (Oct 13 2021 at 15:32):
That makes more sense.
Grey Faulkenberry (Oct 13 2021 at 15:33):
Thanks as always for the insights!
Last updated: Apr 12 2022 at 19:14 UTC