BMS-HOSxP Community
HOSxP => Development => ข้อความที่เริ่มโดย: naj ที่ ธันวาคม 25, 2012, 17:04:51 PM
-
สำหรับใช้แก้ปัญหาปัญหาการส่งตรวจและ Admit ผิดคน ครับ :)
คำเตือน:
tool นี้ไม่มี undo นะครับ :) :) :) :)
-
ถ้าสนใจ ติดต่อน้อง IT ที่ รพ ได้เลยครับ น้องเขาจะส่งโปรแกรมไปให้พร้อมคำแนะนำดีๆในการใช้และข้อควรระวัง ;D ;D ;D ;D
หมายเหตุ:
การกระทำใดๆอันเกิดจากน้อง IT ที่ รพ. ผมได้กระทำลงไป ขอให้น้องเขาเป้นผู้รับผิดชอบแต่เพียงผู้เดียวเท่านั้น ครอบครัว เข็มแข็ง ไม่เกี่ยวนะครับ.... ;D ;D ;D ;D ;D
-
การกระทำใดๆอันเกิดจากน้อง IT ที่ รพ. ผมได้กระทำลงไป ขอให้น้องเขาเป้นผู้รับผิดชอบแต่เพียงผู้เดียวเท่านั้น ครอบครัว เข็มแข็ง ไม่เกี่ยวนะครับ.... Grin Grin Grin Grin Grin
;D ;D ;D
อิ อิ อิ Family man เป็นคนรักครอบครัวอย่างอบอุ่น แต่แบบนี้แถวบ้านผมเรียกว่ารักน้องจริง.....ทิ้งน้องเห็น ๆ จะจะ ครับ
;D ;D ;D
-
ขออภัยด้วยที่ไม่ได้แจกมาบน Board นี้ครับ แต่ถ้าใครสนใจที่จะช่วยร่วมทดสอบการใช้งานให้แจ้งมาที่ mail ของ น้อง IT opendead100@gmail.com เนื่องจากน้องเขากำลังตรวจสอบความถูกต้องก่อนครับ ถ้าทดสอบจนมั่นใจว่าใช้งานได้แน่นอนถูกต้อง จะ upload ตัว STABLE ให้ต่อไปครับ :) :) :) :) :) :)
-
น้องเข้าตั้งใจทำครับ :) :) :)
-
ช่วงนี้เมล์ใช้ไม่ได้เลย น่าจะแจกบนบอร์ดนะครับ
-
opendead100
... อิอิ แค่ชื่อก็กินขาดแล้วครับ ;D ;D ;D
แสดงว่า อ.นาจ กำลังจะวางมือ (ไม่รู้โดนบังคับหรือป่าว .. อิอิ)
... Yindee Tan หมายถึง มาแทนยินดี หรือว่าลูกคนที่สองครับ ...
-
สำหรับใช้แก้ปัญหาปัญหาการส่งตรวจและ Admit ผิดคน ครับ :)
คำเตือน:
tool นี้ไม่มี undo นะครับ :) :) :) :)
ผมว่าถ้าจะ undo ก็ทำกลับกันได้ไหมครับ
เช่น จาก แก้จาก hnเดิม 5600001 --> 56000002
เป็น 56000002 --> 5600001 ก็น่าจะเป็นการ undo ที่สมบูรณ์นะครับ โดยใช้ vn เหมือนกัน
sql สำหรับแก้ส่งตรวจผิดคนน่าจะประมาณนี้นะครับ
update an_stat set hn='5600002' where vn='560101000000' and hn='5600001';
update anc_detail set hn='5600002' where vn='560101000000' and hn='5600001';
update approve_doctor set hn='5600002' where vn='560101000000' and hn='5600001';
update ar_head set hn='5600002' where vn='560101000000' and hn='5600001';
update blood_request set hn='5600002' where vn='560101000000' and hn='5600001';
update cancer_nursenote set hn='5600002' where vn='560101000000' and hn='5600001';
update cancer_nursenote_icrt set hn='5600002' where vn='560101000000' and hn='5600001';
update clinic_cormobidity_diabete set hn='5600002' where vn='560101000000' and hn='5600001';
update clinic_visit set hn='5600002' where vn='560101000000' and hn='5600001';
update clinicmember_cormobidity_screen set hn='5600002' where vn='560101000000' and hn='5600001';
update doctor_cert set hn='5600002' where vn='560101000000' and hn='5600001';
update doctor_consult set hn='5600002' where vn='560101000000' and hn='5600001';
update doctor_fee_list set hn='5600002' where vn='560101000000' and hn='5600001';
update doctor_order_print set hn='5600002' where vn='560101000000' and hn='5600001';
update doctor_order_print_queue set hn='5600002' where vn='560101000000' and hn='5600001';
update doctorptotlist set hn='5600002' where vn='560101000000' and hn='5600001';
update doctorscreen set hn='5600002' where vn='560101000000' and hn='5600001';
update dtmain set hn='5600002' where vn='560101000000' and hn='5600001';
update dtmain_save set hn='5600002' where vn='560101000000' and hn='5600001';
update ekg_request set hn='5600002' where vn='560101000000' and hn='5600001';
update enoc_member set hn='5600002' where vn='560101000000' and hn='5600001';
update enoc_member_dw set hn='5600002' where vn='560101000000' and hn='5600001';
update factordm set hn='5600002' where vn='560101000000' and hn='5600001';
update fbshistory set hn='5600002' where vn='560101000000' and hn='5600001';
update finance_check set hn='5600002' where vn='560101000000' and hn='5600001';
update finance_deposit set hn='5600002' where vn='560101000000' and hn='5600001';
update health_med_queue set hn='5600002' where vn='560101000000' and hn='5600001';
update health_med_service set hn='5600002' where vn='560101000000' and hn='5600001';
update inc_opd_stat set hn='5600002' where vn='560101000000' and hn='5600001';
update inc_std_opd_stat set hn='5600002' where vn='560101000000' and hn='5600001';
update incoth set hn='5600002' where vn='560101000000' and hn='5600001';
update ipt set hn='5600002' where vn='560101000000' and hn='5600001';
update ipt_admit_queue set hn='5600002' where vn='560101000000' and hn='5600001';
update lab_app_head set hn='5600002' where vn='560101000000' and hn='5600001';
update lab_head set hn='5600002' where vn='560101000000' and hn='5600001';
update medplan_ipd_wait set hn='5600002' where vn='560101000000' and hn='5600001';
update oapp set hn='5600002' where vn='560101000000' and hn='5600001';
update oapp_cancel set hn='5600002' where vn='560101000000' and hn='5600001';
update oapp_temp set hn='5600002' where vn='560101000000' and hn='5600001';
update opd_card_request set hn='5600002' where vn='560101000000' and hn='5600001';
update opd_presc_machine set hn='5600002' where vn='560101000000' and hn='5600001';
update opdscan set hn='5600002' where vn='560101000000' and hn='5600001';
update opdscreen set hn='5600002' where vn='560101000000' and hn='5600001';
update opdscreening set hn='5600002' where vn='560101000000' and hn='5600001';
update operation_cancel set hn='5600002' where vn='560101000000' and hn='5600001';
update operation_list set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece_arc set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece_bak set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece_delta set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece_finance_delete set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece_innodb set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece_ipd set hn='5600002' where vn='560101000000' and hn='5600001';
update opitemrece_trx set hn='5600002' where vn='560101000000' and hn='5600001';
update ovaccident set hn='5600002' where vn='560101000000' and hn='5600001';
update ovst set hn='5600002' where vn='560101000000' and hn='5600001';
update ovst_department set hn='5600002' where vn='560101000000' and hn='5600001';
update ovstdiag set hn='5600002' where vn='560101000000' and hn='5600001';
update patient_cancer_interrogate set hn='5600002' where vn='560101000000' and hn='5600001';
update patient_cancer_order_3dcrt set hn='5600002' where vn='560101000000' and hn='5600001';
update patient_history_pe_visit set hn='5600002' where vn='560101000000' and hn='5600001';
update patient_opd_scan set hn='5600002' where vn='560101000000' and hn='5600001';
update physic_main set hn='5600002' where vn='560101000000' and hn='5600001';
update pq_rxorder set hn='5600002' where vn='560101000000' and hn='5600001';
update provis_direct_person_op set hn='5600002' where vn='560101000000' and hn='5600001';
update psychia_service_list set hn='5600002' where vn='560101000000' and hn='5600001';
update psychia_visit set hn='5600002' where vn='560101000000' and hn='5600001';
update ptdepart set hn='5600002' where vn='560101000000' and hn='5600001';
update pteroprt set hn='5600002' where vn='560101000000' and hn='5600001';
update rcpt_abort set hn='5600002' where vn='560101000000' and hn='5600001';
update rcpt_arrear set hn='5600002' where vn='560101000000' and hn='5600001';
update rcpt_credit set hn='5600002' where vn='560101000000' and hn='5600001';
update rcpt_current set hn='5600002' where vn='560101000000' and hn='5600001';
update rcpt_debt set hn='5600002' where vn='560101000000' and hn='5600001';
update rcpt_debt_cancel set hn='5600002' where vn='560101000000' and hn='5600001';
update rcpt_print set hn='5600002' where vn='560101000000' and hn='5600001';
update referin set hn='5600002' where vn='560101000000' and hn='5600001';
update referout set hn='5600002' where vn='560101000000' and hn='5600001';
update report_sks set hn='5600002' where vn='560101000000' and hn='5600001';
update rvp_accident set hn='5600002' where vn='560101000000' and hn='5600001';
update service_time set hn='5600002' where vn='560101000000' and hn='5600001';
update sti_patient_counseling set hn='5600002' where vn='560101000000' and hn='5600001';
update sti_patient_queue set hn='5600002' where vn='560101000000' and hn='5600001';
update sti_patient_std set hn='5600002' where vn='560101000000' and hn='5600001';
update sti_queue set hn='5600002' where vn='560101000000' and hn='5600001';
update surveil_member set hn='5600002' where vn='560101000000' and hn='5600001';
update surveil_member_507 set hn='5600002' where vn='560101000000' and hn='5600001';
update surveil_member_dw set hn='5600002' where vn='560101000000' and hn='5600001';
update temp412a061 set hn='5600002' where vn='560101000000' and hn='5600001';
update temp412a071 set hn='5600002' where vn='560101000000' and hn='5600001';
update temp412a091 set hn='5600002' where vn='560101000000' and hn='5600001';
update temp412b031 set hn='5600002' where vn='560101000000' and hn='5600001';
update temp412b051 set hn='5600002' where vn='560101000000' and hn='5600001';
update temp412b091 set hn='5600002' where vn='560101000000' and hn='5600001';
update temp421d071 set hn='5600002' where vn='560101000000' and hn='5600001';
update tempblue_command1 set hn='5600002' where vn='560101000000' and hn='5600001';
update tempcom41 set hn='5600002' where vn='560101000000' and hn='5600001';
update tempdental1 set hn='5600002' where vn='560101000000' and hn='5600001';
update universal_head set hn='5600002' where vn='560101000000' and hn='5600001';
update visit_name set hn='5600002' where vn='560101000000' and hn='5600001';
update visit_pay_plan set hn='5600002' where vn='560101000000' and hn='5600001';
update vital_sign_data set hn='5600002' where vn='560101000000' and hn='5600001';
update vn_stat set hn='5600002' where vn='560101000000' and hn='5600001';
update xray_head set hn='5600002' where vn='560101000000' and hn='5600001';
update xray_report set hn='5600002' where vn='560101000000' and hn='5600001';
-
รอสักครู่ ช่วงบ่ายผมจะ upload ให้ครับ :) :) :)
-
ขอ source code ด้วยได้ไหมครับจะได้เอาเป็นแรงบันดาลใจ ;D ;D
-
upload ให้แล้ว file จะอยู่ด้านล่างของกระทู้นี้ครับ YindeeAndTan Tool For HOSxP 3.55.12.26
code ที่แก้ไขกรณีเป็น IPD Case
procedure TIPDAdmitEditForm.cxButton2Click(Sender: TObject);
var i,i1:integer;
begin
if cxTextEdit1.Text='' then
begin
ShowMessage('ไม่ได้กำหนด HN ที่ส่งตรวจผิด');
cxTextEdit1.SetFocus;
Exit;
end;
if cxTextEdit2.Text='' then
begin
ShowMessage('ไม่ได้กำหนด AN');
cxTextEdit2.SetFocus;
Exit;
end;
if Length(cxTextEdit2.Text)<>9 then
begin
ShowMessage('AN ต้องเท่ากับ 9 หลัก');
cxTextEdit2.SetFocus;
Exit;
end;
if cxTextEdit3.Text<>'' then
begin
TC.Close;
tc.data:=hosxp_getdataset('select * from hosxp_ddl_field where field_name ="an"');
ClientDataSet1.Close;
ClientDataSet1.data:=HOSxP_GetDataSet('select sys_value from '+
'sys_var where sys_name="hn_digit"');
i1:=StrToInt(ClientDataSet1.FieldByName('sys_value').AsString);
{PatientCDS.Close;
PatientCDS.Data:=HOSxP_GetDataSet('select concat(pname,fname," ",lname) as ptname '+
'from patient where hn="'+addzero(cxtextedit3.text,i1)+'" limit 1') ;}
ProgressBar1.position:=0;
ProgressBar1.max:=tc.recordcount;
i:=0;
while not tc.eof do
begin
i:=i+1;
label1.caption:='ตารางที่:'+inttostr(i)+': ชื่อ: '+tc.fields[0].asstring;
if tc.fields[1].asstring ='an' then
begin
Memo1.lines.add('Table...'+tc.fields[0].asstring);
try
hosxp_getdataset('update '+tc.fields[0].asstring+' set hn="'+
addzero(cxtextedit3.text,i1)+'" where an="'+
cxTextEdit2.text+'" and hn="'+AddZero(cxtextedit1.text,i1)+'" ');
HOSxP_GetDataSet('update lab_head set '+
'hn="'+addzero(cxtextedit3.text,i1)+'" '+
'where vn="'+ cxTextEdit2.text+'" ') ;
HOSxP_GetDataSet('update patient set '+
'admit="Y" '+
'where hn="'+ addzero(cxtextedit3.text,i1)+'" limit 1') ;
HOSxP_GetDataSet('update patient set '+
'admit="N" '+
'where hn="'+ addzero(cxtextedit1.text,i1)+'" limit 1') ;
except end;
end;
memo1.lines.add('Change...'+'update '+tc.fields[0].asstring+' set hn="'
+addzero(cxtextedit3.text,i1)+'" where an="'+cxtextedit2.text+'" and hn="'+
AddZero(cxtextedit1.text,i1)+'" ---> OK');
ProgressBar1.position:=ProgressBar1.position+1;
application.processmessages;
tc.next;
end;
Memo1.Lines.Add('--------------------------------------------------------------------------------------------------------------------');
Memo1.Lines.Add('Data Update Successfull...');
tc.close;
ClientDataSet1.Close;
PatientCDS.Close;
showmessage('Done.');
end else
begin
ShowMessage('ไม่ได้กำนด HN ที่ถูกต้อง') ;
cxTextEdit3.SetFocus;
Exit;
end;
end;
//////////////////////////////////////////////////////////////////
code กรณีเป็น OPD CASE
procedure TOPDvisitEditForm.cxButton2Click(Sender: TObject);
var i,i1:integer;
begin
if cxTextEdit1.Text='' then
begin
ShowMessage('ไม่ได้กำหนด HN ที่ส่งตรวจผิด');
cxTextEdit1.SetFocus;
Exit;
end;
if cxTextEdit2.Text='' then
begin
ShowMessage('ไม่ได้กำหนด VN');
cxTextEdit2.SetFocus;
Exit;
end;
if Length(cxTextEdit2.Text)<>12 then
begin
ShowMessage('VN ต้องเท่ากับ 12 หลัก');
cxTextEdit2.SetFocus;
Exit;
end;
if cxTextEdit3.Text<>'' then
begin
TC.Close;
tc.data:=hosxp_getdataset('select * from hosxp_ddl_field where field_name ="vn"');
ClientDataSet1.Close;
ClientDataSet1.data:=HOSxP_GetDataSet('select sys_value from '+
'sys_var where sys_name="hn_digit"');
i1:=StrToInt(ClientDataSet1.FieldByName('sys_value').AsString);
PatientCDS.Close;
PatientCDS.Data:=HOSxP_GetDataSet('select concat(pname,fname," ",lname) as ptname '+
'from patient where hn="'+addzero(cxtextedit3.text,i1)+'" limit 1') ;
ProgressBar1.position:=0;
ProgressBar1.max:=tc.recordcount;
i:=0;
while not tc.eof do
begin
i:=i+1;
label1.caption:='ตารางที่:'+inttostr(i)+' ชื่อ '+tc.fields[0].asstring+' Done...';
if tc.fields[1].asstring ='vn' then
begin
Memo1.lines.add('Table...'+tc.fields[0].asstring);
try
hosxp_getdataset('update '+tc.fields[0].asstring+' set hn="'+
addzero(cxtextedit3.text,i1)+'" where vn="'+
cxTextEdit2.text+'" and hn="'+AddZero(cxtextedit1.text,i1)+'" ');
HOSxP_GetDataSet('update visit_name set '+
'patient_name="'+patientcds.FieldByName('ptname').AsString+'" '+
'where vn="'+ cxTextEdit2.text+'" ') ;
except end;
end;
memo1.lines.add('Change...'+'update '+tc.fields[0].asstring+' set hn="'
+addzero(cxtextedit3.text,i1)+'" where vn="'+cxtextedit2.text+'" and hn="'+
AddZero(cxtextedit1.text,i1)+'" ---> OK');
ProgressBar1.position:=ProgressBar1.position+1;
application.processmessages;
tc.next;
end;
Memo1.Lines.Add('--------------------------------------------------------------------------------------------------------------------');
Memo1.Lines.Add('Data Update Successfull...');
tc.close;
ClientDataSet1.Close;
PatientCDS.Close;
showmessage('Done.');
end else
begin
ShowMessage('ไม่ได้กำหนด HN ที่ถูกต้อง') ;
cxTextEdit3.SetFocus;
Exit;
end;
end;
-
สิ่งที่โปรแกรมตรวจสอบ
เงื่อนไขทุกช่องต้องมีข้อมูล ว่างไม่ได้
สิ่งที่ไม่ได้ตรวจสอบ
hn,vn,an มีจริงอยู่ในฐานข้อมูลหรือไม่ น้องเขาไม่ได้ทำระบบ search
AN,VN เป็นของ HN ที่ส่งตรวจผิดหรือเปล่า
ดังนั้น ตอนที่นำไปใช้งานต้องแน่ใจว่าถูกต้อง :) :) :) :) :)
เป็น Tool เล็กๆที่ใช้สำหรับแก้ปัญหาเฉพาะหน้าให้กับ admin :)