119 lines
3.3 KiB
PHP
Executable File
119 lines
3.3 KiB
PHP
Executable File
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
class Assessment_model extends CI_model {
|
|
|
|
function __construct() {
|
|
parent::__construct();
|
|
$this->load->database();
|
|
|
|
}
|
|
|
|
function insertPatient($data) {
|
|
$this->db->insert('patient_details', $data);
|
|
return $this->db->insert_id();
|
|
}
|
|
function insertDesignate($data,$pid){
|
|
$this->db->where('id', $pid);
|
|
$this->db->update('patient_details', $data);
|
|
return 'phs2';
|
|
}
|
|
function insertServices($data,$pid){
|
|
$this->db->where('id', $pid);
|
|
$this->db->update('patient_details', $data);
|
|
return 'phs2';
|
|
}
|
|
function insertPatientInsurance($data) {
|
|
$this->db->insert('patient_insurance_info', $data);
|
|
return $this->db->insert_id();
|
|
}
|
|
/*get necessesary dropdown details*/
|
|
function getReferalSource() {
|
|
$query = $this->db->get('master_patient_ref');
|
|
return $query->result();
|
|
}
|
|
|
|
function getEleDep(){
|
|
$query = $this->db->get('master_ele_dependency');
|
|
return $query->result();
|
|
}
|
|
|
|
function getICD(){
|
|
$query = $this->db->get('master_icd');
|
|
return $query->result();
|
|
}
|
|
|
|
|
|
function getLevelService() {
|
|
$query = $this->db->get('master_level_of_service');
|
|
return $query->result();
|
|
}
|
|
|
|
function getServiceActivity() {
|
|
$query = $this->db->get('master_service_activity');
|
|
return $query->result();
|
|
}
|
|
|
|
function getTherapyType() {
|
|
$query = $this->db->get('master_therapytype');
|
|
return $query->result();
|
|
}
|
|
function getAccessType() {
|
|
$query = $this->db->get('master_access_type');
|
|
return $query->result();
|
|
}
|
|
|
|
function getTubeType() {
|
|
$query = $this->db->get('master_tubetype');
|
|
return $query->result();
|
|
}
|
|
/*get necessesary dropdown details end*/
|
|
|
|
function getWherevalue($id){
|
|
$this->db->where('id', $id);
|
|
$query = $this->db->get('patient_details');
|
|
return $query->result();
|
|
}
|
|
|
|
function saveInitialAssessment($data,$data2,$data3,$data4,$data5,$data6){
|
|
$this->db->insert('assessment', $data);
|
|
$main_id = $this->db->insert_id();
|
|
|
|
$data2['main_id'] = $main_id;
|
|
$this->db->insert('assessment_step2', $data2);
|
|
|
|
$data3['main_id'] = $main_id;
|
|
$this->db->insert('assessment_step3', $data3);
|
|
|
|
$data4['main_id'] = $main_id;
|
|
$this->db->insert('assessment_step4', $data4);
|
|
|
|
$data5['main_id'] = $main_id;
|
|
$this->db->insert('assessment_step5', $data5);
|
|
|
|
$data6['main_id'] = $main_id;
|
|
$this->db->insert('assessment_step6', $data6);
|
|
|
|
return $main_id;
|
|
}
|
|
|
|
function getWhereAssessment($id){
|
|
$this->db->select('*');
|
|
$this->db->from('assessment a1');
|
|
$this->db->join('assessment_step2 a2', 'a1.id = a2.main_id', 'left');
|
|
$this->db->join('assessment_step3 a3', 'a1.id = a3.main_id', 'left');
|
|
$this->db->join('assessment_step4 a4', 'a1.id = a4.main_id', 'left');
|
|
$this->db->join('assessment_step5 a5', 'a1.id = a5.main_id', 'left');
|
|
$this->db->join('assessment_step6 a6', 'a1.id = a6.main_id', 'left');
|
|
|
|
$this->db->where('a1.patient_id',$id);
|
|
$query = $this->db->get();
|
|
return $query->result();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/* for data table end */ |