Where to store Business-specific State about Patie...
# support
s
Hello Medplum! We are running into a scenario where we want to store extra metadata about a Patient. For right now the example is just a simple enum that represents some business-specific stages a Patient can be in, not related to treatment. Where is the best place for this enum of stages to live on the Patient object? I think we could do it as an
identifier
but its not "uniquely identifying a patient" so we were thinking that might be the wrong spot. Any guidance would be appreciated! Stefan
r
Common use case for this is "Account" - for example a patient pays a subscription for their service and you need to keep track of their status - here's a sample in the Stripe bot for reference https://github.com/medplum/medplum-demo-bots/tree/main/src/examples/stripe-bots
Account.type
s
does it matter if this metadata has nothing to do with finances or charges? it sounds like Account might be specific to a billing usecase
r
Ah, you mentioned business-specific, so I assumed it was commercial - can you give me an example?
s
sure! we have an internal concept of a "funnel" like in the traditional customer funnel case, customers would be at different stages within a CRM
in our case its patients that are in different stages within an internal funnel eg. "onboarding" or "starting care" etc
r
do you have a CDP?
e.g. Freshpaint or Amplitude
s
I think so, we use salesforce
r
common implementation is to link identifiers to your CDP
this has compliance benefits potentially
s
making the CDP the source of truth? so if we wanted to write a flow within the EHR that changes the status of a patient, we would need to make an external call to the CDP and change it there instead?
I can't think of a reason we would want this data outside of the EHR, it's patient specific and there are flows within the EHR that would mutate its state
I'll dm you a design that might explain it better, I think it should be relatively simple to model
r
Some reference material: https://hl7.org/fhir/workflow.html
Ended up discussing representing this as a workflow, which seems appropriate for this particular type of data. All resources have Resource.meta.tag but in practice should be a last resort (in our opinion) https://hl7.org/fhir/resource.html#Meta
155 Views