예제 #1
0
        public static PresentIllnessDetailModel ToModel(this PresentIllnessDetailViewModel entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var model = new PresentIllnessDetailModel
            {
                TakenBy          = entity.TakenBy,
                TakenTime        = entity.TakenTime,
                ContactID        = entity.ContactID,
                HPIID            = entity.HPIID,
                HPIDetailID      = entity.HPIDetailID,
                Comment          = entity.Comment,
                Location         = entity.Location,
                Quality          = entity.Quality,
                HPISeverityID    = entity.HPISeverityID,
                Duration         = entity.Duration,
                Timing           = entity.Timing,
                Context          = entity.Context,
                Modifyingfactors = entity.Modifyingfactors,
                Symptoms         = entity.Symptoms,
                Conditions       = entity.Conditions,
                ModifiedOn       = entity.ModifiedOn
            };

            return(model);
        }
        public void AddHPIDetail_Failure()
        {
            //Arrange
            var srModel = new PresentIllnessDetailViewModel
            {
                HPIDetailID   = -57,
                HPIID         = 1,
                Comment       = "Some comment",
                Location      = "SOme location",
                Quality       = "Living with Family.",
                HPISeverityID = 1,
                Duration      = " Some duration",
                Timing        = "Some  timing",
                Context       = "Some context",
                EncounterID   = null,
                TakenBy       = 1,
                TakenTime     = DateTime.Now,
                ForceRollback = true
            };
            // Act
            var response = controller.AddHPIDetail(srModel);

            // Assert
            Assert.IsNotNull(response, "Response can not be null");
            Assert.IsTrue(response.ID <= 0, "HPI created for invalid data.");
        }
        public void UpdateHPIDetail_Failure()
        {
            //Arrange
            var srModel = new PresentIllnessDetailViewModel
            {
                HPIDetailID   = -57,
                HPIID         = 1,
                Comment       = "Some reasonable comment",
                Location      = "SOme different location",
                Quality       = "SOme QUality Updated.",
                HPISeverityID = 1,
                Duration      = " Some duration",
                Timing        = "Some  timing",
                Context       = "Some context",
                EncounterID   = null,
                TakenBy       = 1,
                TakenTime     = DateTime.Now,
                ForceRollback = true
            };
            // Act
            var response = controller.UpdateHPIDetail(srModel);

            // Assert
            Assert.IsNotNull(response, "Response can not be null");
            Assert.IsTrue(response.RowAffected == 0, "Present illness updated for invalid data.");
        }
        public Response <PresentIllnessDetailViewModel> UpdateHPIDetail(PresentIllnessDetailViewModel hpi)
        {
            string apiUrl = BaseRoute + "UpdateHPIDetail";

            var response = _communicationManager.Put <PresentIllnessDetailModel, Response <PresentIllnessDetailModel> >(hpi.ToModel(), apiUrl);

            return(response.ToModel());
        }
예제 #5
0
 public Response <PresentIllnessDetailViewModel> AddHPIDetail(PresentIllnessDetailViewModel hpiDetail)
 {
     return(_PresentIllnessRepository.AddHPIDetail(hpiDetail));
 }
예제 #6
0
 public Response <PresentIllnessDetailViewModel> UpdateHPIDetail(PresentIllnessDetailViewModel HPI)
 {
     return(_PresentIllnessRepository.UpdateHPIDetail(HPI));
 }