劉盛均 劉丹 陳楊(通訊作者)
(四川省綿陽市中心醫(yī)院病理科 四川 綿陽 621000)
病理科的免疫組化染色,通過手工或自動免疫組化染色機(jī)進(jìn)行[1]。在切片準(zhǔn)備階段,均需對玻片進(jìn)行編號及抗體標(biāo)記物名稱書寫?,F(xiàn)階段,手工染色一般以鉛筆書寫,自動免疫組化機(jī)染色以手工錄入電腦,標(biāo)簽打號機(jī)打印防水標(biāo)簽,再粘貼于玻片。均存在操作繁瑣,易于出現(xiàn)差錯遺漏,不易辨識等缺點(diǎn)[2]。我科運(yùn)用按鍵精靈編程,鏈接病理數(shù)據(jù)庫,實(shí)現(xiàn)免疫組化玻片自動打印,現(xiàn)介紹如下。
辦公電腦(WINDOWS XP),按鍵精靈(2014版),瑯伽病理數(shù)據(jù)庫(PATHQC1.0),玻片書寫儀(PASSMARCH),防脫玻片(邁新SLI-20010601)。
//主模塊,定義變量并賦值屏幕點(diǎn)位,測試數(shù)據(jù)庫鏈接。
Delay 1000
Dim ret,rets
Dim getdata, d_blh, groupdata
Dim p1,p2,p3,p4,p5,p6,p7,p8,p9,p10
p1 = array(339,705)
p2 = array(762,255)
p3 = array(1049,484)
p4 = array(1049,530)
p5 = array(1102,159)
p6 = array(1102,198)
p7 = array(1102,239)
p8 = array(1102,322)
p9 = array(1102,279)
p10 = array(1126,587)
ret = Plugin.SQLServer.connect("數(shù)據(jù)庫網(wǎng)址,端口","用戶名", "密碼", "數(shù)據(jù)庫名")
Delay 1000
If ret = false Then
MsgBox "數(shù)據(jù)庫鏈接失敗,請檢查后再試!
",16+0+4096,"綿陽市中心醫(yī)院-錯誤提示"
Else
Call startapp
End If
//啟動模塊,初始化打印界面。
Sub startapp
Delay 500
MoveTo p1(0),p1(1)
Delay 500
LeftClick 1
Delay 1000
MoveTo p2(0),p2(1)
Delay 500
LeftClick 1
Delay 3500
Call opendata
End Sub
//數(shù)據(jù)處理模塊,鏈接數(shù)據(jù)庫獲取數(shù)據(jù)。
Sub opendata
d_blh = inputbox("1、檢查打印機(jī)玻片、色帶及狀態(tài)。" & vbcrlf & "2、輸入需要打印切片的免疫組化號,按ENTER開始搜索數(shù)據(jù)并自動打印。" & vbcrlf & "3、打印期間勿隨意移動鼠標(biāo)及點(diǎn)擊鍵盤。" & vbcrlf & "4、運(yùn)行中終止運(yùn)行按CTRL+F12,暫停/繼續(xù)按CTRL+F11。" & vbcrlf & "5、輸入all搜索所有未打印數(shù)據(jù)并打印(慎用)。" & vbcrlf & "6、輸入@+免疫組化號搜索已執(zhí)行與未執(zhí)行數(shù)據(jù)并打印。", "綿陽市中心醫(yī)院-免疫組化玻片打印")
If d_blh = "" Then
ret = Plugin.SQLServer.Close()
MsgBox "切片標(biāo)簽錄入完畢,即將退出程序!
",16+0+4096,"綿陽市中心醫(yī)院-溫馨提示!"
Else
If d_blh = "all" Then
getdata = Plugin.SQLServer.SelectData("T_TJYZ", "F_BLH,F(xiàn)_LKH,F(xiàn)_BJW,F(xiàn)_TJYZH,F(xiàn)_BZ", "F_YZLX = '特殊染色' and F_YZZT = ''")
Delay 1000
If getdata = "" Then
MsgBox "數(shù)據(jù)庫內(nèi)沒有查詢到任何未執(zhí)行數(shù)據(jù),請檢查再試或手工錄入打印。", 16+0+4096, "綿陽市中心醫(yī)院-錯誤提示"
Else
Call printdata
End If
Else
If left(d_blh, 1) = "@" Then
d_blh = replace(d_blh, "@", "")
getdata = Plugin.SQLServer.SelectData("T_TJYZ", "F_BLH,F(xiàn)_LKH,F(xiàn)_BJW,F(xiàn)_TJYZH,F(xiàn)_BZ","F_YZLX = '特殊染色' and F_BLH = '" & d_blh & "'")
Delay 500
Else
getdata = Plugin.SQLServer.SelectData("T_TJYZ", "F_BLH,F(xiàn)_LKH,F(xiàn)_BJW,F(xiàn)_TJYZH,F(xiàn)_BZ","F_YZLX = '特殊染色' and F_BLH = '" & d_blh & "' and F_YZZT = ''")
Delay 500
End if
If getdata = "" Then
MsgBox "數(shù)據(jù)庫內(nèi)沒有查詢到 " & d_blh & " 相關(guān)未執(zhí)行數(shù)據(jù),請檢查再試或手工錄入打印。",16+0+4096, "綿陽市中心醫(yī)院-錯誤提示"
Else
Call printdata
End If
End If
Call resetapp
End if
End Sub
Sub resetapp
Delay 500
Call opendata
End Sub
//打印模塊,將獲取的數(shù)據(jù)自動輸出到文本框并打印玻片。
Sub printdata
Call clearall
Dim dataindex,last_blh,last_lkh
dataindex = 0
last_blh = 0
last_lkh = 0
getdata=Replace(getdata,"#","")
groupdata = split(getdata, "|")
For i = 0 To ubound(groupdata) - 1
dataindex = dataindex + 1
Select case dataindex
Case 1
If groupdata(i) = last_blh Then
Else
Delay 500
MoveTo p5(0),p5(1)
If last_blh = 0 Then
Delay 500
LeftClick 1
Delay 500
Else
Call cleartext
Call cleartext
End If
SayString lcase(groupdata(i))
Delay 1500
last_blh=groupdata(i)
End If
Case 2
If groupdata(i) = last_lkh Then
Else
Delay 500
MoveTo p6(0),p6(1)
If last_lkh = 0 Then
Delay 500
LeftClick 1
Delay 500
Else
Call cleartext
Call cleartext
End If
SayString groupdata(i)
Delay 1500
last_lkh=groupdata(i)
End If
Case 3
Delay 500
MoveTo p7(0),p7(1)
Call cleartext
SayString groupdata(i)
Delay 500
Case 4
Delay 500
MoveTo p9(0),p9(1)
Call cleartext
SayString Right(groupdata(i),2)
Delay 500
rets = Plugin.SQLServer.UpdateData("T_TJYZ", "F_YZZT = '已執(zhí)行'", "F_YZLX = '特殊染色' and F_TJYZH = '" & groupdata(i) & "'")
Case 5
Delay 500
MoveTo P8(0), p8(1)
Call cleartext
SayString groupdata(i)
Delay 500
dataindex = 0
MoveTo p10(0),p10(1)
Delay 500
LeftClick 1
Delay 1000
Call checkerror
End select
Next
End Sub
//重置模塊,清理所有文本框數(shù)據(jù)。
Sub clearall
Delay 500
MoveTo p3(0),p3(1)
Delay 500
LeftClick 1
Delay 500
MoveTo p4(0),p4(1)
Delay 500
LeftClick 1
Delay 1000
End Sub
//清理模塊,清除文本框數(shù)據(jù)。
Sub cleartext
Delay 500
LeftClick 1
Delay 500
KeyPress "backspace", 10
Delay 500
End Sub
//錯誤檢測模塊,檢測打印機(jī)錯誤并處理。
Sub checkerror
Hwnd = Plugin.Window.find(0, "FormError")
sWindow = Plugin.window.iswindow(Hwnd)
If sWindow = 1 Then
MsgBox "發(fā)生打印機(jī)錯誤,請排除錯誤,按ENTER繼續(xù)", 16 + 0 + 4096, "綿陽市中心醫(yī)院-錯誤提示"
Delay 2000
End If
End Sub
我科應(yīng)用此方法,打印免疫組化玻片50000余張,玻片信息豐富,標(biāo)志清晰,適用于手工及自動免疫組化機(jī)染色。該程序經(jīng)有限改動,可適配于各型自動免疫組化染色機(jī)及玻片書寫儀,進(jìn)行玻片或防水標(biāo)簽的自動打印。