วันอังคารที่ 31 มีนาคม พ.ศ. 2563
วันศุกร์ที่ 27 มีนาคม พ.ศ. 2563
showPageSummary Option In Yii2
showPageSummary Option In Yii2
showPageSummary
: ชนิด boolean [ TRUE , FALSE ] จะแสดงผลรวมของฟิลด์ ใน grid view. ค่าเริ่มต้นจะกำหนดไว้เป็น FALSE
.
echo GridView::widget([
'dataProvider' => $dataProvider,
'hover' => TRUE,
'resizableColumns'=>true,
'showPageSummary' => true,
'columns' => [];
กำหนดใน column ที่ต้องการ sum
'pageSummary' => true
[
'headerOptions' => ['class' => 'text-center'],
'contentOptions' => ['class' => 'text-right'],
//'options' => ['style' => 'width:30px;'],
'attribute' => 'total_value',
'header' => 'มูลค่ารวม (บาท)',
'format'=>['decimal', 0],
'value' => function($data) {
return empty($data['total_value']) ? '0' : $data['total_value'];
},
'pageSummary' => true,
],
วันศุกร์ที่ 20 มีนาคม พ.ศ. 2563
php search mysql
<?php
ini_set('display_errors', 1);
error_reporting(~0);
$strKeyword = null;
if(isset($_POST["txtKeyword"]))
{
$strKeyword = $_POST["txtKeyword"];
}
?>
<form name="frmSearch" method="post" action="<?php echo $_SERVER['SCRIPT_NAME'];?>">
<table width="599" border="1">
<tr>
<th>Keyword
<input name="txtKeyword" type="text" id="txtKeyword" value="<?php echo $strKeyword;?>">
<input type="submit" value="Search"></th>
</tr>
</table>
</form>
<?php
$serverName = "localhost";
$userName = "root";
$userPassword = "1234";
$dbName = "testdb";
$conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
mysqli_set_charset($conn, "utf8");
$sql = "SELECT * FROM provider WHERE (NAME LIKE '%".$strKeyword."%' OR LNAME LIKE '%".$strKeyword."%' ) ";
$query = mysqli_query($conn,$sql);
?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">CID </div></th>
<th width="98"> <div align="center">NAME </div></th>
<th width="198"> <div align="center">LNAME </div></th>
<th width="198"> <div align="center">BIRTH </div></th>
</tr>
<?php
while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
{
?>
<tr>
<td><div align="center"><?php echo $result["CID"];?></div></td>
<td><?php echo $result["NAME"];?></td>
<td><?php echo $result["LNAME"];?></td>
<td><?php echo $result["BIRTH"];?></td>
</tr>
<?php
}
?>
</table>
<?php
mysqli_close($conn);
?>
วันจันทร์ที่ 16 มีนาคม พ.ศ. 2563
admitt+referน้อยกว่า 4 ชั่วโมง
SELECT k.ICD10_TM , k.NICKNAME, COUNT(k.ICD10_TM) as AMOUNT
FROM (
SELECT i.VISIT_ID ,i.ADM_DT, r.RF_DT ,
((to_days(r.RF_DT)*24)- (to_days(i.ADM_DT)*24))/24 AS DAYS, abs((time_to_sec(r.RF_DT)/3600) - (time_to_sec(i.ADM_DT)/3600)) as Times
,ic.ICD10_TM , ic.NICKNAME
FROM ipd_reg i
INNER JOIN refers r on i.VISIT_ID = r.VISIT_ID AND i.IS_CANCEL = 0 AND r.IS_CANCEL = 0 AND r.rf_type = 2
INNER JOIN opd_diagnosis o ON i.VISIT_ID = o.VISIT_ID AND o.IS_CANCEL = 0 AND o.DXT_ID = 1
INNER JOIN icd10new ic ON o.ICD10 = ic.ICD10
WHERE r.RF_DT BETWEEN '2018-10-01 00:00' AND '2019-09-30 23:59'
AND ((to_days(r.RF_DT)*24)- (to_days(i.ADM_DT)*24))/24 = '0'
AND abs((time_to_sec(r.RF_DT)/3600) - (time_to_sec(i.ADM_DT)/3600)) <= '4.0') as k
GROUP BY k.ICD10_TM ORDER BY AMOUNT DESC
****List แยก ตามAN***
FROM (
SELECT i.VISIT_ID ,i.ADM_DT, r.RF_DT ,
((to_days(r.RF_DT)*24)- (to_days(i.ADM_DT)*24))/24 AS DAYS, abs((time_to_sec(r.RF_DT)/3600) - (time_to_sec(i.ADM_DT)/3600)) as Times
,ic.ICD10_TM , ic.NICKNAME
FROM ipd_reg i
INNER JOIN refers r on i.VISIT_ID = r.VISIT_ID AND i.IS_CANCEL = 0 AND r.IS_CANCEL = 0 AND r.rf_type = 2
INNER JOIN opd_diagnosis o ON i.VISIT_ID = o.VISIT_ID AND o.IS_CANCEL = 0 AND o.DXT_ID = 1
INNER JOIN icd10new ic ON o.ICD10 = ic.ICD10
WHERE r.RF_DT BETWEEN '2018-10-01 00:00' AND '2019-09-30 23:59'
AND ((to_days(r.RF_DT)*24)- (to_days(i.ADM_DT)*24))/24 = '0'
AND abs((time_to_sec(r.RF_DT)/3600) - (time_to_sec(i.ADM_DT)/3600)) <= '4.0') as k
GROUP BY k.ICD10_TM ORDER BY AMOUNT DESC
****List แยก ตามAN***
SELECT i.VISIT_ID ,op.HN,i.ADM_ID as AN ,op.REG_DATETIME as REGDATE,i.ADM_DT, r.RF_DT ,
((to_days(r.RF_DT)*24)- (to_days(i.ADM_DT)*24))/24 AS DAYS, abs((time_to_sec(r.RF_DT)/3600) - (time_to_sec(i.ADM_DT)/3600)) as Times
,ic.ICD10_TM , ic.NICKNAME
FROM ipd_reg i
LEFT JOIN opd_visits op ON op.visit_id = i.visit_id AND op.is_cancel = 0
INNER JOIN refers r on i.VISIT_ID = r.VISIT_ID AND i.IS_CANCEL = 0 AND r.IS_CANCEL = 0 AND r.rf_type = 2
INNER JOIN opd_diagnosis o ON i.VISIT_ID = o.VISIT_ID AND o.IS_CANCEL = 0 AND o.DXT_ID = 1
INNER JOIN icd10new ic ON o.ICD10 = ic.ICD10
WHERE r.RF_DT BETWEEN '2020-01-01 00:00' AND '2021-09-30 23:59'
AND ((to_days(r.RF_DT)*24)- (to_days(i.ADM_DT)*24))/24 = '0'
AND abs((time_to_sec(r.RF_DT)/3600) - (time_to_sec(i.ADM_DT)/3600)) <= '2.0'
#GROUP BY k.ICD10_TM ORDER BY AMOUNT DESC
วันศุกร์ที่ 13 มีนาคม พ.ศ. 2563
การเข้าHDC แบบง่าย
203.157.102.1xx
33=
34=ubon
33=
34=ubon
********************************************
#######SLIDEประกอบ#######
***update person กรณีcid =000000 ส่งเข้าupdateได้เลย ระบบตรวจสอบวันเกิด ***
query การตัดchief complaint (history)
####History###
SELECT SUBSTR(o.history,LOCATE('CHIEF COMPLAINT',o.history),LOCATE('PRESENT ILLNESS',o.history)-
LOCATE('CHIEF COMPLAINT',o.history))
FROM opd_visits o
WHERE o.visit_id in ('0002250117','0002250119')
/////ตัดอักขระพิเศษ
SELECT o.VISIT_ID as seq , replace(replace(replace(SUBSTR(o.history,LOCATE('PRESENT ILLNESS',o.history)+17) ,char(13),''),char(10),''),'""','') as hpi FROM opd_visits o WHERE o.visit_id = '${seq}' group by o.visit_id
######ตรวจร่างกาย#######
SELECT o.VISIT_ID as seq , replace(replace(replace(o.pexam,char(13),''),char(10),''),'""','') as pe FROM opd_visits o WHERE o.visit_id = '${seq}' group by o.visit_id
วันพฤหัสบดีที่ 12 มีนาคม พ.ศ. 2563
X60-X64
SELECT o.REG_DATETIME , o.HN , o.VISIT_ID, p.CID, CONCAT(p.FNAME,'',p.LNAME) AS FULLNAME, p.BIRTHDATE, o.UNIT_REG, icd.ICD10_TM
FROM opd_visits o
INNER JOIN cid_hn c ON o.hn = c.hn
INNER JOIN population p ON c.cid = p.cid
INNER JOIN opd_diagnosis dx ON dx.visit_id = o.visit_id and dx.is_cancel = 0
INNER JOIN icd10new icd ON icd.icd10 = dx.icd10 and icd.ICD10_TM BETWEEN 'X60' AND 'X64'
WHERE o.REG_DATETIME BETWEEN '2017.01.01 00:00' and '2020.12.31 23:59'
AND o.is_cancel = 0 ORDER BY o.REG_DATETIME DESC
FROM opd_visits o
INNER JOIN cid_hn c ON o.hn = c.hn
INNER JOIN population p ON c.cid = p.cid
INNER JOIN opd_diagnosis dx ON dx.visit_id = o.visit_id and dx.is_cancel = 0
INNER JOIN icd10new icd ON icd.icd10 = dx.icd10 and icd.ICD10_TM BETWEEN 'X60' AND 'X64'
WHERE o.REG_DATETIME BETWEEN '2017.01.01 00:00' and '2020.12.31 23:59'
AND o.is_cancel = 0 ORDER BY o.REG_DATETIME DESC
วันพุธที่ 11 มีนาคม พ.ศ. 2563
GetNuture SmartRefer
SELECT o.VISIT_ID as seq,
DATE_FORMAT(date(o.REG_DATETIME),'%Y-%m-%d') as date_serv,
DATE_FORMAT(time(o.REG_DATETIME),'%h:%i:%s') as time_serv,
'' as bloodgrp,
o.WEIGHT as weight,
o.HEIGHT as height,
ROUND((o.WEIGHT / ((o.height / 100) * (o.height / 100))), 2) as BMI,
o.BODY_TEMP as temperature,
o.PULSE_RATE as pr,
o.RESP_RATE as rr,
o.BP_SYST as sbp,
o.BP_DIAS as dbp,
'' as symptom,
s.UNIT_ID as depcode,
s.UNIT_NAME as department
FROM opd_visits o
LEFT JOIN service_units s ON o.unit_reg = s.unit_id
WHERE o.VISIT_ID in ('0002265136' )
DATE_FORMAT(date(o.REG_DATETIME),'%Y-%m-%d') as date_serv,
DATE_FORMAT(time(o.REG_DATETIME),'%h:%i:%s') as time_serv,
'' as bloodgrp,
o.WEIGHT as weight,
o.HEIGHT as height,
ROUND((o.WEIGHT / ((o.height / 100) * (o.height / 100))), 2) as BMI,
o.BODY_TEMP as temperature,
o.PULSE_RATE as pr,
o.RESP_RATE as rr,
o.BP_SYST as sbp,
o.BP_DIAS as dbp,
'' as symptom,
s.UNIT_ID as depcode,
s.UNIT_NAME as department
FROM opd_visits o
LEFT JOIN service_units s ON o.unit_reg = s.unit_id
WHERE o.VISIT_ID in ('0002265136' )
หาชื่อฟิลด์จากฐานข้อมูลScript
SELECT DISTINCT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE column_name LIKE 'prepack'
AND TABLE_SCHEMA= 'mbase_data'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE column_name LIKE 'prepack'
AND TABLE_SCHEMA= 'mbase_data'
drugs-smartRefer
SELECT a.VISIT_ID as seq,
DATE_FORMAT(date(a.REG_DATETIME),'%Y%m%d') as date_serv,
time(a.REG_DATETIME) as time_serv,
c.DRUG_NAME as drug_name,
b.RX_AMOUNT as qty,
d.UUNIT_NAME as unit ,
วันพฤหัสบดีที่ 5 มีนาคม พ.ศ. 2563
Lab Smart Refer
SELECT
DATE_FORMAT(date(a.LREQ_DT),'%Y%m%d') as date_serv,DATE_FORMAT(time(a.LREQ_DT),'%h:%i:%s') as time_serv
,b.LAB_GROUP as labgroup,b.LAB_NAME as lab_name
,replace(replace(SUBSTR(a.LAB_RESULT, LOCATE('=', a.LAB_RESULT)+1),char(13),''),char(10),'') as lab_result
, '' as unit, b.normal_val as standard_result
FROM lab_requests a
INNER JOIN lab_lists b ON a.LAB_ID = b.LAB_ID AND b.IS_CANCEL =0
WHERE a.VISIT_ID in('0002250317','0002250318','0002262813','0002255663')
AND a.is_cancel = 0
AND b.is_secret = 0
DATE_FORMAT(date(a.LREQ_DT),'%Y%m%d') as date_serv,DATE_FORMAT(time(a.LREQ_DT),'%h:%i:%s') as time_serv
,b.LAB_GROUP as labgroup,b.LAB_NAME as lab_name
,replace(replace(SUBSTR(a.LAB_RESULT, LOCATE('=', a.LAB_RESULT)+1),char(13),''),char(10),'') as lab_result
, '' as unit, b.normal_val as standard_result
FROM lab_requests a
INNER JOIN lab_lists b ON a.LAB_ID = b.LAB_ID AND b.IS_CANCEL =0
WHERE a.VISIT_ID in('0002250317','0002250318','0002262813','0002255663')
AND a.is_cancel = 0
AND b.is_secret = 0
วันจันทร์ที่ 2 มีนาคม พ.ศ. 2563
Smart Refer
ติดตั้ง smartrefer-api #Install Git on a Ubuntu 16.04 apt-get update apt-get install curl sudo curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -apt-get install nodejs apt-get install git ———
#ติดตั้ง Apache2. ใช้คำสั่ง : sudo apt-get install apache2 sudo apt-get install libapache2-mod-php #ติดตั้ง PHP7.0 (Default version สำหรับ Ubuntu 16.04) sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql php-curl php-mbstring ———
#Install Git on a CentOS 6.4 curl -sL https://rpm.nodesource.com/setup_10.x | bash -yum install nodejs yum install git ———
#ติดตั้ง Apache2. ใช้คำสั่ง : yum install apache2 yum install libapache2-mod-php #ติดตั้ง PHP7.0 (Default version สำหรับ Ubuntu 16.04) yum install php libapache2-mod-php php-mcrypt php-mysql php-curl phpmbstring ———
node -v
npm -v
npm i -g typings
npm i -g typescript
npm i -g nodemon
npm i -g pm2
git clone https://gitlab.com/ubon-refer/smart-refer-api.git
git clone https://gitlab.com/ubon-refer/smart-refer-web.git
cd smart-refer-api cp config.txt config nano config
#ติดตั้ง Apache2. ใช้คำสั่ง : sudo apt-get install apache2 sudo apt-get install libapache2-mod-php #ติดตั้ง PHP7.0 (Default version สำหรับ Ubuntu 16.04) sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql php-curl php-mbstring ———
#Install Git on a CentOS 6.4 curl -sL https://rpm.nodesource.com/setup_10.x | bash -yum install nodejs yum install git ———
#ติดตั้ง Apache2. ใช้คำสั่ง : yum install apache2 yum install libapache2-mod-php #ติดตั้ง PHP7.0 (Default version สำหรับ Ubuntu 16.04) yum install php libapache2-mod-php php-mcrypt php-mysql php-curl phpmbstring ———
node -v
npm -v
npm i -g typings
npm i -g typescript
npm i -g nodemon
npm i -g pm2
git clone https://gitlab.com/ubon-refer/smart-refer-api.git
git clone https://gitlab.com/ubon-refer/smart-refer-web.git
cd smart-refer-api cp config.txt config nano config
สมัครสมาชิก:
บทความ (Atom)