Record IDs

A Coudb/Pouchdb database is structured as a collection of documents organized by a document id. Best practice is to use the document id creatively.

eMission uses the following scheme for document ids:

TypeVersionLastFirstDOBDATE
char0lastnamefirstnamedate-of-birthISO create date-time

Each field is separated by a ";"

Typedescriptionnotes
pPatientno DATE e.g. p;0;Doe;John;2000-01-01
mMissionno DATE e.g. m;0;;;;
oOperatione.g. o;0;Doe;John;2000-01-01;2021-12-29T21:16:39.648Z;
cNotee.g. c;0;Doe;John;2000-01-01;2021-12-19T21:19:39.658Z;

Observe that all notes and operations contain the patient's id in their id -- as well as a field called patient_id to help with that link.

The ID scheme also allows retrieving all operations, notes for either a patient or all patients directly.

If a patient is later found to have two different IDs, it is possible to merge with an option in the Administration menu.