Esempio n. 1
0
 public static function addNew($patient_id, $title, $first_name, $last_name, $prefered_name, $dob, $gender, $nhs_number, $occupation, $ni_number, $home_phone, $work_phone, $mobile_phone, $email_address, $doctor, $acquisition_source, $payment_plan, $dentist_id, $hygienist_id, $receive_emails, $receive_sms, $dentist_recall_interval, $dental_recall_date, $hygienist_recall_interval, $hygienist_recall_date, $recall_method, $creator_id)
 {
     $patient = new Patient();
     $patient->patient_id = $patient_id;
     $patient->title = $title;
     $patient->first_name = $first_name;
     $patient->last_name = $last_name;
     $patient->prefered_name = $prefered_name;
     $patient->dob = $dob->format('Y-m-d H:i:s');
     $patient->gender = $gender;
     $patient->nhs_number = $nhs_number;
     $patient->occupation = $occupation;
     $patient->ni_number = $ni_number;
     $patient->home_phone = $home_phone;
     $patient->work_phone = $work_phone;
     $patient->mobile_phone = $mobile_phone;
     $patient->email = $email_address;
     $patient->doctor = $doctor;
     $patient->acquisition_source_id = $acquisition_source;
     $patient->payment_plan_id = $payment_plan;
     $patient->dentist_id = $dentist_id;
     $patient->hygienist_id = $hygienist_id;
     $patient->receive_emails = $receive_emails;
     $patient->receive_sms = $receive_sms;
     $patient->dentist_recall_interval = $dentist_recall_interval;
     $patient->creator_id = $creator_id;
     if ($dental_recall_date != '') {
         $patient->dental_recall_date = $dental_recall_date->format('Y-m-d H:i:s');
     } else {
         $patient->dental_recall_date = '';
     }
     $patient->hygienist_recall_interval = $hygienist_recall_interval;
     if ($hygienist_recall_date != '') {
         $patient->hygienist_recall_date = $hygienist_recall_date->format('Y-m-d H:i:s');
     } else {
         $patient->hygienist_recall_date = '';
     }
     $patient->recall_method = $recall_method;
     $patient->save();
     Patient::incrementPatientStats();
     $patient->addHistoryItem("Patient Added", "This patient was added to the system.", Auth::user()->id, 3);
     return $patient;
 }