diff --git a/PEIS/Entity/ExamCareerConclusion.cs b/PEIS/Entity/ExamCareerConclusion.cs
new file mode 100644
index 0000000..8de4a3c
--- /dev/null
+++ b/PEIS/Entity/ExamCareerConclusion.cs
@@ -0,0 +1,33 @@
+using PEIS.Utils;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace PEIS.Entity
+{
+ ///
+ /// 职业体检结论
+ ///
+ public class ExamCareerConclusion : ObjectData
+ {
+ public override String TableName => "Exam_CareerConclusion";
+ ///
+ /// 体检ID
+ ///
+ public Int64 EID { get; set; }
+ ///
+ /// 职业体检结论(1.目前未见异常 2.复查 3.疑似职业病 4.职业禁忌症 5.其他疾病或异常)
+ ///
+ public int OccupationalConclusion { get; set; }
+ }
+
+ public class CareerConclusionReportModele : ExamCareerConclusion
+ {
+ public bool Conclusion_1 { get; set; } = false;
+ public bool Conclusion_2 { get; set; } = false;
+ public bool Conclusion_3 { get; set; } = false;
+ public bool Conclusion_4 { get; set; } = false;
+ public bool Conclusion_5 { get; set; } = false;
+ }
+}
diff --git a/PEIS/Entity/ExamCareerHisInq.cs b/PEIS/Entity/ExamCareerHisInq.cs
index a480b0a..cb9e4f7 100644
--- a/PEIS/Entity/ExamCareerHisInq.cs
+++ b/PEIS/Entity/ExamCareerHisInq.cs
@@ -21,14 +21,38 @@ namespace PEIS.Entity
///
public string PastHistory { get; set; }
///
- /// 现病史
+ /// 现病史(急慢性职业病史)
///
public string PreHisIllness { get; set; }
///
+ /// 诊断日期
+ ///
+ public string PreHisIllnessDate { get; set; }
+ ///
+ /// 诊断证明书编号
+ ///
+ public string PreHisIllnessNo { get; set; }
+ ///
+ /// 诊断单位
+ ///
+ public string PreHisIllnessOrg { get; set; }
+ ///
+ /// 是否痊愈
+ ///
+ public string PreHisIllnessIsHeal { get; set; }
+ ///
/// 家族史
///
public string FamilyHistory { get; set; }
///
+ /// 服药史、药物过敏史
+ ///
+ public string DrugHistory { get; set; }
+ ///
+ /// 药物禁忌或其他
+ ///
+ public string DrugTaboo { get; set; }
+ ///
/// 手术史
///
public string SurgicalHistory { get; set; }
diff --git a/PEIS/Event/Args.cs b/PEIS/Event/Args.cs
index f804b82..7ac9439 100644
--- a/PEIS/Event/Args.cs
+++ b/PEIS/Event/Args.cs
@@ -50,6 +50,7 @@ namespace PEIS.Event
public String DeptCode { get; set; }
public Int64 Eid{ get; set; }
public Int64 Pid { get; set; }
+ public int OccupationalConclusion { get; set; }
public Args()
{
diff --git a/PEIS/Model/BaseOrgModel.cs b/PEIS/Model/BaseOrgModel.cs
index 00cf163..dd8d2e8 100644
--- a/PEIS/Model/BaseOrgModel.cs
+++ b/PEIS/Model/BaseOrgModel.cs
@@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using PEIS.Entity;
using PEIS.Utils;
@@ -26,11 +27,19 @@ namespace PEIS.Model
{
internal class BaseOrgModel : IModel
{
- public List GetItems()
+ public List GetItems()
{
return DAOHelp.GetDataBySQL($"select * from Base_Org Order by id desc");
}
+ public BaseOrg GetOrgByID(Int64? orgID)
+ {
+ if (orgID == null)
+ return null;
+
+ return DAOHelp.GetDataBySQL($"select * from Base_Org WHERE ID = {orgID}")?.FirstOrDefault();
+ }
+
public List GetPatient(Int64 orgID)
{
return DAOHelp.GetDataBySQL($"SELECT a.*, b.Name,b.Birthday,b.CardType, b.CardNo,b.Education, b.Marriage,b.Nation, b.Tel1,b.Address1, b.Tel2, CASE b.Sex WHEN 1 THEN '男' WHEN 2 THEN '女' ELSE '' END AS Sex FROM Base_OrgPatient a LEFT JOIN Base_Patient b ON a.PID = b.ID WHERE OID = {orgID} ORDER BY a.Seq");
@@ -45,7 +54,7 @@ namespace PEIS.Model
{
var item = DAOHelp.GetDataBySQL($@"SELECT * FROM Base_OrgPatient WHERE OID = {oid} AND PID = {pid} ");
- if(item.Count != 0)
+ if (item.Count != 0)
{
Global.Msg("info", "该成员已应用到分组!");
return;
diff --git a/PEIS/Model/Exam/TotalModel.cs b/PEIS/Model/Exam/TotalModel.cs
index 4d30cb6..ddcf7dd 100644
--- a/PEIS/Model/Exam/TotalModel.cs
+++ b/PEIS/Model/Exam/TotalModel.cs
@@ -326,7 +326,7 @@ namespace PEIS.Model
try
{
Task task = new Task(() => ReportHelper.SaveReport(id));
- task.Start();
+ task.Start();
Debug.WriteLine($"{id}保存体检报告成功!");
}
catch (AggregateException ae)
@@ -359,6 +359,29 @@ namespace PEIS.Model
return DAOHelp.ExecuteSql($@"UPDATE Enrollment_Patient SET isWeChatView={isView} WHERE ID = {eid}") > 0;
}
+ ///
+ /// 获取职业体检结论
+ ///
+ ///
+ ///
+ public List GetExamCareerConclusion(Int64 eid)
+ {
+ return DAOHelp.GetDataBySQL($@"SELECT * FROM Exam_CareerConclusion WHERE eid = {eid}")?.ToList();
+ }
+
+ ///
+ /// 保存职业体检结论
+ ///
+ ///
+ ///
+ ///
+ public List SaveExamCareerConclusion(Int64 eid, int conclusion)
+ {
+ DAOHelp.ExecuteSql($@"DELETE Exam_CareerConclusion WHERE eid = {eid}");
+ DAOHelp.Save(new ExamCareerConclusion() { EID = eid, OccupationalConclusion = conclusion });
+ return GetExamCareerConclusion(eid);
+ }
+
#endregion MyMethod
}
}
\ No newline at end of file
diff --git a/PEIS/Model/ReportModel.cs b/PEIS/Model/ReportModel.cs
index acbbb0c..497c2aa 100644
--- a/PEIS/Model/ReportModel.cs
+++ b/PEIS/Model/ReportModel.cs
@@ -65,7 +65,13 @@ namespace PEIS.Model
a.CardNo,
COALESCE(a.OrgName, a.Company) AS OrgName,
COALESCE ( a.Nation, b.Nation ) AS Nation,
- c.DeptName
+ c.DeptName,
+ a.OID,
+ a.PID,
+ a.HazardFactors,
+ a.WorkYears,
+ a.JobTypes,
+ a.HazardYears
FROM
Enrollment_Patient a
LEFT JOIN Base_Patient b ON a.pid = b.id
diff --git a/PEIS/PEIS.csproj b/PEIS/PEIS.csproj
index 500f9e3..a85b10f 100644
--- a/PEIS/PEIS.csproj
+++ b/PEIS/PEIS.csproj
@@ -198,6 +198,7 @@
+
@@ -762,38 +763,37 @@
True
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
-
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
@@ -801,7 +801,7 @@
- Always
+ PreserveNewest
@@ -830,7 +830,7 @@
- Always
+ PreserveNewest
@@ -846,34 +846,34 @@
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
- Always
+ PreserveNewest
diff --git a/PEIS/Presenter/TotalPresenter.cs b/PEIS/Presenter/TotalPresenter.cs
index b0f84ce..fa48995 100644
--- a/PEIS/Presenter/TotalPresenter.cs
+++ b/PEIS/Presenter/TotalPresenter.cs
@@ -40,7 +40,7 @@ namespace PEIS.Presenter
View.GetPatient += (send, args) =>
{
View.ShowPatient(new TotalModel().GetPatient(args.ID));
- };
+ };
//2.检查结果
View.GetExamResultList += (send, args) =>
{
@@ -51,7 +51,7 @@ namespace PEIS.Presenter
{
View.ShowSummary(new TotalModel().GetSummary(args.ID));
};
-
+
//4.结论词
View.GetExamConclusion += (send, args) =>
{
@@ -81,6 +81,16 @@ namespace PEIS.Presenter
{
View.ShowReportExtList(new PartModel().GetReportExtList(args.ID));
};
+
+ //8.职业体检结论
+ View.GetExamCareerConclusion += (send, args) =>
+ {
+ View.ShowExamCareerConclusion(new TotalModel().GetExamCareerConclusion(args.ID));
+ };
+ View.SaveExamCareerConclusion += (send, args) =>
+ {
+ View.ShowExamCareerConclusion(new TotalModel().SaveExamCareerConclusion(args.ID, args.OccupationalConclusion));
+ };
}
}
}
\ No newline at end of file
diff --git a/PEIS/ReportFiles/CAPReport.frx b/PEIS/ReportFiles/CAPReport.frx
index ccf099c..e1b56a3 100644
--- a/PEIS/ReportFiles/CAPReport.frx
+++ b/PEIS/ReportFiles/CAPReport.frx
@@ -1,5 +1,5 @@
-
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -46,12 +46,12 @@ namespace FastReport
Text132.Text = rowData["IsDeptGiveUp"].ToString() == "1" ? "是" : "";
Text134.Text = rowData["GiveUpTime"] == null ? "" : "是";
}
-
- private void Picture3_BeforePrint(object sender, EventArgs e)
+
+
+ private void Avatar_BeforePrint(object sender, EventArgs e)
{
- //Picture3.Image = Base64ToImage((string)Report.GetParameterValue("Avatar"));
- Picture6.Image = Base64ToImage((string)Report.GetParameterValue("Avatar"));
- }
+ Avatar.Image = Base64ToImage((string)Report.GetParameterValue("Avatar"));
+ }
private void Cell171_AfterData(object sender, EventArgs e)
{
@@ -145,8 +145,7 @@ namespace FastReport
}
}
-
-
+
}
}
@@ -169,46 +168,195 @@ namespace FastReport
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -252,146 +400,6 @@ namespace FastReport
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -465,7 +473,7 @@ namespace FastReport
-
+
@@ -586,7 +594,7 @@ namespace FastReport
-
+
@@ -602,8 +610,9 @@ namespace FastReport
-
-
+
+
+
@@ -617,10 +626,19 @@ namespace FastReport
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/PEIS/Utils/ReportHelper.cs b/PEIS/Utils/ReportHelper.cs
index ddb0322..28758cf 100644
--- a/PEIS/Utils/ReportHelper.cs
+++ b/PEIS/Utils/ReportHelper.cs
@@ -28,11 +28,12 @@ using System.Drawing;
using System.Drawing.Imaging;
using FastReport.Export.Pdf;
using PEIS.Model.Exam;
+using PEIS.View.Exam;
namespace PEIS.Utils
{
public static class ReportHelper
- {
+ {
///
/// PDF to Image
///
@@ -112,14 +113,14 @@ namespace PEIS.Utils
///
/// 体检号
///
- public static FastReport.Report GetReport(Int64 eid,String paramFile = null)
+ public static FastReport.Report GetReport(Int64 eid, String paramFile = null)
{
try
{
var patient = new ReportModel().GetPatientInfo(eid);
if (patient == null) return null;
var fileName = DAOHelp.GetDataBySQL($"SELECT Description FROM Dict_Config where Value='{patient.Type}'").FirstOrDefault()?.Description ?? "PReport.frx";
- var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles",string.IsNullOrEmpty(paramFile) ? fileName : paramFile);
+ var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", string.IsNullOrEmpty(paramFile) ? fileName : paramFile);
if (!File.Exists(filePath))
{
MessageBox.Show($@"未找到报告单模板文件:{fileName}", @"获取报告单失败");
@@ -254,32 +255,50 @@ namespace PEIS.Utils
var examCareerHisInq = new CareerHisInqModel().GetExamCareerHisInqByEid(eid);
var examEmploymentHis = new CareerHisInqModel().GetEmploymentHises(eid);
- // 登记信息
+ var examCareerConclusions = new TotalModel().GetExamCareerConclusion(eid);
+
+ // 基础信息
+ rpt.SetParameterValue("TeamName", patient.OrgName);
+ if (patient.OID != null)
+ {
+ var org = new BaseOrgModel().GetOrgByID(patient.OID);
+ rpt.SetParameterValue("TeamAddress", org.Address);
+ }
+ else
+ {
+ rpt.SetParameterValue("TeamAddress", "");
+ }
+ rpt.SetParameterValue("PatientID", patient.PID);
+ rpt.SetParameterValue("ExamID", patient.ID.ToString());
rpt.SetParameterValue("PatientName", patient.Name);
- rpt.SetParameterValue("CardNo", patient.CardNo);
- rpt.SetParameterValue("Nation", patient.Nation);
- rpt.SetParameterValue("Age", patient.Age + patient.AgeClass);
rpt.SetParameterValue("Sex", patient.Sex == "1" ? "男" : patient.Sex == "2" ? "女" : "");
- rpt.SetParameterValue("ExamID", patient.ID.ToString());
- rpt.SetParameterValue("ExamDate", patient.SignTime?.ToShortDateString());
+ rpt.SetParameterValue("Age", patient.Age + patient.AgeClass);
rpt.SetParameterValue("Marriage", patient.Marriage);
- rpt.SetParameterValue("TeamName", patient.OrgName);
- rpt.SetParameterValue("GroupName", patient.GroupName);
- rpt.SetParameterValue("Company", patient.Company);
- rpt.SetParameterValue("ExamType", patient.Type);
- rpt.SetParameterValue("Address", patient.Address1);
+ rpt.SetParameterValue("IDCard", patient.CardNo);
+ rpt.SetParameterValue("JobTypes", patient.JobTypes);
+ rpt.SetParameterValue("WorkYears", patient.WorkYears);
+ rpt.SetParameterValue("HazardYears", patient.HazardYears);
+ rpt.SetParameterValue("HazardFactors", patient.HazardFactors);
+ rpt.SetParameterValue("EnrollmentType", patient.JobStatus);
+ rpt.SetParameterValue("ExamDate", patient.SignTime?.ToShortDateString());
rpt.SetParameterValue("Tel", patient.Tel1);
+
+ //rpt.SetParameterValue("Nation", patient.Nation);
+ //rpt.SetParameterValue("GroupName", patient.GroupName);
+ //rpt.SetParameterValue("Company", patient.Company);
+ //rpt.SetParameterValue("ExamType", patient.Type);
+ //rpt.SetParameterValue("Address", patient.Address1);
+
+ //rpt.SetParameterValue("DeptName", patient.DeptName);
+ //rpt.SetParameterValue("HospitalAddress", "无");
+ //rpt.SetParameterValue("HospitalCertificate", "无");
+ //rpt.SetParameterValue("HospitalTel", Global._hospital.Tel);
+
+ rpt.SetParameterValue("HospitalName", Global._hospital.Name);
+
rpt.SetParameterValue("FinishPerson", patient.Finisher);
rpt.SetParameterValue("FinishDate", patient.FinishTime?.ToShortDateString());
- rpt.SetParameterValue("HospitalName", Global._hospital.Name);
- rpt.SetParameterValue("DeptName", patient.DeptName);
-
- rpt.SetParameterValue("EnrollmentType", patient.JobStatus);
- rpt.SetParameterValue("IDCard", patient.CardNo);
- rpt.SetParameterValue("HospitalAddress", "无");
- rpt.SetParameterValue("HospitalCertificate", "无");
- rpt.SetParameterValue("HospitalTel", Global._hospital.Tel);
if (string.IsNullOrEmpty(patient.Photo))
{
@@ -299,43 +318,53 @@ namespace PEIS.Utils
}
}
- List