ผู้เขียน หัวข้อ: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน  (อ่าน 11684 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

doramon

  • บุคคลทั่วไป
Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« เมื่อ: มีนาคม 07, 2008, 14:48:01 PM »
0
ฝากให้ มะการักษ์

Scipt โอนข้อมูล pe_template  ให้กลับหมอทุกคน

DFM

โค๊ด: Pascal
  1.  
  2. object Form8: TForm8
  3.   Left = 0
  4.   Top = 0
  5.   Caption = ' Doctor pe_template Note Copy'
  6.   ClientHeight = 248
  7.   ClientWidth = 409
  8.   Color = clMoneyGreen
  9.   Font.Charset = DEFAULT_CHARSET
  10.   Font.Color = clWindowText
  11.   Font.Height = -11
  12.   Font.Name = 'Tahoma'
  13.   Font.Style = []
  14.   OldCreateOrder = False
  15.   Position = poMainFormCenter
  16.   OnShow = FormShow
  17.   PixelsPerInch = 96
  18.   TextHeight = 13
  19.   object Label1: TLabel
  20.     Left = 21
  21.     Top = 0
  22.     Width = 89
  23.     Height = 13
  24.     Caption = 'Copy pe_template'#3607#3637#3656#3651#3594#3657#3610#3656#3629#3618
  25.   end
  26.   object Label2: TLabel
  27.     Left = 24
  28.     Top = 39
  29.     Width = 39
  30.     Height = 13
  31.     Caption = #3648#3621#3639#3629#3585#3594#3639#3656#3629
  32.   end
  33.   object Label3: TLabel
  34.     Left = 54
  35.     Top = 192
  36.     Width = 313
  37.     Height = 23
  38.     Caption = 'OOD HOSXP  &   BMS'
  39.     Font.Charset = DEFAULT_CHARSET
  40.     Font.Color = clYellow
  41.     Font.Height = -19
  42.     Font.Name = 'Tahoma'
  43.     Font.Style = []
  44.     ParentFont = False
  45.   end
  46.   object cxComboBox1: TcxComboBox
  47.     Left = 21
  48.     Top = 63
  49.     TabOrder = 0
  50.     Width = 172
  51.   end
  52.   object Button1: TButton
  53.     Left = 285
  54.     Top = 33
  55.     Width = 94
  56.     Height = 36
  57.     Caption = 'Copy to all doctor'
  58.     TabOrder = 1
  59.     OnClick = Button1Click
  60.   end
  61.   object pg: TProgressBar
  62.     Left = 7
  63.     Top = 126
  64.     Width = 394
  65.     Height = 17
  66.     TabOrder = 2
  67.   end
  68. end
  69.  
  70.  
  71.  
  72.  

pas

โค๊ด: Delphi
  1.  
  2. unit Unit8;
  3.  
  4. interface
  5.  
  6. uses
  7.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  8.   Dialogs, cxGraphics, ComCtrls, StdCtrls, cxControls, cxContainer, cxEdit,
  9.   cxTextEdit, cxMaskEdit, cxDropDownEdit;
  10.  
  11. type
  12.   TForm8 = class(TForm)
  13.     Label1: TLabel;
  14.     cxComboBox1: TcxComboBox;
  15.     Button1: TButton;
  16.     pg: TProgressBar;
  17.     Label2: TLabel;
  18.     Label3: TLabel;
  19.     procedure Button1Click(Sender: TObject);
  20.     procedure FormShow(Sender: TObject);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   Form8: TForm8;
  29.  
  30. implementation
  31.  
  32. {$R *.dfm}
  33.  
  34. procedure TForm8.Button1Click(Sender: TObject);
  35. var tc1,tc2,tc3:tclientdataset; dc:string;
  36. begin
  37.   if cxcombobox1.text='' then exit;
  38.   dc:=vartostr(getsqldata('select code from doctor where name = "'+cxcombobox1.text+'"'));
  39.  
  40.   tc1:=tclientdataset.create(nil);
  41.   tc2:=tclientdataset.create(nil);
  42.   tc3:=tclientdataset.create(nil);
  43.   tc1.data:=hosxp_getdataset('select code from doctor where name <> "'+cxcombobox1.text+'"');
  44.   tc2.data:=hosxp_getdataset('select * from pe_template where doctor = "'+dc+'"');
  45.  
  46.   pg.min:=0;
  47.   pg.max:=tc2.recordcount;
  48.   pg.position:=0;
  49.  
  50.   while not tc2.eof do
  51.   begin
  52.     pg.position:=pg.position+1;
  53.     tc1.first;
  54.     while not tc1.eof do
  55.     begin
  56.       tc3.data:=hosxp_getdataset('select * from pe_template where doctor="'+
  57.          tc1.fieldbyname('code').asstring+'" and pe_name="'+tc2.fieldbyname('pe_name').asstring+'"');
  58.       if tc3.recordcount=0 then
  59.       begin
  60.         tc3.append;
  61.         tc3.fieldbyname('pe_temp_id').asinteger:=
  62.          getserialnumber('pe_temp_id');
  63.       end else
  64.       begin
  65.         tc3.edit;
  66.       end;
  67.  
  68.       tc3.fieldbyname('doctor').asstring:=tc1.fieldbyname('code').asstring;
  69.       tc3.fieldbyname('pe_name').asstring:=tc2.fieldbyname('pe_name').asstring;
  70.       tc3.fieldbyname('pe_text').asstring:=tc2.fieldbyname('pe_text').asstring;
  71.  //     tc3.fieldbyname('icd_order').asinteger:=tc2.fieldbyname('icd_order').asinteger;
  72.       tc3.post;
  73.  
  74.       if tc3.changecount>0 then hosxp_updatedelta(tc3.delta,'select * from pe_template where doctor="'+
  75.          tc1.fieldbyname('code').asstring+'" and pe_name="'+tc2.fieldbyname('pe_name').asstring+'"');
  76.  
  77.       tc1.next;
  78.     end;
  79.     tc2.next;
  80.   end;
  81.  
  82.  
  83.  
  84. end;
  85.  
  86. procedure TForm8.FormShow(Sender: TObject);
  87. var tc:tclientdataset;
  88. begin
  89.   tc:=tclientdataset.create(nil);
  90.   tc.data:=hosxp_getdataset('select name from doctor order by name');
  91.   while not tc.eof do
  92.   begin
  93.     cxcombobox1.properties.items.add(tc.fieldbyname('name').asstring);
  94.     tc.next;
  95.   end;
  96.   tc.free;
  97. end;
  98.  
  99. end.
  100.  
  101.  
  102.  
  103.  
« แก้ไขครั้งสุดท้าย: มีนาคม 07, 2008, 14:54:35 PM โดย doraemon(saiyok) »

doramon

  • บุคคลทั่วไป
Re: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« ตอบกลับ #1 เมื่อ: มีนาคม 07, 2008, 17:32:12 PM »
0
รบกวน อ.ชัยพร ทำแบบนี้ก็ดีครับ




ออฟไลน์ anukul

  • Hero Member
  • *****
  • กระทู้: 1,363
  • Respect: +1
    • ดูรายละเอียด
Re: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« ตอบกลับ #2 เมื่อ: มีนาคม 07, 2008, 17:40:30 PM »
0
ขอบคุณครับ อ.อ๊อด  เดี๋ยวคืนนี้จะลองดูครับ

เห็นด้วยกับ อ.อ๊อด ครับ เพราะ การใช้งาน Physical exam จะได้ง่ายขึ้น ทำให้แพทย์อยากใช้มากขึ้นครับ

 ;)
รพ.มะการักษ์ 260 เตียง
เริ่มระบบ 1 ธค 48 (ทีม MN)
Database structure :HOSxP 3.55.9.21b
Client : 3.55.6.8-3.55.9.21b
Server : Double QuadCore XEON 3.2 G. ECC 18 G. SAS 146 G x4(Raid 5) -- CentOS 5.3 (64 bit) , MySQL 5.1.30 percana
Client : Win2000 ~ 200 clients
Module :
OPD -Register,Screening,Doctor,Dispense,Billing,Dentist,PMMR
IPD - Admit center,Ward,Nutrition,Dispense,LR,OR
LAB , X-ray
การเชื่อมต่อ : LIS             --> RAX
                    X-ray PACS --> Infinitt (ThaiGL)

ออฟไลน์ shukree

  • Sr. Member
  • ****
  • กระทู้: 294
  • Respect: 0
    • ดูรายละเอียด
Re: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« ตอบกลับ #3 เมื่อ: มีนาคม 07, 2008, 21:19:33 PM »
0
ขอโทษครับ ใช้อย่างไรครับ
Sukhirin Hospital Narathiwat 30 เตียง
Server : IBM x226 Xeon 3.2 Ram 512 Mb SCSI 72x2 G OS CentOS 5.1 MySQL 5.5.35Client : PD 2.8 Ram 512 HDD 160 (Acer) WinXP SP2
ขึ้นระบบ กุมภาพันธ์ 2550

doramon

  • บุคคลทั่วไป
Re: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« ตอบกลับ #4 เมื่อ: มีนาคม 07, 2008, 22:11:02 PM »
0
ขอโทษครับ ใช้อย่างไรครับ

เอาทำ source มาว่าแทนที่ตามรูปครับ

ออฟไลน์ shukree

  • Sr. Member
  • ****
  • กระทู้: 294
  • Respect: 0
    • ดูรายละเอียด
Re: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« ตอบกลับ #5 เมื่อ: มีนาคม 07, 2008, 23:31:04 PM »
0
ขอบคุณครับ
Sukhirin Hospital Narathiwat 30 เตียง
Server : IBM x226 Xeon 3.2 Ram 512 Mb SCSI 72x2 G OS CentOS 5.1 MySQL 5.5.35Client : PD 2.8 Ram 512 HDD 160 (Acer) WinXP SP2
ขึ้นระบบ กุมภาพันธ์ 2550

doramon

  • บุคคลทั่วไป
Re: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« ตอบกลับ #6 เมื่อ: มีนาคม 08, 2008, 16:58:57 PM »
0
anukul   

ต้องขอโทษ ด้วยครับ  มันสามารถส่งไปได้ทั้งหมดแบบเดียวครับ
ยังเลือกไม่ได้  จะทำให้ เป็นอันต่อไปแล้วกัน

doramon

  • บุคคลทั่วไป
Re: Scipt โอนข้อมูล pe_template ให้กับหมอทุกคน
« ตอบกลับ #7 เมื่อ: กันยายน 22, 2008, 18:49:54 PM »
0
 ;D