Ejemplo n.º 1
0
        public void IsValid()
        {
            var item = new IllnessHistoryDto()
            {
                Patient = new LightPatientDto(),
            };

            Assert.IsTrue(item.IsValid());
        }
Ejemplo n.º 2
0
        public void IsInvalid()
        {
            var item = new IllnessHistoryDto()
            {
                Patient = null,
            };

            Assert.IsFalse(item.IsValid());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the illness history for the specified patient.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <returns>
        /// The history of illness periods
        /// </returns>
        public IllnessHistoryDto GetIllnessHistory(LightPatientDto patient)
        {
            var illnessHistory = new IllnessHistoryDto()
            {
                Patient = patient
            };
            var entity = this.Session.Get <Patient>(patient.Id);

            var periods = Mapper.Map <IList <IllnessPeriod>, IList <IllnessPeriodDto> >(entity.IllnessHistory);

            illnessHistory.Periods.Refill(periods);
            return(illnessHistory);
        }