职业体检更新

1.职业体检报告单位名称和地址取值调整
2.拍照窗口的危害因素取值调整
dhzzyy
LiJiaWen 2 months ago
parent 863ce64ef2
commit a8b8da97fd
  1. 1
      PEIS/Model/ReportModel.cs
  2. 4
      PEIS/Utils/ObjectData.cs
  3. 8
      PEIS/Utils/ReportHelper.cs
  4. 48
      PEIS/View/Enrollment/NewEnrollmentPersonForm.cs

@ -67,6 +67,7 @@ namespace PEIS.Model
COALESCE ( a.Nation, b.Nation ) AS Nation, COALESCE ( a.Nation, b.Nation ) AS Nation,
c.DeptName, c.DeptName,
a.OID, a.OID,
a.OEID,
a.PID, a.PID,
a.HazardFactors, a.HazardFactors,
a.WorkYears, a.WorkYears,

@ -92,9 +92,9 @@ namespace PEIS.Utils
return false; return false;
} }
public virtual T Get<T>(T pobj) public virtual void GetById()
{ {
return (T)DAOHelp.GetById(this); DAOHelp.GetById(this);
} }
} }

@ -258,14 +258,16 @@ namespace PEIS.Utils
var examCareerConclusions = new TotalModel().GetExamCareerConclusion(eid); var examCareerConclusions = new TotalModel().GetExamCareerConclusion(eid);
// 基础信息 // 基础信息
rpt.SetParameterValue("TeamName", patient.OrgName); if (patient.OEID != null)
if (patient.OID != null)
{ {
var org = new BaseOrgModel().GetOrgByID(patient.OID); var org = new EnrollmentOrg() { ID = (long)patient.OEID };
org.GetById();
rpt.SetParameterValue("TeamName", org.InvoiceName);
rpt.SetParameterValue("TeamAddress", org.Address); rpt.SetParameterValue("TeamAddress", org.Address);
} }
else else
{ {
rpt.SetParameterValue("TeamName", "");
rpt.SetParameterValue("TeamAddress", ""); rpt.SetParameterValue("TeamAddress", "");
} }
rpt.SetParameterValue("PatientID", patient.PID); rpt.SetParameterValue("PatientID", patient.PID);

@ -39,7 +39,7 @@ namespace PEIS.View.Enrollment
NewBaseBtn.Enabled = !editStatus; NewBaseBtn.Enabled = !editStatus;
//NameTextBox.Enabled = !editStatus; //NameTextBox.Enabled = !editStatus;
Text = editStatus ? "编辑登记信息" : "新增登记信息"; Text = editStatus ? "编辑登记信息" : "新增登记信息";
// 查询 // 查询
NameTextBox.Leave += NameTextBox_Leave; NameTextBox.Leave += NameTextBox_Leave;
@ -89,9 +89,11 @@ namespace PEIS.View.Enrollment
private void JobStatusComboBox_SelectedIndexChanged(object sender, EventArgs e) private void JobStatusComboBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
var status = JobStatusComboBox.SelectedValue?.ToString(); var status = JobStatusComboBox.SelectedValue?.ToString();
//var _lst = DAOHelp.GetDataBySQL<DictHazardType>($@"SELECT Name FROM Dict_HazardType
// WHERE ID IN (SELECT HID FROM Dict_HTypeFItem GROUP BY HID)
// AND ParentID IN (SELECT ID FROM Dict_HazardType WHERE ParentID in (SELECT ID FROM Dict_HazardType WHERE Name = '{status}'))");
var _lst = DAOHelp.GetDataBySQL<DictHazardType>($@"SELECT Name FROM Dict_HazardType var _lst = DAOHelp.GetDataBySQL<DictHazardType>($@"SELECT Name FROM Dict_HazardType
WHERE ID IN (SELECT HID FROM Dict_HTypeFItem GROUP BY HID) WHERE ParentID IN (SELECT ID FROM Dict_HazardType WHERE ParentID in (SELECT ID FROM Dict_HazardType WHERE Name = '{status}'))");
AND ParentID IN (SELECT ID FROM Dict_HazardType WHERE ParentID in (SELECT ID FROM Dict_HazardType WHERE Name = '{status?? "岗前"}'))");
foreach (var item in _lst) foreach (var item in _lst)
{ {
@ -167,11 +169,11 @@ namespace PEIS.View.Enrollment
return; return;
} }
if(_editStatus && Global.currentUser.Code == Global._hospital.DoctCode) if (_editStatus && Global.currentUser.Code == Global._hospital.DoctCode)
{ {
return; return;
} }
if(!_editStatus) if (!_editStatus)
{ {
OnGetBaseInfoByName(); OnGetBaseInfoByName();
} }
@ -219,8 +221,8 @@ namespace PEIS.View.Enrollment
CardTypeComboBox.Text = item?.CardType; CardTypeComboBox.Text = item?.CardType;
IDCard.Text = item?.CardNo; IDCard.Text = item?.CardNo;
NationBoxTxt.Text = item?.Nation; NationBoxTxt.Text = item?.Nation;
BirthdayDateTimePicker.Value = item?.Birthday ?? DateTime.Now; BirthdayDateTimePicker.Value = item?.Birthday ?? DateTime.Now;
ExamDate.Value = item?.ExamDate?? DateTime.Now; ExamDate.Value = item?.ExamDate ?? DateTime.Now;
ExamTypeComboBox.SelectedValue = item?.ExamType ?? "健康体检"; ExamTypeComboBox.SelectedValue = item?.ExamType ?? "健康体检";
MaritalComboBox.SelectedValue = item?.Marriage ?? "未知"; MaritalComboBox.SelectedValue = item?.Marriage ?? "未知";
OccupationComboBox.SelectedValue = item?.Occupation ?? "其它劳动者"; OccupationComboBox.SelectedValue = item?.Occupation ?? "其它劳动者";
@ -253,7 +255,7 @@ namespace PEIS.View.Enrollment
NewPersonForm personForm = new NewPersonForm(action); NewPersonForm personForm = new NewPersonForm(action);
personForm.ShowDialog(); personForm.ShowDialog();
} }
private void ReadIDCard_Click(object sender, EventArgs e) private void ReadIDCard_Click(object sender, EventArgs e)
{ {
@ -275,9 +277,9 @@ namespace PEIS.View.Enrollment
Global.MsgErr(a.Message); Global.MsgErr(a.Message);
return; return;
} }
} }
private void TakePhotoBtn_Click(object sender, EventArgs e) private void TakePhotoBtn_Click(object sender, EventArgs e)
{ {
Bitmap img = CameraPlayer.GetCurrentVideoFrame(); Bitmap img = CameraPlayer.GetCurrentVideoFrame();
@ -325,7 +327,7 @@ namespace PEIS.View.Enrollment
if (ExamType != null && ExamType.Contains("职业")) if (ExamType != null && ExamType.Contains("职业"))
{ {
if(string.IsNullOrEmpty(JobTypes.Text.Trim())) if (string.IsNullOrEmpty(JobTypes.Text.Trim()))
{ {
Global.Msg("err", "请输入工种!"); Global.Msg("err", "请输入工种!");
return; return;
@ -388,7 +390,7 @@ namespace PEIS.View.Enrollment
Description = Description.Text.Trim(), Description = Description.Text.Trim(),
SpellCode = PingYinHelper.GetTotalPingYin(NameTextBox.Text.Trim()).FirstPingYin.Count == 0 ? null : PingYinHelper.GetTotalPingYin(NameTextBox.Text.Trim()).FirstPingYin[0] SpellCode = PingYinHelper.GetTotalPingYin(NameTextBox.Text.Trim()).FirstPingYin.Count == 0 ? null : PingYinHelper.GetTotalPingYin(NameTextBox.Text.Trim()).FirstPingYin[0]
}; };
if (ExamType != null && ExamType.Contains("职业")) if (ExamType != null && ExamType.Contains("职业"))
{ {
item.JobTypes = JobTypes.Text.Trim(); item.JobTypes = JobTypes.Text.Trim();
@ -548,7 +550,7 @@ namespace PEIS.View.Enrollment
OccupationComboBox.DataSource = Global._lstConfig.Where(w => w.Key == "Occupation").OrderBy(p => p.Seq).ToList(); OccupationComboBox.DataSource = Global._lstConfig.Where(w => w.Key == "Occupation").OrderBy(p => p.Seq).ToList();
OccupationComboBox.DisplayMember = "Value"; OccupationComboBox.DisplayMember = "Value";
OccupationComboBox.ValueMember = "Value"; OccupationComboBox.ValueMember = "Value";
ExamTypeComboBox.DataSource = Global._lstConfig.Where(w => w.Key == "ExamType").ToList(); ExamTypeComboBox.DataSource = Global._lstConfig.Where(w => w.Key == "ExamType").ToList();
ExamTypeComboBox.DisplayMember = "Value"; ExamTypeComboBox.DisplayMember = "Value";
ExamTypeComboBox.ValueMember = "Value"; ExamTypeComboBox.ValueMember = "Value";
@ -655,7 +657,7 @@ namespace PEIS.View.Enrollment
"月" "月"
}; };
} }
// 转换照片格式 // 转换照片格式
public string ImageToBase64() public string ImageToBase64()
{ {
if (Photo.Image == null) if (Photo.Image == null)
@ -666,13 +668,13 @@ namespace PEIS.View.Enrollment
{ {
using (MemoryStream ms = new MemoryStream()) using (MemoryStream ms = new MemoryStream())
{ {
Photo.Image.Save(ms, ImageFormat.Png); Photo.Image.Save(ms, ImageFormat.Png);
byte[] imageBytes = ms.ToArray(); byte[] imageBytes = ms.ToArray();
return Convert.ToBase64String(imageBytes); return Convert.ToBase64String(imageBytes);
} }
} }
catch(Exception ex) catch (Exception ex)
{ {
Global.Msg("err", ex.Message); Global.Msg("err", ex.Message);
return null; return null;
@ -695,7 +697,7 @@ namespace PEIS.View.Enrollment
return image; return image;
} }
} }
catch(Exception ex) catch (Exception ex)
{ {
Global.Msg("err", ex.Message); Global.Msg("err", ex.Message);
return null; return null;
@ -753,16 +755,16 @@ namespace PEIS.View.Enrollment
SelectPerson(items[0]); SelectPerson(items[0]);
break; break;
default: default:
{ {
SelectPatientForm selectPatientForm = new SelectPatientForm(action, NameTextBox.Text.Trim()); SelectPatientForm selectPatientForm = new SelectPatientForm(action, NameTextBox.Text.Trim());
selectPatientForm.ShowDialog(); selectPatientForm.ShowDialog();
break; break;
} }
} }
} }
protected virtual void OnGetBaseInfoByName() protected virtual void OnGetBaseInfoByName()
{ {
GetBaseInfoByName?.Invoke(this, new Args<string>{ Name = NameTextBox.Text }); GetBaseInfoByName?.Invoke(this, new Args<string> { Name = NameTextBox.Text });
} }
// 通过证件类型、证件号查询PID // 通过证件类型、证件号查询PID

Loading…
Cancel
Save