Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Per the notes taken during the implementers meeting 2009, the episode table would be designed as:

episode

column

description

episode_id

internal primary key

patient_id

patient to whom episode applies (is this redundant, since we're grouping visits & encounters which already link to patient?)

episode_topic

defines the type of episode, probably a link to a concept (e.g., pregnancy)

start_date

date on which episode began (could be earlier than first encounter/visit)

end_date

date on which episode ended (could be later than last encounter/visit)

voided

true if episode voided

voided_by

who voided episode

date_voided

date episode was voided

creator

who created this row

date_created

when row was created

episode_visit_map

column

description

episode_visit_map_idinternal primary key

episode_id

link to an episode

visit_id

link to a visit that is within the linked episode

voidedtrue if voided
voided_bywho voided link of visit to episode
date_voideddate link of visit to episode was voided
creatorwho created this row
date_createdwhen row was created

We would link visits to an episode only when all encounter(s) within the visit are part of the episode.

episode_encounter_map

column

description

episode_encounter_map_idinternal primary key

episode_id

link to an episode

encounter_id

link to an encounter that is within the linked episode

voidedtrue if voided
voided_bywho voided link of encounter to episode
date_voideddate link of encounter to episode was voided
creatorwho created this row
date_createdwhen row was created

We would link encounters to episodes when other encounters in the same visit are not part of the episode.

...

There is a similarity to programs, which track programs of care.  Episodes of care differ in that they only represent a grouping of encounters & visits -- i.e., episodes do not have to be part of a patient program of care and episodes would not directly reference study protocols, workflows/states, etc.  Once episodes of care are realized within OpenMRS, then programs could link to episodes to define the set of encounters/visits that are part of the program of care.

Since each program requires a concept (program.concept_id), an episode of care (and all of the visit/encounters it contains) can be related to a program by setting the episode_topic to this concept.