PHP Класс 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 .
Автор: OpenEyes ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

addLog() публичный Метод

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

comparePatientDetails() публичный Метод

Compare data in the patient table.
public comparePatientDetails ( Patient $primary, Patient $secondary ) : array
$primary Patient
$secondary Patient
Результат array

getLog() публичный Метод

Returns the log messages.
public getLog ( ) : type
Результат type

getPrimaryPatient() публичный Метод

Returns the Primary patient.
public getPrimaryPatient ( ) : Patient
Результат Patient AR record

getSecondaryPatient() публичный Метод

Returns the secondary patient.
public getSecondaryPatient ( ) : Patient
Результат Patient AR record

load() публичный Метод

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

merge() публичный Метод

..
public merge ( ) : boolean
Результат boolean $isMerged success or fail

setPrimaryPatientById() публичный Метод

Set primary patient by id.

setSecondaryPatientById() публичный Метод

Set secondaty patient by id.

updateAllergyAssignments() публичный Метод

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

updateEpisodes() публичный Метод

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
Результат boolean

updateEpisodesPatientId() публичный Метод

Assign episodes to a new paient id.
public updateEpisodesPatientId ( $newPatientId, $episodes ) : boolean
Результат boolean true if no error thrown

updateEventsEpisodeId() публичный Метод

Moving event from one episode to another.
public updateEventsEpisodeId ( integer $newEpisodeId, array $events ) : boolean
$newEpisodeId integer
$events array
Результат boolean

updateLegacyEpisodes() публичный Метод

Moving Legacy episode from secondary patient to primary.
public updateLegacyEpisodes ( type $primaryPatient, type $secondaryPatient ) : boolean
$primaryPatient type
$secondaryPatient type
Результат boolean

updateOphthalmicDiagnoses() публичный Метод

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

updatePreviousOperations() публичный Метод

Moving previous operations from secondaty patient to primary.
public updatePreviousOperations ( Patient $newPatient, type $previousOperations ) : boolean
$newPatient Patient
$previousOperations type
Результат boolean

updateRiskAssignments() публичный Метод

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

updateSystemicDiagnoses() публичный Метод

Update Systemati Diagnoses' patient id
public updateSystemicDiagnoses ( Patient $newPatient, type $systemicDiagnoses ) : boolean
$newPatient Patient
$systemicDiagnoses type
Результат boolean