Method |
Description |
|
addLog ( string $msg ) |
Adding message to the log array. |
|
comparePatientDetails ( Patient $primary, Patient $secondary ) : array |
Compare data in the patient table. |
|
getLog ( ) : type |
Returns the log messages. |
|
getPrimaryPatient ( ) : Patient |
Returns the Primary patient. |
|
getSecondaryPatient ( ) : Patient |
Returns the secondary patient. |
|
load ( PatientMergeRequest $request ) |
Load data from PatientMergeRequest AR record. |
|
merge ( ) : boolean |
Do the actual merging by calling separated functions to move episodes, events etc. |
|
setPrimaryPatientById ( integer $id ) |
Set primary patient by id. |
|
setSecondaryPatientById ( integer $id ) |
Set secondaty patient by id. |
|
updateAllergyAssignments ( $primaryPatient, $secondaryPatient ) |
Updates the patient id in the Allergy Assigment. |
|
updateEpisodes ( Patient $primaryPatient, Patient $secondaryPatient ) : boolean |
Updating an episode
- if primary has no episodes than we just assign the secondary patient's episodes to the primary
- if secondary patient has no episodes we have nothing to do here
- if both patiens have episode we have to check if there is any conflicting(same subspeicaly like cataract or glaucoma) episodes
- we move the non conflictong episodes from secondary to primary
- when two episodes are conflicting we move the events from the secondary patient's episode to the primary patient's episode then delete the secondary empty episode. |
|
updateEpisodesPatientId ( $newPatientId, $episodes ) : boolean |
Assign episodes to a new paient id. |
|
updateEventsEpisodeId ( integer $newEpisodeId, array $events ) : boolean |
Moving event from one episode to another. |
|
updateLegacyEpisodes ( type $primaryPatient, type $secondaryPatient ) : boolean |
Moving Legacy episode from secondary patient to primary. |
|
updateOphthalmicDiagnoses ( Patient $newPatient, type $ophthalmicDiagnoses ) |
Updates the Ophthalmic Diagnoses' patient_id |
|
updatePreviousOperations ( Patient $newPatient, type $previousOperations ) : boolean |
Moving previous operations from secondaty patient to primary. |
|
updateRiskAssignments ( integer $newPatientId, $riskAssignments ) |
Updates patient id in Risk Assignment. |
|
updateSystemicDiagnoses ( Patient $newPatient, type $systemicDiagnoses ) : boolean |
Update Systemati Diagnoses' patient id |
|