BMS-HOSxP Community
HOSxP => Report Exchange => ข้อความที่เริ่มโดย: Red'A'rmY ที่ พฤษภาคม 31, 2011, 22:45:15 PM
-
พอดีหัดเขียนรายงานครับมือใหม่
-
พอดีหัดเขียนรายงานครับมือใหม่
Capture หน้าตารายงานให้ดูหน่อยก็จะดีนะครับ จะได้ไม่ต้องนำเข้ารายงาน ฝากด้วยครับ ;D ;D ;D
-
ผู้รู้ช่วยบอกโค้ดคำสั่งหน่อยครับ พอดีมือใหม่ลองผิดลองถูกอ่ะครับ
-
ตัวอย่าง
โรคจิต F20-F25,F28-F29
var
date1, date2:tdatetime;
ds1, ds2:string;
GetDateRangeDialog(date1,date2);
ds1:=formatdatetime('yyyy-mm-dd',date1);
ds2:=formatdatetime('yyyy-mm-dd',date2);
วาง variable ลงไปตัวหนึ่งตรงจำนวนที่ต้องการหา แล้วใช้คำสั่งนี้
value:=GetSQLIntegerData('select count(vn) from vn_stat where vstdate between "'+ds1+'" and "'+ds2+'" where (pdx between "F20" and "F25" or pdx between "F28" and "F29" ');
แล้วทำแบบนี้กับตัวอื่น ๆ ครับ
-
ลองแล้วครับ ค่าที่ออกมาเป็น 0 ครับ
-
ผมใช้คำสั่งนี้ครับ ช่วยอาจารย์ดูที่ครับว่าใช้ได้ไหม
var
date1,date2 : datetime;
ds1,ds2,gl1: string;
if gl1='OPD' then
begin
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
end else
if gl1='IPD' then
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
end;
ลองคำสั่งนี้แล้ว ค่าที่ได้กลับเป็นศูนย์ ไม่รู้จะแก้ยังไงกำลังรอผู้รู้อยู่ครับ
-
ผมว่าน่าจะเพิ่ม
between like "F20%" and like "F25%"
จะครบกว่านะครับ
เพิ่มเติมนิดเดียว ;D
-
ผมใช้คำสั่งนี้ครับ ช่วยอาจารย์ดูที่ครับว่าใช้ได้ไหม
... น่าจะเป็น ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
if gl1='IPD' then
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
... หรือ ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"')
else
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
-
งงกำคำสั่งอ่ะครับ น่าจะลืมเขียนคำสัง่ like"F20%" ให้นะครับ
-
ผมใช้คำสั่งนี้ครับ ช่วยอาจารย์ดูที่ครับว่าใช้ได้ไหม
... น่าจะเป็น ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
if gl1='IPD' then
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
... หรือ ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"')
else
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
คำสั่ง like"F20%" น่าจะหายไปนะครับ
-
ผมใช้คำสั่งนี้ครับ ช่วยอาจารย์ดูที่ครับว่าใช้ได้ไหม
... น่าจะเป็น ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
if gl1='IPD' then
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
... หรือ ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"')
else
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29"');
คำสั่ง like"F20%" น่าจะหายไปนะครับ
ไม่หายครับ ลอง run คำสั่งหรือยังครับ
-
... น่าจะเป็น ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29")');
if gl1='IPD' then
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29")');
... หรือ ...
if gl1='OPD' then
Value := GetSQLIntegerData('select count(vn) as c_an from vn_stat'+
' where vstdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29")')
else
Value := GetSQLIntegerData('select count(an) as c_an from an_stat'+
' where regdate between "'+ds1+'" and "'+ds2+'"'+
' and (pdx between "F20" and "F25" or pdx between "F28" and "F29")');
-
... น่าจะเป็น ...
... ตาม อ.ป๊อบ เลยครับ
copy มาวางลืมดูให้ละเอียดครับ ว่า ) หายไป 1 ตัว ... ;D ;D ....
-
... น่าจะเป็น ...
... ตาม อ.ป๊อบ เลยครับ
copy มาวางลืมดูให้ละเอียดครับ ว่า ) หายไป 1 ตัว ... ;D ;D ....
คนมันอายุเยอะแล้วก็เป็นอย่างนี้แหละ ;D ;D ;D ;D
-
คนมันอายุเยอะแล้วก็เป็นอย่างนี้แหละ ;D ;D ;D ;D
... อิ อิ อิ แต่ว่าพี่น่ะ ก้ออายุเยอะกว่าผมติดนึงนาคร้าบบบบบบ 55555++ ... ;D ;D ....
-
แล้วทำไมไม่ใช้ PDX between "F20" and "F29" ไปเลยละนี่ เพราะ F26- F27 มันไม่มีใน ICD10 นะค่ะ
-
... อีกอย่างตรง
and (pdx between "F20" and "F25"
แบบนี้ จะไม่รวมพวก F250 F251 F252 ประมาณนี้ เข้าไปด้วยครับ ....
... ถ้าต้องการ F25 ทุกตัว ต้องเขียนเป็น
and (pdx between "F20" and "F2599" ครับ ... :D ...
-
;D ;D ;D อีกวิธีครับ and (substring(pdx,1,3) between "F20" and "F25")
-
... อีกอย่างตรง
and (pdx between "F20" and "F25"
แบบนี้ จะไม่รวมพวก F250 F251 F252 ประมาณนี้ เข้าไปด้วยครับ ....
... ถ้าต้องการ F25 ทุกตัว ต้องเขียนเป็น
and (pdx between "F20" and "F2599" ครับ ... :D ...
รวมอยู่นะครับอ.ขวด
-
รวมอยู่นะครับอ.ขวด
... หมายถึงว่า ถ้าต้องการ F25 ทุกตัว เช่นพวก F250 F251 F252 ประมาณนี้ครับ อ.ป๊อบ
ถ้าใช้แค่ and (pdx between "F20" and "F25" มันก็จะไปหยุดอยู่แค่ F25
จะไม่รวมพวก F25x ไปด้วยครับ ... :D ....