497 lines
31 KiB
PHP
Executable File
497 lines
31 KiB
PHP
Executable File
<?php
|
|
if(!defined('BASEPATH')){
|
|
exit('No direct script access allowed');
|
|
}
|
|
|
|
class Cproforms_model extends CI_model{
|
|
function __construct() {
|
|
parent::__construct();
|
|
$this->load->database();
|
|
}
|
|
function hms_model_get_merchant_info(){
|
|
try{
|
|
$query=$this->db->get('website_settings');
|
|
$result=$query->row();
|
|
return $result;
|
|
}
|
|
catch(Exception $e){
|
|
$getMsg="CproForms_model - hms_model_get_merchant_info: ".$e->getMessage();
|
|
echo $getMsg;
|
|
}
|
|
}
|
|
function hms_model_get_patient_basic_info($patient_id){
|
|
try{
|
|
$this->db->select('*');
|
|
$this->db->from('patient_details');
|
|
$this->db->where(array(
|
|
'id'=>$patient_id
|
|
));
|
|
$query=$this->db->get();
|
|
$result=$query->row();
|
|
return $result;
|
|
}
|
|
catch(Exception $e){
|
|
$getMsg="CproForms_model - hms_model_get_patient_basic_info: ".$e->getMessage();
|
|
echo $getMsg;
|
|
}
|
|
}
|
|
function hms_model_get_patient_user_id($patient_id){
|
|
try{
|
|
$this->db->select('ion_user_id');
|
|
$this->db->from('patient_details');
|
|
$this->db->where(array(
|
|
'id'=>$patient_id
|
|
));
|
|
$query=$this->db->get();
|
|
$rows=$query->num_rows();
|
|
$result=$query->row_array();
|
|
return isset($result['ion_user_id'])?intval($result['ion_user_id']):0;
|
|
}
|
|
catch(Exception $e){
|
|
$getMsg="CproForms_model - hms_model_get_patient_user_id: ".$e->getMessage();
|
|
echo $getMsg;
|
|
}
|
|
}
|
|
function hms_model_get_patient_report_id($patient_id,$schedule_id){
|
|
try{
|
|
$this->db->select('id');
|
|
$this->db->from('patient_report');
|
|
$this->db->where(array(
|
|
'patient_id'=>$patient_id,
|
|
'schedule_id'=>$schedule_id
|
|
));
|
|
$query=$this->db->get();
|
|
$rows=$query->num_rows();
|
|
$result=$query->row_array();
|
|
return isset($result['id'])?intval($result['id']):0;
|
|
}
|
|
catch(Exception $e){
|
|
$getMsg="CproForms_model - hms_model_get_patient_report_id: ".$e->getMessage();
|
|
echo $getMsg;
|
|
}
|
|
}
|
|
|
|
function hms_model_get_nursing_assessment_page_two_pdf_datas($data){
|
|
try{
|
|
/*
|
|
| Segement => ~Cardiovascular~
|
|
| Segement => ~Respiratory~
|
|
| Segement => ~Skin~
|
|
| Segement => ~musculoskeletal~
|
|
*/
|
|
|
|
/*collecting informations from database table*/
|
|
$this->db->select('curdiovascular,body_mark_base64,feet_mark_base64');
|
|
$this->db->from('patient_report');
|
|
$this->db->where(array(
|
|
'id'=>$data->report_id
|
|
));
|
|
$query=$this->db->get();
|
|
$rows=$query->num_rows();
|
|
$result=$rows>0?$query->row_array():[];
|
|
/*collecting informations from database table*/
|
|
|
|
/*setting images*/
|
|
$imageDatas=[
|
|
'nursing_assessment_body'=>isset($result['body_mark_base64'])&&$result['body_mark_base64']!=""&&$result['body_mark_base64']!=null?$result['body_mark_base64']:'',
|
|
'nursing_assessment_feet'=>isset($result['feet_mark_base64'])&&$result['feet_mark_base64']!=""&&$result['feet_mark_base64']!=null?$result['feet_mark_base64']:''
|
|
];
|
|
/*setting images*/
|
|
|
|
/*Cardiovascular*/
|
|
$cardiovascularObj=isset($result['curdiovascular'])&&$result['curdiovascular']!=null&&trim($result['curdiovascular'])!=""?json_decode($result['curdiovascular']):(object)[];
|
|
if(count((array)$cardiovascularObj)>0){
|
|
$heart=isset($cardiovascularObj->heart)?$cardiovascularObj->heart:[];
|
|
$chest_pain=isset($cardiovascularObj->chest_pain)?$cardiovascularObj->chest_pain:'';
|
|
$associated_with_activity=isset($cardiovascularObj->associated_with_activity)?$cardiovascularObj->associated_with_activity:'';
|
|
$edema=isset($cardiovascularObj->Edema)?$cardiovascularObj->Edema:'';
|
|
$pulses=isset($cardiovascularObj->pulses)?$cardiovascularObj->pulses:'';
|
|
$fluid_restriction=isset($cardiovascularObj->fluid_restriction)?$cardiovascularObj->fluid_restriction:'';
|
|
|
|
$heart_hdfg=$this->hms_helper_create_keys_values_pair('heart',['WNL','Pacemaker','Palpitation','Fatigue','Stents','Other'],$heart);
|
|
$chest_pain_hdfg=$this->hms_helper_create_keys_values_pair('chest_pain',['yes','no'],$chest_pain);
|
|
$associated_with_activity_hdfg=$this->hms_helper_create_keys_values_pair('associated_with_activity',['yes','no'],$associated_with_activity);
|
|
$edema_hdfg=$this->hms_helper_create_keys_values_pair('edema',['None','Pitting','Non-Pitting','Mild','Moderate','Severe'],$edema);
|
|
$pulses_hdfg=$this->hms_helper_create_keys_values_pair('pulses',['WNL','Equal Bilaterally','Bounding','Diminished','No palpable'],$pulses);
|
|
$fluid_restriction_hdfg=$this->hms_helper_create_keys_values_pair('fluid_restriction',['none','restricted'],$fluid_restriction);
|
|
|
|
$cardiovascularBasic=[
|
|
'heart'=>$heart,
|
|
'chest_pain'=>$chest_pain,
|
|
'chest_pain_location'=>isset($cardiovascularObj->chest_pain_location)?$cardiovascularObj->chest_pain_location:'',
|
|
'chest_pain_frequency'=>isset($cardiovascularObj->chest_pain_frequency)?$cardiovascularObj->chest_pain_frequency:'',
|
|
'chest_pain_duration'=>isset($cardiovascularObj->chest_pain_duration)?$cardiovascularObj->chest_pain_duration:'',
|
|
'associated_with_activity'=>$associated_with_activity,
|
|
'measures_to_relieve'=>isset($cardiovascularObj->measures_to_relieve)?$cardiovascularObj->measures_to_relieve:'',
|
|
'Edema'=>$edema,
|
|
'edema_position'=>isset($cardiovascularObj->edema_Position)?$cardiovascularObj->edema_Position:'',
|
|
'pulses'=>$pulses,
|
|
'fluid_restriction'=>$fluid_restriction,
|
|
'fluid_restricted_to'=>isset($cardiovascularObj->fluid_restricted_to)?$cardiovascularObj->fluid_restricted_to:''
|
|
];
|
|
|
|
$cardiovascularData=array_merge(
|
|
$heart_hdfg,
|
|
$chest_pain_hdfg,
|
|
$associated_with_activity_hdfg,
|
|
$edema_hdfg,
|
|
$pulses_hdfg,
|
|
$fluid_restriction_hdfg,
|
|
$cardiovascularBasic
|
|
);
|
|
}else{
|
|
$cardiovascularData=[];
|
|
}
|
|
/*Cardiovascular*/
|
|
|
|
/*Respiratory*/
|
|
$respiratoryData=[];
|
|
/*Respiratory*/
|
|
|
|
/*Skin*/
|
|
$skinData=[];
|
|
/*Skin*/
|
|
|
|
/*Musculoskeletal*/
|
|
$musculoskeletalData=[];
|
|
/*Musculoskeletal*/
|
|
|
|
/*response*/
|
|
$response=[
|
|
'form_data'=>array_merge($cardiovascularData,$respiratoryData,$skinData,$musculoskeletalData),
|
|
'image_data'=>$imageDatas
|
|
];
|
|
return $response;
|
|
/*response*/
|
|
}
|
|
catch(Exception $e){
|
|
$getMsg="CproForms_model - hms_model_get_nursing_assessment_page_two_pdf_datas: ".$e->getMessage();
|
|
echo $getMsg;
|
|
}
|
|
}
|
|
|
|
function hms_helper_create_keys_values_pair($name,$array=[],$array_=null){
|
|
try{
|
|
$new_array=[];
|
|
if(gettype($array_)=='string'){
|
|
foreach($array as $val){
|
|
$k=strtolower($name.'_'.str_replace("-","_",str_replace(" ","_",$val)));
|
|
$new_array[$k]=$array_==$val?$array_:'';
|
|
}
|
|
}
|
|
else if(gettype($array_)=='array'){
|
|
foreach($array as $val){
|
|
$k=strtolower($name.'_'.str_replace("-","_",str_replace(" ","_",$val)));
|
|
$new_array[$k]=in_array($val,$array_)?$val:'';
|
|
}
|
|
}
|
|
return $new_array;
|
|
}
|
|
catch(Exception $e){
|
|
$getMsg="CproForms_model - hms_helper_create_keys_values_pair: ".$e->getMessage();
|
|
echo $getMsg;
|
|
}
|
|
}
|
|
|
|
function get_data_nursing_assessment_page_one($patient_id, $schedule_id)
|
|
{
|
|
$reportData = $this->getPatientReport($patient_id, $schedule_id);
|
|
$patient_data = $this->getPatientById($patient_id);
|
|
$insdata = $this->getWherevalueInsInfo($patient_id)[0];
|
|
$relation_data = $this->getRelation($insdata->emgContactRelation)[0];
|
|
$emg_name = $insdata->emgContactFirstName.' '.$insdata->emgContactLastName;
|
|
$emg_phone = $insdata->emgContactOteNo;
|
|
$emg_relation = $relation_data->name;
|
|
$neuro_eent = $this->objectToArray(json_decode($reportData->neuro_eent));
|
|
$vital_signs = $this->objectToArray(json_decode($reportData->vital_signs));
|
|
$curdiovascular = $this->objectToArray(json_decode($reportData->curdiovascular));
|
|
$psycho_social = $this->objectToArray(json_decode($reportData->psycho_social));
|
|
$intake_sheet = $this->objectToArray(json_decode($reportData->intake_sheet));
|
|
$curdiovascular = $this->objectToArray(json_decode($reportData->curdiovascular));
|
|
$integument = $this->objectToArray(json_decode($reportData->integument));
|
|
$dme_supplies = $this->objectToArray(json_decode($reportData->dme_supplies));
|
|
$medication = $this->objectToArray(json_decode($reportData->medication));
|
|
$gi_gu_reproductive = $this->objectToArray(json_decode($reportData->gi_gu_reproductive));
|
|
$paraprofessional_supervission = $this->objectToArray(json_decode($reportData->paraprofessional_supervission));
|
|
$nutrition = $this->objectToArray(json_decode($reportData->nutrition));
|
|
$visit_info = $this->objectToArray(json_decode($reportData->visit_info));
|
|
|
|
$psychosocial = isset($psycho_social['psychosocial']) ? $psycho_social['psychosocial'] : [];
|
|
$behavior = isset($neuro_eent['BEHAVIOR']) ? $neuro_eent['BEHAVIOR'] : [];
|
|
$communication_manner = isset($neuro_eent['communication_manner']) ? $neuro_eent['communication_manner'] : [];
|
|
$neurological = isset($neuro_eent['Neurological']) ? $neuro_eent['Neurological'] : [];
|
|
$eyes = isset($neuro_eent['Eyes']) ? $neuro_eent['Eyes'] : [];
|
|
$vision = isset($neuro_eent['Vision']) ? $neuro_eent['Vision'] : [];
|
|
$nose = isset($neuro_eent['Nose']) ? $neuro_eent['Nose'] : [];
|
|
$ears = isset($neuro_eent['Ears']) ? $neuro_eent['Ears'] : [];
|
|
$throat_mouth = isset($neuro_eent['Throat_Mouth']) ? $neuro_eent['Throat_Mouth'] : [];
|
|
|
|
$visit_date = isset($visit_info['visit_date']) ? $visit_info['visit_date'] : '';
|
|
$visit_year = '';
|
|
$visit_month = '';
|
|
$visit_day = '';
|
|
if($visit_date != '')
|
|
{
|
|
$visit_year = $newDate = date("Y", strtotime($visit_date));;
|
|
$visit_month = $newDate = date("m", strtotime($visit_date));;
|
|
$visit_day = $newDate = date("d", strtotime($visit_date));;
|
|
}
|
|
$address = $this->objectToArray(json_decode($patient_data->address));
|
|
$p_address='';
|
|
if(is_array($address) && $address != '')
|
|
{
|
|
$p_address = $address['address'].', '.$address['Apartment'].', '.$address['City'].', '.$address['State'].', '.$address['Zipcode'].', '.$address['County'];
|
|
}
|
|
$nursing_assessment_page_one_data=[
|
|
"psychosocial_initial"=> in_array('Initial', $psychosocial),
|
|
"psychosocial_reassessment"=> in_array('Reassessment', $psychosocial),
|
|
"visit_year"=>$visit_year,
|
|
"visit_month"=>$visit_month,
|
|
"visit_day"=>$visit_day,
|
|
"visit_date"=>$visit_year.'/'.$visit_month.'/'.$visit_day,
|
|
"patient_name"=> $patient_data->first_name.' '.$patient_data->last_name,
|
|
"dob"=> isset($patient_data->dob) ? $patient_data->dob : '',
|
|
"gender"=> isset($patient_data->gender)? $patient_data->gender : '',
|
|
"patient_id"=> isset($patient_id)? $patient_id : '',
|
|
"address"=> isset($p_address)? $p_address : '',
|
|
"patient_phone"=> isset($patient_data->telephone)? $patient_data->telephone : '',
|
|
"phone_fax"=> isset($patient_data->cellphone)? $patient_data->cellphone : '',
|
|
"primary_md"=> isset($intake_sheet['primary_md']) ? $intake_sheet['primary_md'] : '',
|
|
"primary_md_address"=> isset($intake_sheet['primary_md_address']) ? $intake_sheet['primary_md_address'] : '',
|
|
"primary_diagnosis"=> isset($intake_sheet['primary_diagnosis']) ? $intake_sheet['primary_diagnosis'] : '',
|
|
"secondary_diagnosis"=> isset($intake_sheet['secondary_diagnosis']) ? $intake_sheet['secondary_diagnosis'] : '',
|
|
"past_medical_history"=> isset($visit_info['Past_medical_history_note_box']) ? $visit_info['Past_medical_history_note_box']: '',
|
|
"hospitalizations_within_6_month"=> isset($intake_sheet['hospitalizations_within_6_month']) ? $intake_sheet['hospitalizations_within_6_month'] : '',
|
|
"allergies"=> $intake_sheet['list_allergies'] == '' ? 'No':'Yes',
|
|
"list_allergies"=> isset($intake_sheet['list_allergies']) ? $intake_sheet['list_allergies'] : '',
|
|
"immunizations_current"=> isset($intake_sheet['immunizations_current']) ? $intake_sheet['immunizations_current'] : '',
|
|
"influenza"=> isset($intake_sheet['influenza']) ? $intake_sheet['influenza'] : '',
|
|
"influenza_reason"=> isset($intake_sheet['influenza_reason']) ? $intake_sheet['influenza_reason'] : '',
|
|
"pneumococcal_vaccine"=> isset($intake_sheet['pneumococcal_vaccine']) ? $intake_sheet['pneumococcal_vaccine'] : '',
|
|
"pneumococcal_vaccine_reason"=> isset($intake_sheet['pneumococcal_vaccine_reason']) ? $intake_sheet['pneumococcal_vaccine_reason'] : '',
|
|
"in_case_emergency"=> isset($intake_sheet['in_case_emergency']) ? $intake_sheet['in_case_emergency'] : '',
|
|
"advanced_directives_in_place"=> isset($intake_sheet['advanced_directives_in_place']) ? $intake_sheet['advanced_directives_in_place'] : '',
|
|
"indicate"=> isset($intake_sheet['indicate']) ? $intake_sheet['indicate'] : '',
|
|
"copy_obtained"=> isset($intake_sheet['copy_obtained']) ? $intake_sheet['copy_obtained'] : '',
|
|
"copy_requested"=> isset($intake_sheet['copy_requested']) ? $intake_sheet['copy_requested'] : '',
|
|
"emergency_name"=> isset($emg_name) ? $emg_name : '',
|
|
"emergency_relation"=> isset($emg_relation) ? $emg_relation : '',
|
|
"emergency_phone"=> isset($emg_phone) ? $emg_phone : '',
|
|
"has_keys"=> isset($intake_sheet['has_keys']) ? $intake_sheet['has_keys'] : '',
|
|
"economic_functioning"=> isset($psycho_social['economic_functioning']) ? $psycho_social['economic_functioning'] : '',
|
|
"cultural_religion_background"=> isset($psycho_social['cultural_religion_background']) ? $psycho_social['cultural_religion_background'] : '',
|
|
"martial_status"=> isset($psycho_social['martial_status']) ? $psycho_social['martial_status'] : '',
|
|
"attend_adult_daycare_center"=> isset($psycho_social['attend_adult_daycare_center']) ? $psycho_social['attend_adult_daycare_center'] : '',
|
|
"day_hour"=> isset($psycho_social['day_hour']) ? $psycho_social['day_hour'] : '',
|
|
"social_peer_group"=> isset($psycho_social['social_peer_group']) ? $psycho_social['social_peer_group'] : '',
|
|
"patient_smoke"=> isset($psycho_social['patient_smoke']) ? $psycho_social['patient_smoke'] : '',
|
|
"smoke_frequency_per_day"=> isset($psycho_social['smoke_frequency_per_day']) ? $psycho_social['smoke_frequency_per_day'] : '',
|
|
"patient_alcoholic"=> isset($psycho_social['patient_alcoholic']) ? $psycho_social['patient_alcoholic'] : '',
|
|
"drink_frequency_per_day"=> isset($psycho_social['drink_frequency_per_day']) ? $psycho_social['drink_frequency_per_day'] : '',
|
|
"drink_frequency_per_week"=> isset($psycho_social['drink_frequency_per_week']) ? $psycho_social['drink_frequency_per_week'] : '',
|
|
"other_drug_use"=> isset($psycho_social['other_drug_use']) ? $psycho_social['other_drug_use'] : '',
|
|
"history_chemical_dependency"=> isset($psycho_social['history_chemical_dependency']) ? $psycho_social['history_chemical_dependency'] : '',
|
|
"ss_possible_abuse_neglect"=> isset($psycho_social['ss_possible_abuse_neglect']) ? $psycho_social['ss_possible_abuse_neglect'] : '',
|
|
"being_sad_depressed_hopeless"=> isset($psycho_social['being_sad_depressed_hopeless']) ? $psycho_social['being_sad_depressed_hopeless'] : '',
|
|
"little_interest_or_pleasure"=> isset($psycho_social['little_interest_or_pleasure']) ? $psycho_social['little_interest_or_pleasure'] : '',
|
|
"2week_score"=> isset($psycho_social['2week_score']) ? $psycho_social['2week_score'] : '',
|
|
"lives_with"=> isset($neuro_eent['Lives with']) ? $neuro_eent['Lives with'] : '',
|
|
"lives"=> isset($neuro_eent['Lives with']) ? 'no' : 'yes',
|
|
"temperature"=> isset($curdiovascular['Temperature']) ? $curdiovascular['Temperature'] : '',
|
|
"vital_sign_temparature_2"=> isset($vital_signs['vital_sign_temparature_2']) ? $vital_signs['vital_sign_temparature_2'] : '',
|
|
"respiration_rate"=> isset($vital_signs['respiration_rate']) ? $vital_signs['respiration_rate'] : '',
|
|
"blood_glucose"=> isset($vital_signs['blood_glucose']) ? $vital_signs['blood_glucose'] : '',
|
|
"pulse_rythm"=> isset($vital_signs['pulse_rythm']) ? $vital_signs['pulse_rythm'] : '',
|
|
"blood_pressure"=> isset($vital_signs['blood_pressure']) ? $vital_signs['blood_pressure'] : '',
|
|
"blood_pressure_measured_hand"=> isset($vital_signs['blood_pressure_measured_hand']) ? $vital_signs['blood_pressure_measured_hand'] : '',
|
|
"blood_pressure_measured_position"=> isset($vital_signs['blood_pressure_measured_position']) ? $vital_signs['blood_pressure_measured_position'] : '',
|
|
"level_of_consciousness"=> isset($neuro_eent['level_of_consciousness']) ? $neuro_eent['level_of_consciousness'] : '',
|
|
"behavior_cooperative"=> in_array('Cooperative', $behavior),
|
|
"behavior_agitated"=> in_array('Agitated', $behavior),
|
|
"behavior_aggressive"=> in_array('Aggressive', $behavior),
|
|
"behavior_anxious"=> in_array('Anxious', $behavior),
|
|
"behavior_depressed"=> in_array('Depressed', $behavior),
|
|
"behavior_withdrawn"=> in_array('Withdrawn', $behavior),
|
|
"communication_english"=> in_array('english', $communication_manner),
|
|
"communication_other"=> in_array('other', $communication_manner),
|
|
"communication_sign"=> in_array('sign', $communication_manner),
|
|
"communication_abnormal"=> in_array('abnormal', $communication_manner),
|
|
"communication_manner_other_languages"=> isset($neuro_eent['communication_manner_other_languages']) ? $neuro_eent['communication_manner_other_languages'] : '',
|
|
"abnormal_speech_type"=> isset($neuro_eent['abnormal_speech_type']) ? $neuro_eent['abnormal_speech_type'] : '',
|
|
"abnormal_speech_type_other"=> isset($neuro_eent['abnormal_speech_type_other']) ? $neuro_eent['abnormal_speech_type_other'] : '',
|
|
"neurological_no_symptoms"=> in_array('no-symptoms', $neurological),
|
|
"neurological_dizziness"=> in_array('dizziness', $neurological),
|
|
"neurological_vertigo"=> in_array('Vertigo', $neurological),
|
|
"neurological_seizures"=> in_array('Seizures', $neurological),
|
|
"neurological_tremors"=> in_array('Tremors', $neurological),
|
|
"neurological_migraine"=> in_array('Migraine Headache', $neurological),
|
|
"neurological_numbness_tingling"=> in_array('Numbness Tingling', $neurological),
|
|
"neurological_rue"=> in_array('rue', $neurological),
|
|
"neurological_rle"=> in_array('rle', $neurological),
|
|
"neurological_lue"=> in_array('lue', $neurological),
|
|
"neurological_lle"=> in_array('lle', $neurological),
|
|
"tremors"=> isset($neuro_eent['Tremors']) ? $neuro_eent['Tremors'] : '',
|
|
"sleeping_pattern"=> isset($neuro_eent['sleeping_pattern']) ? $neuro_eent['sleeping_pattern'] : '',
|
|
"functional_Limits"=> isset($neuro_eent['Functional_Limits']) ? $neuro_eent['Functional_Limits'] : '',
|
|
"slurred"=> isset($neuro_eent['Slurred']) ? $neuro_eent['Slurred'] : '',
|
|
"teaching_Provided"=> isset($neuro_eent['Teaching_Provided']) ? $neuro_eent['Teaching_Provided'] : '',
|
|
"teaching_Provided_To"=> isset($neuro_eent['Teaching_Provided_To']) ? $neuro_eent['Teaching_Provided_To'] : '',
|
|
"response_To_Teaching"=> isset($neuro_eent['Response_To_Teaching']) ? $neuro_eent['Response_To_Teaching'] : '',
|
|
"notes_one"=> isset($neuro_eent['notes_one']) ? $neuro_eent['notes_one'] : '',
|
|
"head"=> isset($neuro_eent['head']) ? $neuro_eent['head'] : '',
|
|
"eye_wnl"=> in_array('WNL', $eyes),
|
|
"eye_blurred_vision"=> in_array('Blurred Vision', $eyes),
|
|
"eye_blind"=> in_array('Blind', $eyes),
|
|
"eye_glaucoma"=> in_array('glaucoma', $eyes),
|
|
"eye_other"=> in_array('other', $eyes),
|
|
"vision_glasses"=> in_array('Glasses', $eyes),
|
|
"vision_contacts"=> in_array('Contacts', $eyes),
|
|
"ptosis"=> isset($neuro_eent['Ptosis']) ? $neuro_eent['Ptosis'] : '',
|
|
"recent_Ophthalmology_Appointment"=> isset($neuro_eent['Recent_Ophthalmology_Appointment']) ? $neuro_eent['Recent_Ophthalmology_Appointment'] : '',
|
|
"ears_wnl"=> in_array('WNL', $ears),
|
|
"ears_hearing_aid"=> in_array('Hearing Aid', $ears),
|
|
"ears_diffilculty_hearing"=> in_array('Diffilculty Hearing', $ears),
|
|
"ears_deaf"=> in_array('Deaf', $ears),
|
|
"nose_wnl"=> in_array('WNL', $nose),
|
|
"nose_drainage"=> in_array('drainage', $nose),
|
|
"nose_congestion"=> in_array('Congestion', $nose),
|
|
"nose_loss_of_smell"=> in_array('loss-of-smell', $nose),
|
|
"nose_other"=> in_array('other', $nose),
|
|
"other"=> isset($neuro_eent['other']) ? $neuro_eent['other'] : '',
|
|
"mouth_wnl"=> in_array('WNL', $throat_mouth),
|
|
"mouth_dentures"=> in_array('Dentures', $throat_mouth),
|
|
"mouth_partial_dentures"=> in_array('partial-dentures', $throat_mouth),
|
|
"mouth_dont_fit_dentures"=> in_array('dont-fit-dentures', $throat_mouth),
|
|
"mouth_missing_teeth"=> in_array('missing-teeth', $throat_mouth),
|
|
"mouth_chewing_problems"=> in_array('chewing-problems', $throat_mouth),
|
|
"mouth_liaisons"=> in_array('liaisons', $throat_mouth),
|
|
"mouth_poor_oral_hygiene"=> in_array('poor-oral-hygiene', $throat_mouth),
|
|
"mouth_loss_of_teste"=> in_array('Loss of Taste', $throat_mouth),
|
|
"mouth_other"=> in_array('other', $throat_mouth)
|
|
];
|
|
return $nursing_assessment_page_one_data;
|
|
}
|
|
function get_data_nursing_assessment_page_two($patient_id, $schedule_id)
|
|
{
|
|
$reportData = $this->getPatientReport($patient_id, $schedule_id);
|
|
$patient_data = $this->getPatientById($patient_id);
|
|
|
|
$neuro_eent = $this->objectToArray(json_decode($reportData->neuro_eent));
|
|
$vital_signs = $this->objectToArray(json_decode($reportData->vital_signs));
|
|
$curdiovascular = $this->objectToArray(json_decode($reportData->curdiovascular));
|
|
$psycho_social = $this->objectToArray(json_decode($reportData->psycho_social));
|
|
$intake_sheet = $this->objectToArray(json_decode($reportData->intake_sheet));
|
|
$curdiovascular = $this->objectToArray(json_decode($reportData->curdiovascular));
|
|
$integument = $this->objectToArray(json_decode($reportData->integument));
|
|
$dme_supplies = $this->objectToArray(json_decode($reportData->dme_supplies));
|
|
$medication = $this->objectToArray(json_decode($reportData->medication));
|
|
$gi_gu_reproductive = $this->objectToArray(json_decode($reportData->gi_gu_reproductive));
|
|
$paraprofessional_supervission = $this->objectToArray(json_decode($reportData->paraprofessional_supervission));
|
|
$nutrition = $this->objectToArray(json_decode($reportData->nutrition));
|
|
$visit_info = $this->objectToArray(json_decode($reportData->visit_info));
|
|
$musculoskeletal_pv_pan = $this->objectToArray(json_decode($reportData->musculoskeletal_pv_pan));
|
|
|
|
$psychosocial = isset($psycho_social['psychosocial']) ? $psycho_social['psychosocial'] : [];
|
|
$behavior = isset($neuro_eent['BEHAVIOR']) ? $neuro_eent['BEHAVIOR'] : [];
|
|
$communication_manner = isset($neuro_eent['communication_manner']) ? $neuro_eent['communication_manner'] : [];
|
|
$neurological = isset($neuro_eent['Neurological']) ? $neuro_eent['Neurological'] : [];
|
|
$eyes = isset($neuro_eent['Eyes']) ? $neuro_eent['Eyes'] : [];
|
|
$vision = isset($neuro_eent['Vision']) ? $neuro_eent['Vision'] : [];
|
|
$nose = isset($neuro_eent['Nose']) ? $neuro_eent['Nose'] : [];
|
|
$ears = isset($neuro_eent['Ears']) ? $neuro_eent['Ears'] : [];
|
|
$throat_mouth = isset($neuro_eent['Throat_Mouth']) ? $neuro_eent['Throat_Mouth'] : [];
|
|
|
|
$visit_date = isset($visit_info['visit_date']) ? $visit_info['visit_date'] : '';
|
|
$visit_year = '';
|
|
$visit_month = '';
|
|
$visit_day = '';
|
|
if($visit_date != '')
|
|
{
|
|
$visit_year = $newDate = date("Y", strtotime($visit_date));;
|
|
$visit_month = $newDate = date("m", strtotime($visit_date));;
|
|
$visit_day = $newDate = date("d", strtotime($visit_date));;
|
|
}
|
|
|
|
$nursing_assessment_page_two=[
|
|
"patient_name"=> $patient_data->first_name.' '.$patient_data->last_name,
|
|
"today"=> date('Y/m/d'),
|
|
"heart"=> '',
|
|
"chest_pain_frequency"=> isset($curdiovascular['chest_pain_frequency']) ? $curdiovascular['chest_pain_frequency'] : '',
|
|
"chest_pain_duration"=> isset($curdiovascular['chest_pain_duration']) ? $curdiovascular['chest_pain_duration'] : '',
|
|
"associated_with_activity"=> isset($curdiovascular['associated_with_activity']) ? $curdiovascular['associated_with_activity'] : '',
|
|
"measures_to_relieve"=> isset($curdiovascular['measures_to_relieve']) ? $curdiovascular['measures_to_relieve'] : '',
|
|
"fluid_restriction"=> isset($curdiovascular['fluid_restriction']) ? $curdiovascular['fluid_restriction'] : '',
|
|
"breathing"=> isset($curdiovascular['breathing']) ? $curdiovascular['breathing'] : '',
|
|
"lung_sounds"=> isset($curdiovascular['lung_sounds']) ? $curdiovascular['lung_sounds'] : '',
|
|
"anterior"=> isset($curdiovascular['Anterior']) ? $curdiovascular['Anterior'] : '',
|
|
"posterior"=> isset($curdiovascular['Posterior']) ? $curdiovascular['Posterior'] : '',
|
|
"cough"=> isset($curdiovascular['cough']) ? $curdiovascular['cough'] : '',
|
|
"sputum"=> isset($curdiovascular['sputum']) ? $curdiovascular['sputum'] : '',
|
|
"amount_type"=> isset($curdiovascular['amount_type']) ? $curdiovascular['amount_type'] : '',
|
|
"devices_used"=> isset($curdiovascular['devices_used']) ? $curdiovascular['devices_used'] : '',
|
|
"oxygen_l_per_min"=> isset($curdiovascular['oxygen_l_per_min']) ? $curdiovascular['oxygen_l_per_min'] : '',
|
|
"oxygen_frequency"=> isset($curdiovascular['oxygen_frequency']) ? $curdiovascular['oxygen_frequency'] : '',
|
|
"o2_saturation"=> isset($curdiovascular['o2_saturation']) ? $curdiovascular['o2_saturation'] : '',
|
|
"color"=> isset($curdiovascular['color']) ? $curdiovascular['color'] : '',
|
|
"temperature"=> isset($curdiovascular['Temperature']) ? $curdiovascular['Temperature'] : '',
|
|
"hydration"=> isset($integument['hydration']) ? $integument['hydration'] : '',
|
|
"turgor"=> isset($integument['Turgor']) ? $integument['Turgor'] : '',
|
|
"skin_potency"=> isset($integument['skin_potency']) ? $integument['skin_potency'] : '',
|
|
"location"=> isset($integument['location']) ? $integument['location'] : '',
|
|
"size_l_w_o"=> isset($integument['size_l_w_o']) ? $integument['size_l_w_o'] : '',
|
|
"describe"=> isset($integument['describe']) ? $integument['describe'] : '',
|
|
"others"=> isset($integument['others']) ? $integument['others'] : '',
|
|
"if_patient_is_getting_skilled_skin_treatments_indicate"=> isset($integument['if_patient_is_getting_skilled_skin_treatments_indicate']) ? $integument['if_patient_is_getting_skilled_skin_treatments_indicate'] : '',
|
|
"activity_mobility"=> isset($musculoskeletal_pv_pan['activity_mobility']) ? $musculoskeletal_pv_pan['activity_mobility'] : '',
|
|
"ambulation"=> isset($musculoskeletal_pv_pan['ambulation']) ? $musculoskeletal_pv_pan['ambulation'] : '',
|
|
"transfer"=> isset($musculoskeletal_pv_pan['transfer']) ? $musculoskeletal_pv_pan['transfer'] : '',
|
|
"devices"=> isset($musculoskeletal_pv_pan['devices']) ? $musculoskeletal_pv_pan['devices'] : '',
|
|
"contractures"=> isset($musculoskeletal_pv_pan['contractures']) ? $musculoskeletal_pv_pan['contractures'] : '',
|
|
"weakness"=> isset($musculoskeletal_pv_pan['weakness']) ? $integument['weakness'] : '',
|
|
"amputation"=> isset($musculoskeletal_pv_pan['amputation']) ? $musculoskeletal_pv_pan['amputation'] : '',
|
|
"paralysis"=> isset($musculoskeletal_pv_pan['paralysis']) ? $musculoskeletal_pv_pan['paralysis'] : ''
|
|
|
|
];
|
|
return $nursing_assessment_page_two;
|
|
}
|
|
|
|
function getPatientReport($pid,$schedule_id){
|
|
$this->db->where('patient_id', $pid);
|
|
$this->db->where('schedule_id', $schedule_id);
|
|
$query = $this->db->get('patient_report');
|
|
return $query->row();
|
|
}
|
|
function getPatientById($id){
|
|
$this->db->where('id', $id);
|
|
$query = $this->db->get('patient_details');
|
|
return $query->row();
|
|
}
|
|
function objectToArray($obj){
|
|
foreach($obj as $key=>$val){
|
|
// echo $key.'>'.$val;
|
|
$arr[$key]=$val;
|
|
|
|
}
|
|
return $arr;
|
|
}
|
|
function getRelation($id) {
|
|
$this->db->where('id', $id);
|
|
$query = $this->db->get('master_relations');
|
|
return $query->result();
|
|
}
|
|
function getPatientSignature($id) {
|
|
$this->db->where('patient_id', $id);
|
|
$query = $this->db->get('patient_md_order');
|
|
return $query->result();
|
|
}
|
|
function getWherevalueInsInfo($id){
|
|
$this->db->select('*');
|
|
$this->db->from('patient_payment_info p1');
|
|
$this->db->join('patient_insurance_info p2', 'p1.main_id = p2.main_id', 'left');
|
|
$this->db->where('p1.main_id', $id);
|
|
$query = $this->db->get();
|
|
return $query->result();
|
|
}
|
|
}
|
|
?>
|