resetPatientData function
void
resetPatientData()
Clears all behavior subjects that contain the current patient's data this is normally called when a visit is ended to prevent corrupt data when a visit for a new patient is started
OBJECTS TO RESET
- TimelineInfoObject - stores the information about the patient's visits
- PatientSearchStore - stores the status of the patient search
- PrimaryBannerInfoObject - stores the patient's problems and allergies
- CurrentPatientInEpisode - stores everything about the currently active patient
- SecondaryBannerInfoObject - stores all the secondary banner information about this patient, including their conditions, allergies and medications
Implementation
void resetPatientData() {
/// Main objects to be reset
TimelineInfoObject().reset();
PatientSearchStore().reset();
PrimaryBannerInfoObject().reset();
CurrentPatientInEpisode().reset();
SecondaryBannerInfoObject().reset();
/// extra objects to be reset (the ones that don't have side effects because
/// they will always be up to date when the UI being built)
///
AddVitalsObject().reset();
AddTestStore().reset();
}