diff --git a/PEIS/Entity/ExamCareerHisInq.cs b/PEIS/Entity/ExamCareerHisInq.cs
index f7a2197..a480b0a 100644
--- a/PEIS/Entity/ExamCareerHisInq.cs
+++ b/PEIS/Entity/ExamCareerHisInq.cs
@@ -151,4 +151,33 @@ namespace PEIS.Entity
public int DispOrder { get; set; }
}
+
+ public class ECInqReportModele : ExamCareerHisInq
+ {
+ public bool SmokeState_1 { get; set; } = false;
+ public bool SmokeState_2 { get; set; } = false;
+ public bool SmokeState_3 { get; set; } = false;
+ public bool DrinkState_1 { get; set; } = false;
+ public bool DrinkState_2 { get; set; } = false;
+ public bool DrinkState_3 { get; set; } = false;
+ }
+ public class SymptomReportModele
+ {
+ ///
+ /// 症状名称
+ ///
+ public string SMName0 { get; set; }
+ ///
+ /// 症状值
+ ///
+ public string SMValue0 { get; set; }
+ ///
+ /// 症状名称
+ ///
+ public string SMName1 { get; set; }
+ ///
+ /// 症状值
+ ///
+ public string SMValue1 { get; set; }
+ }
}
diff --git a/PEIS/Model/Exam/CareerHisInqModel.cs b/PEIS/Model/Exam/CareerHisInqModel.cs
index d4c1339..8279199 100644
--- a/PEIS/Model/Exam/CareerHisInqModel.cs
+++ b/PEIS/Model/Exam/CareerHisInqModel.cs
@@ -22,7 +22,7 @@ namespace PEIS.Model.Exam
public List GetEmploymentHises(Int64 eID)
{
var list = DAOHelp.GetDataBySQL($@"Select * From Exam_EmploymentHis a WHERE a.PID = {eID}");
- return list;
+ return list==null?new List():list;
}
public List GetBaseSymptom()
{
@@ -32,7 +32,7 @@ namespace PEIS.Model.Exam
public List GetCareerHisInqSymptom(Int64 eID)
{
var list = DAOHelp.GetDataBySQL($@"Select * From Exam_CareerHisInqSymptom a where a.PID={eID} ORDER BY a.DispOrder ");
- return list;
+ return list==null?new List(): list;
}
public bool DelByPID(Int64 eID)
{
diff --git a/PEIS/PEIS.csproj b/PEIS/PEIS.csproj
index 4d0ef66..8ab1858 100644
--- a/PEIS/PEIS.csproj
+++ b/PEIS/PEIS.csproj
@@ -747,6 +747,7 @@
Settings.settings
True
+
Always
diff --git a/PEIS/ReportFiles/CAPReport.frx b/PEIS/ReportFiles/CAPReport.frx
new file mode 100644
index 0000000..d328f2e
--- /dev/null
+++ b/PEIS/ReportFiles/CAPReport.frx
@@ -0,0 +1,627 @@
+
+
+ using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Data;
+using System.IO;
+using FastReport;
+using FastReport.Data;
+using FastReport.Dialog;
+using FastReport.Barcode;
+using FastReport.Table;
+using FastReport.Utils;
+
+namespace FastReport
+{
+ public class ReportScript
+ {
+ String _pDeptName = "科室";
+ string picpathbase = System.Windows.Forms.Application.StartupPath + "\\ReportFiles\\";
+ private void Logo_BeforePrint(object sender, EventArgs e)
+ {
+ Logo.ImageLocation = picpathbase + "Logo.jpg";
+ }
+ private void Picture7_BeforePrint(object sender, EventArgs e)
+ {
+ Logo.ImageLocation = picpathbase + "Exam_Signature.png";
+ }
+
+ private void General_AfterData(object sender, EventArgs e)
+ {
+ DataSourceBase rowData = Report.GetDataSource("G");
+ Text95.Text = rowData["Summary"].ToString();
+ Text97.Text = rowData["Checker"].ToString();
+ Text99.Text = rowData["CheckTime"].ToString();
+ }
+
+ private void FeeItems_AfterData(object sender, EventArgs e)
+ {
+ DataSourceBase rowData = Report.GetDataSource("F");
+ Object rowValue = rowData.CurrentRow;
+ Text132.Text = rowData["IsDeptGiveUp"].ToString() == "1" ? "是" : "";
+ Text134.Text = rowData["GiveUpTime"] == null ? "" : "是";
+ }
+
+ private void Picture3_BeforePrint(object sender, EventArgs e)
+ {
+ //Picture3.Image = Base64ToImage((string)Report.GetParameterValue("Avatar"));
+ Picture6.Image = Base64ToImage((string)Report.GetParameterValue("Avatar"));
+ }
+
+ private void Cell171_AfterData(object sender, EventArgs e)
+ {
+ if(Cell171.Text.Contains("↑"))
+ {
+ Cell167.FillColor = Color.LightCoral;
+ Cell168.FillColor = Color.LightCoral;
+ Cell169.FillColor = Color.LightCoral;
+ Cell170.FillColor = Color.LightCoral;
+ Cell171.FillColor = Color.LightCoral;
+ }else if (Cell171.Text.Contains("↓"))
+ {
+ Cell167.FillColor = Color.LightCyan;
+ Cell168.FillColor = Color.LightCyan;
+ Cell169.FillColor = Color.LightCyan;
+ Cell170.FillColor = Color.LightCyan;
+ Cell171.FillColor = Color.LightCyan;
+ }else
+ {
+ Cell167.FillColor = Color.White;
+ Cell168.FillColor = Color.White;
+ Cell169.FillColor = Color.White;
+ Cell170.FillColor = Color.White;
+ Cell171.FillColor = Color.White;
+ }
+ }
+
+ private void Picture4_BeforePrint(object sender, EventArgs e)
+ {
+ DataSourceBase rowData = Report.GetDataSource("P");
+
+ Object rowValue = rowData.CurrentRow;
+ var Picture = rowValue.GetType().GetProperty("PImage").GetValue(rowValue, null);
+
+ if(rowData["PImage"] != null){
+ Picture4.Image = Image.FromStream(new MemoryStream((Byte[])Picture));
+ Picture4.Visible = true;
+ }else{
+ Picture4.Image = null;
+ Picture4.Visible = false;
+ }
+ }
+
+ private void Page6_StartPage(object sender, EventArgs e)
+ {
+ DataSourceBase rowData = Report.GetDataSource("I");
+ Object rowValue = rowData.CurrentRow;
+ if(rowValue == null)
+ {
+ Page6.Visible = false;
+ return;
+ }
+ }
+
+ private void Picture5_BeforePrint(object sender, EventArgs e)
+ {
+ DataSourceBase rowData = Report.GetDataSource("I");
+ Object rowValue = rowData.CurrentRow;
+ if(rowValue == null)
+ {
+ Page6.Visible = false;
+ return;
+ }
+
+ var Picture = rowValue.GetType().GetProperty("ReportImage").GetValue(rowValue, null);
+ if(rowData["ReportImage"] != null){
+ Picture5.Image = Image.FromStream(new MemoryStream((Byte[])Picture));
+ Picture5.Visible = true;
+ }else{
+ Picture5.Image = null;
+ Picture5.Visible = false;
+ }
+ }
+
+ public Image Base64ToImage(string base64Str)
+ {
+ if(base64Str == null || base64Str == "")
+ {
+ return null;
+ }
+
+ byte[] imageBytes = Convert.FromBase64String(base64Str);
+ using (MemoryStream ms = new MemoryStream(imageBytes))
+ {
+ Image image = Image.FromStream(ms);
+ using (MemoryStream stream = new MemoryStream())
+ {
+ image.Save(stream, ImageFormat.Png);
+ return image;
+ }
+
+ }
+ }
+
+
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PEIS/ReportFiles/Exam_Signature.png b/PEIS/ReportFiles/Exam_Signature.png
new file mode 100644
index 0000000..5d85717
Binary files /dev/null and b/PEIS/ReportFiles/Exam_Signature.png differ
diff --git a/PEIS/Utils/ReportHelper.cs b/PEIS/Utils/ReportHelper.cs
index 970ccb4..5dd4e9f 100644
--- a/PEIS/Utils/ReportHelper.cs
+++ b/PEIS/Utils/ReportHelper.cs
@@ -28,6 +28,7 @@ using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using FastReport.Export.Pdf;
+using PEIS.Model.Exam;
namespace PEIS.Utils
{
@@ -141,6 +142,8 @@ namespace PEIS.Utils
return EasyReport(patient, eid, filePath);
case "Health.frx":
return EasyReport(patient, eid, filePath);
+ case "CAPReport.frx":
+ return CAPReport(patient, eid, filePath);
default:
return General(patient, eid, filePath);
}
@@ -231,15 +234,14 @@ namespace PEIS.Utils
return null;
}
}
-
///
- /// 一般体检
+ /// 职业病体检
///
///
///
///
///
- private static FastReport.Report General(EnrollmentPatient patient, Int64 eid, string filePath)
+ private static FastReport.Report CAPReport(EnrollmentPatient patient, Int64 eid, string filePath)
{
var rpt = new FastReport.Report(); //实例化一个Report报表
@@ -251,6 +253,10 @@ namespace PEIS.Utils
var lstPacs = new ReportModel().GetPacsResult(eid);
var lstPacsPhotos = new ReportModel().GetPacsPhoto(eid);
+ var lstSymptom = new CareerHisInqModel().GetCareerHisInqSymptom(10154);
+ var examCareerHisInq = new CareerHisInqModel().GetExamCareerHisInqByEid(10008);
+ var examEmploymentHis = new CareerHisInqModel().GetEmploymentHises(10028);
+
// 登记信息
rpt.SetParameterValue("PatientName", patient.Name);
rpt.SetParameterValue("CardNo", patient.CardNo);
@@ -271,7 +277,14 @@ namespace PEIS.Utils
rpt.SetParameterValue("HospitalName", Global._hospital.Name);
rpt.SetParameterValue("DeptName", patient.DeptName);
- if(string.IsNullOrEmpty(patient.Photo))
+
+ rpt.SetParameterValue("EnrollmentType", "岗中");
+ rpt.SetParameterValue("IDCard", patient.CardNo);
+ rpt.SetParameterValue("HospitalAddress", "无");
+ rpt.SetParameterValue("HospitalCertificate", "无");
+ rpt.SetParameterValue("HospitalTel", Global._hospital.Tel);
+
+ if (string.IsNullOrEmpty(patient.Photo))
{
rpt.SetParameterValue("Avatar", patient.Photo);
}
@@ -289,7 +302,96 @@ namespace PEIS.Utils
}
}
-
+ List