BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: white ที่ สิงหาคม 27, 2008, 04:28:32 AM

หัวข้อ: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ สิงหาคม 27, 2008, 04:28:32 AM
ตอนนี้รพ.ผมยังรายงานโรคเรื้อรัง โดยนับ manual เอาอยู่เลยครับ
1.รพ.อื่นรายงานกันอย่างไร เข้า Surveillance กันหมดเลยหรือครับ

2.รายงานที่โปรแกรมมีอยู่ CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 (ไม่รู้ต่างจาก v1 ยังไง?)
เชื่อถือได้ไหมครับ ถ้าเราลงภาวะแทรกซ้อนของโรคด้วย (เพิ่งจะเริ่มลง เลยอยากรู้ว่าที่อื่นทำกันยังไง)
มีปัญหาเรื่องอะไรไหมครับ

3.ผมสงสัยเรื่องการนับผู้ป่วย ถ้าคนไข้มีภาวะแทรกซ้อนอย่างหนึ่ง เช่นทางไต
แล้วต่อมา เพิ่มเป็นภาวะแทรกซ้อนหลายอย่างแล้ว ต้องลบภาวะแทรกซ้อนเดิมด้วยไหม

4.เรื่องนี้สงสัยมาก ทำให้ไม่มั่นใจว่าจะทำรายงานให้ถูกต้องอย่างไร
จะแก้ให้ผู้ป่วยรายใหม่ เป็นรายเก่าอย่างไร โดยไม่ต้องมาแก้ทีละ case เพื่อความถูกต้องของรายงาน
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: มนตรี บอยรักยุ้ยคนเดียว ที่ สิงหาคม 27, 2008, 15:05:54 PM
ของผมดึงจาก hosxp ตั้งแต่แรกแล้วข้อมูลก็ครบ
แต่ต้องให้พยาบาลถามหมอ
เพื่อยืนยันก็วินจฉัย
ผิดหลายคน จาก 3000 คน เหลือ 2400 คน
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ สิงหาคม 27, 2008, 18:35:46 PM
ของผมดึงจาก hosxp ตั้งแต่แรกแล้วข้อมูลก็ครบ
แต่ต้องให้พยาบาลถามหมอ
เพื่อยืนยันก็วินจฉัย
ผิดหลายคน จาก 3000 คน เหลือ 2400 คน

ดึงรายงานโดยใช้ report แบบไหนหรือครับ แบบ form ที่ผมพูดถึง หรือว่า form ที่ออกเป็น excel ครับ
แล้วไม่มีปัญหาเรื่องผู้ป่วยรายเก่ารายใหม่หรือครับ

ไม่เข้าใจว่า จะแก้อย่างไรว่าถ้ารายงานไปแล้วให้เปลี่ยนจากผู้ป่วยเดิมที่เป็นรายใหม่ ให้กลายเป็นรายเก่าสำหรับการรายงานครั้งถัดไป  :'(
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: golf_win ที่ สิงหาคม 27, 2008, 19:31:41 PM
ถ้าเข้าใจไม่ผิดนะครับ จะเป็นการดึงข้อมูลออกจากฐาน Hosxp มาเป็น Excel(ใช้ sql) แล้วใช้ตัว import นำเข้าไปสู่ program Surveillance ครับ ;D ;D
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ สิงหาคม 28, 2008, 00:03:20 AM
ถ้าเข้าใจไม่ผิดนะครับ จะเป็นการดึงข้อมูลออกจากฐาน Hosxp มาเป็น Excel(ใช้ sql) แล้วใช้ตัว import นำเข้าไปสู่ program Surveillance ครับ ;D ;D

ผมมี report สำหรับ export ออก excel แล้วครับ
ผมติดที่ อยากให้ข้อมูลถูกต้องที่สุด เท่าที่ควรจะเป็น เท่านั้นเองครับ ;)
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: golf_win ที่ สิงหาคม 28, 2008, 06:22:31 AM
ประเด็นนี้ผมก็คิดไว้ตอนส่งออกข้อมูลครับ ที่จริงมันขึ้นกับตัว pdx ถ้ารหัสที่ให้ไว้ถูกต้องก็ไม่มีปัญหาครับ แต่ถ้าไม่เป็นตามนั้น คงต้องใช้ จนท.มาช่วยกรองข้อมูลแบบ manual อีกครั้งครับ หรือตรวจสอบจาก คลินิกพิเศษ
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: มนตรี บอยรักยุ้ยคนเดียว ที่ สิงหาคม 28, 2008, 09:02:12 AM
ประเด็นนี้ผมก็คิดไว้ตอนส่งออกข้อมูลครับ ที่จริงมันขึ้นกับตัว pdx ถ้ารหัสที่ให้ไว้ถูกต้องก็ไม่มีปัญหาครับ แต่ถ้าไม่เป็นตามนั้น คงต้องใช้ จนท.มาช่วยกรองข้อมูลแบบ manual อีกครั้งครับ หรือตรวจสอบจาก คลินิกพิเศษ
ถูกต้องแล้วครับ
คุณหมอ white ต้องหาคนมาช่วยเพื่อความถูกต้อง
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ สิงหาคม 28, 2008, 23:20:46 PM
ตอนนี้จะลงวินิจฉัยให้ถูก มันต้องให้บุคคลากรช่วย ใช่แล้วครับ
ตอนนี้แพทย์ยังไม่ค่อยลงวินิจฉัยที่ละเอียดพอ (เริ่มดีขึ้นบ้างแล้ว)

อย่างที่พูดตอนแรกครับ
ระบบคลินิกพิเศษ ผมยังไม่เข้าใจเท่าไหร่ครับ (อาจต้องปรึกษา ส่วนตัวแล้วมั๊งครับ)  ::)
1.รพ.ผม ไม่ได้ลงในทะเบียนความดัน/เบาหวานเฉพาะ ตั้งแต่แรกน่ะสิครับ
ลงเป็นคลินิกพิเศษทั่วไป อยากจะย้ายรายชื่อมาเข้าคลินิกเฉพาะ ไม่ทราบทำได้ไหม?

2.การลงรายละเอียดอื่นๆ เช่นส่งตัวไป PCU
เราสามารถดูได้ไหมว่า ส่งไปที่ไหนบ้าง ที่ละกี่คน?

3.ที่ผมสงสัยที่สุด คือ รายงานผู้ป่วยเก่า/ใหม่ แยกกันอย่างไร
เพราะ script ของใน report จะเอาจาก field ว่าเป็น case เก่าหรือไม่
ซึ่งจะแก้ข้อมูลตรงนี้ เห็นมีแต่ในช่องลงรายละเอียด เราต้องไปติ๊ก"ผู้ป่วยรายใหม่"ออกเองใช่ไหมครับ
ไม่ได้ทยอยติ๊กเอาไว้ตั้งแต่แรก ตอนนี้มันเยอะมากน่ะครับ :'(

4.ปกติเน้นดูภาวะแทรกซ้อนจาก icd10 กันหรือครับ ไม่ได้ดูจากการลงประวัติภาวะแทรกซ้อน?

คงต้อง รบกวนถามอาจารย์ทุกท่านครับ
อยากรู้แนวของแต่ละที่ครับ
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: golf_win ที่ สิงหาคม 29, 2008, 06:18:43 AM
ข้อ 1 ผมว่าคีย์ manual แบบ case ต่อ case จะดีกว่านะครับอย่างน้อยก็จะเป็นการทวนสอบข้อมูลลดการ error จากการบันทึกข้อมูลผิดได้ส่วนหนึ่งครับ
ข้อ 2 ผมใช้การส่งไปห้องตรวจ PCU ครับ สร้างห้องตรวจขึ้นมาใหม่ ทีนี้การนับยอดคนไข้ที่ห้องตรวจนี้ก็ไม่ยากแล้วครับ ;D ;D
ข้อ 3 น่าจะเข้าไปแก้ไขได้ในตาราง clinic member ต้องลองดูนะครับ
ข้อ 4 ของผมตอนเริ่มใช้ clinic พิเศษ ใช้การลุยคีย์ข้อมูลจาก OPD card อาศัยการลงประวัติแทรกซ้อนครับซึ่งจะถูกต้องกว่า icd10 เพราะช่วงเริ่มใช้ program ยังไม่ค่อยคุ้นกับระบบ icd10 ครับ ??? ???
ยังไงรอความเห็นจาก อ,ท่านอื่นๆ ด้วยนะครับ อาจจะได้มุมมองที่แตกต่างครับ
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ สิงหาคม 29, 2008, 06:31:00 AM
ข้อ 1 ผมว่าคีย์ manual แบบ case ต่อ case จะดีกว่านะครับอย่างน้อยก็จะเป็นการทวนสอบข้อมูลลดการ error จากการบันทึกข้อมูลผิดได้ส่วนหนึ่งครับ
ข้อ 2 ผมใช้การส่งไปห้องตรวจ PCU ครับ สร้างห้องตรวจขึ้นมาใหม่ ทีนี้การนับยอดคนไข้ที่ห้องตรวจนี้ก็ไม่ยากแล้วครับ ;D ;D
ข้อ 3 น่าจะเข้าไปแก้ไขได้ในตาราง clinic member ต้องลองดูนะครับ
ข้อ 4 ของผมตอนเริ่มใช้ clinic พิเศษ ใช้การลุยคีย์ข้อมูลจาก OPD card อาศัยการลงประวัติแทรกซ้อนครับซึ่งจะถูกต้องกว่า icd10 เพราะช่วงเริ่มใช้ program ยังไม่ค่อยคุ้นกับระบบ icd10 ครับ ??? ???
ยังไงรอความเห็นจาก อ,ท่านอื่นๆ ด้วยนะครับ อาจจะได้มุมมองที่แตกต่างครับ

ขอบคุณสำหรับความเห็นครับ
ข้อ 2 ผมหมายถึงส่งออกอนามัย ในหน้าต่างตามรูปคับ  ;D
จะทำอย่างไรให้รู้ว่าส่งไปแต่ละที่เท่าไหร่บ้าง ชื่ออะไรบ้างน่ะครับ

แล้ว ข้อ 3 คุณ golf_win ใช้แก้ในตารางเอาเลยหรือครับ
ตอนแรกก็คิดว่าจะเข้าไปแก้รายใหม่ ให้เป็น"รายเก่า" ทั้งหมด ถ้ารายงานไปแล้วเหมือนกันครับ
แต่ไม่แน่ใจว่าทำอย่างนี้ถูกต้องหรือเปล่า หรือควรจะทำอย่างไร  ::)
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: golf_win ที่ สิงหาคม 29, 2008, 06:45:41 AM
ข้อ 2 เข้าใจผิดขอโทษนะครับ.... ผมใช้หน้าที่คุณหมอแสดงขึ้นมาในการส่งผู้ป่วยไป PCU ครับเลือก สอ. ก็นับยอดได้แล้วครับ
ข้อ 3 ก็แล้วแต่สะดวกครับ ถ้ามี short note อยู่แล้วจะแก้ในตารางก็ได้ แต่ถ้าให้ดี ลงบันทึกให้เสร็จที่เดียวเลยดีกว่าครับ ;D ;D
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ พฤศจิกายน 22, 2008, 22:51:06 PM
กลับมาที่กระทู้เก่า
ที่ผ่านมา รพ.ผมส่งข้อมูลโรคแทรกซ้อน 5 โรคโดยใช้โปรแกรม FanHos ครับ
ผมเข้าใจว่า เอาจากรหัสวินิจฉัย

แต่...
1. ปัจจุบันผมให้ลงภาวะแทรกซ้อนในทะเบียนคลินิก DM, HT แล้ว
ส่วนนี้อยากดึงออกมาเป็นรายงาน จำนวนภาวะแทรกซ้อนแต่ละช่วงอายุ และรายชื่อ ทำอย่างไรดีครับ
มีคนทำเสร็จแล้วไหม
เอาจากข้อมูลใน cormobidity_list ครับ (ถ้าจำชื่อตารางไม่ผิด)

2.ส่วนโรคอื่นๆเช่นหัวใจ COPD ยังเอาข้อมูลจาก ICD10
มีใครทำรายงานเอาไว้แล้วไหมครับ

3.ผมรู้เข้าใจมาว่า ผู้ป่วยรายใหม่คือผู้ป่วยที่มารับบริการต่อเนื่อง ในปีล่าสุดครับ
นอกนั้นจะถือเป็นรายเก่าหมด
และในบางกรณีอาจดึง ICD10 มาเป็นข้อมูลภาวะแทรกซ้อนไม่ได้
เช่น คนไข้เป็น DM และ stroke
...ในการส่งรายงาน 5 โรคบอกให้ส่งเป็นภาวะแทรกซ้อนระบบหลอดเลือด
แต่ในคู่มือ ICD10 ให้ถือสองโรคนี้แยกกัน ให้วินิจฉัยเป็นเบาหวานไม่มีภาวะแทรกซ้อนเหมือนเดิม(เช่น E119) คู่กับ stroke ต่างหาก

ขอบคุณมากครับ

รายงานละเอียดขนาดนี้ผมยังไม่ไหว มึนตึ๊บครับ ;D
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ พฤศจิกายน 23, 2008, 21:32:39 PM
แต่ละรพ. ส่งข้อมูลกันอย่างไรหรือครับ :'(
ผมขอมาลองบ้างครับ  ::)
เครียดจัง อุตส่าห์ลงภาวะแทรกซ้อนไปตั้งเยอะ
แต่ไม่รู้จะดึงมาออกรายงานยังไง
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ พฤศจิกายน 24, 2008, 06:03:44 AM
CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2
code มันยากน่ะครับ มีใครช่วยแก้ได้ไหมครับ อ.อ๊อดช่วยทีครับ
ยอดได้น้อยเกิน + ยอดภาวะแทรกซ้อนไม่ออกครับ

โค๊ด: SQL
  1. unit MyIPDReport;
  2.  
  3. FUNCTION getsqlsubquerydatax(SQL:string):string;
  4. BEGIN
  5.   RESULT:='';
  6.   zquery.close;
  7.   zquery.SQL.text:=SQL;
  8.   zquery.OPEN;
  9.   zquery.FIRST;
  10.     while NOT zquery.eof do
  11.     BEGIN
  12.        IF RESULT='' THEN RESULT:=''''+zquery.FIELDS[0].asstring+'''' ELSE
  13.        RESULT:=RESULT+','''+zquery.FIELDS[0].asstring+'''';
  14.  
  15.        zquery.NEXT;
  16.     END;
  17.   zquery.close;
  18.     IF RESULT='' THEN RESULT:='''''';
  19.  
  20. END;
  21.  
  22. PROCEDURE main;
  23. var d1,d2:tdatetime;
  24. people_distinct_count1 : INTEGER;
  25. people_count1 : INTEGER;
  26. ds1,ds2:string;
  27. pttype_list1 : string;
  28. pttype,pttype_name:string;
  29. hospcode_list:string;
  30. money1:currency;
  31. i:INTEGER;
  32. clinic,cln_cor:string;
  33. visit_hn : string;
  34.  
  35. BEGIN
  36.    //showmessage('à¡ÕèÂǡѺÃÒ§ҹ'+#13+'Custom OPD-NK2');
  37.  
  38.    clinic:='';
  39.    clinic:= getpickuplist('select name from clinic where chronic="Y" order by name');
  40.    IF clinic='' THEN exit;
  41.  
  42.    pttype_name:=clinic;
  43.  
  44.    clinic:=getsqldata('select clinic from clinic where name="'+clinic+'"');
  45.  
  46.  
  47.    IF NOT getdaterange() THEN exit;
  48.    d1:=date_result1();
  49.    d2:=date_result2();
  50.  
  51.   // showmessage(formatdatetime('yyyy-mm-dd',d1)+' - '+
  52.    //  formatdatetime('yyyy-mm-dd',d2));
  53.  
  54.    ds1:=formatdatetime('yyyy-mm-dd',d1);
  55.    ds2:=formatdatetime('yyyy-mm-dd',d2);
  56.  
  57.  
  58.    visit_hn:=getsqlsubquerydata('select hn from clinicmember where clinic="'+clinic+'" and regdate between "'+ds1+'" and "'+ds2+'" ');
  59.   // visit_hn := getsqlsubquerydata('select distinct hn from ovst where vstdate between "'+ds1+'" and "'+ds2+'" and hn in ('+
  60.   //    visit_hn+') ');
  61.  
  62.    zquery.SQL.text:='delete from tempreport where id = "CUSTOM-CHRONIC2" ';
  63.    zquery.execsql;
  64.    fcds.close;
  65.    fcds.datarequest('select * from tempreport where id = "CUSTOM-CHRONIC2" ');
  66.    fcds.OPEN;
  67.  
  68.    fcds2.close;
  69.  
  70.    fcds2.datarequest('select * from clinic_cormobidity where clinic = "'+clinic+'"  '+
  71.    ' order by cormobidity');
  72.    fcds2.OPEN;
  73.    setstatuslabel('Open result : '+inttostr(fcds2.recordcount)+' Records');
  74.    fcds2.FIRST;
  75.  
  76.    i:=0;
  77.    i:=1;
  78.    fcds.INSERT;
  79.    fcds['id']:='CUSTOM-CHRONIC2';
  80.    fcds['reportname']:='CUSTOM-CHRONIC2';
  81.   // fcds['name']:=fcds2['vn'];
  82.    fcds['name1']:=pttype_name;
  83.    fcds['num']:=1;
  84.    fcds['num2']:=i;
  85.    fcds['date3']:=d1;
  86.    fcds['date4']:=d2;
  87.  
  88.    fcds['name2']:= pttype_name+' ÃÇÁ';
  89.    fcds['mon1']:= getsqldata('select count(hn) as cc '+
  90.       ' from clinicmember c1 '+
  91.       ' where clinic="'+clinic+'" and age_y<40 and sex="1" and hn in ('+visit_hn+') ');
  92.    fcds['mon2']:= getsqldata('select count(hn) as cc '+
  93.       ' from clinicmember c1 '+
  94.       ' where clinic="'+clinic+'" and age_y>=40 and age_y<=49 and sex="1" and hn in ('+visit_hn+') ');
  95.    fcds['mon3']:= getsqldata('select count(hn) as cc '+
  96.       ' from clinicmember c1 '+
  97.       ' where clinic="'+clinic+'" and age_y>=50 and age_y<=59 and sex="1" and hn in ('+visit_hn+') ');
  98.    fcds['mon4']:= getsqldata('select count(hn) as cc '+
  99.       ' from clinicmember c1 '+
  100.       ' where clinic="'+clinic+'" and age_y>=60 and sex="1" and hn in ('+visit_hn+') ');
  101.    fcds['mon5']:= getsqldata('select count(hn) as cc '+
  102.       ' from clinicmember c1 '+
  103.       ' where clinic="'+clinic+'" and sex="1" and hn in ('+visit_hn+') ');
  104.    fcds['mon6']:= getsqldata('select count(hn) as cc '+
  105.       ' from clinicmember c1 '+
  106.       ' where clinic="'+clinic+'"  and hn in ('+visit_hn+') ');
  107.  
  108.  
  109.    fcds.post;
  110.  
  111.  
  112.    fcds.INSERT;
  113.    fcds['id']:='CUSTOM-CHRONIC2';
  114.    fcds['reportname']:='CUSTOM-CHRONIC2';
  115.   // fcds['name']:=fcds2['vn'];
  116.    fcds['name1']:=pttype_name;
  117.    fcds['num']:=2;
  118.    fcds['num2']:=i;
  119.    fcds['date3']:=d1;
  120.    fcds['date4']:=d2;
  121.  
  122.    fcds['name2']:= pttype_name+' &Atilde;&Ccedil;&Aacute;';
  123.    fcds['mon1']:= getsqldata('select count(hn) as cc '+
  124.       ' from clinicmember c1 '+
  125.       ' where clinic="'+clinic+'" and age_y<40 and sex="2" and hn in ('+visit_hn+') ');
  126.    fcds['mon2']:= getsqldata('select count(hn) as cc '+
  127.       ' from clinicmember c1 '+
  128.       ' where clinic="'+clinic+'" and age_y>=40 and age_y<=49 and sex="2" and hn in ('+visit_hn+') ');
  129.    fcds['mon3']:= getsqldata('select count(hn) as cc '+
  130.       ' from clinicmember c1 '+
  131.       ' where clinic="'+clinic+'" and age_y>=50 and age_y<=59 and sex="2" and hn in ('+visit_hn+') ');
  132.    fcds['mon4']:= getsqldata('select count(hn) as cc '+
  133.       ' from clinicmember c1 '+
  134.       ' where clinic="'+clinic+'" and age_y>=60 and sex="2" and hn in ('+visit_hn+') ');
  135.    fcds['mon5']:= getsqldata('select count(hn) as cc '+
  136.       ' from clinicmember c1 '+
  137.       ' where clinic="'+clinic+'" and sex="2" and hn in ('+visit_hn+') ');
  138.  
  139.  
  140.  
  141.    fcds.post;
  142.  
  143.    i:=2;
  144.  
  145.    cln_cor:=getsqlsubquerydata('select distinct hn from clinic_cormobidity_list where clinic="'+clinic+'"');
  146.  
  147.    fcds.INSERT;
  148.    fcds['id']:='CUSTOM-CHRONIC2';
  149.    fcds['reportname']:='CUSTOM-CHRONIC2';
  150.   // fcds['name']:=fcds2['vn'];
  151.    fcds['name1']:=pttype_name;
  152.    fcds['num']:=1;
  153.    fcds['num2']:=i;
  154.    fcds['date3']:=d1;
  155.    fcds['date4']:=d2;
  156.  
  157.    fcds['name2']:= '&auml;&Aacute;&egrave;&Aacute;&Otilde;&Agrave;&Ograve;&Ccedil;&ETH;&aacute;&middot;&Atilde;&iexcl;&laquo;&eacute;&Iacute;&sup1;  &agrave;&iexcl;&egrave;&Ograve;';
  158.    fcds['mon1']:= getsqldata('select count(hn) as cc '+
  159.       ' from clinicmember c1 '+
  160.       ' where clinic="'+clinic+'" and age_y<40 and sex="1" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  161.    fcds['mon2']:= getsqldata('select count(hn) as cc '+
  162.       ' from clinicmember c1 '+
  163.       ' where clinic="'+clinic+'" and age_y>=40 and age_y<=49 and sex="1" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  164.    fcds['mon3']:= getsqldata('select count(hn) as cc '+
  165.       ' from clinicmember c1 '+
  166.       ' where clinic="'+clinic+'" and age_y>=50 and age_y<=59 and sex="1" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  167.    fcds['mon4']:= getsqldata('select count(hn) as cc '+
  168.       ' from clinicmember c1 '+
  169.       ' where clinic="'+clinic+'" and age_y>=60 and sex="1" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  170.    fcds['mon5']:= getsqldata('select count(hn) as cc '+
  171.       ' from clinicmember c1 '+
  172.       ' where clinic="'+clinic+'" and sex="1" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  173.    fcds['mon6']:= getsqldata('select count(hn) as cc '+
  174.       ' from clinicmember c1 '+
  175.       ' where clinic="'+clinic+'"  and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  176.  
  177.    fcds.post;
  178.  
  179.    fcds.INSERT;
  180.    fcds['id']:='CUSTOM-CHRONIC2';
  181.    fcds['reportname']:='CUSTOM-CHRONIC2';
  182.   // fcds['name']:=fcds2['vn'];
  183.    fcds['name1']:=pttype_name;
  184.    fcds['num']:=2;
  185.    fcds['num2']:=i;
  186.    fcds['date3']:=d1;
  187.    fcds['date4']:=d2;
  188.  
  189.    fcds['name2']:= '&auml;&Aacute;&egrave;&Aacute;&Otilde;&Agrave;&Ograve;&Ccedil;&ETH;&aacute;&middot;&Atilde;&iexcl;&laquo;&eacute;&Iacute;&sup1;  &agrave;&iexcl;&egrave;&Ograve;';
  190.    fcds['mon1']:= getsqldata('select count(hn) as cc '+
  191.       ' from clinicmember c1 '+
  192.       ' where clinic="'+clinic+'" and age_y<40 and sex="2" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  193.    fcds['mon2']:= getsqldata('select count(hn) as cc '+
  194.       ' from clinicmember c1 '+
  195.       ' where clinic="'+clinic+'" and age_y>=40 and age_y<=49 and sex="2" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  196.    fcds['mon3']:= getsqldata('select count(hn) as cc '+
  197.       ' from clinicmember c1 '+
  198.       ' where clinic="'+clinic+'" and age_y>=50 and age_y<=59 and sex="2" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  199.    fcds['mon4']:= getsqldata('select count(hn) as cc '+
  200.       ' from clinicmember c1 '+
  201.       ' where clinic="'+clinic+'" and age_y>=60 and sex="2" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  202.    fcds['mon5']:= getsqldata('select count(hn) as cc '+
  203.       ' from clinicmember c1 '+
  204.       ' where clinic="'+clinic+'" and sex="2" and hn not in ('+cln_cor+') and (new_case is NULL or new_case="N" or new_case="")  and hn in ('+visit_hn+') ');
  205.  
  206.  
  207.    fcds.post;
  208.  
  209.  
  210.    i:=3;
  211.  
  212.    cln_cor:=getsqlsubquerydata('select distinct hn from clinic_cormobidity_list where clinic="'+clinic+'"');
  213.  
  214.    fcds.INSERT;
  215.    fcds['id']:='CUSTOM-CHRONIC2';
  216.    fcds['reportname']:='CUSTOM-CHRONIC2';
  217.   // fcds['name']:=fcds2['vn'];
  218.    fcds['name1']:=pttype_name;
  219.    fcds['num']:=1;
  220.    fcds['num2']:=i;
  221.    fcds['date3']:=d1;
  222.    fcds['date4']:=d2;
  223.  
  224.    fcds['name2']:= '&auml;&Aacute;&egrave;&Aacute;&Otilde;&Agrave;&Ograve;&Ccedil;&ETH;&aacute;&middot;&Atilde;&iexcl;&laquo;&eacute;&Iacute;&sup1;  &atilde;&Euml;&Aacute;&egrave;';
  225.    fcds['mon1']:= getsqldata('select count(hn) as cc '+
  226.       ' from clinicmember c1 '+
  227.       ' where clinic="'+clinic+'" and age_y<40 and sex="1" and hn not in ('+cln_cor+') and new_case="Y"  and hn in ('+visit_hn+') ');
  228.    fcds['mon2']:= getsqldata('select count(hn) as cc '+
  229.       ' from clinicmember c1 '+
  230.       ' where clinic="'+clinic+'" and age_y>=40 and age_y<=49 and sex="1" and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  231.    fcds['mon3']:= getsqldata('select count(hn) as cc '+
  232.       ' from clinicmember c1 '+
  233.       ' where clinic="'+clinic+'" and age_y>=50 and age_y<=59 and sex="1" and hn not in ('+cln_cor+') and new_case="Y"  and hn in ('+visit_hn+') ');
  234.    fcds['mon4']:= getsqldata('select count(hn) as cc '+
  235.       ' from clinicmember c1 '+
  236.       ' where clinic="'+clinic+'" and age_y>=60 and sex="1" and hn not in ('+cln_cor+') and new_case="Y"  and hn in ('+visit_hn+') ');
  237.    fcds['mon5']:= getsqldata('select count(hn) as cc '+
  238.       ' from clinicmember c1 '+
  239.       ' where clinic="'+clinic+'" and sex="1" and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  240.    fcds['mon6']:= getsqldata('select count(hn) as cc '+
  241.       ' from clinicmember c1 '+
  242.       ' where clinic="'+clinic+'"  and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  243.  
  244.    fcds.post;
  245.  
  246.    fcds.INSERT;
  247.    fcds['id']:='CUSTOM-CHRONIC2';
  248.    fcds['reportname']:='CUSTOM-CHRONIC2';
  249.   // fcds['name']:=fcds2['vn'];
  250.    fcds['name1']:=pttype_name;
  251.    fcds['num']:=2;
  252.    fcds['num2']:=i;
  253.    fcds['date3']:=d1;
  254.    fcds['date4']:=d2;
  255.  
  256.    fcds['name2']:= '&auml;&Aacute;&egrave;&Aacute;&Otilde;&Agrave;&Ograve;&Ccedil;&ETH;&aacute;&middot;&Atilde;&iexcl;&laquo;&eacute;&Iacute;&sup1;  &atilde;&Euml;&Aacute;&egrave;';
  257.    fcds['mon1']:= getsqldata('select count(hn) as cc '+
  258.       ' from clinicmember c1 '+
  259.       ' where clinic="'+clinic+'" and age_y<40 and sex="2" and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  260.    fcds['mon2']:= getsqldata('select count(hn) as cc '+
  261.       ' from clinicmember c1 '+
  262.       ' where clinic="'+clinic+'" and age_y>=40 and age_y<=49 and sex="2" and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  263.    fcds['mon3']:= getsqldata('select count(hn) as cc '+
  264.       ' from clinicmember c1 '+
  265.       ' where clinic="'+clinic+'" and age_y>=50 and age_y<=59 and sex="2" and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  266.    fcds['mon4']:= getsqldata('select count(hn) as cc '+
  267.       ' from clinicmember c1 '+
  268.       ' where clinic="'+clinic+'" and age_y>=60 and sex="2" and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  269.    fcds['mon5']:= getsqldata('select count(hn) as cc '+
  270.       ' from clinicmember c1 '+
  271.       ' where clinic="'+clinic+'" and sex="2" and hn not in ('+cln_cor+') and new_case="Y"   and hn in ('+visit_hn+') ');
  272.  
  273.  
  274.    fcds.post;
  275.  
  276.  
  277.    while NOT fcds2.eof do
  278.    BEGIN
  279.     i:=i+1;
  280.     setprogressbar(i,fcds2.recordcount);
  281.      fcds.INSERT;
  282.    fcds['id']:='CUSTOM-CHRONIC2';
  283.    fcds['reportname']:='CUSTOM-CHRONIC2';
  284.   // fcds['name']:=fcds2['vn'];
  285.    fcds['name1']:=pttype_name;
  286.    fcds['num']:=1;
  287.    fcds['num2']:=i;
  288.    fcds['date3']:=d1;
  289.    fcds['date4']:=d2;
  290.  
  291.    fcds['name2']:= fcds2['name'];
  292.    fcds['mon1']:= getsqldata('select count(c3.hn) as cc '+
  293.       ' from clinic_cormobidity c1 '+
  294.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y < 40 and c2.sex="1" '+
  295.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  296.       ' where c1.name="'+fcds2['name']+'" ');
  297.    fcds['mon2']:= getsqldata('select count(c3.hn) as cc '+
  298.       ' from clinic_cormobidity c1 '+
  299.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y >= 40 and c2.age_y <= 49 and c2.sex="1" '+
  300.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  301.       ' where c1.name="'+fcds2['name']+'"   ');
  302.    fcds['mon3']:= getsqldata('select count(c3.hn) as cc '+
  303.       ' from clinic_cormobidity c1 '+
  304.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y >= 50 and c2.age_y <= 59 and c2.sex="1" '+
  305.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  306.       ' where c1.name="'+fcds2['name']+'" ');
  307.    fcds['mon4']:= getsqldata('select count(c3.hn) as cc '+
  308.       ' from clinic_cormobidity c1 '+
  309.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y >= 60 and c2.sex="1" '+
  310.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  311.       ' where c1.name="'+fcds2['name']+'" ');
  312.    fcds['mon5']:= getsqldata('select count(c3.hn) as cc '+
  313.       ' from clinic_cormobidity c1 '+
  314.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.sex="1" '+
  315.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  316.       ' where c1.name="'+fcds2['name']+'"   ');
  317.    fcds['mon6']:= getsqldata('select count(c3.hn) as cc '+
  318.       ' from clinic_cormobidity c1 '+
  319.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic  '+
  320.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  321.       ' where c1.name="'+fcds2['name']+'"  ');
  322.  
  323.  
  324.  
  325.    //fcds['date1']:=d1;
  326.    //fcds['date2']:=d2;
  327.  
  328.  
  329.    fcds.post;
  330.  
  331.  
  332.     fcds.INSERT;
  333.     fcds['id']:='CUSTOM-CHRONIC2';
  334.     fcds['reportname']:='CUSTOM-CHRONIC2';
  335.     fcds['num']:=2;
  336.     fcds['num2']:=i;
  337.     fcds['date3']:=d1;
  338.     fcds['date4']:=d2;
  339.  
  340.     fcds['mon1']:= getsqldata('select count(c3.hn) as cc '+
  341.       ' from clinic_cormobidity c1 '+
  342.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y < 40 and c2.sex="2" '+
  343.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  344.       ' where c1.name="'+fcds2['name']+'" ');
  345.    fcds['mon2']:= getsqldata('select count(c3.hn) as cc '+
  346.       ' from clinic_cormobidity c1 '+
  347.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y >= 40 and c2.age_y <= 49 and c2.sex="2" '+
  348.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  349.       ' where c1.name="'+fcds2['name']+'"   ');
  350.    fcds['mon3']:= getsqldata('select count(c3.hn) as cc '+
  351.       ' from clinic_cormobidity c1 '+
  352.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y >= 50 and c2.age_y <= 59 and c2.sex="2" '+
  353.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  354.       ' where c1.name="'+fcds2['name']+'"   ');
  355.    fcds['mon4']:= getsqldata('select count(c3.hn) as cc '+
  356.       ' from clinic_cormobidity c1 '+
  357.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.age_y >= 60 and c2.sex="2" '+
  358.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  359.       ' where c1.name="'+fcds2['name']+'"  ');
  360.    fcds['mon5']:= getsqldata('select count(c3.hn) as cc '+
  361.       ' from clinic_cormobidity c1 '+
  362.       ' left outer join clinicmember c2 on c2.clinic=c1.clinic and c2.sex="2" '+
  363.       ' left outer join clinic_cormobidity_list c3 on c3.hn=c2.hn and c3.clinic=c2.clinic and c3.cormobidity=c1.cormobidity  and c3.hn in ('+visit_hn+') '+
  364.       ' where c1.name="'+fcds2['name']+'"   ');
  365.  
  366.     fcds.post;
  367.    fcds2.NEXT;
  368.    END;
  369.  
  370.    fcds.datarequest('select * from tempreport where id = "CUSTOM-CHRONIC2" ');
  371.    applyupdate_fcds();
  372.  
  373. END;
  374.  
  375. END.
  376.  
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: white ที่ พฤศจิกายน 25, 2008, 07:35:11 AM
ท่านทั้งหลายครับ
ขอคำแนะนำหน่อยครับ :'(
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: manoi ที่ พฤศจิกายน 25, 2008, 07:58:03 AM
เรื่องระบบบันทึกข้อมูลผู้ป่วยโรคเรื้อรังตอนนี้ ระบบมี concept แบบนี้ครับ

1. รายการทะเบียนทั้งหมดอยู่ในตาราง clinic  (กำหนด field chronic = Y เพื่อบอกว่าเป็นโรคเรื้อรัง)
2. ข้อมูลผู้ที่ถูกลงทะเบียนทั้งหมดจะถูกบันทึกอยู่ใน clinicmember โดยมี field clinic ช่วยแยกชนิดว่าใครถูกลงทะเบียนใน Clinic อะไร ข้อมูลที่เหลือใช้สำหรับช่วยแยกข้อมูลอื่นๆ และทำรายงาน แต่กรณีผู้ป่วยรายใหม่ จะมี 2 แบบครับ คือใหม่ในปี กับใหม่จริงๆ หากเป็นใหม่ จริงๆ สามารถใช้ regdate มากรองข้อมูลหรือ รายใหม่ตามเงื่อนไขอื่นๆ (ผมเองก็ยังไม่ทราบชัดว่ามีเงื่อนไขอะไรบ้าง แต่มี checkbox ให้ check) ก็ใช้ข้อมูล new_case มาช่วยกรองทำรายงานก็ได้เหมือนกันครับ
3. ข้อมูลภาวะแทรกซ้อนของแต่ละโรคสามารถกำหนดได้ในตาราง clinic_cormobidity โดยสามารถกำหนดแยกของแต่ละ clinic ได้
4. ข้อมูลภาวะแทรกซ้อนของผู้ป่วยแต่ละคน สามารถเพิ่มและยกเลิกได้ โดยข้อมูล ณ ปัจจุบันของแต่ละคนจะถูกเก็บไว้ในตาราง clinic_cormobidity_list และสามารถใช้ field begin_date มาช่วยกรองข้อมูลได้ครับ

(เดี๋ยวมาต่อให้ครับ)
หัวข้อ: Re: CUSTOM-สรุปยอดภาวะแทรกซ้อนของผู้ป่วยโรคเรื้อรัง v2 ?
เริ่มหัวข้อโดย: golf_win ที่ พฤศจิกายน 26, 2008, 20:38:12 PM
มารอฟัง อ.MN แนะนำต่อ+ขออนุญาติดันกระทู้เอาไว้ครับ(ถ้ารายงานนี้สมบูรณ์อาจไม่ต้อง export ออกจากตัวโปรแกรม Surveillance )   :o :o