StableVersion4.3/HL_FristAidPlatform_Bussiness/Service/T_Service_InformedConsentBL...

58 lines
2.1 KiB
C#
Raw Normal View History

2024-03-11 09:47:34 +08:00
using HL_FristAidPlatform_DataBase;
using HL_FristAidPlatform_Help;
using HL_FristAidPlatform_IDataBase;
using HL_FristAidPlatform_Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HL_FristAidPlatform_Bussiness
{
public class T_Service_InformedConsentBLL
{
IT_Service_InformedConsent IInformed = new T_Service_InformedConsentDB();
IT_Service_Patient IPatient = new T_Service_PatientDB();
/// <summary>
/// 保存患者知情告知
/// </summary>
/// <param name="Informed"></param>
/// <returns></returns>
public MessageModel<bool> SaveInformedConsent(T_Service_InformedConsent Informed)
{
var oneClass = IPatient.Get(Informed.PatientGuid);
if (oneClass == null)
return new MessageModel<bool> { Success = false, Msg = "患者不存在" };
var twoClass = IInformed.GetnformedConsentByPatientGuid(Informed.PatientGuid,Informed.Flag);
if (twoClass != null)
Informed.GUID = twoClass.GUID;
if (string.IsNullOrEmpty(Informed.CreateTime + "") || Informed.CreateTime == Convert.ToDateTime("0001-01-01 00:00:00") || Informed.CreateTime == Convert.ToDateTime("1753-01-01 00:00:00"))
{
Informed.CreateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
}
if (IInformed.SaveInformedConsent(Informed))
{
return new MessageModel<bool> { Success = true, Msg = "保存成功" };
}
else
{
return new MessageModel<bool> { Success = false, Msg = "保存失败" };
}
}
/// <summary>
/// 根据患者唯一标识获取知情告知信息
/// </summary>
/// <param name="patientGuid"></param>
/// <returns></returns>
public T_Service_InformedConsent GetnformedConsentByPatientGuid(string patientGuid, int flag)
{
return IInformed.GetnformedConsentByPatientGuid(patientGuid, flag);
}
}
}