|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 一般体检 |
|
|
|
|
/// 职业病体检 |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="patient"></param> |
|
|
|
|
/// <param name="eid"></param> |
|
|
|
|
/// <param name="filePath"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
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<object> testList = new List<object>() |
|
|
|
|
{ |
|
|
|
|
//new { PatientName="张三1",Sex="男",IDCard="530128199403243610",MaritalStatus="已婚",HDTAge="10年",HDAge="5年",HDStr="高温、高压"}, |
|
|
|
|
}; |
|
|
|
|
foreach (var item in examEmploymentHis) |
|
|
|
|
{ |
|
|
|
|
testList.Add(new |
|
|
|
|
{ |
|
|
|
|
PatientName = patient.Name, |
|
|
|
|
Sex = patient.Sex == "1" ? "男" : patient.Sex == "2" ? "女" : "", |
|
|
|
|
IDCard = patient.CardNo, |
|
|
|
|
MaritalStatus = patient.Marriage, |
|
|
|
|
HDTAge = "", |
|
|
|
|
HDAge = "", |
|
|
|
|
HDStr = item.HarmfulFactors |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<SymptomReportModele> symptoms = new List<SymptomReportModele>(); |
|
|
|
|
for (int i = 0; i < lstSymptom.Count; i = i + 2) |
|
|
|
|
{ |
|
|
|
|
SymptomReportModele sm = new SymptomReportModele(); |
|
|
|
|
sm.SMName0 = $"{lstSymptom[i].DispOrder}、{lstSymptom[i].SMName}"; |
|
|
|
|
sm.SMValue0 = lstSymptom[i].SMValue; |
|
|
|
|
if ((i + 1) < lstSymptom.Count) |
|
|
|
|
{ |
|
|
|
|
sm.SMName1 = $"{lstSymptom[i + 1].DispOrder}、{lstSymptom[i + 1].SMName}"; |
|
|
|
|
sm.SMValue1 = lstSymptom[i + 1].SMValue; |
|
|
|
|
} |
|
|
|
|
symptoms.Add(sm); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var careerHisInq = new List<ECInqReportModele>(); |
|
|
|
|
ECInqReportModele eCInqReport = new ECInqReportModele(); |
|
|
|
|
if (examCareerHisInq != null) |
|
|
|
|
{ |
|
|
|
|
eCInqReport.PastHistory = string.IsNullOrEmpty(examCareerHisInq.PastHistory) ? "/" : examCareerHisInq.PastHistory; |
|
|
|
|
eCInqReport.Menarche = string.IsNullOrEmpty(examCareerHisInq.Menarche) ? "/" : examCareerHisInq.Menarche; |
|
|
|
|
eCInqReport.MenarchePeriod = string.IsNullOrEmpty(examCareerHisInq.MenarchePeriod) ? "/" : examCareerHisInq.MenarchePeriod; |
|
|
|
|
eCInqReport.MenarcheCycle = string.IsNullOrEmpty(examCareerHisInq.MenarcheCycle) ? "/" : examCareerHisInq.MenarcheCycle; |
|
|
|
|
eCInqReport.LastMenstrualPod = string.IsNullOrEmpty(examCareerHisInq.LastMenstrualPod) ? "/" : examCareerHisInq.LastMenstrualPod; |
|
|
|
|
eCInqReport.ExistingChildren = string.IsNullOrEmpty(examCareerHisInq.ExistingChildren) ? "/" : examCareerHisInq.ExistingChildren; |
|
|
|
|
eCInqReport.Abortion = string.IsNullOrEmpty(examCareerHisInq.Abortion) ? "/" : examCareerHisInq.Abortion; |
|
|
|
|
eCInqReport.PrematureDelivery = string.IsNullOrEmpty(examCareerHisInq.PrematureDelivery) ? "/" : examCareerHisInq.PrematureDelivery; |
|
|
|
|
eCInqReport.Stillbirth = string.IsNullOrEmpty(examCareerHisInq.Stillbirth) ? "/" : examCareerHisInq.Stillbirth; |
|
|
|
|
eCInqReport.AbnormalFetus = string.IsNullOrEmpty(examCareerHisInq.AbnormalFetus) ? "/" : examCareerHisInq.AbnormalFetus; |
|
|
|
|
if (examCareerHisInq.SmokeState == 1) eCInqReport.SmokeState_1 = true; |
|
|
|
|
if (examCareerHisInq.SmokeState == 2) eCInqReport.SmokeState_2 = true; |
|
|
|
|
if (examCareerHisInq.SmokeState == 3) eCInqReport.SmokeState_3 = true; |
|
|
|
|
eCInqReport.SmokeQuantity = string.IsNullOrEmpty(examCareerHisInq.SmokeQuantity) ? "/" : examCareerHisInq.SmokeQuantity; |
|
|
|
|
eCInqReport.SmokeYears = string.IsNullOrEmpty(examCareerHisInq.SmokeQuantity) ? "/" : examCareerHisInq.SmokeYears; |
|
|
|
|
eCInqReport.SmokeMonths = string.IsNullOrEmpty(examCareerHisInq.SmokeMonths) ? "/" : examCareerHisInq.SmokeMonths; |
|
|
|
|
if (examCareerHisInq.DrinkState == 1) eCInqReport.DrinkState_1 = true; |
|
|
|
|
if (examCareerHisInq.DrinkState == 2) eCInqReport.DrinkState_2 = true; |
|
|
|
|
if (examCareerHisInq.DrinkState == 3) eCInqReport.DrinkState_3 = true; |
|
|
|
|
eCInqReport.DrinkQuantity = string.IsNullOrEmpty(examCareerHisInq.DrinkQuantity) ? "/" : examCareerHisInq.DrinkQuantity; |
|
|
|
|
eCInqReport.DrinkYears = string.IsNullOrEmpty(examCareerHisInq.DrinkYears) ? "/" : examCareerHisInq.DrinkYears; |
|
|
|
|
eCInqReport.SleepCondition = string.IsNullOrEmpty(examCareerHisInq.SleepCondition) ? "/" : examCareerHisInq.SleepCondition; |
|
|
|
|
eCInqReport.Other = string.IsNullOrEmpty(examCareerHisInq.Other) ? "/" : examCareerHisInq.Other; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
eCInqReport.PastHistory = "/"; |
|
|
|
|
eCInqReport.Menarche = "/"; |
|
|
|
|
eCInqReport.MenarchePeriod = "/"; |
|
|
|
|
eCInqReport.MenarcheCycle = "/"; |
|
|
|
|
eCInqReport.LastMenstrualPod = "/"; |
|
|
|
|
eCInqReport.ExistingChildren = "/"; |
|
|
|
|
eCInqReport.Abortion = "/"; |
|
|
|
|
eCInqReport.PrematureDelivery = "/"; |
|
|
|
|
eCInqReport.Stillbirth = "/"; |
|
|
|
|
eCInqReport.AbnormalFetus = "/"; |
|
|
|
|
if (examCareerHisInq.SmokeState == 1) eCInqReport.SmokeState_1 = true; |
|
|
|
|
if (examCareerHisInq.SmokeState == 2) eCInqReport.SmokeState_2 = true; |
|
|
|
|
if (examCareerHisInq.SmokeState == 3) eCInqReport.SmokeState_3 = true; |
|
|
|
|
eCInqReport.SmokeQuantity = "/"; |
|
|
|
|
eCInqReport.SmokeYears = "/"; |
|
|
|
|
eCInqReport.SmokeMonths = "/"; |
|
|
|
|
if (examCareerHisInq.DrinkState == 1) eCInqReport.DrinkState_1 = true; |
|
|
|
|
if (examCareerHisInq.DrinkState == 2) eCInqReport.DrinkState_2 = true; |
|
|
|
|
if (examCareerHisInq.DrinkState == 3) eCInqReport.DrinkState_3 = true; |
|
|
|
|
eCInqReport.DrinkQuantity = "/"; |
|
|
|
|
eCInqReport.DrinkYears = "/"; |
|
|
|
|
eCInqReport.SleepCondition = "/"; |
|
|
|
|
eCInqReport.Other = "/"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
careerHisInq.Add(eCInqReport); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 收费列表 |
|
|
|
|
SetDataSource(ref rpt, lstEFeeItems, "F", "FeeItems"); |
|
|
|
@ -303,7 +405,86 @@ namespace PEIS.Utils |
|
|
|
|
SetDataSource(ref rpt, lstLis, "L", "LIS"); |
|
|
|
|
// PacsImage |
|
|
|
|
SetDataSource(ref rpt, lstPacsPhotos, "I", "PACSImage"); |
|
|
|
|
// 职业史 |
|
|
|
|
SetDataSource(ref rpt, testList, "CAH", "CAItems"); |
|
|
|
|
//问诊 |
|
|
|
|
SetDataSource(ref rpt, careerHisInq, "CAC", "CareerHisInq"); |
|
|
|
|
//症状 |
|
|
|
|
SetDataSource(ref rpt, symptoms, "CAS", "Symptoms"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rpt.Prepare(); //准备 |
|
|
|
|
return rpt; |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
|
/// 一般体检 |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="patient"></param> |
|
|
|
|
/// <param name="eid"></param> |
|
|
|
|
/// <param name="filePath"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
private static FastReport.Report General(EnrollmentPatient patient, Int64 eid, string filePath) |
|
|
|
|
{ |
|
|
|
|
var rpt = new FastReport.Report(); //实例化一个Report报表 |
|
|
|
|
|
|
|
|
|
rpt.Load(filePath); |
|
|
|
|
var lstEFeeItems = new ReportModel().GetEFeeItem(eid); |
|
|
|
|
var lstConclusions = new ReportModel().GetExamConclusions(eid); |
|
|
|
|
var lstGeneral = new ReportModel().GetGeneralResult(eid); |
|
|
|
|
var lstLis = new ReportModel().GetLisResult(eid); |
|
|
|
|
var lstPacs = new ReportModel().GetPacsResult(eid); |
|
|
|
|
var lstPacsPhotos = new ReportModel().GetPacsPhoto(eid); |
|
|
|
|
|
|
|
|
|
// 登记信息 |
|
|
|
|
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("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("Tel", patient.Tel1); |
|
|
|
|
rpt.SetParameterValue("FinishPerson", patient.Finisher); |
|
|
|
|
rpt.SetParameterValue("FinishDate", patient.FinishTime?.ToShortDateString()); |
|
|
|
|
rpt.SetParameterValue("HospitalName", Global._hospital.Name); |
|
|
|
|
rpt.SetParameterValue("DeptName", patient.DeptName); |
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(patient.Photo)) |
|
|
|
|
{ |
|
|
|
|
rpt.SetParameterValue("Avatar", patient.Photo); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
byte[] imageBytes = Convert.FromBase64String(patient.Photo); |
|
|
|
|
using (MemoryStream ms = new MemoryStream(imageBytes)) |
|
|
|
|
{ |
|
|
|
|
Image image = Image.FromStream(ms); |
|
|
|
|
using (MemoryStream stream = new MemoryStream()) |
|
|
|
|
{ |
|
|
|
|
image.Save(stream, ImageFormat.Png); |
|
|
|
|
rpt.SetParameterValue("Avatar", Convert.ToBase64String(stream.ToArray())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 收费列表 |
|
|
|
|
SetDataSource(ref rpt, lstEFeeItems, "F", "FeeItems"); |
|
|
|
|
// 总结结论词 |
|
|
|
|
SetDataSource(ref rpt, lstConclusions, "C", "Conclusion"); |
|
|
|
|
//一般检查 |
|
|
|
|
SetDataSource(ref rpt, lstGeneral, "G", "General"); |
|
|
|
|
//PACS |
|
|
|
|
SetDataSource(ref rpt, lstPacs, "P", "PACS"); |
|
|
|
|
//LIS |
|
|
|
|
SetDataSource(ref rpt, lstLis, "L", "LIS"); |
|
|
|
|
// PacsImage |
|
|
|
|
SetDataSource(ref rpt, lstPacsPhotos, "I", "PACSImage"); |
|
|
|
|
rpt.Prepare(); //准备 |
|
|
|
|
return rpt; |
|
|
|
|
} |
|
|
|
|