Esempio n. 1
0
        /// <summary>
        /// Updates the referral followup.
        /// </summary>
        /// <param name="referral">The referral.</param>
        /// <returns></returns>

        public Response <ReferralOutcomeDetailsViewModel> UpdateReferralFollowup(ReferralOutcomeDetailsViewModel referral)
        {
            const string apiUrl   = baseRoute + "UpdateReferralFollowup";
            var          response = communicationManager.Put <ReferralOutcomeDetailsModel, Response <ReferralOutcomeDetailsModel> >(referral.ToModel(), apiUrl);

            return(response.ToViewModel());
        }
Esempio n. 2
0
        public void AddReferralFollowup_Failed()
        {
            // Arrange
            var referral = new ReferralOutcomeDetailsViewModel
            {
                ReferralHeaderID              = -1,
                FollowupExpected              = true,
                FollowupDate                  = DateTime.UtcNow,
                FollowupProviderID            = 4,
                FollowupOutcome               = null,
                IsAppointmentNotified         = true,
                AppointmentNotificationMethod = null,
                Comments      = null,
                ForceRollback = true
            };

            // Act
            var response = controller.AddReferralFollowup(referral);

            // Assert
            Assert.IsTrue(response != null, "Response can't be null");
            Assert.IsTrue(response.ResultCode != 0, "Invalid referral followup has been added.");
        }
Esempio n. 3
0
        public void AddReferralFollowup_Success()
        {
            // Arrange
            var referral = new ReferralOutcomeDetailsViewModel
            {
                ReferralHeaderID              = 1,
                FollowupExpected              = true,
                FollowupDate                  = DateTime.UtcNow,
                FollowupProviderID            = 4,
                FollowupOutcome               = "Followup Outcome",
                IsAppointmentNotified         = true,
                AppointmentNotificationMethod = "How",
                Comments      = "comments",
                ForceRollback = true
            };

            // Act
            var response = controller.AddReferralFollowup(referral);

            // Assert
            Assert.IsTrue(response != null, "Response can't be null");
            Assert.IsTrue(response.ResultCode == 0, "Referral followup could not be created.");
        }
        /// <summary>
        /// To the model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        public static ReferralOutcomeDetailsModel ToModel(this ReferralOutcomeDetailsViewModel model)
        {
            if (model == null)
            {
                return(null);
            }

            var entity = new ReferralOutcomeDetailsModel
            {
                ReferralOutcomeDetailID       = model.ReferralOutcomeDetailID,
                ReferralHeaderID              = model.ReferralHeaderID,
                FollowupExpected              = model.FollowupExpected,
                FollowupProviderID            = model.FollowupProviderID,
                FollowupDate                  = model.FollowupDate,
                FollowupOutcome               = model.FollowupOutcome,
                IsAppointmentNotified         = model.IsAppointmentNotified,
                AppointmentNotificationMethod = model.AppointmentNotificationMethod,
                Comments      = model.Comments,
                ForceRollback = model.ForceRollback,
                ModifiedOn    = model.ModifiedOn
            };

            return(entity);
        }
Esempio n. 5
0
        public void UpdateReferralFollowup_Failed()
        {
            // Arrange
            var referral = new ReferralOutcomeDetailsViewModel
            {
                ReferralOutcomeDetailID       = -1,
                ReferralHeaderID              = -1,
                FollowupExpected              = true,
                FollowupDate                  = DateTime.UtcNow,
                FollowupProviderID            = 5,
                FollowupOutcome               = null,
                IsAppointmentNotified         = true,
                AppointmentNotificationMethod = null,
                Comments      = null,
                ForceRollback = true
            };

            // Act
            var response = controller.UpdateReferralFollowup(referral);

            // Assert
            Assert.IsTrue(response != null, "Response can't be null");
            Assert.IsTrue(response.RowAffected == 0, "Updated referral followup with invalid data.");
        }
Esempio n. 6
0
 public Response <ReferralOutcomeDetailsViewModel> UpdateReferralFollowup(ReferralOutcomeDetailsViewModel referral)
 {
     return(referralFollowupRepository.UpdateReferralFollowup(referral));
 }