PHP Class PatientMerge

(C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011 (C) OpenEyes Foundation, 2011-2013 This file is part of OpenEyes. OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see .
Author: OpenEyes ([email protected])
Afficher le fichier Open project: openeyes/openeyes Class Usage Examples

Méthodes publiques

Méthode 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

Method Details

addLog() public méthode

Adding message to the log array.
public addLog ( string $msg )
$msg string

comparePatientDetails() public méthode

Compare data in the patient table.
public comparePatientDetails ( Patient $primary, Patient $secondary ) : array
$primary Patient
$secondary Patient
Résultat array

getLog() public méthode

Returns the log messages.
public getLog ( ) : type
Résultat type

getPrimaryPatient() public méthode

Returns the Primary patient.
public getPrimaryPatient ( ) : Patient
Résultat Patient AR record

getSecondaryPatient() public méthode

Returns the secondary patient.
public getSecondaryPatient ( ) : Patient
Résultat Patient AR record

load() public méthode

Load data from PatientMergeRequest AR record.
public load ( PatientMergeRequest $request )
$request PatientMergeRequest

merge() public méthode

..
public merge ( ) : boolean
Résultat boolean $isMerged success or fail

setPrimaryPatientById() public méthode

Set primary patient by id.

setSecondaryPatientById() public méthode

Set secondaty patient by id.

updateAllergyAssignments() public méthode

Updates the patient id in the Allergy Assigment.
public updateAllergyAssignments ( $primaryPatient, $secondaryPatient )

updateEpisodes() public méthode

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.
public updateEpisodes ( Patient $primaryPatient, Patient $secondaryPatient ) : boolean
$primaryPatient Patient
$secondaryPatient Patient
Résultat boolean

updateEpisodesPatientId() public méthode

Assign episodes to a new paient id.
public updateEpisodesPatientId ( $newPatientId, $episodes ) : boolean
Résultat boolean true if no error thrown

updateEventsEpisodeId() public méthode

Moving event from one episode to another.
public updateEventsEpisodeId ( integer $newEpisodeId, array $events ) : boolean
$newEpisodeId integer
$events array
Résultat boolean

updateLegacyEpisodes() public méthode

Moving Legacy episode from secondary patient to primary.
public updateLegacyEpisodes ( type $primaryPatient, type $secondaryPatient ) : boolean
$primaryPatient type
$secondaryPatient type
Résultat boolean

updateOphthalmicDiagnoses() public méthode

Updates the Ophthalmic Diagnoses' patient_id
public updateOphthalmicDiagnoses ( Patient $newPatient, type $ophthalmicDiagnoses )
$newPatient Patient
$ophthalmicDiagnoses type

updatePreviousOperations() public méthode

Moving previous operations from secondaty patient to primary.
public updatePreviousOperations ( Patient $newPatient, type $previousOperations ) : boolean
$newPatient Patient
$previousOperations type
Résultat boolean

updateRiskAssignments() public méthode

Updates patient id in Risk Assignment.
public updateRiskAssignments ( integer $newPatientId, $riskAssignments )
$newPatientId integer

updateSystemicDiagnoses() public méthode

Update Systemati Diagnoses' patient id
public updateSystemicDiagnoses ( Patient $newPatient, type $systemicDiagnoses ) : boolean
$newPatient Patient
$systemicDiagnoses type
Résultat boolean