BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: vinaisena ที่ กันยายน 15, 2009, 10:21:27 AM
-
ต้องการเอาประวัติของการตรวจของ HN ที่ 1 ไปใส่ใน HN ที่ 2 ได้อย่างไร
----------------------------------------------------------------------------------
มีขั้นตอนอย่างไรบ้างครับท่านอาจารย์ ในการนำ ประวัติการตรวจทั้งหมด ทั้งผล LAB ของ HN ที่ 2 มาใส่ใน HN ที่ 1
ขอบพระคุณล่วงหน้าครับ
-
เห็นมี Tool ของ อ.อ๊อด อยู่นะ
****
on M ติ พอมี source code ของ vfp อยู่ จะได้ไปประยุกต์ต่อ
-
ถ้า hn 1 กับ hn 2 เป็นคนเดียวกัน ก็รวม hn ไปเลยครับ ..........ไม่รู้จะตรงประเด็นหรือเปล่า ตามรูปครับ
;D ;D ;D
-
ถ้า hn 1 กับ hn 2 เป็นคนเดียวกัน ก็รวม hn ไปเลยครับ ..........ไม่รู้จะตรงประเด็นหรือเปล่า ตามรูปครับ
;D ;D ;D
เท่าที่อ่าน เข้าใจว่าจะเป็นคนละคนครับ แต่ชื่อ-นามสกุลเหมือนกัน เลยส่งตรวจผิดคน
:( :( :(
-
ตามความเข้าใจของ อ.อุดมโชคครับ ถูกต้องแล้ว
ชื่อเหมือนกัน ต่างกันตรงนามสกุล HN 1 มาตรวจ แต่ห้องบัตรส่งชื่อ HN 2 ไปตรวจฉิบ ตรวจจนเสร็จได้ผล LAB ได้ผล X-ray ได้ยา จนจ่ายเงิน เรียกชื่อ -สกุล ถึงรู้ว่า ผิดคน เลยอยากเอารายการการตรวจทั้งหมดของการตรวจใน HN 2 มาแปะใส่ใน HN1 ครับ อาจารย์
-
มีใครได้ tool แล้วบ้างครับ จะขอด้วยคนครับ
เริ่มมีเหตุการณ์แบบนี้แล้วครับ :D ;D ;)
-
มีใครได้ tool แล้วบ้างครับ จะขอด้วยคนครับ
เริ่มมีเหตุการณ์แบบนี้แล้วครับ :D ;D ;)
นี่แหล่ะครับ...ที่เขาเรียกว่า ADMIN ใครจะทำอะไรก็ตาม หากมีความผิดพลาดเกิดขึ้น และผู้ใช้ระบบไม่อย่ากเริ่มใหม่ทั้งหมด ก็คงมีแต่ ADMIN ที่ต้องแก้ไขปัญหาเหล่านั้นให้จงได้.......ดีใจด้วยครับ..พวกเรายังมีค่าเสมอในตัวเอง และในองค์กร.....สู้ต่อไปครับ... :D ;D
-
ดันขึ้นมา......ฮ...ฮึ๊บ......
รอ TOOL เทพ ครับ ;) :D ;)
-
Tools ชื่อ VN2VN นะครับ
ถ้าจำไม่ผิดเป็นของ อ.อ๊อด หรือเปล่าคับ
พอดีตอนนี้อยู่บ้าน ก็เลยไม่มี tools คับ ;D ;D
การทำงานคร่าว ๆ ก็คือจะไปไล่อัพเดทตารางที่มี VN โดยเปลี่ยนจาก HN1 เป็นอีก HN2
แล้วประวัติการ visit นี้ก็จะเปลี่ยนเป็นของอีกคนครับ
ใช้แบบนี้หรือเปล่าคับที่ต้องการ
-
ลืมไปว่า VPN เข้าไปได้
เอา code ไปใส่ Script ใน SQL Query นะคับ
ขอขอบคุณ อ. Doraemon
Source
unit hn2hn;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Edit3: TEdit;
Label3: TLabel;
pg: TProgressBar;
Label4: TLabel;
logmemo: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var tc,ts:tclientdataset; i:integer;
begin
tc:=tclientdataset.create(nil);
ts:=tclientdataset.create(nil);
tc.data:=hosxp_getdataset('select * from hosxp_ddl_field where field_name ="vn"');
pg.position:=0;
pg.max:=tc.recordcount;
while not tc.eof do
begin
label4.caption:=tc.fields[0].asstring;
if tc.fields[1].asstring ='vn' then
begin
logmemo.lines.add('Change...'+tc.fields[0].asstring);
try
hosxp_getdataset('update '+tc.fields[0].asstring+' set hn="'+edit3.text+'" where vn="'+edit2.text+'" and hn="'+edit1.text+'" ');
except end;
end;
logmemo.lines.add('Change...'+'update '+tc.fields[0].asstring+' set hn="'+edit3.text+'" where vn="'+edit2.text+'" and hn="'+edit1.text+'" ');
pg.position:=pg.position+1;
application.processmessages;
tc.next;
end;
tc.free;
ts.free;
showmessage('Done.');
end;
end.
DFM
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Hosxp VN2VN by Doraemon saiyok'
ClientHeight = 492
ClientWidth = 567
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 32
Top = 35
Width = 45
Height = 22
Caption = 'HN (OLD)'
end
object Label2: TLabel
Left = 32
Top = 91
Width = 50
Height = 18
Caption = 'VN'
end
object Label3: TLabel
Left = 32
Top = 147
Width = 48
Height = 13
Caption = 'HN (NEW)'
end
object Label4: TLabel
Left = 80
Top = 224
Width = 31
Height = 13
Caption = 'Label4'
end
object Edit1: TEdit
Left = 96
Top = 32
Width = 153
Height = 41
TabOrder = 0
Text = '0062411'
end
object Edit2: TEdit
Left = 96
Top = 79
Width = 153
Height = 41
TabOrder = 1
Text = '510807210208'
end
object Button1: TButton
Left = 80
Top = 256
Width = 393
Height = 73
Caption = 'Button1'
TabOrder = 2
OnClick = Button1Click
end
object Edit3: TEdit
Left = 96
Top = 144
Width = 153
Height = 41
TabOrder = 3
Text = '0023900'
end
object pg: TProgressBar
Left = 80
Top = 344
Width = 393
Height = 17
TabOrder = 4
end
object logmemo: TMemo
Left = 80
Top = 384
Width = 393
Height = 89
Lines.Strings = (
'logmemo')
TabOrder = 5
end
end
-
ช่วยอธิบายวิธีใช้อย่างละเอียดด้วยครับ ขอบคุณครับ ;D
-
เปิดสายฟ้าขึ้นมา แล้วทำตามรูปครับ
-
แบบนี้ข้อมูลจะ update เข้า slave ด้วยหรือเปล่าครับ ??? ???
-
ช่วยอธิบายวิธีใช้อย่างละเอียดด้วยครับ ขอบคุณครับ ;D
จากวิธีของพี่กิจ
สามารถ save ได้ครับคราวหลังจะได้ load มาใช้ได้เลย หรือ ติ๊ก allow user run ด้านล่าง จะรันscriptได้ในเมนู tool -> user script ระวังอย่า save ให้ชื่อซ้ำกับ script ที่มีอยู่แล้วนะครับไม่งั้นเจ้งไปถึงส่วนอื่นด้วยนะครับ
แบบนี้ข้อมูลจะ update เข้า slave ด้วยหรือเปล่าครับ ??? ???
ถ้าทำตามด้านบนน่าจะเข้าครับ
-
:) ขอบคุณครับ กำลังต้องการอยู่เลยคับ :)
-
วันนี้ได้ลองใช้ scrip ของ อ.อ็อดค่ะ ขอบคุณสำหรับการแบ่งปันค่ะ