392 lines
14 KiB
C#
392 lines
14 KiB
C#
using DevExpress.XtraEditors;
|
||
using HL_FristAidPlatform_DTO;
|
||
using Newtonsoft.Json;
|
||
using Newtonsoft.Json.Linq;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Data;
|
||
using System.Drawing;
|
||
using System.IO;
|
||
|
||
namespace HL_FristAidPlatform_Public
|
||
{
|
||
public partial class Form_UpwardReferral : XtraForm
|
||
{
|
||
public string PatientGuid;
|
||
public string HospitalGuid;
|
||
public PatientReferralModelDTO dto;
|
||
|
||
public Form_UpwardReferral(string patientGuid, string hospitalGuid)
|
||
{
|
||
InitializeComponent();
|
||
PatientGuid = patientGuid;
|
||
HospitalGuid = hospitalGuid;
|
||
}
|
||
|
||
private void Form_DownwardReferral_Load(object sender, EventArgs e)
|
||
{
|
||
GetHospitalList();
|
||
dto = new PatientReferralModelDTO();
|
||
labelControl1.Text = Information.Hospital.Name;
|
||
GetPatientReferral();
|
||
}
|
||
public void GetHospitalList()
|
||
{
|
||
List<string> list = new List<string>();
|
||
list.Add("请选择");
|
||
List<HospitalModelDTO> lst = DBHelpClass.GetList<HospitalModelDTO>(string.Format("api/base/T_Base_Hospital/GetNameByHospitalGUID?parentHospitalGUID={0}", Information.Hospital.GUID));
|
||
if (lst != null && lst.Count > 0)
|
||
{
|
||
for (int i = 0; i < lst.Count; i++)
|
||
{
|
||
list.Add(lst[i].Name);
|
||
}
|
||
}
|
||
|
||
if (list.Count > 0)
|
||
{
|
||
lookUpEdit_ReceiveHospital.Properties.DataSource = list;
|
||
}
|
||
}
|
||
|
||
public void GetPatientReferral()
|
||
{
|
||
string URL = string.Format("api/service/T_Service_Chest_UpwardReferral/GetByPatientGuid?PatientGUID={0}&HospitalGuid={1}", PatientGuid, HospitalGuid);
|
||
PatientReferralModelDTO model = new PatientReferralModelDTO();
|
||
lbl_LeaveHospital.Text = Information.Hospital.Name;
|
||
model = DBHelpClass.GetDateModel<PatientReferralModelDTO>(URL);
|
||
if (model != null)
|
||
{
|
||
lbl_name.Text = model.Name;
|
||
if (model.Gender == 0)
|
||
lbl_gender.Text = "未知";
|
||
if (model.Gender == 1)
|
||
lbl_gender.Text = "男";
|
||
if (model.Gender == 0)
|
||
lbl_gender.Text = "女";
|
||
lbl_phone.Text = model.Phone;
|
||
if (model.Medical_Insurance_Type == "1")
|
||
lbl_medical_Insurance_Type.Text = "城镇职工基本医疗保险";
|
||
if (model.Medical_Insurance_Type == "2")
|
||
lbl_medical_Insurance_Type.Text = "新型农村合作医疗";
|
||
if (model.Medical_Insurance_Type == "3")
|
||
lbl_medical_Insurance_Type.Text = "城镇居民基本医疗保险";
|
||
if (model.Medical_Insurance_Type == "4")
|
||
lbl_medical_Insurance_Type.Text = "自费";
|
||
if (model.Medical_Insurance_Type == "5")
|
||
lbl_medical_Insurance_Type.Text = "军免";
|
||
lbl_age.Text = model.Age + "";
|
||
lbl_inpatient_ID.Text = model.Inpatient_ID;
|
||
memo_IllnessExplain.Text = model.IllnessExplain;
|
||
lbl_LeaveHospital.Text = model.LeaveHospital;
|
||
|
||
if (!string.IsNullOrEmpty(model.LeaveTime + ""))
|
||
timeControl_LeaveTime.TimeValue = model.LeaveTime;
|
||
//lbl_LeaveTime.Text = model.LeaveTime + "";
|
||
if (!string.IsNullOrEmpty(model.ReceiveHospital))
|
||
{
|
||
lookUpEdit_ReceiveHospital.Text = model.ReceiveHospital;
|
||
}
|
||
|
||
textEdit_AppointHospital.Text = model.AppointHospital + "";
|
||
|
||
if (!string.IsNullOrEmpty(model.TransferWay + ""))
|
||
radioGroup_TransferWay.EditValue = model.TransferWay;
|
||
|
||
PublicClass.SetItemChecked(checkedListBoxControl1, PublicClass.ToString(model.TransferNotice, ""), '|');//转院须知
|
||
|
||
//if (model.TransferWay == "1")
|
||
// lbl_TransferWay.Text = "120";
|
||
//if (model.TransferWay == "2")
|
||
// lbl_TransferWay.Text = "本院急救车";
|
||
//if (model.TransferWay == "3")
|
||
// lbl_TransferWay.Text = "患者自理";
|
||
|
||
if (model.PatientSignature != null)
|
||
{
|
||
//string str = Encoding.ASCII.GetString(model.PatientSignature);
|
||
//dto.PatientSignature = Convert.ToByte(str, 2);
|
||
dto.PatientSignature = model.PatientSignature;
|
||
string patientSignature = Convert.ToBase64String(model.PatientSignature);
|
||
if (!string.IsNullOrEmpty(patientSignature))
|
||
{
|
||
MemoryStream ms = new MemoryStream(Convert.FromBase64String(patientSignature));
|
||
Image img = Image.FromStream(ms);
|
||
pic_PatientSignature.Image = img;
|
||
}
|
||
}
|
||
//pic_ReferringDoctorSignature 转诊医生签字
|
||
if (model.ReferringDoctorSignature != null)
|
||
{
|
||
dto.ReferringDoctorSignature = model.ReferringDoctorSignature;
|
||
string ReferringDoctorSignature = Convert.ToBase64String(model.ReferringDoctorSignature);
|
||
if (!string.IsNullOrEmpty(ReferringDoctorSignature))
|
||
{
|
||
MemoryStream ms = new MemoryStream(Convert.FromBase64String(ReferringDoctorSignature));
|
||
Image img = Image.FromStream(ms);
|
||
pic_ReferringDoctorSignature.Image = img;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
private void simpleButton1_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
if (dto == null)
|
||
dto = new PatientReferralModelDTO();
|
||
|
||
dto.Name = lbl_name.Text;
|
||
if (lbl_gender.Text == "未知")
|
||
dto.Gender = 0;
|
||
if (lbl_gender.Text == "男")
|
||
dto.Gender = 1;
|
||
if (lbl_gender.Text == "女")
|
||
dto.Gender = 2;
|
||
dto.Phone = lbl_phone.Text;
|
||
dto.Medical_Insurance_Type = lbl_medical_Insurance_Type.Text;
|
||
dto.Age = int.Parse(lbl_age.Text);
|
||
dto.Inpatient_ID = lbl_inpatient_ID.Text;
|
||
string tempnotice = "";
|
||
string temptext = "";
|
||
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl1, "|", out tempnotice, out temptext);
|
||
dto.TransferNotice = tempnotice;
|
||
dto.IllnessExplain = memo_IllnessExplain.Text;
|
||
dto.LeaveHospital = lbl_LeaveHospital.Text;
|
||
|
||
dto.LeaveTime = timeControl_LeaveTime.TimeValue;
|
||
|
||
if (lookUpEdit_ReceiveHospital.Text + "" == "请选择")
|
||
{
|
||
dto.ReceiveHospital = "";
|
||
}
|
||
else
|
||
{
|
||
dto.ReceiveHospital = lookUpEdit_ReceiveHospital.Text;
|
||
}
|
||
dto.AppointHospital = textEdit_AppointHospital.Text;
|
||
dto.TransferWay = radioGroup_TransferWay.EditValue + "";
|
||
dto.HospitalGuid = Information.Hospital.GUID;
|
||
dto.CreatorID = Information.User.ID;
|
||
dto.PatientGuid = PatientGuid;
|
||
List<PatientReferralModelDTO> baseInfoDTOs = new List<PatientReferralModelDTO>();
|
||
|
||
string Url = string.Format("api/service/T_Service_Chest_UpwardReferral/AddORUpdate");
|
||
|
||
ClientFactory<PatientReferralModelDTO> httpClient = new HttpClientFactory<PatientReferralModelDTO>();
|
||
Client<PatientReferralModelDTO> client = httpClient.VisitFactory();
|
||
|
||
baseInfoDTOs.Add(dto);
|
||
//访问
|
||
ListEntity<PatientReferralModelDTO> t = client.Post(Url, baseInfoDTOs);
|
||
|
||
if (t.Success)
|
||
{
|
||
if (!string.IsNullOrEmpty(t.DataString))
|
||
{
|
||
if (t.DataString.Contains("Success"))
|
||
{
|
||
JObject jo = (JObject)JsonConvert.DeserializeObject(t.DataString);
|
||
string msg = jo["Msg"].ToString();
|
||
if (!string.IsNullOrEmpty(msg))
|
||
{
|
||
XtraMessageBox.Show(msg);
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
string msg1 = t.DataString.Replace("/", "").Replace(@"\", "").Replace("\"", "");
|
||
XtraMessageBox.Show(msg1);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
XtraMessageBox.Show("保存失败");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
XtraMessageBox.Show("保存失败");
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
throw;
|
||
}
|
||
|
||
}
|
||
|
||
private void simpleButton2_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
if (dto == null)
|
||
dto = new PatientReferralModelDTO();
|
||
|
||
dto.Name = lbl_name.Text;
|
||
if (lbl_gender.Text == "未知")
|
||
dto.Gender = 0;
|
||
if (lbl_gender.Text == "男")
|
||
dto.Gender = 1;
|
||
if (lbl_gender.Text == "女")
|
||
dto.Gender = 2;
|
||
dto.Phone = lbl_phone.Text;
|
||
dto.Medical_Insurance_Type = lbl_medical_Insurance_Type.Text;
|
||
dto.Age = int.Parse(lbl_age.Text);
|
||
dto.Inpatient_ID = lbl_inpatient_ID.Text;
|
||
string tempnotice = "";
|
||
string temptext = "";
|
||
PublicClass.GetCheckedListBoxItemValues(checkedListBoxControl1, "|", out tempnotice, out temptext);
|
||
dto.TransferNotice = tempnotice;
|
||
dto.IllnessExplain = memo_IllnessExplain.Text;
|
||
dto.LeaveHospital = lbl_LeaveHospital.Text;
|
||
|
||
dto.LeaveTime = timeControl_LeaveTime.TimeValue;
|
||
|
||
if (lookUpEdit_ReceiveHospital.Text + "" == "请选择")
|
||
{
|
||
dto.ReceiveHospital = "";
|
||
}
|
||
else
|
||
{
|
||
dto.ReceiveHospital = lookUpEdit_ReceiveHospital.Text;
|
||
}
|
||
dto.AppointHospital = textEdit_AppointHospital.Text;
|
||
dto.TransferWay = radioGroup_TransferWay.EditValue + "";
|
||
dto.HospitalGuid = Information.Hospital.GUID;
|
||
dto.CreatorID = Information.User.ID;
|
||
dto.PatientGuid = PatientGuid;
|
||
Print.PrintUpwardReferral(dto, true);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
throw;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 患者转诊信息
|
||
/// </summary>
|
||
/*private class PatientReferralModel
|
||
{
|
||
/// <summary>
|
||
/// 创建人编号
|
||
/// </summary>
|
||
public long CreatorID { get; set; }
|
||
|
||
/// <summary>
|
||
///
|
||
/// </summary>
|
||
public string PatientGuid { get; set; }
|
||
|
||
/// <summary>
|
||
/// 所属院区GUID
|
||
/// </summary>
|
||
public string HospitalGuid { get; set; }
|
||
|
||
/// <summary>
|
||
/// 真实姓名
|
||
/// </summary>
|
||
public string Name { get; set; }
|
||
|
||
/// <summary>
|
||
/// 性别
|
||
/// </summary>
|
||
public int Gender { get; set; }
|
||
|
||
/// <summary>
|
||
/// 年龄
|
||
/// </summary>
|
||
public int Age { get; set; }
|
||
|
||
/// <summary>
|
||
/// 移动电话
|
||
/// </summary>
|
||
public string Phone { get; set; }
|
||
|
||
/// <summary>
|
||
/// 住院ID
|
||
/// </summary>
|
||
public string Inpatient_ID { get; set; }
|
||
|
||
/// <summary>
|
||
/// 医保类型
|
||
/// 1:城镇职工基本医疗保险
|
||
/// 2:新型农村合作医疗
|
||
/// 3:城镇居民基本医疗保险
|
||
/// 4:自费
|
||
/// 5:军免
|
||
/// </summary>
|
||
public string Medical_Insurance_Type { get; set; }
|
||
|
||
/// <summary>
|
||
/// 转出时间
|
||
/// </summary>
|
||
public string LeaveTime { get; set; }
|
||
|
||
/// <summary>
|
||
/// 病情摘要及情况
|
||
/// </summary>
|
||
public string IllnessExplain { get; set; }
|
||
|
||
/// <summary>
|
||
/// 住院小结
|
||
/// </summary>
|
||
public string HospitalSummary { get; set; }
|
||
|
||
/// <summary>
|
||
/// 后期治疗方案及建议
|
||
/// </summary>
|
||
public string TreatmentPlan { get; set; }
|
||
|
||
/// <summary>
|
||
/// 转出医院
|
||
/// </summary>
|
||
public string LeaveHospital { get; set; }
|
||
|
||
/// <summary>
|
||
/// 送往医院
|
||
/// </summary>
|
||
public string SendHospital { get; set; }
|
||
|
||
/// <summary>
|
||
/// 患者/家属指定医院
|
||
/// </summary>
|
||
public string DesignatedHospital { get; set; }
|
||
|
||
/// <summary>
|
||
/// 患者知情同意签字
|
||
/// </summary>
|
||
public byte[] PatientSignature { get; set; }
|
||
|
||
/// <summary>
|
||
/// 转诊医生签字
|
||
/// </summary>
|
||
public byte[] ReferringDoctorSignature { get; set; }
|
||
|
||
/// <summary>
|
||
/// 上转送往医院
|
||
/// </summary>
|
||
public string ReceiveHospital { get; set; }
|
||
|
||
/// <summary>
|
||
/// 上转患者指定医院
|
||
/// </summary>
|
||
public string AppointHospital { get; set; }
|
||
|
||
/// <summary>
|
||
/// 转送方式
|
||
/// </summary>
|
||
public string TransferWay { get; set; }
|
||
|
||
/// <summary>
|
||
/// 转院须知
|
||
/// </summary>
|
||
public string TransferNotice { get; set; }
|
||
}*/
|
||
}
|
||
} |