2024-10-16 19:18:52 +05:30
< ? php include ( 'techsyn_header.php' ); ?>
<!-- Main Content Container for side bar and body -->
< div class = " main-container ace-save-state " id = " main-container " >
< script type = " text/javascript " >
try {
ace . settings . loadState ( 'main-container' )
} catch ( e ) {}
</ script >
< ? php include ( 'techsyn_sidebar.php' ); ?>
<!-- breadcrumb -->
< ? php
$current_month = date ( 'm' );
$current_year = date ( 'Y' );
$current_day = date ( 'd' );
?>
< div class = " main-content " >
< div class = " main-content-inner " >
< div class = " breadcrumbs ace-save-state " id = " breadcrumbs " >
< ul class = " breadcrumb " >
< li class = " active " > Reporting </ li >
< li class = " active " > Health Index Dashboard </ li >
</ ul >
<!-- End of breadcrumb -->
</ div >
< link rel = " stylesheet " href = " css/wizard.css " >
< script src = " js/Chart.min.js " ></ script >
< script src = " //code.jquery.com/jquery-1.12.0.min.js " ></ script >
< style type = " text/css " >
. hidden - radio {
position : absolute ;
top : 11 px ;
left : 27 px ;
width : 60 px ;
height : 60 px ;
border - radius : 100 % ;
background : #fff;
opacity : 0 ;
cursor : pointer ;
}
</ style >
<!-- < link href = " includes/css-js/admin.css " rel = " stylesheet " type = " text/css " /> -->
< style >
. btn {
background - color : #4CAF50;
border - radius : 5 % ;
/* Green */
border : none ;
color : white ;
padding : 5 px 8 px ;
text - align : center ;
text - decoration : none ;
display : inline - block ;
font - size : 12 px ;
margin : 4 px 2 px ;
cursor : pointer ;
}
body {
background - color : azure ;
}
@ media print {
#printPageButton {
display : none ;
}
}
. box {
margin - left : 0 % ;
margin - top : 0 % ;
display : flex ;
align - items : flex - start ;
justify - content : space - between ;
}
. box : first - child {
align - self : center ;
}
. td_head {
border - bottom : outset ;
/* width: 40%; */
text - align : center ;
font - weight : bold ;
background - color : #8080807a;
border - right - width : 10 px ;
padding : 10 px 0 ;
}
. td_data_risk {
border - bottom : outset ;
text - align : center ;
font - weight : bold ;
padding : 20 px 5 px 20 px 0 ;
/* width: 40%; */
/* color: aliceblue; */
margin - right : 10 px ;
background - color : #ff0000a1;
}
. td_data_mid {
border - bottom : outset ;
text - align : center ;
font - weight : bold ;
padding : 20 px 5 px 20 px 0 ;
/* color: aliceblue; */
margin - right : 10 px ;
background - color : #ffff00ba;
}
. td_data_low {
border - bottom : outset ;
text - align : center ;
font - weight : bold ;
padding : 20 px 5 px 20 px 0 ;
/* color: aliceblue; */
margin - right : 10 px ;
background - color : #00800094;
}
. td_head_risk {
border - bottom : outset ;
text - align : center ;
font - weight : bold ;
border - right - width : 10 px ;
padding : 10 px 0 ;
background - color : #ff0000a1;
}
. td_head_mid {
border - bottom : outset ;
text - align : center ;
font - weight : bold ;
border - right - width : 10 px ;
padding : 10 px 0 ;
background - color : #ffff00ba;
}
. td_head_low {
border - bottom : outset ;
text - align : center ;
font - weight : bold ;
border - right - width : 10 px ;
padding : 10 px 0 ;
background - color : #00800094;
}
. td_data {
border - bottom : outset ;
text - align : center ;
font - weight : bold ;
/* padding : 20 px 5 px 20 px 0 ;
width : 40 % ; */
background - color : #8080807a;
margin - right : 10 px ;
}
</ style >
< ? php
$twoyear = " select count(appointment_id) count from employee_appointment where appointment_type='O' and DATE(appointment_date) >= date(NOW()-INTERVAL 730 DAY) and ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' " ;
// error_log("row count:" . $twoyear);
$result_twoyear = mysqli_query ( $conn , $twoyear );
$row_twoyear = @ mysqli_fetch_array ( $result_twoyear );
?>
< div class = " page-content " style = " background-color: azure; " >
< h2 align = center
style = " border-bottom: 2px dotted black;margin-bottom: 0px;margin-top: 0px;background-color:bisque " >
< strong > OHC Software : Health Index
</ strong >
</ h2 >
< h5 align = center
style = " border-bottom: 2px dotted black;margin-bottom: 0px;margin-top: 0px;background-color:#379683; color:#fff " >
< strong >& nbsp ; Apply date 's to Health Index' s
</ strong >
</ h5 >
< form class = " page-content " method = 'post' id = " filter_report " align = 'right' style = " height:153px "
name = " filter_report " >
< div class = " col-sm-2 " >
< div class = " panel panel-warning card " >
< div class = " panel-heading " >
< h3 class = " panel-title center " > Start date </ h3 >
</ div >
< div class = " panel-body " >
< div class = " input-group " >
< input class = " form-control date-picker " style = " width:auto " id = " startDate "
name = " startDate " value = " <?= date('01-01-Y') ?> " type = " text "
data - date - format = " dd-mm-yyyy " />
</ div >
</ div >
</ div >
</ div >
< div class = " col-sm-2 " >
< div class = " panel panel-warning card " >
< div class = " panel-heading " >
< h3 class = " panel-title center " > End date </ h3 >
</ div >
< div class = " panel-body " >
< div class = " input-group " >
< input class = " form-control date-picker " style = " width:auto " id = " endDate "
name = " endDate " value = " <?= date('d-m-Y') ?> " type = " text "
data - date - format = " dd-mm-yyyy " />
</ div >
</ div >
</ div >
</ div >
< div class = " col-sm-2 container-fluid " style = " margin-top: 40px; " >
< button type = " button " class = " card " id = " mybtn " onclick = " getShowingData(); " > GO </ button >
</ div >
</ form >
< h3 style = " background-color:#0000ff6e;margin-top: 1px; " >
< strong style = " margin-left:8% " align = 'center' > Health Index
Formula </ strong >
</ h3 >
< div class = 'row' style = " height:280px ; " >
< table align = 'center' style = " width:50%;height:230px " >
< thead >
< td class = " td_head " >< span > Risk Factor </ span > </ td >
< td class = " td_head_risk " >< span > Hight Risk Score = 4 </ span > </ td >
< td class = " td_head_mid " >< span > Moderated Risk Score = 2 </ span > </ td >
< td class = " td_head_low " >< span > Low Risk Score = 0 </ span > </ td >
</ thead >
< tbody >
< tr >
< td class = " td_data " > BP </ td >
< td class = " td_data_risk " > > 140 / 90 </ td >
< td class = " td_data_mid " > 121 - 139 / 81 - 89 </ td >
< td class = " td_data_low " > > 120 / 80 or less </ td >
</ tr >
< tr >
< td class = " td_data " > DIABETES </ td >
< td class = " td_data_risk " > RBS + 200 Mg / Dl </ td >
< td class = " td_data_mid " > RBS140 - 199 Mg / Dl </ td >
< td class = " td_data_low " > RBS + 140 - 199 Mg / Dl </ td >
</ tr >
< tr >
< td class = " td_data " > CHOLESTROL </ td >
< td class = " td_data_risk " > > 240 Mg / Dl </ td >
< td class = " td_data_mid " > 200 - 239 Mg / Dl </ td >
< td class = " td_data_low " > RBS + 200 Mg / Dl </ td >
</ tr >
< tr >
< td class = " td_data " > BMI </ td >
< td class = " td_data_risk " > > 30 </ td >
< td class = " td_data_mid " > 25 - 30 </ td >
< td class = " td_data_low " > = 25 </ td >
</ tr >
</ tbody >
</ table >
</ div >
<!-- //////index from checkup form \\\ -->
< h3 align = 'center' style = " background-color:#0000ff6e;margin-bottom: 0px;margin-top: 1px; " >< span
style = " margin-left: 15px; " >
< strong > Total EHC Done </ strong >
</ span ></ h3 >
< h4 align = 'center' style = " background-color:#0000ff33 " >< strong > Health Index :< input type = 'text'
name = 'show_start_date' id = " show_start_date "
style = " background-color:#0000ff00 ;border:hidden;text-align:center " > to
< input type = 'text' name = 'show_end_date' id = " show_end_date "
style = " background-color:#0000ff00;border:hidden;text-align:center " >
EHC Report Reviwe For
< input type = 'text' name = 'total_checkup' id = " total_checkup "
style = " background-color:#0000ff00;border:hidden;text-align:center " >
</ strong ></ h4 >
< div class = " container-fluid " >
< div class = " row " >
< div class = " container-fluid " >
< ? php
$total_checkup = 0 ;
$start = date ( '01-01-Y' );
$end = date ( 'd-m-Y' );
$index_risk_car = 0 ;
$index_risk_pwt = 0 ;
$index_risk_corp = 0 ;
$index_mid_car = 0 ;
$index_mid_pwt = 0 ;
$index_mid_corp = 0 ;
$index_low_car = 0 ;
$index_low_pwt = 0 ;
$index_low_corp = 0 ;
error_log ( " fffttt " . $start );
$data = array ();
$date = array ();
$query = " SELECT checkup_id,checkup_date,c.valid_upto,c.health_index FROM checkup_form c left join patient_master p on c.emp_id=p.id WHERE DATE(checkup_date) between STR_TO_DATE(' " . $start . " ', '%d-%m-%Y') AND STR_TO_DATE(' " . $end . " ', '%d-%m-%Y') and p.bu_id='1' and c.checkup_type_id='25' and c.ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' " ;
error_log ( 'qqqq' . $query );
if ( ! $result = @ mysqli_query ( $conn , $query )) {
2024-11-02 18:03:13 +05:30
die ( mysqli_error ( $conn ));
2024-10-16 19:18:52 +05:30
}
if ( mysqli_num_rows ( $result ) > 0 ) {
while ( $row = @ mysqli_fetch_array ( $result )) {
if ( $row [ " health_index " ] == '2' ) $index_mid_corp ++ ;
else if ( $row [ " health_index " ] == '0' || $row [ " health_index " ] == '1' ) $index_low_corp ++ ;
else $index_risk_corp ++ ;
array_push ( $date , date ( 'd-m-Y' , strtotime ( $row [ " checkup_date " ])));
array_push ( $date , date ( 'd-m-Y' , strtotime ( $row [ " valid_upto " ])));
$total_checkup ++ ;
}
}
$query1 = " SELECT checkup_id,checkup_date,c.valid_upto,c.health_index FROM checkup_form c left join patient_master p on c.emp_id=p.id WHERE DATE(checkup_date) between STR_TO_DATE(' " . $start . " ', '%d-%m-%Y') AND STR_TO_DATE(' " . $end . " ', '%d-%m-%Y') and p.bu_id='2' and c.checkup_type_id='25' and c.ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' " ;
error_log ( 'mm' . $query1 ) ;
if ( ! $result1 = @ mysqli_query ( $conn , $query1 )) {
2024-11-02 18:03:13 +05:30
die ( mysqli_error ( $conn ));
2024-10-16 19:18:52 +05:30
}
if ( mysqli_num_rows ( $result1 ) > 0 ) {
while ( $row1 = @ mysqli_fetch_array ( $result1 )) {
if ( $row1 [ " health_index " ] == '2' ) $index_mid_pwt ++ ;
else if ( $row1 [ " health_index " ] == '0' || $row1 [ " health_index " ] == '1' ) $index_low_pwt ++ ;
else $index_risk_pwt ++ ;
array_push ( $date , date ( 'd-m-Y' , strtotime ( $row1 [ " checkup_date " ])));
array_push ( $date , date ( 'd-m-Y' , strtotime ( $row1 [ " valid_upto " ])));
$total_checkup ++ ;
}
}
$query2 = " SELECT checkup_id,checkup_date,c.valid_upto,c.health_index FROM checkup_form c left join patient_master p on c.emp_id=p.id WHERE DATE(checkup_date) between STR_TO_DATE(' " . $start . " ', '%d-%m-%Y') AND STR_TO_DATE(' " . $end . " ', '%d-%m-%Y') and p.bu_id='3' and c.checkup_type_id='25' and c.ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' " ;
error_log ( 'ww' . $query2 ) ;
if ( ! $result2 = @ mysqli_query ( $conn , $query2 )) {
2024-11-02 18:03:13 +05:30
die ( mysqli_error ( $conn ));
2024-10-16 19:18:52 +05:30
}
if ( mysqli_num_rows ( $result2 ) > 0 ) {
while ( $row2 = @ mysqli_fetch_array ( $result2 )) {
if ( $row2 [ " health_index " ] == '2' ) $index_mid_car ++ ;
else if ( $row2 [ " health_index " ] == '0' || $row2 [ " health_index " ] == '1' ) $index_low_car ++ ;
else $index_risk_car ++ ;
array_push ( $date , date ( 'd-m-Y' , strtotime ( $row2 [ " valid_upto " ])));
array_push ( $date , date ( 'd-m-Y' , strtotime ( $row2 [ " checkup_date " ])));
$total_checkup ++ ;
}
}
usort ( $date , function ( $a , $b ) {
$dateTimestamp1 = strtotime ( $a );
$dateTimestamp2 = strtotime ( $b );
return $dateTimestamp1 < $dateTimestamp2 ? - 1 : 1 ;
});
error_log ( " checkup date " . print_r (( $date ), true ));
$max_date = $date [ count ( $date ) - 1 ];
$min_date = $date [ 0 ];
?>
< table align = 'left' name = 'checkup_index_table' id = " checkup_index_table "
style = " width:48%;height:250px " >
< thead >
< td class = " td_head " >< span > Risk Factor </ span > </ td >
< td class = " td_head_risk " >< span > Hight Risk Score = 4 </ span > </ td >
< td class = " td_head_mid " >< span > Moderated Risk Score = 2 </ span > </ td >
< td class = " td_head_low " >< span > Low Risk Score = 0 </ span > </ td >
</ thead >
< tbody >
< tr >
< td class = " td_data " > Corporate </ td >
< td class = " td_data_risk " > < ? = $index_risk_corp ?> </td>
< td class = " td_data_mid " > < ? = $index_mid_corp ?> </td>
< td class = " td_data_low " > < ? = $index_low_corp ?> </td>
</ tr >
< tr >
< td class = " td_data " > PWT </ td >
< td class = " td_data_risk " > < ? = $index_risk_pwt ?> </td>
< td class = " td_data_mid " > < ? = $index_mid_pwt ?> </td>
< td class = " td_data_low " > < ? = $index_low_pwt ?> </td>
</ tr >
< tr >
< td class = " td_data " > Car </ td >
< td class = " td_data_risk " >< ? = $index_risk_car ?> </td>
< td class = " td_data_mid " >< ? = $index_mid_car ?> </td>
< td class = " td_data_low " > < ? = $index_low_car ?> </td>
</ tr >
</ tbody >
</ table >
< div class = " col-sm-6 container-fluid " style = " padding-left: 20px; " >
< canvas id = " heath_index_checkup " name = 'heath_index_checkup' ></ canvas >
</ div >
</ div >
</ div >
</ div >
<!-- index from opd -->
< h4 align = 'center' style = " background-color:#0000ff33 " >< strong > Health Index Formula :< input type = 'text'
name = 'show_min_date' id = " show_min_date "
style = " background-color:#0000ff00 ;border:hidden;text-align:center " > to
< input type = 'text' name = 'show_max_date' id = " show_max_date "
style = " background-color:#0000ff00;border:hidden;text-align:center " >
2 nd Follow up
< input type = 'text' name = 'total_followup' id = " total_followup "
style = " background-color:#0000ff00;border:hidden;text-align:center " >
</ strong ></ h4 >
< div class = " container-fluid " >
< div class = " row " >
< div class = " container-fluid " >
< ? php
$total_followup = 0 ;
$start1 = $min_date ;
$end1 = $max_date ;
$index_risk_car1 = 0 ;
$index_risk_pwt1 = 0 ;
$index_risk_corp1 = 0 ;
$index_mid_car1 = 0 ;
$index_mid_pwt1 = 0 ;
$index_mid_corp1 = 0 ;
$index_low_car1 = 0 ;
$index_low_pwt1 = 0 ;
$index_low_corp1 = 0 ;
error_log ( " fffttt1 " . $start1 );
$data1 = array ();
$query_opd = " SELECT appointment_id,appointment_date ,c.health_index FROM employee_appointment c left join patient_master p on c.emp_id=p.id WHERE DATE(appointment_date) between STR_TO_DATE(' " . $start1 . " ', '%d-%m-%Y') AND STR_TO_DATE(' " . $end1 . " ', '%d-%m-%Y') and p.bu_id='1' and c.case_type='EFUP' and c.ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' " ;
error_log ( 'qqqq_opd' . $query_opd );
if ( ! $result_opd = @ mysqli_query ( $conn , $query_opd )) {
2024-11-02 18:03:13 +05:30
die ( mysqli_error ( $conn ));
2024-10-16 19:18:52 +05:30
}
if ( mysqli_num_rows ( $result_opd ) > 0 ) {
while ( $row_opd = @ mysqli_fetch_array ( $result_opd )) {
if ( $row_opd [ " health_index " ] == '2' ) $index_mid_corp1 ++ ;
else if ( $row_opd [ " health_index " ] == '0' || $row_opd [ " health_index " ] == '1' ) $index_low_corp1 ++ ;
else $index_risk_corp1 ++ ;
$total_followup ++ ;
}
}
$query1_opd = " SELECT appointment_id,appointment_date ,c.health_index FROM employee_appointment c left join patient_master p on c.emp_id=p.id WHERE DATE(appointment_date) between STR_TO_DATE(' " . $start1 . " ', '%d-%m-%Y') AND STR_TO_DATE(' " . $end1 . " ', '%d-%m-%Y') and p.bu_id='2' and c.case_type='EFUP' and c.ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' " ;
error_log ( 'mm_opd' . $query1_opd ) ;
if ( ! $result1_opd = @ mysqli_query ( $conn , $query1_opd )) {
2024-11-02 18:03:13 +05:30
die ( mysqli_error ( $conn ));
2024-10-16 19:18:52 +05:30
}
if ( mysqli_num_rows ( $result1_opd ) > 0 ) {
while ( $row1_opd = @ mysqli_fetch_array ( $result1_opd )) {
if ( $row1_opd [ " health_index " ] == '2' ) $index_mid_pwt1 ++ ;
else if ( $row1_opd [ " health_index " ] == '0' || $row1_opd [ " health_index " ] == '1' ) $index_low_pwt1 ++ ;
else $index_risk_pwt1 ++ ;
$total_followup ++ ;
}
}
$query2_opd = " SELECT appointment_id,appointment_date ,c.health_index FROM employee_appointment c left join patient_master p on c.emp_id=p.id WHERE DATE(appointment_date) between STR_TO_DATE(' " . $start . " ', '%d-%m-%Y') AND STR_TO_DATE(' " . $end . " ', '%d-%m-%Y') and p.bu_id='3' and c.case_type='EFUP' and c.ohc_type_id=' " . $_SESSION [ 'current_ohcttype' ] . " ' " ;
error_log ( 'ww_opd' . $query2_opd ) ;
if ( ! $result2_opd = @ mysqli_query ( $conn , $query2_opd )) {
2024-11-02 18:03:13 +05:30
die ( mysqli_error ( $conn ));
2024-10-16 19:18:52 +05:30
}
if ( mysqli_num_rows ( $result2_opd ) > 0 ) {
while ( $row2_opd = @ mysqli_fetch_array ( $result2_opd )) {
if ( $row2_opd [ " health_index " ] == '2' ) $index_mid_car1 ++ ;
else if ( $row2_opd [ " health_index " ] == '0' || $row2_opd [ " health_index " ] == '1' ) $index_low_car1 ++ ;
else $index_risk_car1 ++ ;
$total_followup ++ ;
}
}
?>
< table align = 'left' name = 'followup_index_table' id = " followup_index_table "
style = " width:48%;height:250px " >
< thead >
< td class = " td_head " >< span > Risk Factor </ span > </ td >
< td class = " td_head_risk " >< span > Hight Risk Score = 4 </ span > </ td >
< td class = " td_head_mid " >< span > Moderated Risk Score = 2 </ span > </ td >
< td class = " td_head_low " >< span > Low Risk Score = 0 </ span > </ td >
</ thead >
< tbody >
< tr >
< td class = " td_data " > Corporate </ td >
< td class = " td_data_risk " > < ? = $index_risk_corp1 ?> </td>
< td class = " td_data_mid " > < ? = $index_mid_corp1 ?> </td>
< td class = " td_data_low " > < ? = $index_low_corp1 ?> </td>
</ tr >
< tr >
< td class = " td_data " > PWT </ td >
< td class = " td_data_risk " > < ? = $index_risk_pwt1 ?> </td>
< td class = " td_data_mid " > < ? = $index_mid_pwt1 ?> </td>
< td class = " td_data_low " > < ? = $index_low_pwt1 ?> </td>
</ tr >
< tr >
< td class = " td_data " > Car </ td >
< td class = " td_data_risk " >< ? = $index_risk_car1 ?> </td>
< td class = " td_data_mid " >< ? = $index_mid_car1 ?> </td>
< td class = " td_data_low " > < ? = $index_low_car1 ?> </td>
</ tr >
</ tbody >
</ table >
< div class = " col-sm-6 container-fluid " style = " padding-left: 20px; " >
< canvas id = " heath_index_followup " name = 'heath_index_followup' ></ canvas >
</ div >
</ div >
</ div >
</ div >
</ div >
</ div >
</ div >
< ? php include ( 'techsyn_footer.php' ); ?>
< style >
. outer - container {
background : #F0F0F0;
border : #e0dfdf 1px solid;
padding : 40 px 20 px ;
border - radius : 2 px ;
}
. btn - submit {
background : #333;
border : #1d1d1d 1px solid;
border - radius : 2 px ;
color : #f0f0f0;
cursor : pointer ;
padding : 5 px 20 px ;
font - size : 0.9 em ;
}
. tutorial - table {
margin - top : 40 px ;
font - size : 0.8 em ;
border - collapse : collapse ;
width : 100 % ;
}
. tutorial - table th {
background : #f0f0f0;
border - bottom : 1 px solid #dddddd;
padding : 8 px ;
text - align : left ;
}
. tutorial - table td {
background : #FFF;
border - bottom : 1 px solid #dddddd;
padding : 8 px ;
text - align : left ;
}
#response {
padding : 10 px ;
margin - top : 10 px ;
border - radius : 2 px ;
display : none ;
}
. success {
background : #c7efd9;
border : #bbe2cd 1px solid;
}
. error {
background : #fbcfcf;
border : #f3c6c7 1px solid;
}
div #response.display-block {
display : block ;
}
. input - group - addon {
height : 25 px ;
width : 30 px ;
padding : 0 px 0 px ;
}
</ style >
< script >
function getShowingData () {
var start = $ ( " #startDate " ) . val ();
var end = $ ( " #endDate " ) . val ();
var total_checkup = '<?= $total_checkup ?>' ;
var max_date = '<?=$max_date?>' ;
var min_date = '<?=$min_date?>' ;
var total_followup = '<?= $total_followup ?>' ;
$ ( '#show_start_date' ) . val ( start );
$ ( '#show_end_date' ) . val ( end );
$ ( '#total_checkup' ) . val ( total_checkup );
$ ( '#show_max_date' ) . val ( max_date );
$ ( '#show_min_date' ) . val ( min_date );
$ ( '#total_followup' ) . val ( total_followup );
$ . ajax ({
url : 'filter_health_index_deshboard.php' ,
data : {
start : start ,
end : end ,
max_date : max_date ,
min_date : min_date ,
},
type : 'POST' ,
dataType : 'json' ,
success : function ( data ) {
//alert(data);
$ ( '#total_checkup' ) . val ( data [ 'total_checkup' ]);
$ ( '#total_followup' ) . val ( data [ 'total_followup' ]);
$ ( '#show_max_date' ) . val ( data [ 'max_date' ]);
$ ( '#show_min_date' ) . val ( data [ 'min_date' ]);
var car_risk = data [ 'car_risk' ];
var car_mid = data [ 'car_mid' ];
var car_low = data [ 'car_low' ];
var corp_risk = data [ 'corp_risk' ];
var corp_mid = data [ 'corp_mid' ];
var corp_low = data [ 'corp_low' ];
var pwt_risk = data [ 'pwt_risk' ];
var pwt_mid = data [ 'pwt_mid' ];
var pwt_low = data [ 'pwt_low' ];
var content = '' ;
content +=
" <thead><td class='td_head'><span>Risk Factor</span> </td><td class='td_head_risk'><span> Hight Risk Score=4</span> </td><td class='td_head_mid'><span> Moderated Risk Score=2</span> </td><td class='td_head_low'><span> Low Risk Score=0</span> </td></thead> <tbody ><tr><td class = 'td_data'> Corporate </td> <td class = 'td_data_risk'> " +
corp_risk + " </td> <td class = 'td_data_mid'> " + corp_mid +
" </td><td class = 'td_data_low'> " +
corp_low +
" </td> </tr> <tr><td class = 'td_data'> PWT </td> <td class = 'td_data_risk'> " +
pwt_risk + " </td> <td class = 'td_data_mid'> " +
pwt_mid + " </td> <td class = 'td_data_low'> " +
pwt_low +
" </td> </tr><tr><td class = 'td_data'> Car </td> <td class = 'td_data_risk'> " +
car_risk + " </td> <td class = 'td_data_mid'> " +
car_mid + " </td><td class = 'td_data_low'> " +
car_low + " </td> </tr></tbody> " ;
$ ( " #checkup_index_table " ) . html ( content );
//opd and injury followup data//
var car_risk_opd = data [ 'car_risk_opd' ];
var car_mid_opd = data [ 'car_mid_opd' ];
var car_low_opd = data [ 'car_low_opd' ];
var corp_risk_opd = data [ 'corp_risk_opd' ];
var corp_mid_opd = data [ 'corp_mid_opd' ];
var corp_low_opd = data [ 'corp_low_opd' ];
var pwt_risk_opd = data [ 'pwt_risk_opd' ];
var pwt_mid_opd = data [ 'pwt_mid_opd' ];
var pwt_low_opd = data [ 'pwt_low_opd' ];
var content_opd = '' ;
content_opd +=
" <thead><td class='td_head'><span>Risk Factor</span> </td><td class='td_head_risk'><span> Hight Risk Score=4</span> </td><td class='td_head_mid'><span> Moderated Risk Score=2</span> </td><td class='td_head_low'><span> Low Risk Score=0</span> </td></thead> <tbody ><tr><td class = 'td_data'> Corporate </td> <td class = 'td_data_risk'> " +
corp_risk_opd + " </td> <td class = 'td_data_mid'> " + corp_mid_opd +
" </td><td class = 'td_data_low'> " +
corp_low_opd +
" </td> </tr> <tr><td class = 'td_data'> PWT </td> <td class = 'td_data_risk'> " +
pwt_risk_opd + " </td> <td class = 'td_data_mid'> " +
pwt_mid_opd + " </td> <td class = 'td_data_low'> " +
pwt_low_opd +
" </td> </tr><tr><td class = 'td_data'> Car </td> <td class = 'td_data_risk'> " +
car_risk_opd + " </td> <td class = 'td_data_mid'> " +
car_mid_opd + " </td><td class = 'td_data_low'> " +
car_low_opd + " </td> </tr></tbody> " ;
$ ( " #followup_index_table " ) . html ( content_opd );
//checkup chart
var xaxis_checkup_data = [];
xaxis_checkup_data . push ( corp_risk , pwt_risk , car_risk , corp_mid , pwt_mid , car_mid ,
corp_low , pwt_low , car_low );
var checkup_lable = [];
var score_risk = [];
var score_mid = [];
var score_low = [];
checkup_lable . push ( " Corporete " );
checkup_lable . push ( " PTW " );
checkup_lable . push ( " Car " );
for ( var i = 0 ; i < xaxis_checkup_data . length ; i ++ ) {
if ( i < 3 ) {
score_risk . push ( xaxis_checkup_data [ i ]);
} else if ( i < 6 && i > 2 ) {
score_mid . push ( xaxis_checkup_data [ i ]);
} else {
score_low . push ( xaxis_checkup_data [ i ]);
}
}
// alert(score_risk[2], score_mid[2], score_low[2]);
var chartdata = {
labels : checkup_lable ,
datasets : [{
label : 'Risk Health Index' ,
backgroundColor : '#ff0000a1' ,
borderColor : 'rgba(200, 200, 200, 0.75)' ,
data : score_risk ,
},
{
label : 'Moderated Health Index' ,
backgroundColor : '#ffff00ba' ,
borderColor : 'rgba(200, 200, 200, 0.75)' ,
data : score_mid ,
},
{
label : 'Low Health Index ' ,
backgroundColor : '#00800094' ,
borderColor : 'rgba(200, 200, 200, 0.75)' ,
data : score_low ,
}
]
};
var ctx = $ ( " #heath_index_checkup " );
var barGraph = new Chart ( ctx , {
type : 'bar' ,
data : chartdata
});
//followup chart
var xaxis_followup_data = [];
xaxis_followup_data . push ( corp_risk_opd , pwt_risk_opd , car_risk_opd , corp_mid_opd ,
pwt_mid_opd ,
car_mid_opd , corp_low_opd , pwt_low_opd , car_low_opd );
var followup_lable = [];
var score_risk_followup = [];
var score_mid_followup = [];
var score_low_followup = [];
followup_lable . push ( " Corporete " );
followup_lable . push ( " PTW " );
followup_lable . push ( " Car " );
for ( var i = 0 ; i < xaxis_followup_data . length ; i ++ ) {
if ( i < 3 ) {
score_risk_followup . push ( xaxis_followup_data [ i ]);
} else if ( i < 6 && i > 2 ) {
score_mid_followup . push ( xaxis_followup_data [ i ]);
} else {
score_low_followup . push ( xaxis_followup_data [ i ]);
}
}
// alert(score_risk[2], score_mid[2], score_low[2]);
var chartdatafollowup = {
labels : followup_lable ,
datasets : [{
label : 'Risk Health Index' ,
backgroundColor : '#ff0000a1' ,
borderColor : 'rgba(200, 200, 200, 0.75)' ,
data : score_risk_followup ,
},
{
label : 'Moderated Health Index' ,
backgroundColor : '#ffff00ba' ,
borderColor : 'rgba(200, 200, 200, 0.75)' ,
data : score_mid_followup ,
},
{
label : 'Low Health Index ' ,
backgroundColor : '#00800094' ,
borderColor : 'rgba(200, 200, 200, 0.75)' ,
data : score_low_followup ,
}
]
};
var ctx_followup = $ ( " #heath_index_followup " );
var barGraph_followup = new Chart ( ctx_followup , {
type : 'bar' ,
data : chartdatafollowup
});
BootstrapDialog . alert ( 'Health Indexes Between ' + start + ' and ' + end );
},
error : function ( data ) {
console . log ( data );
}
});
}
window . onload = getShowingData ();
</ script >