If Tables("主检窗口_table2").Current Is Nothing Then
MessageBox.Show("您查询的对象不存在,请核对后查询!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Else
Dim dtb As New DataTableBuilder("血常规一")
dtb.AddDef("日期", Gettype(Date))
dtb.AddDef("序号", Gettype(Double))
dtb.AddDef("标本号", Gettype(Double))
dtb.AddDef("检验时间", Gettype(Date))
dtb.AddDef("类型", Gettype(String), 25)
dtb.AddDef("姓名", Gettype(String), 25)
dtb.AddDef("性别", Gettype(String), 5)
dtb.AddDef("年龄", Gettype(String), 25)
dtb.AddDef("年龄单位", Gettype(String), 5)
dtb.AddDef("病历号", Gettype(String), 25)
dtb.AddDef("床号", Gettype(String), 25)
dtb.AddDef("检验者", Gettype(String), 25)
dtb.AddDef("审核者", Gettype(String), 25)
dtb.AddDef("仪器", Gettype(String), 25)
dtb.AddDef("检验项目", Gettype(String), 255)
dtb.AddDef("检验结果", Gettype(Double))
dtb.AddDef("单位", Gettype(String), 25)
dtb.AddDef("参考低值", Gettype(String), 25)
dtb.AddDef("参考高值", Gettype(String), 25)
dtb.AddDef("结果提示", Gettype(String), 25)
dtb.Build()
Dim dr1 As DataRow = DataTables("血常规结果").Find("病历号 = '" & Filter & "'")
If dr1 IsNot Nothing Then
Dim nms() As String = {"白细胞数目(WBC)" ,"嗜碱性粒细胞数目(BaS#)","中性粒细胞数目(NEU#)","嗜酸性粒细胞数目(Eos#)","淋巴细胞数目(LYM#)","单核细胞数目(Mon#)","ALY# 10^9/L","LIC# 10^9/L","嗜碱性粒细胞百分比(Bas%)","中性粒细胞百分比(Neu%)","嗜酸性粒细胞百分比(EOS%)","淋巴细胞百分比(LYMph%)","单核细胞百分比(Mon%)","ALY% %","LIC% %","红细胞数目(RBC)","血红蛋白浓度(HGB)","平均红细胞体积(MCV)","平均红细胞血红蛋白含量(MCH)","平均红细胞血红蛋白浓度(MCHC)","红细胞分布宽度变异系数(RDW-CV)","红细胞分布宽度标准差(RDW-SD)","红细胞压积(HCT)","血小板数目(PLT)","平均血小板体积(MPV)","血小板分布宽度(PDW)","血小板压积(PCT%)","P-LCC 10^9/L","P-LCR %"}
Dim kms() As String = {"WBC 10^9/L","Bas# 10^9/L","Neu# 10^9/L","Eos# 10^9/L","Lymph# 10^9/L","Mon# 10^9/L","ALY# 10^9/L","LIC# 10^9/L","Bas% %","Neu% %","Eos% %","Lymph% %","Mon% %","ALY% %","LIC% %","RBC 10^12/L","HGB g/L","MCV fL","MCH pg","MCHC g/L","RDW-CV %","RDW-SD fL","HCT %","PLT 10^9/L","MPV fL","PDW","PCT %","P-LCC 10^9/L","P-LCR %"}
' For Each km As String In kms
For i As Integer = 0 To nms.Length - 1
If dr1.IsNull(kms(i)) = False Then
Dim dr2 As DataRow = DataTables("血常规一").AddNew()
dr2("日期") = dr1("检验时间")
dr2("序号") = dr1("序号")
dr2("标本号") = dr1("标本号")
DataTables("血常规一").DataCols("检验时间").SetDateTimeFormat(DateTimeFormatEnum.DateLongTime)
Dim dr As DataRow = DataTables("职业健康检查表").SQLFind("编号 = '" & "ZYTJ-20" & dr1("姓名") & "'")
If dr IsNot Nothing Then
dr2("姓名") = dr("姓名")
dr2("性别") = dr("性别")
dr2("年龄") = dr("年龄")
End If
dr2("检验时间") = dr1("检验时间")
dr2("类型") = dr1("类型")
dr2("年龄单位") = dr1("年龄单位")
dr2("病历号") = dr1("病历号")
dr2("床号") = dr1("床号")
dr2("检验者") = dr1("检验者")
dr2("审核者") = dr1("审核者")
dr2("仪器") = dr1("仪器")
dr2("检验项目") = nms(i)
dr2("检验结果") = dr1(kms(i))
Dim r As DataRow = DataTables("职业健康体检项目设置").SQLFind("项目名称 = '" & nms(i) & "'")
If r IsNot Nothing Then
dr2("单位") = r("单位")
dr2("参考低值") = r("参考低值")
dr2("参考高值") = r("参考高值")
End If
If dr2("检验结果") < Val(dr2("参考低值")) Then
dr2("结果提示") = "↓"
ElseIf dr2("检验结果") > Val(dr2("参考高值")) Then
dr2("结果提示") = "↑"
ElseIf dr2("检验结果") <= Val(dr2("参考高值")) AndAlso dr2("检验结果") >= Val(dr2("参考低值")) Then
dr2("结果提示") = Nothing
ElseIf dr2.IsNull("参考高值") AndAlso dr2.IsNull("参考低值") Then
dr2("结果提示") = Nothing
End If
If dr2.IsNull("参考高值") AndAlso dr2.IsNull("参考低值") Then
dr2("结果提示") = Nothing
End If
If dr2.IsNull("检验结果") Then
dr2("结果提示") = ""
End If
End If
Next
Tables("主检窗口_table1").DataSource = DataTables("血常规一")
Tables("主检窗口_table1").SetColVisibleWidth("日期|60|姓名|60|性别|40|年龄|60|检验项目|100|检验结果|60|单位|60|参考低值|60|参考高值|60|结果提示|60")
Tables("主检窗口_table1").DefaultRowHeight = 40
Tables("主检窗口_table1").AllowEdit = False
For Each c As Col In Tables("主检窗口_table1").Cols
C.TextAlign =TextAlignEnum.Center
Next
Tables("主检窗口_table1").DataTable.GlobalHandler.DrawCell = True
DataTables("血常规一").AddUserStyle("a", Color.Red, Color.White)
End If