Generate Person IDs: Difference between revisions

From CCMDB Wiki
Jump to navigation Jump to search
Line 9: Line 9:
'' see encounter_processing module Sub Encounter_processor() for most current implementation
'' see encounter_processing module Sub Encounter_processor() for most current implementation


for each L_Log entry for which Person_ID is blank and recordstatus is not "incomplete"
*clean out inconsistent data
* if a record matching PHIN '''doesn't''' exist in L_Person
*for each L_Log entry for which Person_ID is blank and recordstatus is not "incomplete"
** generate record in L_Person (set death to discharge date if deceased)
** if a record matching PHIN '''doesn't''' exist in L_Person
** update L_Log.Person_ID to that new record's Person_ID
*** generate record in L_Person (set death to discharge date if deceased)
* if a record matching PHIN '''does''' exist in L_Person
*** update L_Log.Person_ID to that new record's Person_ID
** if patient is deceased in this L_Log, then confirm death date is not before one we already have in L_Person, don't process record and launch error if so
*** set L_Person.last_updated to now
** if no inconsistent death data, update last_updated and death in L_Person
** if a record matching PHIN '''does''' exist in L_Person
** add Person_ID to L_Log
*** add Person_ID to L_Log
*** update last_updated and death in L_Person


We don't have process to populate [[L_Hospitalization]] worked out yet.
We don't have process to populate [[L_Hospitalization]] worked out yet. {{discussion}}


== Consistency of Person_ID over time ==
== Consistency of Person_ID over time ==

Revision as of 16:17, 1 April 2015

"Generate Person IDs" is the process by which unique Person IDs are generated in L Person and associated with the ward-admission records in centralized_data.mdb. It also refers to the button "Generate Person IDs" in CFE.

Related to Encounter processing and L Person.

Instructions

At the right point in Centralized data Vetting Process (and only then) press the "Generate Person IDs" button.

algorithm summary

see encounter_processing module Sub Encounter_processor() for most current implementation

  • clean out inconsistent data
  • for each L_Log entry for which Person_ID is blank and recordstatus is not "incomplete"
    • if a record matching PHIN doesn't exist in L_Person
      • generate record in L_Person (set death to discharge date if deceased)
      • update L_Log.Person_ID to that new record's Person_ID
      • set L_Person.last_updated to now
    • if a record matching PHIN does exist in L_Person
      • add Person_ID to L_Log
      • update last_updated and death in L_Person

We don't have process to populate L_Hospitalization worked out yet. Template:Discussion

Consistency of Person_ID over time

Once generated the Person_ID for new entries with same PHIN would be the same for new encounters.

If data becomes inconsistent (eg for some reason two person_ids for same PHIN, L_Person entry without corresponding L_Log entry, L_Log.Person_ID without correspoinding L_Person entry) the old data will be cleaned out and the records will be treated as if newly encountered patients.

Tina discussed with Julie that this will affect previously given out data, and we will address by giving out fresh data as a set including the old where linking is necessary. 17:15, 2015 April 1 (CDT)