diff --git a/providerwww/application/controllers/Patient.php b/providerwww/application/controllers/Patient.php index d3328a3..78a0019 100644 --- a/providerwww/application/controllers/Patient.php +++ b/providerwww/application/controllers/Patient.php @@ -28,13 +28,22 @@ class Patient extends Provider_Controller { $data['street2'] = trim($this->input->post('street2')); $data['city'] = trim($this->input->post('city')); $data['state'] = trim($this->input->post('state')); + + $data['dob'] = trim($this->input->post('dob')); + $data['gender'] = trim($this->input->post('gender')); + $data["loc"] = $_SERVER["REMOTE_ADDR"]; $data["action"] = MERMS_PROVIDERS_CREATEMEMBER; $out = array(); $ret = $this->mermsemr_api($data, $out); - $data["account_message"] = "This is the return " . $ret; - echo "Posted"; + + if ($ret==0 && $out["member_id"]>0){ + $data["account_message"] = "New patient added "; + } + else{ + $data["account_message"] = "Error adding new patient "; + } } $out = array(); @@ -46,7 +55,14 @@ class Patient extends Provider_Controller { } public function selectPatient(){ - + if ($this->uri->segment(3) === FALSE) { + $patient_id = 0; + } else { + $patient_id = $this->uri->segment(3); + } + + // echo $patient_id; + $this->selectedPatientView($patient_id); } public function findpatient(){ @@ -61,17 +77,24 @@ class Patient extends Provider_Controller { public function patientView() { $data['patient_id'] = trim($this->input->post('patientID')); - $this->load->model('patient_model'); - $out = $this->patient_model->LoadPatient(0, $data['patient_id']); - - // print_r($out); - $data['firstname'] = $out["patient_return"][0]->firstname; - $data['lastname'] = $out["patient_return"][0]->lastname; - $data['email'] = $out["patient_return"][0]->email; - - $this->renderProviderSecurePage('patient/thispatient', $data); + $this->selectedPatientView($data['patient_id']); } +private function selectedPatientView($patient_id){ + + $data['patient_id'] =$patient_id; + $this->load->model('patient_model'); + $out = $this->patient_model->LoadPatient(0, $data['patient_id']); + + // print_r($out); + $data['firstname'] = $out["patient_return"][0]->firstname; + $data['lastname'] = $out["patient_return"][0]->lastname; + $data['email'] = $out["patient_return"][0]->email; + + $this->renderProviderSecurePage('patient/thispatient', $data); + +} + private function getPatientList() { $mysql = "SELECT p.practice_id,p.id AS patient_id,p.member_id,p.long_id,m.firstname,m.lastname,m.phone,p.added " diff --git a/providerwww/application/views/provider/patient/newpatient.php b/providerwww/application/views/provider/patient/newpatient.php index 069c30c..10e9b92 100644 --- a/providerwww/application/views/provider/patient/newpatient.php +++ b/providerwww/application/views/provider/patient/newpatient.php @@ -21,7 +21,7 @@