public function postTimeline() { $pid = Session::get('pid'); $json = array(); $date_arr = array(); $query0 = DB::table('encounters')->where('pid', '=', $pid)->where('addendum', '=', 'n')->get(); if ($query0) { foreach ($query0 as $row0) { $description = ''; $procedureInfo = Procedure::find($row0->eid); if ($procedureInfo) { $description .= '<br><h4>Procedures:</h4><p class="view">'; if ($procedureInfo->proc_type != '') { $description .= '<strong>Procedure: </strong>'; $description .= nl2br($procedureInfo->proc_type); $description .= '<br /><br />'; } $description .= '</p>'; } $assessmentInfo = Assessment::find($row0->eid); if ($assessmentInfo) { $description .= '<br><h4>Assessment:</h4><p class="view">'; if ($assessmentInfo->assessment_1 != '') { $description .= '<strong>' . $assessmentInfo->assessment_1 . '</strong><br />'; if ($assessmentInfo->assessment_2 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_2 != '') { $description .= '<strong>' . $assessmentInfo->assessment_2 . '</strong><br />'; if ($assessmentInfo->assessment_3 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_3 != '') { $description .= '<strong>' . $assessmentInfo->assessment_3 . '</strong><br />'; if ($assessmentInfo->assessment_4 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_4 != '') { $description .= '<strong>' . $assessmentInfo->assessment_4 . '</strong><br />'; if ($assessmentInfo->assessment_5 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_5 != '') { $description .= '<strong>' . $assessmentInfo->assessment_5 . '</strong><br />'; if ($assessmentInfo->assessment_6 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_6 != '') { $description .= '<strong>' . $assessmentInfo->assessment_6 . '</strong><br />'; if ($assessmentInfo->assessment_7 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_7 != '') { $description .= '<strong>' . $assessmentInfo->assessment_7 . '</strong><br />'; if ($assessmentInfo->assessment_8 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_8 != '') { $description .= '<strong>' . $assessmentInfo->assessment_8 . '</strong><br /><br />'; } if ($assessmentInfo->assessment_other != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<strong>SOAP Note: </strong>'; } else { $description .= '<strong>Additional Diagnoses: </strong>'; } $description .= nl2br($assessmentInfo->assessment_other); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_ddx != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<strong>MAP2: </strong>'; } else { $description .= '<strong>Differential Diagnoses Considered: </strong>'; } $description .= nl2br($assessmentInfo->assessment_ddx); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_notes != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<strong>Pharmacist Note: </strong>'; } else { $description .= '<strong>Assessment Discussion: </strong>'; } $description .= nl2br($assessmentInfo->assessment_notes); $description .= '<br /><br />'; } $description .= '</p>'; } $json[] = array('title' => "<span class='timeline_event' value='" . $row0->eid . "' type='eid' status='" . $row0->encounter_signed . "'>Encounter: " . $row0->encounter_cc . "</span>", 'description' => $description, 'startDate' => $this->human_to_unix($row0->encounter_DOS)); $date_arr[] = $this->human_to_unix($row0->encounter_DOS); } } $query1 = DB::table('t_messages')->where('pid', '=', $pid)->get(); if ($query1) { foreach ($query1 as $row1) { $json[] = array('title' => "<span class='timeline_event' value='" . $row1->t_messages_id . "' type='t_messages_id' status='" . $row1->t_messages_signed . "'>Message: " . $row1->t_messages_subject . "</span>", 'description' => substr($row1->t_messages_message, 0, 500) . '...', 'startDate' => $this->human_to_unix($row1->t_messages_dos)); $date_arr[] = $this->human_to_unix($row1->t_messages_dos); } } $query2 = DB::table('rx_list')->where('pid', '=', $pid)->orderBy('rxl_date_active', 'asc')->groupBy('rxl_medication')->get(); if ($query2) { foreach ($query2 as $row2) { $row2a = DB::table('rx_list')->where('rxl_id', '=', $row2->rxl_id)->first(); if ($row2->rxl_sig == '') { $instructions = $row2->rxl_instructions; } else { $instructions = $row2->rxl_sig . ' ' . $row2->rxl_route . ' ' . $row2->rxl_frequency; } $description2 = $row2->rxl_medication . ' ' . $row2->rxl_dosage . ' ' . $row2->rxl_dosage_unit . ', ' . $instructions . ' for ' . $row2->rxl_reason; $json[] = array('title' => "<span class='timeline_event' value='" . $row2->rxl_id . "' type='rxl_id'>New Medication Started</span>", 'description' => $description2, 'startDate' => $this->human_to_unix($row2->rxl_date_active)); $date_arr[] = $this->human_to_unix($row2->rxl_date_active); } } $query3 = DB::table('issues')->where('pid', '=', $pid)->get(); if ($query3) { foreach ($query3 as $row3) { if ($row3->type == 'Problem List') { $title = 'New Problem'; } if ($row3->type == 'Medical History') { $title = 'New Medical Event'; } if ($row3->type == 'Problem List') { $title = 'New Surgical Event'; } $json[] = array('title' => "<span class='timeline_event' value='" . $row3->issue_id . "' type='issue_id'>" . $title . "</span>", 'description' => $row3->issue, 'startDate' => $this->human_to_unix($row3->issue_date_active)); $date_arr[] = $this->human_to_unix($row3->issue_date_active); } } $query4 = DB::table('immunizations')->where('pid', '=', $pid)->get(); if ($query4) { foreach ($query4 as $row4) { $json[] = array('title' => "<span class='timeline_event' value='" . $row4->imm_id . "' type='imm_id'>Immunization Given</span>", 'description' => $row4->imm_immunization, 'startDate' => $this->human_to_unix($row4->imm_date)); $date_arr[] = $this->human_to_unix($row4->imm_date); } } $query5 = DB::table('rx_list')->where('pid', '=', $pid)->where('rxl_date_inactive', '!=', '0000-00-00 00:00:00')->get(); if ($query5) { foreach ($query5 as $row5) { $row5a = DB::table('rx_list')->where('rxl_id', '=', $row5->rxl_id)->first(); if ($row5->rxl_sig == '') { $instructions5 = $row5->rxl_instructions; } else { $instructions5 = $row5->rxl_sig . ' ' . $row5->rxl_route . ' ' . $row5->rxl_frequency; } $description5 = $row5->rxl_medication . ' ' . $row5->rxl_dosage . ' ' . $row5->rxl_dosage_unit . ', ' . $instructions5 . ' for ' . $row5->rxl_reason; $json[] = array('title' => "<span class='timeline_event' value='" . $row5->rxl_id . "' type='rxl_id'>Medication Stopped</span>", 'description' => $description5, 'startDate' => $this->human_to_unix($row5->rxl_date_inactive)); $date_arr[] = $this->human_to_unix($row5->rxl_date_inactive); } } $query6 = DB::table('allergies')->where('pid', '=', $pid)->where('allergies_date_inactive', '=', '0000-00-00 00:00:00')->get(); if ($query6) { foreach ($query6 as $row6) { $json[] = array('title' => "<span class='timeline_event' value='" . $row6->allergies_id . "' type='allergies_id'>New Allergy</span>", 'description' => $row6->allergies_med, 'startDate' => $this->human_to_unix($row6->allergies_date_active)); $date_arr[] = $this->human_to_unix($row6->allergies_date_active); } } foreach ($json as $key => $value) { $item[$key] = $value['startDate']; } array_multisort($item, SORT_ASC, $json); asort($date_arr); $arr['start'] = reset($date_arr); $arr['end'] = end($date_arr); if ($arr['end'] - $arr['start'] >= 315569260) { $arr['granular'] = 'decade'; } if ($arr['end'] - $arr['start'] > 31556926 && $arr['end'] - $arr['start'] < 315569260) { $arr['granular'] = 'year'; } if ($arr['end'] - $arr['start'] <= 31556926) { $arr['granular'] = 'month'; } $arr['json'] = $json; echo json_encode($arr); }
protected function timeline_new() { $pid = Session::get('pid'); $json = array(); $date_arr = array(); $query0 = DB::table('encounters')->where('pid', '=', $pid)->where('addendum', '=', 'n')->get(); if ($query0) { foreach ($query0 as $row0) { $description = ''; $procedureInfo = Procedure::find($row0->eid); if ($procedureInfo) { $description .= '<span class="nosh_bold">Procedures:</span>'; if ($procedureInfo->proc_type != '') { $description .= '<strong>Procedure: </strong>'; $description .= nl2br($procedureInfo->proc_type); } } $assessmentInfo = Assessment::find($row0->eid); if ($assessmentInfo) { if ($assessmentInfo->assessment_1 != '') { $description .= '<span class="nosh_bold">Assessment:</span>'; $description .= '<br><strong>' . $assessmentInfo->assessment_1 . '</strong><br />'; if ($assessmentInfo->assessment_2 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_2 != '') { $description .= '<strong>' . $assessmentInfo->assessment_2 . '</strong><br />'; if ($assessmentInfo->assessment_3 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_3 != '') { $description .= '<strong>' . $assessmentInfo->assessment_3 . '</strong><br />'; if ($assessmentInfo->assessment_4 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_4 != '') { $description .= '<strong>' . $assessmentInfo->assessment_4 . '</strong><br />'; if ($assessmentInfo->assessment_5 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_5 != '') { $description .= '<strong>' . $assessmentInfo->assessment_5 . '</strong><br />'; if ($assessmentInfo->assessment_6 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_6 != '') { $description .= '<strong>' . $assessmentInfo->assessment_6 . '</strong><br />'; if ($assessmentInfo->assessment_7 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_7 != '') { $description .= '<strong>' . $assessmentInfo->assessment_7 . '</strong><br />'; if ($assessmentInfo->assessment_8 == '') { $description .= '<br />'; } } if ($assessmentInfo->assessment_8 != '') { $description .= '<strong>' . $assessmentInfo->assessment_8 . '</strong><br /><br />'; } if ($assessmentInfo->assessment_other != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<br /><strong>SOAP Note: </strong>'; } else { $description .= '<br /><strong>Additional Diagnoses: </strong>'; } $description .= nl2br($assessmentInfo->assessment_other); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_ddx != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<br /><strong>MAP2: </strong>'; } else { $description .= '<br /><strong>Differential Diagnoses Considered: </strong>'; } $description .= nl2br($assessmentInfo->assessment_ddx); $description .= '<br /><br />'; } if ($assessmentInfo->assessment_notes != '') { if ($row0->encounter_template == 'standardmtm') { $description .= '<br /><strong>Pharmacist Note: </strong>'; } else { $description .= '<br /><strong>Assessment Discussion: </strong>'; } $description .= nl2br($assessmentInfo->assessment_notes); $description .= '<br /><br />'; } } $div0 = $this->timeline_item($row0->eid, 'eid', 'Encounter', $this->human_to_unix($row0->encounter_DOS), 'Encounter: ' . $row0->encounter_cc, $description, $row0->encounter_signed); $json[] = array('div' => $div0, 'startDate' => $this->human_to_unix($row0->encounter_DOS)); $date_arr[] = $this->human_to_unix($row0->encounter_DOS); } } $query1 = DB::table('t_messages')->where('pid', '=', $pid)->get(); if ($query1) { foreach ($query1 as $row1) { $div1 = $this->timeline_item($row1->t_messages_id, 't_messages_id', 'Telephone Message', $this->human_to_unix($row1->t_messages_dos), 'Telephone Message', substr($row1->t_messages_message, 0, 500) . '...', $row1->t_messages_signed); $json[] = array('div' => $div1, 'startDate' => $this->human_to_unix($row1->t_messages_dos)); $date_arr[] = $this->human_to_unix($row1->t_messages_dos); } } $query2 = DB::table('rx_list')->where('pid', '=', $pid)->orderBy('rxl_date_active', 'asc')->groupBy('rxl_medication')->get(); if ($query2) { foreach ($query2 as $row2) { $row2a = DB::table('rx_list')->where('rxl_id', '=', $row2->rxl_id)->first(); if ($row2->rxl_sig == '') { $instructions = $row2->rxl_instructions; } else { $instructions = $row2->rxl_sig . ' ' . $row2->rxl_route . ' ' . $row2->rxl_frequency; } $description2 = $row2->rxl_medication . ' ' . $row2->rxl_dosage . ' ' . $row2->rxl_dosage_unit . ', ' . $instructions . ' for ' . $row2->rxl_reason; $div2 = $this->timeline_item($row2->rxl_id, 'rxl_id', 'New Medication', $this->human_to_unix($row2->rxl_date_active), 'New Medication', $description2); $json[] = array('div' => $div2, 'startDate' => $this->human_to_unix($row2->rxl_date_active)); $date_arr[] = $this->human_to_unix($row2->rxl_date_active); } } $query3 = DB::table('issues')->where('pid', '=', $pid)->get(); if ($query3) { foreach ($query3 as $row3) { if ($row3->type == 'Problem List') { $title = 'New Problem'; } if ($row3->type == 'Medical History') { $title = 'New Medical Event'; } if ($row3->type == 'Problem List') { $title = 'New Surgical Event'; } $div3 = $this->timeline_item($row3->issue_id, 'issue_id', $title, $this->human_to_unix($row3->issue_date_active), $title, $row3->issue); $json[] = array('div' => $div3, 'startDate' => $this->human_to_unix($row3->issue_date_active)); $date_arr[] = $this->human_to_unix($row3->issue_date_active); } } $query4 = DB::table('immunizations')->where('pid', '=', $pid)->get(); if ($query4) { foreach ($query4 as $row4) { $div4 = $this->timeline_item($row4->imm_id, 'imm_id', 'Immunization Given', $this->human_to_unix($row4->imm_date), 'Immunization Given', $row4->imm_immunization); $json[] = array('div' => $div4, 'startDate' => $this->human_to_unix($row4->imm_date)); $date_arr[] = $this->human_to_unix($row4->imm_date); } } $query5 = DB::table('rx_list')->where('pid', '=', $pid)->where('rxl_date_inactive', '!=', '0000-00-00 00:00:00')->get(); if ($query5) { foreach ($query5 as $row5) { $row5a = DB::table('rx_list')->where('rxl_id', '=', $row5->rxl_id)->first(); if ($row5->rxl_sig == '') { $instructions5 = $row5->rxl_instructions; } else { $instructions5 = $row5->rxl_sig . ' ' . $row5->rxl_route . ' ' . $row5->rxl_frequency; } $description5 = $row5->rxl_medication . ' ' . $row5->rxl_dosage . ' ' . $row5->rxl_dosage_unit . ', ' . $instructions5 . ' for ' . $row5->rxl_reason; $div5 = $this->timeline_item($row5->rxl_id, 'rxl_id', 'Medication Stopped', $this->human_to_unix($row5->rxl_date_inactive), 'Medication Stopped', $description5); $json[] = array('div' => $div5, 'startDate' => $this->human_to_unix($row5->rxl_date_inactive)); $date_arr[] = $this->human_to_unix($row5->rxl_date_inactive); } } $query6 = DB::table('allergies')->where('pid', '=', $pid)->where('allergies_date_inactive', '=', '0000-00-00 00:00:00')->get(); if ($query6) { foreach ($query6 as $row6) { $div6 = $this->timeline_item($row6->allergies_id, 'allergies_id', 'New Allergy', $this->human_to_unix($row6->allergies_date_active), 'New Allergy', $row6->allergies_med); $json[] = array('div' => $div6, 'startDate' => $this->human_to_unix($row6->allergies_date_active)); $date_arr[] = $this->human_to_unix($row6->allergies_date_active); } } foreach ($json as $key => $value) { $item[$key] = $value['startDate']; } array_multisort($item, SORT_DESC, $json); asort($date_arr); $arr['start'] = reset($date_arr); $arr['end'] = end($date_arr); if ($arr['end'] - $arr['start'] >= 315569260) { $arr['granular'] = 'decade'; } if ($arr['end'] - $arr['start'] > 31556926 && $arr['end'] - $arr['start'] < 315569260) { $arr['granular'] = 'year'; } if ($arr['end'] - $arr['start'] <= 31556926) { $arr['granular'] = 'month'; } $arr['json'] = $json; return $arr; }
public function postCompileBilling() { $eid = Session::get('eid'); $pid = Session::get('pid'); $practice_id = Session::get('practice_id'); $row = Demographics::find($pid); $encounterInfo = Encounters::find($eid); $dos1 = $this->human_to_unix($encounterInfo->encounter_DOS); $dos = date('mdY', $dos1); $dos2 = date('m/d/Y', $dos1); $pos = $encounterInfo->encounter_location; $assessment_data = Assessment::find($eid); $icd_pointer = ''; if ($assessment_data->assessment_1 != '') { $icd_pointer .= "A"; } if ($assessment_data->assessment_2 != '') { $icd_pointer .= "B"; } if ($assessment_data->assessment_3 != '') { $icd_pointer .= "C"; } if ($assessment_data->assessment_4 != '') { $icd_pointer .= "D"; } $labsInfo = Labs::find($eid); if ($labsInfo) { if ($labsInfo->labs_ua_urobili != '' || $labsInfo->labs_ua_bilirubin != '' || $labsInfo->labs_ua_ketones != '' || $labsInfo->labs_ua_glucose != '' || $labsInfo->labs_ua_protein != '' || $labsInfo->labs_ua_nitrites != '' || $labsInfo->labs_ua_leukocytes != '' || $labsInfo->labs_ua_blood != '' || $labsInfo->labs_ua_ph != '' || $labsInfo->labs_ua_spgr != '' || $labsInfo->labs_ua_color != '' || $labsInfo->labs_ua_clarity != '') { $this->compile_procedure_billing('81002', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_upt != '') { $this->compile_procedure_billing('81025', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_strep != '') { $this->compile_procedure_billing('87880', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_mono != '') { $this->compile_procedure_billing('86308', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_flu != '') { $this->compile_procedure_billing('87804', $eid, $pid, $dos2, $icd_pointer, $practice_id); } if ($labsInfo->labs_glucose != '') { $this->compile_procedure_billing('82962', $eid, $pid, $dos2, $icd_pointer, $practice_id); } } $result9 = Procedure::find($eid); if ($result9) { $this->compile_procedure_billing($result9->proc_cpt, $eid, $pid, $dos2, $icd_pointer, $practice_id); } $result11 = Immunizations::where('eid', '=', $eid)->get(); if ($result11) { foreach ($result11 as $row11) { $this->compile_procedure_billing($row11->cpt, $eid, $pid, $dos2, $icd_pointer, $practice_id); } } echo 'CPT codes complied from the encounter!'; }
protected function encounters_view($eid, $pid, $practice_id, $modal = false, $addendum = false) { $encounterInfo = Encounters::find($eid); $data['patientInfo'] = Demographics::find($pid); $data['eid'] = $eid; $data['encounter_DOS'] = date('F jS, Y; h:i A', $this->human_to_unix($encounterInfo->encounter_DOS)); $data['encounter_provider'] = $encounterInfo->encounter_provider; $data['date_signed'] = date('F jS, Y; h:i A', $this->human_to_unix($encounterInfo->date_signed)); $data['age1'] = $encounterInfo->encounter_age; $data['dob'] = date('F jS, Y', $this->human_to_unix($data['patientInfo']->DOB)); $data['age'] = $this->current_age($pid); if ($data['patientInfo']->sex == 'm') { $data['gender'] = 'Male'; } if ($data['patientInfo']->sex == 'f') { $data['gender'] = 'Female'; } if ($data['patientInfo']->sex == 'u') { $data['gender'] = 'Undifferentiated'; } $data['encounter_cc'] = nl2br($encounterInfo->encounter_cc); $practiceInfo = Practiceinfo::find($practice_id); $hpiInfo = Hpi::find($eid); if ($hpiInfo) { if (!is_null($hpiInfo->hpi) && $hpiInfo->hpi != '') { $data['hpi'] = '<br><h4>History of Present Illness:</h4><p class="view">'; $data['hpi'] .= nl2br($hpiInfo->hpi); $data['hpi'] .= '</p>'; } if (!is_null($hpiInfo->situation) && $hpiInfo->situation != '') { $data['hpi'] = '<br><h4>Situation:</h4><p class="view">'; $data['hpi'] .= nl2br($hpiInfo->situation); $data['hpi'] .= '</p>'; } } else { $data['hpi'] = ''; } $rosInfo = Ros::find($eid); if ($rosInfo) { $data['ros'] = '<br><h4>Review of Systems:</h4><p class="view">'; if ($rosInfo->ros_gen != '') { $data['ros'] .= '<strong>General: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_gen); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_eye != '') { $data['ros'] .= '<strong>Eye: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_eye); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_ent != '') { $data['ros'] .= '<strong>Ears, Nose, Throat: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_ent); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_resp != '') { $data['ros'] .= '<strong>Respiratory: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_resp); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_cv != '') { $data['ros'] .= '<strong>Cardiovascular: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_cv); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_gi != '') { $data['ros'] .= '<strong>Gastrointestinal: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_gi); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_gu != '') { $data['ros'] .= '<strong>Genitourinary: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_gu); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_mus != '') { $data['ros'] .= '<strong>Musculoskeletal: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_mus); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_neuro != '') { $data['ros'] .= '<strong>Neurological: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_neuro); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych != '') { $data['ros'] .= '<strong>Psychological: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_heme != '') { $data['ros'] .= '<strong>Hematological, Lymphatic: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_heme); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_endocrine != '') { $data['ros'] .= '<strong>Endocrine: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_endocrine); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_skin != '') { $data['ros'] .= '<strong>Skin: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_skin); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_wcc != '') { $data['ros'] .= '<strong>Well Child Check: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_wcc); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych1 != '') { $data['ros'] .= '<strong>Depression: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych1); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych2 != '') { $data['ros'] .= '<strong>Anxiety: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych2); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych3 != '') { $data['ros'] .= '<strong>Bipolar: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych3); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych4 != '') { $data['ros'] .= '<strong>Mood Disorders: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych4); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych5 != '') { $data['ros'] .= '<strong>ADHD: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych5); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych6 != '') { $data['ros'] .= '<strong>PTSD: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych6); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych7 != '') { $data['ros'] .= '<strong>Substance Related Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych7); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych8 != '') { $data['ros'] .= '<strong>Obsessive Compulsive Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych8); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych9 != '') { $data['ros'] .= '<strong>Social Anxiety Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych9); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych10 != '') { $data['ros'] .= '<strong>Autistic Disorder: </strong>'; $data['ros'] .= nl2br($rosInfo->ros_psych10); $data['ros'] .= '<br /><br />'; } if ($rosInfo->ros_psych11 != '') { $data['ros'] .= "<strong>Asperger's Disorder: </strong>"; $data['ros'] .= nl2br($rosInfo->ros_psych11); $data['ros'] .= '<br /><br />'; } $data['ros'] .= '</p>'; } else { $data['ros'] = ''; } $ohInfo = DB::table('other_history')->where('eid', '=', $eid)->first(); if ($ohInfo) { $data['oh'] = '<br><h4>Other Pertinent History:</h4><p class="view">'; if ($ohInfo->oh_pmh != '') { $data['oh'] .= '<strong>Past Medical History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_pmh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_psh != '') { $data['oh'] .= '<strong>Past Surgical History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_psh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_fh != '') { $data['oh'] .= '<strong>Family History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_fh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_sh != '') { $data['oh'] .= '<strong>Social History: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_sh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_etoh != '') { $data['oh'] .= '<strong>Alcohol Use: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_etoh); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_tobacco != '') { $data['oh'] .= '<strong>Tobacco Use: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_tobacco); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_drugs != '') { $data['oh'] .= '<strong>Illicit Drug Use: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_drugs); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_employment != '') { $data['oh'] .= '<strong>Employment: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_employment); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_psychosocial != '') { $data['oh'] .= '<strong>Psychosocial: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_psychosocial); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_developmental != '') { $data['oh'] .= '<strong>Developmental: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_developmental); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_medtrials != '') { $data['oh'] .= '<strong>Past Medication Trials: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_medtrials); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_meds != '') { $data['oh'] .= '<strong>Medications: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_meds); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_supplements != '') { $data['oh'] .= '<strong>Supplements: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_supplements); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_allergies != '') { $data['oh'] .= '<strong>Allergies: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_allergies); $data['oh'] .= '<br /><br />'; } if ($ohInfo->oh_results != '') { $data['oh'] .= '<strong>Reviewed Results: </strong>'; $data['oh'] .= nl2br($ohInfo->oh_results); $data['oh'] .= '<br /><br />'; } $data['oh'] .= '</p>'; } else { $data['oh'] = ''; } $vitalsInfo1 = Vitals::where('eid', '=', $eid)->get(); if (count($vitalsInfo1) > 0) { foreach ($vitalsInfo1 as $vitalsInfo) { $data['vitals'] = '<br><h4>Vital Signs:</h4><p class="view">'; $data['vitals'] .= '<strong>Date/Time:</strong>'; $data['vitals'] .= $vitalsInfo->vitals_date . '<br>'; if ($vitalsInfo->weight != '') { $data['vitals'] .= '<strong>Weight: </strong>'; $data['vitals'] .= $vitalsInfo->weight . ' ' . $practiceInfo->weight_unit . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->height != '') { $data['vitals'] .= '<strong>Height: </strong>'; $data['vitals'] .= $vitalsInfo->height . ' ' . $practiceInfo->height_unit . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->headcircumference != '') { $data['vitals'] .= '<strong>Head Circumference: </strong>'; $data['vitals'] .= $vitalsInfo->headcircumference . ' ' . $practiceInfo->hc_unit . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->BMI != '') { $data['vitals'] .= '<strong>Body Mass Index: </strong>'; $data['vitals'] .= $vitalsInfo->BMI . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->temp != '') { $data['vitals'] .= '<strong>Temperature: </strong>'; $data['vitals'] .= $vitalsInfo->temp . ' ' . $practiceInfo->temp_unit . ', ' . $vitalsInfo->temp_method . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->bp_systolic != '' && $vitalsInfo->bp_diastolic != '') { $data['vitals'] .= '<strong>Blood Pressure: </strong>'; $data['vitals'] .= $vitalsInfo->bp_systolic . '/' . $vitalsInfo->bp_diastolic . ', ' . $vitalsInfo->bp_position . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->pulse != '') { $data['vitals'] .= '<strong>Pulse: </strong>'; $data['vitals'] .= $vitalsInfo->pulse . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->respirations != '') { $data['vitals'] .= '<strong>Respirations: </strong>'; $data['vitals'] .= $vitalsInfo->respirations . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->o2_sat != '') { $data['vitals'] .= '<strong>Oxygen Saturations: </strong>'; $data['vitals'] .= $vitalsInfo->o2_sat . '<br>'; } else { $data['vitals'] .= ''; } if ($vitalsInfo->vitals_other != '') { $data['vitals'] .= '<strong>Notes: </strong>'; $data['vitals'] .= nl2br($vitalsInfo->vitals_other) . '<br>'; } $data['vitals'] .= '</p>'; } } else { $data['vitals'] = ''; } $peInfo = Pe::find($eid); if ($peInfo) { $data['pe'] = '<br><h4>Physical Exam:</h4><p class="view">'; if ($peInfo->pe_gen1 != '') { $data['pe'] .= '<strong>General: </strong>'; $data['pe'] .= nl2br($peInfo->pe_gen1); $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_eye1 != '' || $peInfo->pe_eye2 != '' || $peInfo->pe_eye3 != '') { $data['pe'] .= '<strong>Eye:</strong>'; if ($peInfo->pe_eye1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_eye1); } if ($peInfo->pe_eye2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_eye2); } if ($peInfo->pe_eye3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_eye3); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_ent1 != '' || $peInfo->pe_ent2 != '' || $peInfo->pe_ent3 != '' || $peInfo->pe_ent4 != '' || $peInfo->pe_ent5 != '' || $peInfo->pe_ent6 != '') { $data['pe'] .= '<strong>Ears, Nose, Throat:</strong>'; if ($peInfo->pe_ent1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent1); } if ($peInfo->pe_ent2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent2); } if ($peInfo->pe_ent3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent3); } if ($peInfo->pe_ent4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent4); } if ($peInfo->pe_ent5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent5); } if ($peInfo->pe_ent6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ent6); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_neck1 != '' || $peInfo->pe_neck2 != '') { $data['pe'] .= '<strong>Neck:</strong>'; if ($peInfo->pe_neck1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neck1); } if ($peInfo->pe_neck2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neck2); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_resp1 != '' || $peInfo->pe_resp2 != '' || $peInfo->pe_resp3 != '' || $peInfo->pe_resp4 != '') { $data['pe'] .= '<strong>Respiratory:</strong>'; if ($peInfo->pe_resp1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp1); } if ($peInfo->pe_resp2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp2); } if ($peInfo->pe_resp3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp3); } if ($peInfo->pe_resp4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_resp4); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_cv1 != '' || $peInfo->pe_cv2 != '' || $peInfo->pe_cv3 != '' || $peInfo->pe_cv4 != '' || $peInfo->pe_cv5 != '' || $peInfo->pe_cv6 != '') { $data['pe'] .= '<strong>Cardiovascular:</strong>'; if ($peInfo->pe_cv1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv1); } if ($peInfo->pe_cv2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv2); } if ($peInfo->pe_cv3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv3); } if ($peInfo->pe_cv4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv4); } if ($peInfo->pe_cv5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv5); } if ($peInfo->pe_cv6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_cv6); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_ch1 != '' || $peInfo->pe_ch2 != '') { $data['pe'] .= '<strong>Chest:</strong>'; if ($peInfo->pe_ch1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ch1); } if ($peInfo->pe_ch2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ch2); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_gi1 != '' || $peInfo->pe_gi2 != '' || $peInfo->pe_gi3 != '' || $peInfo->pe_gi4 != '') { $data['pe'] .= '<strong>Gastrointestinal:</strong>'; if ($peInfo->pe_gi1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi1); } if ($peInfo->pe_gi2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi2); } if ($peInfo->pe_gi3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi3); } if ($peInfo->pe_gi4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gi4); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_gu1 != '' || $peInfo->pe_gu2 != '' || $peInfo->pe_gu3 != '' || $peInfo->pe_gu4 != '' || $peInfo->pe_gu5 != '' || $peInfo->pe_gu6 != '' || $peInfo->pe_gu7 != '' || $peInfo->pe_gu8 != '' || $peInfo->pe_gu9 != '') { $data['pe'] .= '<strong>Genitourinary:</strong>'; if ($peInfo->pe_gu1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu1); } if ($peInfo->pe_gu2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu2); } if ($peInfo->pe_gu3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu3); } if ($peInfo->pe_gu4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu4); } if ($peInfo->pe_gu5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu5); } if ($peInfo->pe_gu6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu6); } if ($peInfo->pe_gu7 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu7); } if ($peInfo->pe_gu8 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu8); } if ($peInfo->pe_gu9 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_gu9); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_lymph1 != '' || $peInfo->pe_lymph2 != '' || $peInfo->pe_lymph3 != '') { $data['pe'] .= '<strong>Lymphatic:</strong>'; if ($peInfo->pe_lymph1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_lymph1); } if ($peInfo->pe_lymph2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_lymph2); } if ($peInfo->pe_lymph3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_lymph3); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_ms1 != '' || $peInfo->pe_ms2 != '' || $peInfo->pe_ms3 != '' || $peInfo->pe_ms4 != '' || $peInfo->pe_ms5 != '' || $peInfo->pe_ms6 != '' || $peInfo->pe_ms7 != '' || $peInfo->pe_ms8 != '' || $peInfo->pe_ms9 != '' || $peInfo->pe_ms10 != '' || $peInfo->pe_ms11 != '' || $peInfo->pe_ms12 != '') { $data['pe'] .= '<strong>Musculoskeletal:</strong>'; if ($peInfo->pe_ms1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms1); } if ($peInfo->pe_ms2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms2); } if ($peInfo->pe_ms3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms3); } if ($peInfo->pe_ms4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms4); } if ($peInfo->pe_ms5 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms5); } if ($peInfo->pe_ms6 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms6); } if ($peInfo->pe_ms7 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms7); } if ($peInfo->pe_ms8 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms8); } if ($peInfo->pe_ms9 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms9); } if ($peInfo->pe_ms10 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms10); } if ($peInfo->pe_ms11 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms11); } if ($peInfo->pe_ms12 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_ms12); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_skin1 != '' || $peInfo->pe_skin2 != '') { $data['pe'] .= '<strong>Skin:</strong>'; if ($peInfo->pe_skin1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_skin1); } if ($peInfo->pe_skin2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_skin2); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_neuro1 != '' || $peInfo->pe_neuro2 != '' || $peInfo->pe_neuro3 != '') { $data['pe'] .= '<strong>Neurologic:</strong>'; if ($peInfo->pe_neuro1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neuro1); } if ($peInfo->pe_neuro2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neuro2); } if ($peInfo->pe_neuro3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_neuro3); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_psych1 != '' || $peInfo->pe_psych2 != '' || $peInfo->pe_psych3 != '' || $peInfo->pe_psych4 != '') { $data['pe'] .= '<strong>Psychiatric:</strong>'; if ($peInfo->pe_psych1 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych1); } if ($peInfo->pe_psych2 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych2); } if ($peInfo->pe_psych3 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych3); } if ($peInfo->pe_psych4 != '') { $data['pe'] .= ' ' . nl2br($peInfo->pe_psych4); } $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_constitutional1 != '') { $data['pe'] .= '<strong>Constitutional: </strong>'; $data['pe'] .= nl2br($peInfo->pe_constitutional1); $data['pe'] .= '<br /><br />'; } if ($peInfo->pe_mental1 != '') { $data['pe'] .= '<strong>Mental Status Examination: </strong>'; $data['pe'] .= nl2br($peInfo->pe_mental1); $data['pe'] .= '<br /><br />'; } $data['pe'] .= '</p>'; } else { $data['pe'] = ''; } $imagesInfo = DB::table('image')->where('eid', '=', $eid)->get(); $html = ''; if ($imagesInfo) { $data['images'] = '<br><h4>Images:</h4><p class="view">'; $k = 0; foreach ($imagesInfo as $imagesInfo_row) { $directory = $practiceInfo->documents_dir . $pid . "/"; $new_directory = __DIR__ . '/../../public/temp/'; $new_directory1 = '/temp/'; $file_path = str_replace($directory, $new_directory, $imagesInfo_row->image_location); $file_path1 = str_replace($directory, $new_directory1, $imagesInfo_row->image_location); copy($imagesInfo_row->image_location, $file_path); if ($k != 0) { $data['images'] .= '<br><br>'; } $data['images'] .= HTML::image($file_path1, 'Image', array('border' => '0')); if ($imagesInfo_row->image_description != '') { $data['images'] .= '<br>' . $imagesInfo_row->image_description . '<br>'; } $k++; } } else { $data['images'] = ''; } $labsInfo = Labs::find($eid); if ($labsInfo) { $data['labs'] = '<br><h4>Laboratory Testing:</h4><p class="view">'; if ($labsInfo->labs_ua_urobili != '' || $labsInfo->labs_ua_bilirubin != '' || $labsInfo->labs_ua_ketones != '' || $labsInfo->labs_ua_glucose != '' || $labsInfo->labs_ua_protein != '' || $labsInfo->labs_ua_nitrites != '' || $labsInfo->labs_ua_leukocytes != '' || $labsInfo->labs_ua_blood != '' || $labsInfo->labs_ua_ph != '' || $labsInfo->labs_ua_spgr != '' || $labsInfo->labs_ua_color != '' || $labsInfo->labs_ua_clarity != '') { $data['labs'] .= '<strong>Dipstick Urinalysis:</strong><br /><table>'; if ($labsInfo->labs_ua_urobili != '') { $data['labs'] .= '<tr><th align=\\"left\\">Urobilinogen:</th><td align=\\"left\\">' . $labsInfo->labs_ua_urobili . '</td></tr>'; } if ($labsInfo->labs_ua_bilirubin != '') { $data['labs'] .= '<tr><th align=\\"left\\">Bilirubin:</th><td align=\\"left\\">' . $labsInfo->labs_ua_bilirubin . '</td></tr>'; } if ($labsInfo->labs_ua_ketones != '') { $data['labs'] .= '<tr><th align=\\"left\\">Ketones:</th><td align=\\"left\\">' . $labsInfo->labs_ua_ketones . '</td></tr>'; } if ($labsInfo->labs_ua_glucose != '') { $data['labs'] .= '<tr><th align=\\"left\\">Glucose:</th><td align=\\"left\\">' . $labsInfo->labs_ua_glucose . '</td></tr>'; } if ($labsInfo->labs_ua_protein != '') { $data['labs'] .= '<tr><th align=\\"left\\">Protein:</th><td align=\\"left\\">' . $labsInfo->labs_ua_protein . '</td></tr>'; } if ($labsInfo['labs_ua_nitrites'] != '') { $data['labs'] .= '<tr><th align=\\"left\\">Nitrites:</th><td align=\\"left\\">' . $labsInfo->labs_ua_nitrites . '</td></tr>'; } if ($labsInfo->labs_ua_leukocytes != '') { $data['labs'] .= '<tr><th align=\\"left\\">Leukocytes:</th><td align=\\"left\\">' . $labsInfo->labs_ua_leukocytes . '</td></tr>'; } if ($labsInfo->labs_ua_blood != '') { $data['labs'] .= '<tr><th align=\\"left\\">Blood:</th><td align=\\"left\\">' . $labsInfo->labs_ua_blood . '</td></tr>'; } if ($labsInfo->labs_ua_ph != '') { $data['labs'] .= '<tr><th align=\\"left\\">pH:</th><td align=\\"left\\">' . $labsInfo->labs_ua_ph . '</td></tr>'; } if ($labsInfo->labs_ua_spgr != '') { $data['labs'] .= '<tr><th align=\\"left\\">Specific gravity:</th><td align=\\"left\\">' . $labsInfo->labs_ua_spgr . '</td></tr>'; } if ($labsInfo->labs_ua_color != '') { $data['labs'] .= '<tr><th align=\\"left\\">Color:</th><td align=\\"left\\">' . $labsInfo->labs_ua_color . '</td></tr>'; } if ($labsInfo->labs_ua_clarity != '') { $data['labs'] .= '<tr><th align=\\"left\\">Clarity:</th><td align=\\"left\\">' . $labsInfo->labs_ua_clarity . '</td></tr>'; } $data['labs'] .= '</table>'; } if ($labsInfo->labs_upt != '') { $data['labs'] .= '<strong>Urine HcG: </strong>'; $data['labs'] .= $labsInfo->labs_upt; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_strep != '') { $data['labs'] .= '<strong>Rapid Strep: </strong>'; $data['labs'] .= $labsInfo->labs_strep; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_mono != '') { $data['labs'] .= '<strong>Mono Spot: </strong>'; $data['labs'] .= $labsInfo->labs_mono; $data['labs'] .= '<br>'; } if ($labsInfo->labs_flu != '') { $data['labs'] .= '<strong>Rapid Influenza: </strong>'; $data['labs'] .= $labsInfo->labs_flu; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_microscope != '') { $data['labs'] .= '<strong>Micrscopy: </strong>'; $data['labs'] .= nl2br($labsInfo->labs_microscope); $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_glucose != '') { $data['labs'] .= '<strong>Fingerstick Glucose: </strong>'; $data['labs'] .= $labsInfo->labs_glucose; $data['labs'] .= '<br /><br />'; } if ($labsInfo->labs_other != '') { $data['labs'] .= '<strong>Other: </strong>'; $data['labs'] .= nl2br($labsInfo->labs_other); $data['labs'] .= '<br /><br />'; } $data['labs'] .= '</p>'; } else { $data['labs'] = ''; } $procedureInfo = Procedure::find($eid); if ($procedureInfo) { $data['procedure'] = '<br><h4>Procedures:</h4><p class="view">'; if ($procedureInfo->proc_type != '') { $data['procedure'] .= '<strong>Procedure: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_type); $data['procedure'] .= '<br /><br />'; } if ($procedureInfo->proc_description != '') { $data['procedure'] .= '<strong>Description of Procedure: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_description); $data['procedure'] .= '<br /><br />'; } if ($procedureInfo->proc_complications != '') { $data['procedure'] .= '<strong>Complications: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_complications); $data['procedure'] .= '<br /><br />'; } if ($procedureInfo->proc_ebl != '') { $data['procedure'] .= '<strong>Estimated Blood Loss: </strong>'; $data['procedure'] .= nl2br($procedureInfo->proc_ebl); $data['procedure'] .= '<br /><br />'; } $data['procedure'] .= '</p>'; } else { $data['procedure'] = ''; } $assessmentInfo = Assessment::find($eid); if ($assessmentInfo) { $data['assessment'] = '<br><h4>Assessment:</h4><p class="view">'; if ($assessmentInfo->assessment_1 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_1 . '</strong><br />'; if ($assessmentInfo->assessment_2 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_2 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_2 . '</strong><br />'; if ($assessmentInfo->assessment_3 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_3 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_3 . '</strong><br />'; if ($assessmentInfo->assessment_4 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_4 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_4 . '</strong><br />'; if ($assessmentInfo->assessment_5 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_5 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_5 . '</strong><br />'; if ($assessmentInfo->assessment_6 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_6 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_6 . '</strong><br />'; if ($assessmentInfo->assessment_7 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_7 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_7 . '</strong><br />'; if ($assessmentInfo->assessment_8 == '') { $data['assessment'] .= '<br />'; } } if ($assessmentInfo->assessment_8 != '') { $data['assessment'] .= '<strong>' . $assessmentInfo->assessment_8 . '</strong><br /><br />'; } if ($assessmentInfo->assessment_other != '') { if ($encounterInfo->encounter_template == 'standardmtm') { $data['assessment'] .= '<strong>SOAP Note: </strong>'; } else { $data['assessment'] .= '<strong>Additional Diagnoses: </strong>'; } $data['assessment'] .= nl2br($assessmentInfo->assessment_other); $data['assessment'] .= '<br /><br />'; } if ($assessmentInfo->assessment_ddx != '') { if ($encounterInfo->encounter_template == 'standardmtm') { $data['assessment'] .= '<strong>MAP2: </strong>'; } else { $data['assessment'] .= '<strong>Differential Diagnoses Considered: </strong>'; } $data['assessment'] .= nl2br($assessmentInfo->assessment_ddx); $data['assessment'] .= '<br /><br />'; } if ($assessmentInfo->assessment_notes != '') { if ($encounterInfo->encounter_template == 'standardmtm') { $data['assessment'] .= '<strong>Pharmacist Note: </strong>'; } else { $data['assessment'] .= '<strong>Assessment Discussion: </strong>'; } $data['assessment'] .= nl2br($assessmentInfo->assessment_notes); $data['assessment'] .= '<br /><br />'; } $data['assessment'] .= '</p>'; } else { $data['assessment'] = ''; } $ordersInfo1 = Orders::where('eid', '=', $eid)->get(); if (count($ordersInfo1) > 0) { $data['orders'] = '<br><h4>Orders:</h4><p class="view">'; $orders_lab_array = array(); $orders_radiology_array = array(); $orders_cp_array = array(); $orders_referrals_array = array(); foreach ($ordersInfo1 as $ordersInfo) { $address_row1 = Addressbook::find($ordersInfo->address_id); if ($address_row1) { $orders_displayname = $address_row1->displayname; } else { $orders_displayname = 'Unknown'; } if ($ordersInfo->orders_labs != '') { $orders_lab_array[] = 'Orders sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_labs) . '<br />'; } if ($ordersInfo->orders_radiology != '') { $orders_radiology_array[] = 'Orders sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_radiology) . '<br />'; } if ($ordersInfo->orders_cp != '') { $orders_cp_array[] = 'Orders sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_cp) . '<br />'; } if ($ordersInfo->orders_referrals != '') { $orders_referrals_array[] = 'Referral sent to ' . $orders_displayname . ': ' . nl2br($ordersInfo->orders_referrals) . '<br />'; } } if (count($orders_lab_array) > 0) { $data['orders'] .= '<strong>Labs: </strong>'; foreach ($orders_lab_array as $lab_item) { $data['orders'] .= $lab_item; } } if (count($orders_radiology_array) > 0) { $data['orders'] .= '<strong>Imaging: </strong>'; foreach ($orders_radiology_array as $radiology_item) { $data['orders'] .= $radiology_item; } } if (count($orders_cp_array) > 0) { $data['orders'] .= '<strong>Cardiopulmonary: </strong>'; foreach ($orders_cp_array as $cp_item) { $data['orders'] .= $cp_item; } } if (count($orders_referrals_array) > 0) { $data['orders'] .= '<strong>Referrals: </strong>'; foreach ($orders_referrals_array as $referrals_item) { $data['orders'] .= $referrals_item; } } $data['orders'] .= '</p>'; } else { $data['orders'] = ''; } $rxInfo = Rx::find($eid); if ($rxInfo) { $data['rx'] = '<br><h4>Prescriptions and Immunizations:</h4><p class="view">'; if ($rxInfo->rx_rx != '') { $data['rx'] .= '<strong>Prescriptions Given: </strong>'; $data['rx'] .= nl2br($rxInfo->rx_rx); $data['rx'] .= '<br /><br />'; } if ($rxInfo->rx_supplements != '') { $data['rx'] .= '<strong>Supplements Recommended: </strong>'; $data['rx'] .= nl2br($rxInfo->rx_supplements); $data['rx'] .= '<br /><br />'; } if ($rxInfo->rx_immunizations != '') { $data['rx'] .= '<strong>Immunizations Given: </strong>'; $data['rx'] .= 'CDC Vaccine Information Sheets given for each immunization and consent obtained.<br />'; $data['rx'] .= nl2br($rxInfo->rx_immunizations); $data['rx'] .= '<br /><br />'; } $data['rx'] .= '</p>'; } else { $data['rx'] = ''; } $planInfo = Plan::find($eid); if ($planInfo) { $data['plan'] = '<br><h4>Plan:</h4><p class="view">'; if ($planInfo->plan != '') { $data['plan'] .= '<strong>Recommendations: </strong>'; $data['plan'] .= nl2br($planInfo->plan); $data['plan'] .= '<br /><br />'; } if ($planInfo->followup != '') { $data['plan'] .= '<strong>Followup: </strong>'; $data['plan'] .= nl2br($planInfo->followup); $data['plan'] .= '<br /><br />'; } if ($planInfo->goals != '') { $data['plan'] .= '<strong>Goals/Measures: </strong>'; $data['plan'] .= nl2br($planInfo->goals); $data['plan'] .= '<br /><br />'; } if ($planInfo->tp != '') { $data['plan'] .= '<strong>Treatment Plan Notes: </strong>'; $data['plan'] .= nl2br($planInfo->tp); $data['plan'] .= '<br /><br />'; } if ($planInfo->duration != '') { $data['plan'] .= 'Counseling and face-to-face time consists of more than 50 percent of the visit. Total face-to-face time is '; $data['plan'] .= $planInfo->duration . ' minutes.'; $data['plan'] .= '<br /><br />'; } $data['plan'] .= '</p>'; } else { $data['plan'] = ''; } $billing_query = Billing_core::where('eid', '=', $eid)->get(); if ($billing_query) { $data['billing'] = '<p class="view">'; $billing_count = 0; foreach ($billing_query as $billing_row) { if ($billing_count > 0) { $data['billing'] .= ',' . $billing_row->cpt; } else { $data['billing'] .= '<strong>CPT Codes: </strong>'; $data['billing'] .= $billing_row->cpt; } $billing_count++; } if ($encounterInfo->bill_complex != '') { $data['billing'] .= '<br><strong>Medical Complexity: </strong>'; $data['billing'] .= nl2br($encounterInfo->bill_complex); $data['billing'] .= '<br /><br />'; } $data['billing'] .= '</p>'; } else { $data['billing'] = ''; } if ($modal == true) { if ($encounterInfo->encounter_signed == 'No') { $data['status'] = 'Draft'; } else { $data['status'] = 'Signed on ' . date('F jS, Y', $this->human_to_unix($encounterInfo->date_signed)) . '.'; } if ($addendum == true) { $data['addendum'] = true; } else { $data['addendum'] = false; } return View::make('modal_view', $data); } else { return View::make('encounter_view', $data); } }