|
/**
|
|
************************************************************************************************************
|
|
|
|
* File Name : Dashboard.js *
|
|
* Version No : 1.0 *
|
|
* Project Code : HSG *
|
|
* Project Name : DCTC System for Wayanad *
|
|
* Product Name : *
|
|
* Module Name : Dashboard - (Appointment) *
|
|
* Purpose : js of all Dashboards *
|
|
* Author : Jiji *
|
|
* Revision History & Date of
|
|
* modifications of baseline
|
|
* versions : 22/03/2022 *
|
|
* Modified by whom and Reasons for
|
|
* modifications : *
|
|
|
|
************************************************************************************************************
|
|
|
|
**/
|
|
|
|
define('dashboard',['jqueryutils','datatables.net','datatable2','datatable3','datatable4','select2full','list_stroll','slim_stroll','main_Page',],function(utils,datatable1,datatable2,datatable3,datatable4,select2full,list_stroll,slim_stroll,mainPage){
|
|
|
|
var usession;
|
|
var created_patients;
|
|
var referred_patients
|
|
var total_patients;
|
|
usession = mainPage.returnSession();
|
|
var tabel;
|
|
var data;
|
|
var dataval;
|
|
var origin;
|
|
var ip_no;
|
|
|
|
//var count_emr_related = function(){
|
|
|
|
/*****************************For enable emr related dashboard************************************** /
|
|
if(usession.ShowEMRRelatedDashboard != ""){
|
|
$('#emrRelatedDashboard').attr('style','display:visible');
|
|
readCountofCreatedEMRs();
|
|
readCountofReferredEMRs();
|
|
}
|
|
/*****************************For enable emr related dashboard**************************************/
|
|
//}
|
|
|
|
//dctc
|
|
var init= function()
|
|
{
|
|
if(usession.PatientList ==""){
|
|
$('#emrRelatedDashboards').attr('style','display:none');
|
|
//$('#funduspath').attr('style','display:none');
|
|
}
|
|
/*fundus and cytopathology tables are visible*/
|
|
if(usession.PatientList !="" && usession.PatientListDCTC !=""){
|
|
|
|
loadAllEMRRegistrationsdctc(null,null);
|
|
$('#emrRelatedDashboards').attr('style','display:visible');
|
|
|
|
}
|
|
/* cytopathology table is visible*/
|
|
if(usession.PatientList !="" && usession.PatientListCytoPathology !=""){
|
|
loadAllEMRRegistrationsdctc(null,null);
|
|
$('#emrRelatedDashboards').attr('style','display:visible');
|
|
$('#funduspath').attr('style','display:none');
|
|
}
|
|
if(usession.PatientList !="" && usession.PatientListFundusPathology !=""){
|
|
loadfundusimgdctc();
|
|
$('#emrRelatedDashboards').attr('style','display:none');
|
|
$('#cytopath1').attr('style','display:none');
|
|
|
|
}
|
|
|
|
|
|
//total_emr();
|
|
/*========= stroll js start ========= */
|
|
'use strict';
|
|
$(document).ready(function() {
|
|
//alert('in das js')
|
|
stroll.bind('.scroll-list');
|
|
$("#dynamic-list-four-button, #dynamic-list-four-close").on("click", function() {
|
|
$("#dynamic-list-four-slider-wrap").toggleClass("open");
|
|
});
|
|
$("#dynamic-list-five-button").on("click", function() {
|
|
$(this)
|
|
.toggleClass("open")
|
|
.find(".details")
|
|
.slideToggle();
|
|
});
|
|
$("#dynamic-list-six-button").on("click", function() {
|
|
$("#dynamic-list-six-list").toggleClass("open");
|
|
$(this)
|
|
.toggleClass("open")
|
|
.find(".details")
|
|
.slideToggle();
|
|
});
|
|
var a = $(".cards").height();
|
|
$(".cards").slimScroll({
|
|
height: a,
|
|
allowPageScroll: false,
|
|
color: '#000'
|
|
});
|
|
var a = $(".wave").height();
|
|
$(".wave").slimScroll({
|
|
height: a,
|
|
allowPageScroll: false,
|
|
color: '#000'
|
|
});
|
|
var a = $(".flip").height();
|
|
$(".flip").slimScroll({
|
|
height: a,
|
|
allowPageScroll: false,
|
|
color: '#000'
|
|
});
|
|
var a = $(".helix").height();
|
|
$(".helix").slimScroll({
|
|
height: a,
|
|
allowPageScroll: false,
|
|
color: '#000'
|
|
});
|
|
var a = $(".fan").height();
|
|
$(".fan").slimScroll({
|
|
height: a,
|
|
allowPageScroll: false,
|
|
color: '#000'
|
|
});
|
|
var a = $(".twirl").height();
|
|
$(".twirl").slimScroll({
|
|
height: a,
|
|
allowPageScroll: false,
|
|
color: '#000'
|
|
});
|
|
|
|
|
|
$('#newemrpatientListdctc tbody').on('click', 'tr.group', function () {
|
|
var name = $(this).data('name');
|
|
$("."+name).toggleClass('change');
|
|
//table.draw(false);
|
|
});
|
|
|
|
|
|
});
|
|
/*========= stroll js end ========= */
|
|
/*========= dynamic list js start ========= */
|
|
;
|
|
(function(window) {
|
|
|
|
var
|
|
// Is Modernizr defined on the global scope
|
|
Modernizr = typeof Modernizr !== "undefined" ? Modernizr : false,
|
|
|
|
// Always expect both kinds of event
|
|
buttonPressedEvent = 'touchstart click',
|
|
|
|
// List of all animation/transition properties
|
|
// with its animationEnd/transitionEnd event
|
|
animationEndEventNames = {
|
|
'WebkitAnimation': 'webkitAnimationEnd',
|
|
'OAnimation': 'oAnimationEnd',
|
|
'msAnimation': 'MSAnimationEnd',
|
|
'animation': 'animationend'
|
|
},
|
|
transitionEndEventNames = {
|
|
'WebkitTransition': 'webkitTransitionEnd',
|
|
'OTransition': 'oTransitionEnd',
|
|
'msTransition': 'MSTransitionEnd',
|
|
'transition': 'transitionend'
|
|
},
|
|
|
|
Effeckt = function() {
|
|
this.init();
|
|
};
|
|
|
|
// Current version.
|
|
Effeckt.version = '0.0.1';
|
|
// Initialization method
|
|
Effeckt.prototype.init = function() {
|
|
this.buttonPressedEvent = buttonPressedEvent;
|
|
//event trigger after animation/transition end.
|
|
this.transitionEndEventName = Modernizr ? transitionEndEventNames[Modernizr.prefixed('transition')] : getTransitionEndEventNames();
|
|
this.animationEndEventName = Modernizr ? animationEndEventNames[Modernizr.prefixed('animation')] : getAnimationEndEventNames();
|
|
this.transitionAnimationEndEvent = this.animationEndEventName + ' ' + this.transitionEndEventName;
|
|
};
|
|
Effeckt.prototype.getViewportHeight = function() {
|
|
|
|
var docElement = document.documentElement,
|
|
client = docElement['clientHeight'],
|
|
inner = window['innerHeight'];
|
|
|
|
if (client < inner)
|
|
return inner;
|
|
else
|
|
return client;
|
|
};
|
|
// Get all the properties for transition/animation end
|
|
function getTransitionEndEventNames() {
|
|
return _getEndEventNames(transitionEndEventNames);
|
|
}
|
|
|
|
function getAnimationEndEventNames() {
|
|
return _getEndEventNames(animationEndEventNames);
|
|
}
|
|
|
|
function _getEndEventNames(obj) {
|
|
var events = [];
|
|
|
|
for (var eventName in obj) {
|
|
events.push(obj[eventName]);
|
|
}
|
|
return events.join(' ');
|
|
}
|
|
// Creates a Effeckt object.
|
|
/* window.Effeckt = new Effeckt();*/
|
|
|
|
})(this);
|
|
/*========= dynamic list js end ========*/
|
|
|
|
var arr = [];
|
|
var params = {};
|
|
params['hospital_id'] = arr;
|
|
var pdata = {};
|
|
pdata['data']= JSON.stringify(params);
|
|
/* comment: should not call from here... hospital id not passed screening hub not based on institution. */
|
|
utils.postData('../../Rest/insmanagementservice/getAllRegScreeningHubs',pdata,null,successLoadElements,errLoadElements);
|
|
}
|
|
|
|
|
|
|
|
function successLoadElements(result)
|
|
{
|
|
|
|
|
|
institutionJson = result["hospital_list"];
|
|
//alert(result["hospital_list"][0]['hospital_type']);
|
|
|
|
// console.log("successLoadElements: "+JSON.stringify(institutionJson));
|
|
//utils.loadComboWithJSONArrayInstitution('institute',institutionJson,'hospital_id','hospital_name');
|
|
utils.loadComboWithJSONArray('institute',institutionJson,'hospital_id','hospital_name');
|
|
if(usession.user_hospital_id !="")
|
|
{ $('#institute').val(usession.user_hospital_id).change(); }
|
|
//loadComboWithJSONArray
|
|
//readInstitutionsContent();
|
|
}
|
|
|
|
|
|
function errLoadElements(xhr, status, error)
|
|
{
|
|
console.log('status ' + status.toString());
|
|
alert('err ' + error);
|
|
}
|
|
|
|
function readInstitutionsContent(params)
|
|
{
|
|
//alert("A1");
|
|
$('#InstituteConfigurationID').attr('style','display:visible');
|
|
|
|
//console.log("readinstitutionsContent: "+JSON.stringify(institutionJson));
|
|
$('#newemrpatientListdctc').DataTable().clear().destroy();
|
|
|
|
|
|
//$("#changeableDiv").load("dashb/DasboardPHC.html");
|
|
for(i=0;i<institutionJson.length;i++)
|
|
{
|
|
//console.log("readinstitutions: "+JSON.stringify(institutionJson));
|
|
var params= {};
|
|
var institution=$('#institute').val();
|
|
|
|
if(institution!=""&& institution !=null) //institution is just a variable declaring here
|
|
{
|
|
|
|
params['hospital_id']=institution;
|
|
|
|
}
|
|
// alert("A2:"+institution+"aa:"+institutionJson[i]["hospital_id"]);
|
|
if(institution==institutionJson[i]["hospital_id"])
|
|
{
|
|
//alert("A3");
|
|
selInstitutionJson = institutionJson[i];
|
|
// console.log("selInstitutionJson@@@@@@@@@@@@@@ : "+JSON.stringify(selInstitutionJson));
|
|
var instId=institutionJson[i]['hospital_id'];
|
|
var instname =institutionJson[i]['hospital_name'];
|
|
if(instId!= "" && instId!='Null' && instId !='NULL' && instId!='undefined')
|
|
{
|
|
readCountdash(instId);
|
|
loadAllEMRRegistrationsdctc(instId,null);
|
|
}
|
|
else
|
|
{
|
|
alert(instname + ' Details not found ');
|
|
$("#changeableDiv").load("DasboardPHC.html");
|
|
}
|
|
|
|
// alert(institutionJson[i]['hospital_type']);
|
|
|
|
if(institutionJson[i]['hospital_type']=='SH'){
|
|
|
|
$('#div_camp').attr('style','display:visible');
|
|
|
|
var params = {};
|
|
params['hospital_id'] = instId;
|
|
var pdata = {};
|
|
pdata['data']= JSON.stringify(params);
|
|
utils.postData('../../Rest/insmanagementservice/getAllRegScreeningcamps',pdata,null,successLoadCampElements,errLoadElements);
|
|
|
|
}else{
|
|
$('#div_camp').attr('style','display:none');
|
|
}
|
|
}else if(institution==0){
|
|
$('#div_camp').attr('style','display:none');
|
|
}
|
|
}
|
|
|
|
}
|
|
function successLoadCampElements(result)
|
|
{
|
|
|
|
|
|
campJson = result["camp_list"];
|
|
//alert(result["hospital_list"][0]['hospital_type']);
|
|
|
|
// console.log("successLoadElements: "+JSON.stringify(institutionJson));
|
|
//utils.loadComboWithJSONArrayInstitution('institute',institutionJson,'hospital_id','hospital_name');
|
|
utils.loadComboWithJSONArray('camp_id',campJson,'camp_id','camp_place');
|
|
|
|
}
|
|
function readcampsContent(params)
|
|
{
|
|
|
|
$('#InstituteConfigurationID').attr('style','display:visible');
|
|
|
|
//console.log("readinstitutionsContent: "+JSON.stringify(institutionJson));
|
|
$('#newemrpatientListdctc').DataTable().clear().destroy();
|
|
//$("#changeableDiv").load("dashb/DasboardPHC.html");
|
|
for(i=0;i<institutionJson.length;i++)
|
|
{
|
|
//console.log("readinstitutions: "+JSON.stringify(institutionJson));
|
|
var params= {};
|
|
var institution=$('#institute').val();
|
|
var camp=$('#camp_id').val();
|
|
|
|
if(institution!=""&& institution !=null)
|
|
{
|
|
|
|
params['hospital_id']=institution;
|
|
|
|
}
|
|
/*if(camp!=""&& camp !=null)
|
|
{
|
|
|
|
params['camp_id']=camp;
|
|
|
|
}*/
|
|
|
|
/*if(camp==campJson[i]["camp_id"])
|
|
{
|
|
selCampJson = campJson[i];
|
|
// console.log("selInstitutionJson@@@@@@@@@@@@@@ : "+JSON.stringify(selInstitutionJson));
|
|
var campId=campJson[i]['camp_id'];
|
|
var camp_place =campJson[i]['camp_place'];*/
|
|
if(camp!= "" && camp!='Null' && camp !='NULL' && camp!='undefined')
|
|
{
|
|
|
|
|
|
|
|
readCountdash(institution);
|
|
loadAllEMRRegistrationsdctc(institution,camp);
|
|
|
|
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
alert(instname + ' Details not found ');
|
|
$("#changeableDiv").load("DasboardPHC.html");
|
|
}
|
|
|
|
//}
|
|
}
|
|
|
|
}
|
|
var readCountdash = function(hosp_id)
|
|
{
|
|
|
|
var today = new Date();
|
|
var current_Date = today.getDate()+'/'+(today.getMonth()+1)+'/'+today.getFullYear();
|
|
usession = mainPage.returnSession();
|
|
var resultObj={}
|
|
|
|
//resultObj["loggedIn_doctor_id"]=usession.doctor_id.toString();
|
|
resultObj["loggedIn_global_user_id"]=usession.global_user_id.toString();
|
|
resultObj["loggedIn_user_id"]=usession.user_id.toString();
|
|
resultObj["current_Date"]=current_Date;
|
|
//resultObj["ShowOwnHospitalBasedDetailsDash"]=usession.ShowOwnHospitalBasedDetailsDash;
|
|
//resultObj["ShowOwnLoginBasedDetailsDash"]=usession.ShowOwnLoginBasedDetailsDash;
|
|
//resultObj["ShowAllHospitalDetailsDash"]=usession.ShowAllHospitalDetailsDash;
|
|
resultObj["user_hospital_id"]=usession.user_hospital_id.toString();
|
|
resultObj["hospital_id"]=hosp_id;
|
|
var pdata = {};
|
|
pdata['data']= JSON.stringify(resultObj);
|
|
utils.postData('../../Rest/dashboardservice/getcountdash',pdata,null,countSuccess,countErr);
|
|
}
|
|
function countSuccess(result){
|
|
|
|
var count_dash={};
|
|
count_dash=result['count_dash'];
|
|
//alert(JSON.stringify(count_dash));
|
|
if(count_dash!='' && count_dash!=null && count_dash!='undefined')
|
|
{
|
|
|
|
for(i=0;i<count_dash.length;i++){
|
|
|
|
var total_request=count_dash[i]['total_count'];
|
|
console.log("total_count"+total_request)
|
|
if(total_request==''){
|
|
total_request=0;
|
|
}
|
|
var slide_count=count_dash[i]['total_slidecount'];
|
|
if(slide_count==''){
|
|
slide_count=0;
|
|
}
|
|
var abnormal_count=count_dash[i]['total_abnormal'];
|
|
console.log("abnormal_count"+abnormal_count)
|
|
if(abnormal_count==''){
|
|
abnormal_count=0;
|
|
}
|
|
var survey_count=0;
|
|
var Performance_count=0;
|
|
var TP_count=0;
|
|
var Followups_count=0;
|
|
var Forwarded_count=0;
|
|
|
|
$("#total_request").html(total_request);
|
|
$("#slideid").html(slide_count);
|
|
$("#abnormal").html(abnormal_count);
|
|
$("#survey").html(survey_count);
|
|
$("#performance").html(Performance_count);
|
|
$("#tptn").html(TP_count);
|
|
$("#followup").html(Followups_count);
|
|
$("#forwardconsult").html(Forwarded_count);
|
|
|
|
/*********** Added for displaying total consultation count *******************/
|
|
|
|
|
|
usession = mainPage.returnSession();
|
|
|
|
|
|
/****************************************************************************/
|
|
}
|
|
}
|
|
}
|
|
|
|
function countErr(xhr, status, error)
|
|
{
|
|
alert('err ' + error);
|
|
}
|
|
|
|
|
|
|
|
var loadAllEMRRegistrationsdctc = function(hosp_id,camp_id)
|
|
{
|
|
// alert("entered inside CYTO"+camp_id);
|
|
// init()
|
|
//var tabled = $('#fudusimgdctc').DataTable();
|
|
//tabled.destroy();
|
|
$('#patientDetails').attr('style','display:none');
|
|
$('#patientProfile').attr('style','display:none');
|
|
$('#patientSummary').attr('style','display:none');
|
|
$('#emrRelatedDashboards').attr('style','display:visible');
|
|
$('#funduspath').attr('style','visible:');
|
|
$('#fundusDashboard').attr('style','display:none');
|
|
setDivFocus('newemrlstdctc'); // to set focus to div named newemrlst
|
|
var loggedIn_global_user_id;
|
|
var loggedIn_user_id;
|
|
|
|
origin=hosp_id;
|
|
usession = mainPage.returnSession();
|
|
//loggedIn_doc_id = usession.doctor_id.toString();
|
|
loggedIn_user_id = usession.user_id.toString();
|
|
loggedIn_global_user_id=usession.global_user_id.toString();
|
|
|
|
var frm_where="from_das_phc";
|
|
var collapsedGroups = {};
|
|
var editor;
|
|
var storeClosed = true; // Default state, buttons enabled
|
|
className = 'control';
|
|
//var roleid = "RL0001";
|
|
var groupColumn = 2;
|
|
var dataSet = [
|
|
|
|
]
|
|
|
|
;
|
|
//alert("REACH:"+hosp_id);
|
|
var params = {};
|
|
params['hospital_id']=hosp_id;
|
|
var pdata = {};
|
|
pdata['data'] = JSON.stringify(params);
|
|
/* comment: may always return empty as hosp_id not set. also data table rendered from the success of this API */
|
|
utils.postData('../../Rest/dashboardservice/getInstitutionType', pdata, null, function(result) {
|
|
var hospital_type=result.hospital_type;
|
|
|
|
//alert("aaa:"+hospital_type);
|
|
|
|
table= $('#newemrpatientListdctc').dataTable( {
|
|
"data": dataSet,
|
|
"columns": [
|
|
|
|
|
|
{ "data": "row_no",visible:false},
|
|
{ "data": "row_no",visible:false},
|
|
{searchable: true, data:"patient_reg_id",visible:true, orderable: false,render: function(data, type, full, meta){
|
|
dataval = '<a onclick="require([\'main_Page\'],function(pat){pat.get_PatSummary(\''+full.patient_reg_id+'\',\''+frm_where+'\',\''+origin+'\');});" href="#" style="cursor:pointer;">'+data+'</a>';
|
|
//console.log("dataval="+dataval);
|
|
//console.log("full"+JSON.stringify(full));
|
|
//console.log ("VALUE"+JSON.parse(full));
|
|
return dataval;}
|
|
},
|
|
|
|
// { "data": "patient_reg_id", searchable: true},
|
|
|
|
{ "data": "slide_id" ,searchable: true, render: function (data, type, row){
|
|
//onclick="require(['main_Page'],function(mp){mp.viewPatientSummary('fromMenuClick');});" style="display:none">
|
|
dataval = '<a onclick="require([\'dashboard\'],function(dac){dac.go_slideviewMenu(\''+row.patient_reg_id+'\',\''+row.slide_id+'\',\''+origin+'\');});" href="#" style="cursor:pointer;">'+row.slide_id+'</a>';
|
|
return dataval;}
|
|
},
|
|
{ "data": "path_slide_type_code" ,searchable: true, render: function (data, type, row) {
|
|
console.log(data);
|
|
if(data == undefined)
|
|
{
|
|
//console.log('undefined');
|
|
//data = 'done';
|
|
return 'null';
|
|
}
|
|
else {
|
|
return data;
|
|
}
|
|
} },
|
|
{ "data": "created_date",searchable: true, render: function (data, type, row) {
|
|
console.log(data);
|
|
if(data == undefined)
|
|
{
|
|
//console.log('undefined');
|
|
//data = 'done';
|
|
return 'null';
|
|
}
|
|
else {
|
|
return data;
|
|
}
|
|
} },
|
|
|
|
{ "data": "processing_state",searchable: true, render: function (data, type, row) {
|
|
console.log(data);
|
|
if(data == undefined)
|
|
{
|
|
//console.log('undefined');
|
|
//data = 'done';
|
|
return 'null';
|
|
}
|
|
else {
|
|
return data;
|
|
}
|
|
} },
|
|
/*{ "data": "patient_name",searchable: true,visible:true},
|
|
{ "data": "age",searchable: true,visible:true},*/
|
|
// { "data": "created_date",searchable: true },
|
|
{ "data": "drname",searchable: true, render: function (data, type, row) {
|
|
console.log(data);
|
|
if(data == undefined)
|
|
{
|
|
//console.log('undefined');
|
|
//data = 'done';
|
|
return 'null';
|
|
}
|
|
else {
|
|
return data;
|
|
}
|
|
} },
|
|
{ "data": "task_status",searchable: true , render: function (data, type, row) {
|
|
console.log('task_status row= '+row.slide_reg_cervid);
|
|
console.log('task_status row= '+row.age);
|
|
if(hospital_type=='SH'){
|
|
if(data =="P")
|
|
{
|
|
|
|
return 'Pending';
|
|
}
|
|
else if(data == "F")
|
|
{
|
|
//$('#pdfview').removeAttr('disabled');
|
|
//$(':input[name="pdfView"]').prop('enable', true);
|
|
return 'Finished';
|
|
}
|
|
else
|
|
return '';
|
|
}
|
|
else{
|
|
if(data =="P")
|
|
{
|
|
|
|
return 'Pending';
|
|
}
|
|
else if(data == "R")
|
|
{
|
|
// $('#pdfview').attr('disabled','disabled');
|
|
// document.getElementById("pdfview").disabled = true;
|
|
return 'Cancelled and Resheduled';
|
|
}
|
|
else if(data =="S")
|
|
{
|
|
|
|
return 'Forwarded';
|
|
}
|
|
else if(data == "F")
|
|
{
|
|
//$('#pdfview').removeAttr('disabled');
|
|
//$(':input[name="pdfView"]').prop('enable', true);
|
|
return 'Finished';
|
|
}
|
|
else if(data == "")
|
|
{
|
|
// $('#pdfview').attr('disabled','disabled');
|
|
//document.getElementById("pdfview").disabled = true;
|
|
return 'Pending';
|
|
}
|
|
else
|
|
return '';
|
|
}
|
|
}
|
|
},
|
|
{ data: "task_status", render: function (data, type, row) {
|
|
console.log("inside but row "+hospital_type);
|
|
//alert(hospital_type);
|
|
if(hospital_type=='SH'){
|
|
if(data == "F")
|
|
{
|
|
return '<div class="btn-group"> <button type="button" value="Report" class="btn btn-info btn-sm" name="reportView" value="reportView" id="reportView" data-mid="reportView" onclick="require([\'dashboard\'],function(dac){dac.go_ReportviewMenu(\''+row.patient_reg_id+'\',\''+row.slide_id+'\',\''+row.path_slide_type_code+'\',\''+origin+'\',\''+row.global_slide_reg_cervid+'\'); });">Report view </button></div>'
|
|
}else if(data == "P")
|
|
{
|
|
return '<div class="btn-group"> <button type="button" value="Report" class="btn btn-info btn-sm" name="reportView" value="reportView" id="reportView" data-mid="reportView" onclick="require([\'dashboard\'],function(dac){dac.go_ReportviewMenu(\''+row.patient_reg_id+'\',\''+row.slide_id+'\',\''+row.path_slide_type_code+'\',\''+origin+'\',\''+row.global_slide_reg_cervid+'\'); });">Report view </button></div>'
|
|
}
|
|
else
|
|
return '';
|
|
}else{
|
|
if(data == "F")
|
|
{
|
|
return '<div class="btn-group"> <button type="button" value="Submit" class="btn btn-info btn-sm" name="pdfView" value="pdfView" id="pdfview" data-mid="pdfview" onclick="require([\'dashboard\'],function(dac){dac.go_PdfviewMenu(\''+row.patient_reg_id+'\',\''+row.slide_id+'\',\''+row.path_slide_type_code+'\',\''+origin+'\',\''+row.global_slide_reg_cervid+'\'); });">Report view </button></div>'
|
|
}
|
|
else
|
|
return '';
|
|
}
|
|
|
|
|
|
|
|
}
|
|
},
|
|
{ data: "slide_image_status", render: function (data, type, row) {
|
|
//console.log('slide_image_status=='+data);
|
|
if(data == "R")
|
|
{
|
|
|
|
return '<div class="btn-group"> <button type="button" class="btn btn-info btn-sm" name="image" value="ImageView" id="imageview" data-mid="imageview" data-url="/dctc/img/imageview.html" onclick="require([\'dashboard\'],function(dac){dac.go_imageviewMenu(\''+row.global_slide_reg_cervid+'\', \''+row.slide_id+'\',\''+row.patient_name+'\',\''+row.age+'\',\''+origin+'\',\''+row.task_status+'\',\''+row.path_slide_type_code+'\',\''+row.patient_reg_id+'\',\''+row.slide_reg_cervid+'\'); });" >Image view </button></div>'
|
|
}
|
|
|
|
else
|
|
{
|
|
return '';
|
|
}
|
|
|
|
}
|
|
},
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
columnDefs: [ {
|
|
//targets: 0,groupColumn
|
|
"visible": false, "targets": groupColumn,
|
|
className: 'control',
|
|
|
|
}],
|
|
order: [[groupColumn, 'asc']],
|
|
"drawCallback": function ( settings ) {
|
|
// var collapsed = !!collapsedGroups[group];
|
|
var api = this.api();
|
|
var rows = api.rows( {page:'current'} ).nodes();
|
|
//var tem=JSON.stringify(rows);
|
|
// console.log(api);
|
|
var last=null;
|
|
// alert("working");
|
|
// console.log(rows.data());
|
|
//console.log("slide"+i_data.slide_id);
|
|
var rdata = rows.data();
|
|
api.column(groupColumn, {page:'current'} ).data().each( function ( group, i,full ) {
|
|
//console.log(group,i);
|
|
var collapsed = !!collapsedGroups[group];
|
|
//dataval=dataval;
|
|
//console.log("dataval in open"+dataval);
|
|
var groupLink = '<a onclick="require([\'main_Page\'],function(pat){pat.get_PatSummary(\''+rdata[i].patient_reg_id+'\',\''+frm_where+'\',\''+origin+'\');});" href="#" style="cursor:pointer;">'+rdata[i].patient_reg_id+'</a>';
|
|
//console.log('rdata[i].patient_reg_id',rdata[i].slide_id);
|
|
var s_id = rdata[i].slide_id;
|
|
//groupLink = '<a onclick="require([\'main_Page\'],function(pat){pat.get_PatSummary(\''+patient_reg_id+'\',\''+frm_where+'\');});" href="#" style="cursor:pointer;">'+rdata[i].patient_reg_id+'</a>';
|
|
// console.log("groupLink"+groupLink);
|
|
|
|
$(rows).eq(i).addClass(group);
|
|
$(rows).eq(i).addClass('change');
|
|
if (i==0) {
|
|
//console.log('0');
|
|
$(rows).eq( i ).before(
|
|
'<tr id="wrappert" class="group"><td colspan="1">Register No</td><td colspan="2">Name</td><td colspan="1">Age</td><td colspan="1">Phone Number</td><td colspan="2">Address</td><td colspan="1">OP No</td></tr>'
|
|
);
|
|
}
|
|
if(s_id != 'null') {
|
|
console.log('with slide_id',last + group);
|
|
|
|
if ( last !== group ) {
|
|
console.log('with inside',last + group);
|
|
$(rows).eq( i ).before(
|
|
//'<tr id="wrapper" class="group" data-name="'+group+'"><td colspan="10">' + 'Register Number-'+group+'</td></tr>'
|
|
'<tr id="wrapper" class="group" data-name="'+group+'"><td colspan="1">'+groupLink+'</td><td colspan="2">'+rdata[i].patient_name+'</td><td colspan="1">'+rdata[i].age+'</td><td colspan="1">'+rdata[i].phone_no+'</td><td colspan="2">'+rdata[i].address+'</td><td colspan="1">'+rdata[i].op_no+'</td></tr>'
|
|
+'<tr id="wrap" class="group change '+group+'"><td>Slide id</td><td>Slide Type</td><td>Created Date</td><td>Process Status</td><td>Assigned Clinician</td><td>Analysis Status</td> <td>View Report</td><td>View Image</td></tr>'
|
|
);
|
|
|
|
last = group;
|
|
}
|
|
}
|
|
else {
|
|
|
|
console.log('without slide_id');
|
|
if ( last !== group ) {
|
|
$(rows).eq( i ).before(
|
|
//'<tr id="wrapper" class="group" data-name="'+group+'"><td colspan="10">' + 'Register Number-'+group+'</td></tr>'
|
|
'<tr id="wrapper" class="group" data-name="'+group+'"><td colspan="1">'+groupLink+'</td><td colspan="2">'+rdata[i].patient_name+'</td><td colspan="1">'+rdata[i].age+'</td><td colspan="1">'+rdata[i].phone_no+'</td><td colspan="2">'+rdata[i].address+'</td><td colspan="1">'+rdata[i].op_no+'</td></tr>'
|
|
|
|
);
|
|
//$(row).eq( i ).addClass("change");
|
|
|
|
last = group;
|
|
}
|
|
}
|
|
} );
|
|
},
|
|
"rowCallback": function( row, data, index ) {
|
|
if (data["slide_id"] == 'null') {
|
|
$(row).hide();
|
|
console.log('hide');
|
|
}
|
|
},
|
|
/* drawCallback: function (settings) {
|
|
var api = this.api();
|
|
var rows = api.rows({ page: 'current' }).nodes();
|
|
var last = null;
|
|
alert("entered");
|
|
api.column(2, { page: 'current' }).data().each(function (group, i) {
|
|
|
|
if (last !== group) {
|
|
|
|
$(rows).eq(i).before(
|
|
'<tr class="group"><td colspan="9" style="BACKGROUND-COLOR:rgb(237, 208, 0);font-weight:700;color:#006232;">' + 'Register Number ....' + group + '</td></tr>'
|
|
);
|
|
|
|
last = group;
|
|
}
|
|
});
|
|
},*/
|
|
|
|
|
|
/*added for paging*/
|
|
|
|
responsive: true,
|
|
retrieve: true,
|
|
"paging": true, //made true to enable paging
|
|
pagingType: "numbers", //to enable paging
|
|
pageLength:10, // to enable paging
|
|
"lengthChange": true,
|
|
"lengthMenu": [[10, 20, 50,100,200,500,1000], [10, 20, 50,100,200,500,1000]],
|
|
"bSort" : true,
|
|
// scrollX:true,
|
|
// "scrollY":"45vh",
|
|
autoWidth:true,
|
|
"processing": true,
|
|
"serverSide": true,
|
|
"searching": true,
|
|
"header":true,
|
|
"footer":true,
|
|
|
|
ajax: function(data, callback, settings) {
|
|
//console.log(data);
|
|
var params = {};
|
|
var pdata = {};
|
|
|
|
params['start'] = data.start;
|
|
params['length'] = data.length;
|
|
params['search'] = data.search.value;
|
|
params['orderby'] = data.order[0].column;
|
|
params['ordertype'] = data.order[0].dir;
|
|
params['loggedIn_global_user_id']=loggedIn_global_user_id;
|
|
params['loggedin_user_id'] = loggedIn_user_id;
|
|
params['clickevent'] = 'newreg';
|
|
params['user_hospital_id']=usession.user_hospital_id.toString();
|
|
//alert("origin:",origin)
|
|
params['hospital_id']=origin;
|
|
//alert("usession.user_default_role_id:",usession.user_default_role_id)
|
|
params['role_id'] = usession.user_default_role_id;
|
|
//alert("camp_id:",camp_id)
|
|
params['camp_id']=camp_id;
|
|
pdata['data']= JSON.stringify(params);//alert("HERE");
|
|
console.log('*******new reg list >> '+JSON.stringify(params));
|
|
//utils.postData('../../Rest/dashboardservice/getEMRPatientListdctc',pdata,null,function(result){
|
|
utils.postData('../../Rest/dashboardservice/getEMRPatientListdctc',pdata,null,function(result){
|
|
console.log('new reg list >> '+JSON.stringify(result));
|
|
|
|
//alert(JSON.stringify(result));
|
|
|
|
var data=result;
|
|
console.log("rowdatalength"+result.data.length);
|
|
var rowlen=result.data.length;
|
|
/*-----for splitting slideid and create a new row----*/
|
|
var o_data = result.data;
|
|
//result.data = [{"patient_name":" Mrs. Janaki ","name":"varsha","vreccount":3,"row_no":1,"patient_reg_id":"P32000089","created_date":"08/07/2021","slide_id":"sd1223","workstatus":"Finished","age":"50 years "},{"patient_name":" Mrs. Janaki ","name":"varsha","vreccount":3,"row_no":1,"patient_reg_id":"P32000089","created_date":"08/07/2021","slide_id":"sd2243","workstatus":"Finished","age":"50 years"}]
|
|
var o_data_length = o_data.length;
|
|
var o_json = [];
|
|
//console.log('o_data: ',o_data);
|
|
//console.log('o_data_length',o_data_length);
|
|
var rec_len = 0;
|
|
var rec_data;
|
|
for(var i=0; i<o_data.length; i++)
|
|
{
|
|
var i_data = o_data[i];
|
|
//console.log('i_data',i_data);
|
|
if(rec_data !=i_data.patient_reg_id) {
|
|
rec_len ++;
|
|
}
|
|
rec_data = i_data.patient_reg_id;
|
|
//console.log('slide_id', i_data.slide_id.length);
|
|
/*if(i_data.slide_id.length!=null)
|
|
{
|
|
var slide_id = 0;
|
|
}
|
|
else
|
|
{
|
|
console.log('slide_id',i_data.slide_id);
|
|
var slide_id = JSON.parse(i_data.slide_id);
|
|
console.log('slide_id',slide_id);
|
|
var slide_length = slide_id.length;
|
|
}*/
|
|
//console.log('slide_id',i_data.slide_id);
|
|
var slide_id = i_data.slide_id;
|
|
if(slide_id.length != 0) {
|
|
slide_id = JSON.parse(i_data.slide_id);
|
|
}
|
|
//console.log(slide_id.length)
|
|
//console.log(JSON.parse(i_data.slide_id))
|
|
//console.log('slide_id',slide_id);
|
|
var slide_length = slide_id.length;
|
|
//var patient_reg_lengt=patient_reg_id.length;
|
|
//console.log('slide_length',slide_length)
|
|
//alert("kk"+slide_length);
|
|
if(slide_length>0)
|
|
{
|
|
for(var j=0; j<slide_length; j++){
|
|
//console.log('slideregid',slide_id[j].slideregid);
|
|
console.log(i);
|
|
o_json.push({
|
|
patient_name: o_data[i].patient_name,
|
|
drname: o_data[i].drname,
|
|
vreccount: o_data[i].vreccount,
|
|
row_no: o_data[i].row_no,
|
|
patient_reg_id: o_data[i].patient_reg_id,
|
|
created_date: o_data[i].created_date,
|
|
processing_state:o_data[i].processing_state,
|
|
slide_id: slide_id[j].slideregid,
|
|
path_slide_type_code: o_data[i].path_slide_type_code,
|
|
task_status: o_data[i].task_status,
|
|
age: o_data[i].age,
|
|
phone_no: o_data[i].phone_no,
|
|
address: o_data[i].address,
|
|
op_no: o_data[i].op_no,
|
|
global_slide_reg_cervid:o_data[i].global_slide_reg_cervid,
|
|
slide_reg_cervid: o_data[i].slide_reg_cervid,
|
|
slide_image_status:o_data[i].slide_image_status
|
|
});
|
|
|
|
console.log('o_json',JSON.stringify(o_json));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
//console.log('slideregid',slide_id[j].slideregid);
|
|
//console.log(i_data);
|
|
o_json.push({
|
|
patient_name: o_data[i].patient_name,
|
|
//drname: o_data[i].drname,
|
|
vreccount: o_data[i].vreccount,
|
|
row_no: o_data[i].row_no,
|
|
patient_reg_id: o_data[i].patient_reg_id,
|
|
created_date: 'null',
|
|
slide_id: 'null',
|
|
path_slide_type_code: 'null',
|
|
task_status: 'null',
|
|
age: o_data[i].age,
|
|
phone_no: o_data[i].phone_no,
|
|
address: o_data[i].address,
|
|
op_no: o_data[i].op_no,
|
|
processing_state:'null',
|
|
//slide_reg_cervid: o_data[i].slide_reg_cervid,
|
|
//slide_image_status:o_data[i].slide_image_status
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
console.log('rec_len',rec_len)
|
|
result.data = o_json;
|
|
//console.log(result);
|
|
//recordsDisplay,recordsFiltered,recordsTotal
|
|
result.recordsDisplay = rec_len;
|
|
result.recordsFiltered = rec_len;
|
|
result.recordsTotal = rec_len;
|
|
callback(result);
|
|
},
|
|
function(xhr, status, error)
|
|
{
|
|
|
|
alert('Patient list not found ' + error);
|
|
$("#changeableDiv").load("DasboardPHC.html");
|
|
});
|
|
}
|
|
|
|
|
|
});
|
|
|
|
},
|
|
function(xhr, status, error) {
|
|
alert('err ' + error);
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var setDivFocus = function(divname)
|
|
{
|
|
var scrollPos = $("#"+divname).offset().top;
|
|
$(window).scrollTop(scrollPos);
|
|
}
|
|
|
|
function go_slideviewMenu(patientID,slideid,origin)
|
|
{
|
|
var patient_ID=patientID;
|
|
var slide_id=slideid;
|
|
var origin_c=origin;
|
|
//alert("inside slide_id--->"+slide_id)
|
|
mainPage.viewSlideviewerpage(patient_ID,slide_id,origin_c);
|
|
}
|
|
|
|
//code by shameera
|
|
function go_imageviewMenu(global_slide_reg_cervid,slideid,name,age,origin,task_status,slide_type,patientID,slide_reg_cervid)
|
|
{
|
|
//alert("go_imageviewMenu" + global_slide_reg_cervid);
|
|
//alert("go_imageviewMenu" + slide_reg_cervid);
|
|
var global_slide_reg_id = global_slide_reg_cervid;
|
|
var slide_reg_id = slide_reg_cervid;
|
|
var slide_id=slideid;
|
|
var pat_name=name;
|
|
var pat_age=age;
|
|
var origin_c=origin;
|
|
var task=task_status;
|
|
var slidetype=slide_type;
|
|
var patient_ID=patientID;
|
|
//alert("inside slide_id--->"+slide_id)
|
|
mainPage.viewImageviewerpage(global_slide_reg_id,slide_id,pat_name,pat_age,origin_c,task,slidetype,patient_ID,slide_reg_id);
|
|
}
|
|
|
|
/*function go_PdfviewMenu(slide)*/
|
|
function go_PdfviewMenu(patientID,slideid,slidetype,origin,slide_reg_cervid)
|
|
{
|
|
var patient_ID=patientID;
|
|
var slide_id=slideid;
|
|
var slide_type=slidetype;
|
|
var or_gin=origin;
|
|
var slide_reg_cervid=slide_reg_cervid;
|
|
mainPage.viewreportemenu(patient_ID,slide_id,slide_type,or_gin,slide_reg_cervid);
|
|
//alert("inside patient_ID--->"+patient_ID)
|
|
}
|
|
//code by aswathy
|
|
/*function go_ReportviewMenu(slide)*/
|
|
function go_ReportviewMenu(patientID,slideid,slidetype,origin,slide_reg_cervid)
|
|
{
|
|
var patient_ID=patientID;
|
|
var slide_id=slideid;
|
|
var slide_type=slidetype;
|
|
var or_gin=origin;
|
|
var slide_reg_cervid=slide_reg_cervid;
|
|
|
|
|
|
|
|
mainPage.viewscreportemenu(patient_ID,slide_id,slide_type,or_gin,slide_reg_cervid);
|
|
//alert("inside patient_ID--->"+patient_ID)
|
|
}
|
|
|
|
|
|
|
|
|
|
return{
|
|
|
|
//readCountphc:readCountphc,
|
|
//readCountConsultant:readCountConsultant,
|
|
//readCountWaitingConfirmation:readCountWaitingConfirmation,
|
|
init:init,
|
|
//readAllAppointments:readAllAppointments,
|
|
//readCountofCreatedEMRs:readCountofCreatedEMRs,
|
|
//readCountofReferredEMRs:readCountofReferredEMRs,
|
|
//count_emr_related:count_emr_related,
|
|
//readNewEMRForDoc:readNewEMRForDoc,
|
|
//readNewEMRForSpecAdmin:readNewEMRForSpecAdmin,
|
|
loadAllEMRRegistrationsdctc:loadAllEMRRegistrationsdctc,
|
|
setDivFocus:setDivFocus,
|
|
readInstitutionsContent:readInstitutionsContent,
|
|
readcampsContent:readcampsContent,
|
|
//readNewEMRForConsultant:readNewEMRForConsultant,
|
|
go_imageviewMenu:go_imageviewMenu,
|
|
go_slideviewMenu:go_slideviewMenu,
|
|
go_PdfviewMenu:go_PdfviewMenu,go_ReportviewMenu:go_ReportviewMenu
|
|
}
|
|
});
|