备份一下备份一下

添加到脚本后,记得Call IFPETCTORECT

SUB IFPETCTORECT
CHECKSERIALNUM = Rpt.Data.GetNamedValue("CHECKSERIALNUM")
sql="select hispatienttype,INFEEPATIENTID,clinicpatientid from PATIENTINFO where checkserialnum='" & CHECKSERIALNUM & "'"
Set Conn=Rpt.GetDBConn
Set rs = Conn.Execute(sql)
hispatienttype=rs("hispatienttype")
if CInt(hispatienttype)=1 Then
clinicpatientid=rs("clinicpatientid")
sql2="select from studyinfo s,patientinfo p where (s.devicetypeid='24' or s.devicetypeid='25') and s.studytime>sysdate-3 and p.checkserialnum=s.checkserialnum and p.clinicpatientid='" & clinicpatientid & "'"
Set rs2 = Conn.Execute(sql2)
If not rs2.eof Then
msgbox "该患者3天内存在核医学科检查!",vbOKOnly + vbExclamation,"警告"
End If
elseif CInt(hispatienttype)=2 Then
INFEEPATIENTID=rs("INFEEPATIENTID")
sql3="select
from studyinfo s,patientinfo p where (s.devicetypeid='24' or s.devicetypeid='25') and s.studytime>sysdate-3 and p.checkserialnum=s.checkserialnum and p.INFEEPATIENTID='" & INFEEPATIENTID & "'"
Set rs3 = Conn.Execute(sql3)
If not rs3.eof Then
msgbox "该患者3天内存在核医学科检查!",vbOKOnly + vbExclamation,"警告"
End If
end if
end sub

最后修改:2022 年 01 月 27 日 04 : 19 PM
如果觉得我的文章对你有用,请随意赞赏