StableVersion4.3/HL_FristAidPlatform_Bussiness/TranService/MedicalRecordTranBLL.cs

67 lines
2.6 KiB
C#

using HL_FristAidPlatform_DataBase;
using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase;
using HL_FristAidPlatform_Models;
using System;
namespace HL_FristAidPlatform_Bussiness
{
public class MedicalRecordTranBLL
{
private IMedicalRecordTranService IService = new MedicalRecordTranService();
private IT_Service_Patient _Patient = new T_Service_PatientDB();
private IT_Service_FirstAid_Call _Call = new T_Service_FirstAid_CallDB();
/// <summary>
/// 保存电子病历
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public MessageModel<bool> SaveMedicalRecordTran(SaveMedicalRecordModel model)
{
T_Service_Patient patient = new T_Service_Patient();
patient.GUID = model.Patient.GUID;
patient.Name = model.Patient.Name;
patient.Age = model.Patient.Age;
patient.Gender = model.Patient.Gender;
patient.Nation = model.Patient.Nation;
patient.MobilePhone = model.Patient.MobilePhone;
patient.IdentityCard = model.Patient.IdentityCard;
patient.Attack_Address = model.Patient.Attack_Address;
patient.Birthday = model.Patient.Birthday;
patient.EmergencyContactPhone = model.Patient.EmergencyContactPhone;
patient.EmergencyContact = model.Patient.EmergencyContact;
patient.Profession = model.Patient.Profession;
patient.Credentials_Type = model.Patient.Credentials_Type;
patient.Address = model.Patient.Address;
patient.CreationDate = DateTime.Now;
patient.SystemModuleID =8;
T_Service_FirstAid_PatientInfo fp = new T_Service_FirstAid_PatientInfo();
fp = model.FPInfo;
T_Service_FirstAid_HealthCheckup health = new T_Service_FirstAid_HealthCheckup();
health = model.Health;
T_Service_FirstAid_SpecialityCheckUp speciality = new T_Service_FirstAid_SpecialityCheckUp();
speciality = model.Speciality;
T_Service_FirstAid_AssistantExamination assistant = new T_Service_FirstAid_AssistantExamination();
assistant = model.AssistantExamination;
if (IService.SaveMedicalRecordTran(patient, health, speciality, assistant, model.CreatorID, fp))
{
return new MessageModel<bool> { Success = true, Msg = "操作成功" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "操作失败" };
}
}
}
}