📄 全院患者住院号查询.frm
字号:
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808000&
Height = 360
Left = 3030
TabIndex = 18
Top = 780
Width = 1680
End
Begin VB.Label Label5
BackColor = &H80000016&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808000&
Height = 345
Left = 6930
TabIndex = 16
Top = 810
Width = 1635
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "科室总人数:"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00004000&
Height = 360
Left = 5370
TabIndex = 15
Top = 840
Width = 1770
End
Begin VB.Label Label1
BackColor = &H80000016&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808000&
Height = 345
Left = 6930
TabIndex = 9
Top = 1275
Width = 1635
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "全院总人数:"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00004000&
Height = 360
Left = 5370
TabIndex = 8
Top = 1305
Width = 1770
End
Begin VB.Label Label3
BackColor = &H80000016&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808000&
Height = 360
Left = 3030
TabIndex = 7
Top = 315
Width = 1680
End
End
Attribute VB_Name = "frmPatientIdQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If zzz = 28 Then
zzz = 0
frmPatientQuery.Enabled = True
Unload Me
Else
Form3.Enabled = True
Unload Me
Form3.SetFocus
End If
End Sub
Private Sub Command2_Click()
Data1.RecordSource = "SELECT ZY_ID AS 住院号,ZY_NAME AS 姓名,ys_id as 医师,KS_ID AS 科室,PREMONEY AS 预交金,USEMONEY AS 费用,RESTMONEY AS 余额 FROM ZY_IN_OUT where ks_id='" + Left(DBCombo1, 2) + "'"
Data1.Refresh
Label5.Caption = CStr(Data1.Recordset.RecordCount)
End Sub
Private Sub Command3_Click()
If Text1.Text = "" Then
Text1.SetFocus
Exit Sub
End If
If Option1.Value Then
Data1.RecordSource = "SELECT ZY_ID AS 住院号,ZY_NAME AS 姓名,KS_ID AS 科室代码,PREMONEY AS 预交金,USEMONEY AS 费用,RESTMONEY AS 余额 FROM ZY_IN_OUT WHERE ZY_NAME LIKE '%" + Trim(Text1.Text) + "%'"
Else
Data1.RecordSource = "SELECT F_ZYID AS 住院号,HZXM AS 姓名,KS_ID AS 科室代码,F_JZRQ AS 结帐日期 FROM ZY_CYHZFY WHERE HZXM LIKE '%" + Text1.Text + "%'"
End If
Data1.Refresh
End Sub
Private Sub Command4_Click()
Dim rs As Recordset
Dim Ljsh As Long
Dim Sjsh As Long
Dim P As Integer
Dim mm As Integer
If Command4.Caption = "结帐患者查询" Then
Data1.RecordSource = "SELECT F_ZYID AS 住院号,hzxm as 患者姓名,zy_cyhzfy.KS_ID AS 科室代码,ks_name as 科室名称,f_cyrq as 出院日期,f_zyrq as 入院日期,f_use as 使用金额,f_pre as 预交金额,f_rest as 剩余金额,F_JZRQ AS 结帐日期 FROM ZY_CYHZFY,ks_table WHERE zy_cyhzfy.ks_id=ks_table.ks_id and F_JSSI='0'"
Data1.Refresh
Command4.Caption = "当日结帐患者打印 "
Else
mm = MsgBox("确定要打印吗?", vbOKCancel + vbDefaultButton2, "请注意在在今日结算后打印!")
If mm <> vbOK Then
Exit Sub
End If
P = 0
Ljsh = 1000
Sjsh = 0
Set rs = db.OpenRecordset("select top 2 hz_jsh from zy_skhz order by hz_jsh desc")
If Not rs.EOF Then
Ljsh = rs!hz_jsh
rs.MoveNext
End If
If Not rs.EOF Then
Sjsh = rs!hz_jsh
End If
rs.Close
Data1.RecordSource = "SELECT F_ZYID AS 住院号,hzxm as 患者姓名,zy_cyhzfy.KS_ID AS 科室代码,ks_name as 科室名称,f_cyrq as 出院日期,f_zyrq as 入院日期,f_use as 使用金额,f_pre as 预交金额,f_rest as 剩余金额,F_JZRQ AS 结帐日期,jsh as 结算号 FROM ZY_CYHZFY,ks_table WHERE zy_cyhzfy.ks_id=ks_table.ks_id and F_JSSI='0' and jsh>" + CStr(Sjsh) + " and jsh<" + CStr(Ljsh)
Data1.Refresh
' Data1.Recordset.MoveLast
Printer.ScaleMode = 6
'Printer.Height = 3000
'Printer.Width = 10000
'Printer.Font = "宋体"
'Printer.FontSize = 10.5
Printer.Height = 12000
Printer.Width = 10000
' Data1.Recordset.MoveFirst
While Not Data1.Recordset.EOF
P = 1
Printer.Font = "隶书"
Printer.FontSize = 18
Printer.Print " 出院通知单"
Printer.Font = "宋体"
Printer.FontSize = 11
'Printer.Print
Printer.Print "-----------------------------------------"
Printer.Print "患者姓名:" + DxLeft(Data1.Recordset!患者姓名, 10) + Space(11 - DxLen(DxLeft(Data1.Recordset!患者姓名, 10))) + "住 院 号:" + Data1.Recordset!住院号
Printer.Print "科别名称:" + Data1.Recordset!科室名称 + Space(11 - DxLen(Data1.Recordset!科室名称)) + "住院天数:" + CStr(DateDiff("D", Data1.Recordset!入院日期, Data1.Recordset!出院日期))
Printer.Print "入院日期:" + DxLeft(CStr(Data1.Recordset!入院日期), 10) + Space(11 - DxLen(DxLeft(CStr(Data1.Recordset!入院日期), 10))) + "出院日期:" + Space(10 - DxLen(DxLeft(CStr(Data1.Recordset!出院日期), 10))) + DxLeft(CStr(Data1.Recordset!出院日期), 10)
If Data1.Recordset!剩余金额 >= 0 Then
U = "应退金额:"
Else
U = "应补金额:"
End If
Printer.Print "预交金额:" + DxLeft(CStr(Format(Data1.Recordset!预交金额, "0.00")), 10) + Space(11 - DxLen(DxLeft(CStr(Format(Data1.Recordset!预交金额, "0.00")), 10))) _
+ U + DxLeft(CStr(Format(Abs(Data1.Recordset!剩余金额), "0.00")), 10)
Printer.Print "费用总额:" + CStr(Format(Data1.Recordset!使用金额, "0.00")) + Space(11 - DxLen(DxLeft(CStr(Format(Data1.Recordset!使用金额, "0.00")), 10))) + "打印日期:" + CStr(Date)
Printer.Print "-----------------------------------------"
Printer.Print " 结帐流水号:" + CStr(Data1.Recordset!结算号)
Printer.Print
Data1.Recordset.MoveNext
Wend
If P = 1 Then
Printer.EndDoc
End If
Command4.Caption = "结帐患者查询"
End If
End Sub
Private Sub Command5_Click()
Data1.RecordSource = "SELECT ZY_ID AS 住院号,ZY_NAME AS 患者姓名,KS_ID AS 科室代码,ZY_RYRQ AS 入院日期 FROM ZY_IN_OUT WHERE ZY_RYRQ>=CAsT('" + CStr(CDate(Text2.Text)) + "' as datetime) AND ZY_RYRQ<Cast('" + CStr(CDate(Text2.Text) + 1) + "' as datetime)" + _
"union select ZY_zyID AS 住院号,ZY_NAME AS 患者姓名,zy_ryKS AS 科室代码,ZY_RYRQ AS 入院日期 FROM ZY_cyhz WHERE ZY_RYRQ>=Cast('" + CStr(CDate(Text2.Text)) + "' as datetime) AND ZY_RYRQ<cast('" + CStr(CDate(Text2.Text) + 1) + "' as datetime)"
Data1.Refresh
Label3.Caption = CStr(Data1.Recordset.RecordCount) + "人"
End Sub
Private Sub Command6_Click()
Data1.RecordSource = "SELECT f_ZYID AS 住院号,hzxm AS 患者姓名,KS_ID AS 科室代码,f_zYRQ AS 入院日期 FROM ZY_cyhzfy WHERE f_cYRQ>=CAsT('" + CStr(CDate(Text2.Text)) + "' as datetime) AND f_cYRQ<CAsT('" + CStr(CDate(Text2.Text) + 1) + "' as datetime)"
Data1.Refresh
Label6.Caption = CStr(Data1.Recordset.RecordCount) + "人"
End Sub
Private Sub DBCombo1_Change()
Data1.RecordSource = "SELECT ZY_ID AS 住院号,ZY_NAME AS 姓名,ys_id as 医师,KS_ID AS 科室,PREMONEY AS 预交金,USEMONEY AS 费用,RESTMONEY AS 余额 FROM ZY_IN_OUT where ks_id='" + Left(DBCombo1, 2) + "'"
Data1.Refresh
Label5.Caption = CStr(Data1.Recordset.RecordCount)
End Sub
Private Sub Form_Load()
Dim rs As Recordset
Data1.Connect = MyConnect
Data1.DatabaseName = MyDatabase
Data2.Connect = MyConnect
Data2.DatabaseName = MyDatabase
Me.Width = Screen.Width
Me.Height = Screen.Height
Me.Top = 0
Me.Left = 0
Text2.Text = CStr(Date)
Set rs = db.OpenRecordset("select COUNT(zy_id) as zyrs from zy_in_out")
If Not rs.EOF Then
sumZYRS = rs!zyrs
End If
rs.Close
Label1.Caption = CStr(sumZYRS)
End Sub
Private Sub Text1_Keydown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
KeyCode = 0
If Text1.Text <> "" Then
Command3.SetFocus
End If
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > 0 And KeyAscii <> 8 And KeyAscii <> 13 Then
KeyAscii = 0
End If
End Sub
Private Sub VScroll1_Change()
Text2.Text = CStr(Date + VScroll1.Value)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -