hello! naive implementation question incoming 🙂 ...
# general
t
hello! naive implementation question incoming 🙂 i'm exploring what it's like to build a care plan with medplum's API's. from the docs, i landed here (https://github.com/medplum/medplum/blob/86bfdc2435035478d5672daf9cd45a609a012119/packages/react/src/stories/covid19.ts) which shows a sample request group with tasks as actions, with further nested resources like service requests, questionnaires, etc. if i'm building a care plan, would i create resources for each of these nested dependencies? or would i create one top level request group resource? how does that impact reading the resource and nested resources? i've dug into the source code and it looks like there's one SELECT happening from the top level resource that's created but i wanted to confirm (https://github.com/medplum/medplum/blob/86bfdc2435035478d5672daf9cd45a609a012119/packages/server/src/fhir/repo.ts#L222)
i'm new to FHIR so i'm not sure how this all works! i'm trying to model a workflow where: 1. a provider builds a careplan for a patient 2. a patient executes one of the items 3. a provider adds another item onto the care plan 4. a patient views their updated care plan
r
Good question, without a simple answer. @alexkg knows a lot on this topic and can probably give the most comprehensive guidance. If you have a PlanDefinition (represents the CarePlan in abstract) it gets converted to a CarePlan and RequestGroup when applied to a patient. This diff may help: https://github.com/medplum/medplum/pull/703
Here's some basic documentation on it as well https://www.medplum.com/docs/careplans
If you want to make a draft of your PlanDefinition and share here - that might be the best place to start
t
aha, thanks reshma. that $apply doc was super helpful because it laid out the API calls.
a
Looks like Reshma has you covered but happy to help if I can
177 Views