Esempio n. 1
0
 /// <summary>
 /// 查询病人信息
 /// </summary>
 /// <param name="id">主键</param>
 /// <returns>病人信息</returns>
 public static Patient QueryPatientById(int id)
 {
     using (IPatientDal dal = Factory.CreatePatientDalRead())
     {
         return(dal.QueryPatientById(id));
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 更新服药状态
 /// </summary>
 /// <param name="prop">要更新的字段(早上还是中午还是..)</param>
 /// <param name="status">状态</param>
 /// <param name="id">主键</param>
 /// <returns></returns>
 public static bool UpdateTakeTimeStatus(string prop, TakeStatus status, int id)
 {
     using (IPatientDal dal = Factory.CreateMedicineDalWrite())
     {
         return(dal.UpdateTakeTimeStatus(prop, status, id));
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 查询所有病人信息
 /// </summary>
 /// <returns></returns>
 public static List <Patient> QueryAllPatients()
 {
     using (IPatientDal dal = Factory.CreatePatientDalRead())
     {
         return(dal.QueryAllPatients());
     }
 }
Esempio n. 4
0
 /// <summary>
 /// 更新服药时间
 /// </summary>
 /// <param name="info">服药时间信息</param>
 /// <returns>成功=true</returns>
 public static bool UpdateTakeTime(TakeTimeInfo info)
 {
     using (IPatientDal dal = Factory.CreateMedicineDalWrite())
     {
         return(dal.UpdateTakeTimeVal(info));
     }
 }
Esempio n. 5
0
 public PatientService(IPatientDal patientDal)
 {
     _patientDal = patientDal;
     Mapper.Initialize(cfg => {
         cfg.CreateMap <Patient, PatientEntity>().ForMember(x => x.Id, opt => opt.Ignore());
         cfg.CreateMap <PatientEntity, Patient>();
         cfg.CreateMap <Appointment, AppointmentEntity>().ForMember(x => x.Id, opt => opt.Ignore());
         cfg.CreateMap <AppointmentEntity, Appointment>();
     });
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes an instance of the <see cref="AppointmentBookingManager"/>
 /// </summary>
 public AppointmentBookingManager(
     ILogger <AppointmentBookingManager> log,
     IUserDal userDal,
     IAppointmentSlotDal apptSlotDal,
     IPatientDal patientDal,
     IPatientsMedicalPractitionerDal patientsMedicalPractitionerDal,
     IAppointmentSessionDal sessionDal)
 {
     _log         = log ?? throw new ArgumentNullException(nameof(log));
     _userDal     = userDal ?? throw new ArgumentNullException(nameof(userDal));
     _apptSlotDal = apptSlotDal ?? throw new ArgumentNullException(nameof(apptSlotDal));
     _patientDal  = patientDal ?? throw new ArgumentNullException(nameof(patientDal));
     _patientsMedicalPractitionerDal = patientsMedicalPractitionerDal ?? throw new ArgumentNullException(nameof(patientsMedicalPractitionerDal));
     _sessionDal = sessionDal ?? throw new ArgumentNullException(nameof(sessionDal));
 }
 public PatientManager(IPatientDal patientDal)
 {
     _patientDal = patientDal;
 }
 public PatientService(IPatientDal patientDal)
 {
     _patientDal = patientDal;
 }
Esempio n. 9
0
 public override void Initialize()
 {
     _patientDalMock = MockRepository.GenerateMock <IPatientDal>();
     _patientService = new PatientService(_patientDalMock);
 }
 public OpenMrsPatientMatchingRepository(IPatientDal patientDal)
 {
     _patientDal = patientDal;
 }
Esempio n. 11
0
 public OpenMrsPatientRepository(IPatientDal patientDal, ICareContextRepository careContextRepository, IPhoneNumberRepository phoneNumberRepository)
 {
     _patientDal            = patientDal;
     _careContextRepository = careContextRepository;
     _phoneNumberRepository = phoneNumberRepository;
 }
Esempio n. 12
0
 public override void Initialize()
 {
     _patientDal = new PatientDal(Database.TEST_DB_NAME);
 }
 /// <summary>
 /// Initializes an instance of the <see cref="PatientAdministrationService"/> class
 /// </summary>
 /// <param name="log"></param>
 /// <param name="patientDal"></param>
 /// <param name="userDal"></param>
 public PatientAdministrationService(ILogger <PatientAdministrationService> log, IPatientDal patientDal, IUserDal userDal)
 {
     _log        = log ?? throw new ArgumentNullException(nameof(log));
     _patientDal = patientDal ?? throw new ArgumentNullException(nameof(patientDal));
     _userDal    = userDal ?? throw new ArgumentNullException(nameof(userDal));
 }