After discussion with @jdick, I will amend my previous post with a couple of changes:
- Include
location_waiting_for
andprovider_waiting_for
within queue entries to optionally specify for which provider and/or room the patient is queued. This can be useful in some workflows, can be ignored when not needed, and allows us to build on the existing module. - Replicate additional
encounter
attributes within theencounter_status
table as needed to identify to which encounter the status applies (or will apply when the encounter is created). If we had support for draft encounters (the ability to create an encounter row before the actual encounter takes place), we would be adding this status directly to the encounter table. Because we don’t yet support draft encounters and we need to track status before the encounter is completed (and theencounter
row created), we are – for now – creating anencounter_status
table to hold this information. Astatus
attribute alone is insufficient to know to which encounter the status belongs, so we will need to duplicate additional attributes fromencounter
into theencounter_status
table to allow us to know to which encounter the status applies. These would include at leastencounter_datetime
,encounter_type
,patient_id
, andvisit_id
(note thatvisit_id
will be used to help unambiguously identify the encounter to which the status belongs and is not meant to assign status directly to a visit, which – if needed – we would do introducing eithervisit.status
or, if necessary as a workaround for lack of draft visits, within a newvisit_status
table).