本文整理汇总了PHP中Patient类的典型用法代码示例。如果您正苦于以下问题:PHP Patient类的具体用法?PHP Patient怎么用?PHP Patient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Patient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate
public function activate($code, Patient $patient)
{
if ($patient->activateAccount($code)) {
return 'Akun pasien Anda berhasil diaktivasi';
}
return 'Akun pasien Anda gagal diaktivasi';
}
示例2: postRegister
public function postRegister()
{
$validationRules = array('email' => 'required|email|unique:users', 'password' => 'required|min:8|confirmed', 'type' => 'required');
$formValidator = Validator::make(Input::all(), $validationRules);
if ($formValidator->passes()) {
// creatting new user
$createUser = new User();
$createUser->email = Input::get('email');
$createUser->type = Input::get('type');
$createUser->password = Hash::make(Input::get('password'));
$createUser->status = 'OFF';
$createUser->save();
// checking to create if user is patient or physician
if ($createUser->type == 'PHYSICIAN') {
$createPhysisician = new Physician();
$createPhysisician->user_id = $createUser->id;
$createPhysisician->save();
}
if ($createUser->type == 'PATIENT') {
$createPatient = new Patient();
$createPatient->user_id = $createUser->id;
$createPatient->save();
}
return Redirect::to('user/login')->with('success', ' Account created, please login');
} else {
return Redirect::back()->withInput()->withErrors($formValidator);
}
}
示例3: _createAudit
protected function _createAudit($providerId, $personId, $visitId, $type)
{
$providerId = (int) $providerId;
$personId = (int) $personId;
$visitId = (int) $visitId;
$audit = array();
$audit['objectClass'] = 'GenericAccessAudit';
$audit['objectId'] = $personId . ';' . $visitId;
$audit['type'] = (int) $type;
$audit['userId'] = $providerId;
$audit['patientId'] = $personId;
$values = array();
$provider = new Provider();
$provider->personId = $audit['userId'];
$provider->populate();
$values['provider'] = $provider->toArray();
$patient = new Patient();
$patient->personId = $personId;
$patient->populate();
$values['patient'] = $patient->toArray();
$values['personId'] = $patient->personId;
$visit = new Visit();
$visit->visitId = $visitId;
$visit->populate();
$values['visit'] = $visit->toArray();
$values['visitId'] = $visit->visitId;
$audit['auditValues'] = $values;
Audit::persistManualAuditArray($audit);
}
示例4: approve
function approve($id)
{
if ($_POST) {
$rs = new Patient($id);
$rs->from_array($_POST);
$rs->save();
}
}
示例5: getLetterPrescription
/**
* get the prescription letter text for the latest prescription in the episode for the patient.
*
* @param Patient $patient
* @param Episode $episode
*
* @return string
*/
public function getLetterPrescription($patient)
{
if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
if ($details = $this->getElementForLatestEventInEpisode($episode, 'Element_OphDrPrescription_Details')) {
return $details->getLetterText();
}
}
}
示例6: myAlertsAction
public function myAlertsAction()
{
$personId = Zend_Auth::getInstance()->getIdentity()->personId;
$team = new TeamMember();
$teamId = $team->getTeamByPersonId($personId);
$rows = array();
if (true) {
$alertMsg = new GeneralAlert();
$alertMsgIterator = $alertMsg->getIteratorByTeam($teamId);
foreach ($alertMsgIterator as $alert) {
$tmp = array();
$tmp['id'] = $alert->generalAlertId;
$tmp['data'][] = '<img src="' . $this->view->baseUrl . '/img/medium.png' . '" alt="' . $alert->urgency . '" /> ' . $alert->urgency;
// below are temporary data
$objectClass = $alert->objectClass;
if (!class_exists($objectClass)) {
continue;
}
$obj = new $objectClass();
foreach ($obj->_primaryKeys as $key) {
$obj->{$key} = $alert->objectId;
}
$obj->populate();
$patient = new Patient();
$patient->personId = $obj->personId;
$patient->populate();
$tmp['data'][] = $patient->person->getDisplayName();
// patient
$tmp['data'][] = '';
// location
$tmp['data'][] = date('m/d/Y H:i', strtotime($alert->dateTime));
$tmp['data'][] = $alert->message;
$forwardedBy = '';
if ($alert->forwardedBy > 0) {
$person = new Person();
$person->personId = (int) $alert->forwardedBy;
$person->populate();
$forwardedBy = $person->displayName;
}
$tmp['data'][] = $forwardedBy;
// forwarded
$tmp['data'][] = $alert->comment;
// comment
$controllerName = call_user_func($objectClass . "::" . "getControllerName");
$jumpLink = call_user_func_array($controllerName . "::" . "buildJSJumpLink", array($alert->objectId, $alert->userId, $objectClass));
$js = "function jumpLink{$objectClass}(objectId,patientId) {\n{$jumpLink}\n}";
$tmp['data'][] = $js;
$tmp['data'][] = $objectClass . ':' . $alert->objectId . ':' . $patient->personId;
$rows[] = $tmp;
}
}
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct(array('rows' => $rows));
}
示例7: store
public function store()
{
if (Request::ajax()) {
$data = array("agenda_id" => Input::get("agenda_id"), "patient" => Input::get("patient"), "reason" => Input::get("reason"), "fecha" => Input::get("fecha"), "start" => Input::get("start"), "end" => Input::get("end"));
$rules = array("agenda_id" => 'required', "patient" => 'required|min:2|max:100', "reason" => 'required|min:2|max:200', "fecha" => 'required|min:1|max:100', "start" => 'required|min:1|max:100', "end" => 'required|min:1|max:100');
$messages = array('required' => 'El campo :attribute es obligatorio.', 'min' => 'El campo :attribute no puede tener menos de :min carácteres.', 'email' => 'El campo :attribute debe ser un email válido.', 'max' => 'El campo :attribute no puede tener más de :max carácteres.', 'numeric' => 'El campo :attribute debe contener solo numeros', 'mimes' => 'El formato de la imagen logo debe ser jpg, git, png');
$validation = Validator::make(Input::all(), $rules, $messages);
//si la validación falla redirigimos al formulario de registro con los errores
if ($validation->fails()) {
return Response::json(array('success' => false, 'errors' => $validation->getMessageBag()->toArray()));
} else {
$agenda = Agenda::find(Input::get('agenda_id'));
$user = User::where('email', Input::get('patient'))->orWhere('username', Input::get('patient'))->first();
if ($user) {
$patient = Patient::where('user_id', $user->id)->first();
if (!$patient) {
$patient = new Patient();
$patient->user_id = $user->id;
$patient->save();
}
$docPatient = DoctorPatient::where('patient_id', $patient->id)->where('doctor_id', $agenda->doctor_id)->first();
if (!$docPatient) {
$docPatient = new DoctorPatient();
$docPatient->patient_id = $patient->id;
$docPatient->doctor_id = $agenda->doctor_id;
$docPatient->save();
}
$apo = new Appointment();
$apo->patient_id = $patient->id;
$apo->agenda_id = $agenda->id;
$apo->day = Input::get("fecha");
$apo->start_date = Input::get('start');
$apo->end_date = Input::get('end');
$apo->reason = Input::get('reason');
if ($agenda->appointment_state == 0) {
$apo->state = 'confirmed';
} else {
$apo->state = 'pending';
}
$apo->save();
if ($apo) {
if ($agenda->appointment_state == 0) {
$mgs = new MgsAppointment();
$mgs->appointment_id = $apo->id;
$mgs->text = "Su cita fue Confirmada";
$mgs->save();
}
return Response::json(array('success' => true));
}
} else {
return Response::json(array('success' => false, 'errors' => 'El usuario no existe'));
}
}
}
}
示例8: getPCRData
/**
* @param $patientId
* @param $side
* @param $element
* @return array
*/
public function getPCRData($patientId, $side, $element)
{
$pcr = array();
$this->patient = \Patient::model()->findByPk((int) $patientId);
$patientAge = $this->patient->getAge();
$ageGroup = 0;
if ($patientAge < 60) {
$ageGroup = 1;
} elseif ($patientAge >= 60 && $patientAge < 70) {
$ageGroup = 2;
} elseif ($patientAge >= 70 && $patientAge < 80) {
$ageGroup = 3;
} elseif ($patientAge >= 80 && $patientAge < 90) {
$ageGroup = 4;
} elseif ($patientAge >= 90) {
$ageGroup = 5;
}
$gender = ucfirst($this->patient->getGenderString());
$is_diabetic = 'N';
if ($this->patient->getDiabetes()) {
$is_diabetic = 'Y';
}
$is_glaucoma = 'N';
if (strpos($this->patient->getSdl(), 'glaucoma') !== false) {
$is_glaucoma = 'Y';
}
$risk = \PatientRiskAssignment::model()->findByAttributes(array("patient_id" => $patientId));
$user = Yii::app()->session['user'];
$user_id = $user->id;
if (strpos(get_class($element), 'OphTrOperationnote') !== false) {
$user_id = $this->getOperationNoteSurgeonId($patientId);
}
$user_data = \User::model()->findByPk($user_id);
$doctor_grade_id = $user_data['originalAttributes']['doctor_grade_id'];
$pcr['patient_id'] = $patientId;
$pcr['side'] = $side;
$pcr['age_group'] = $ageGroup;
$pcr['gender'] = $gender;
$pcr['diabetic'] = $is_diabetic;
$pcr['glaucoma'] = $is_glaucoma;
$pcr['lie_flat'] = $this->getCannotLieFlat($patientId);
$no_view = 'N';
$no_view_data = $this->getOpticDisc($patientId, $side);
if (count($no_view_data) >= 1) {
$no_view = 'Y';
}
$pcr['noview'] = $no_view;
$pcr['allod'] = $this->getOpticDisc($patientId, $side, true);
$pcr['anteriorsegment'] = $this->getPatientAnteriorSegment($patientId, $side);
$pcr['doctor_grade_id'] = $doctor_grade_id;
$pcr['axial_length_group'] = $this->getAxialLength($patientId, $side);
return $pcr;
}
示例9: _setActivePatient
public function _setActivePatient($personId)
{
if (!$personId > 0) {
return;
}
$patient = new Patient();
$patient->personId = (int) $personId;
$patient->populate();
$patient->person->populate();
$this->_patient = $patient;
//$this->_visit = null;
$this->view->patient = $this->_patient;
}
示例10: execute
public function execute($parameters = [])
{
$result = [];
if (!isset($parameters['action'])) {
$result = ['Result' => 'ERROR', 'Message' => 'Faltan parámetros'];
return json_encode($result);
}
switch ($parameters['action']) {
case 'patients_list':
if (!User::isLogged()) {
$result = ['Result' => 'ERROR', 'Message' => 'No esta loguedo'];
}
extract($parameters);
$jtStartIndex = isset($jtStartIndex) ? $jtStartIndex : 0;
$jtPageSize = isset($jtPageSize) ? $jtPageSize : 10;
$jtSorting = isset($jtSorting) ? $jtSorting : 'name ASC';
$result['Result'] = 'OK';
$result['Records'] = Patient::getPaginatePatients($jtStartIndex, $jtPageSize, $jtSorting);
$result['TotalRecordCount'] = Patient::getTotal();
return $result;
break;
case 'patient_create':
if (!User::isLogged()) {
$result = ['Result' => 'ERROR', 'Message' => 'No esta loguedo'];
}
$p = new Patient();
$result = $p->patient($parameters);
return $result;
break;
case 'patient_update':
if (!User::isLogged()) {
$result = ['Result' => 'ERROR', 'Message' => 'No esta loguedo'];
}
$p = new Patient();
$result = $p->uPatient($parameters);
return $result;
break;
case 'patient_delete':
if (!User::isLogged()) {
$result = ['Result' => 'ERROR', 'Message' => 'No esta loguedo'];
}
extract($parameters);
$result = [];
return $result;
break;
default:
$result = ['Result' => 'ERROR', 'Message' => 'Acción no definida'];
return json_encode($result);
}
}
示例11: getLetterProcedures
/**
* Return the list of procedures as a string for use in correspondence for the given patient and episode.
* if the $snomed_terms is true, return the snomed_term, otherwise the standard text term.
*
* @param Patient $patient
* @param Episode $episode
* @param bool $snomed_terms
*
* @return string
*/
public function getLetterProcedures($patient)
{
$return = '';
if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
if ($plist = $this->getElementForLatestEventInEpisode($episode, 'Element_OphTrOperationnote_ProcedureList')) {
foreach ($plist->procedures as $i => $procedure) {
if ($i) {
$return .= ', ';
}
$return .= $plist->eye->adjective . ' ' . $procedure->term;
}
}
}
return $return;
}
示例12: actionSeed
public function actionSeed()
{
$patients = new Patient();
$patients->attributes = array('name' => '鍾**', 'sex' => 1, 'birthday' => '1989-10-21', 'birth_weight' => 3000, 'telphone' => '08-735****', 'cellphone' => '0917******', 'address' => '屏東市**********', 'doctor_id' => 1, 'icd' => '');
$patients->save();
$patients = new Patient();
$patients->attributes = array('name' => '林**', 'sex' => 1, 'birthday' => '1989-08-12', 'birth_weight' => 3000, 'telphone' => '08-735****', 'cellphone' => '0917******', 'address' => '新北市*******', 'doctor_id' => 1, 'icd' => '');
$patients->save();
$icd = new Icd();
$icd->attributes = array('name' => '1號疾病', 'description' => '');
$icd->save();
$icd = new Icd();
$icd->attributes = array('name' => '2號疾病', 'description' => '');
$icd->save();
}
示例13: pidLookupAction
public function pidLookupAction()
{
$hl7 = $this->_getParam('DATA');
$fields = split("\\|", $hl7);
$personId = 0;
if (count($fields) > 18) {
$personId = (int) $fields[19];
//field containing the MRN
}
$patient = new Patient();
$patient->personId = $personId;
if ($personId > 0 && $patient->populate()) {
urlencode($this->render('pid-lookup.phtml'));
}
return urlencode($this->render('not-found'));
}
示例14: patientList
public function patientList()
{
//appel des composants en base
$patients = Patient::all();
//retour de la vue
return View::make('backend.patient.list', compact('patients'));
}
示例15: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
Patient::create([]);
}
}