public void GetSectionValuesSysReview()
        {
            TestUtils.Security.SetCurrentUser(TestEnums.User.constDoctorID);
            long visitID = 1;

            string            expected = "{\"TestJson\":\"TestJsonValue\"}";
            IVisitService     target   = GetNewVisitService();
            VisitGetSectionSP p        = new VisitGetSectionSP();

            p.SectionName = "SysReview";
            p.VisitID     = visitID;
            string actual = target.GetSectionValues(p);

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        ///// <summary>
        ///// Updates the doctor report.
        ///// </summary>
        ///// <param name="visitID">The visit identifier.</param>
        ///// <param name="doctorReport">The doctor report.</param>
        ///// <exception cref="ServiceSecurityException"></exception>
        //public void UpdateDoctorReport(long visitID, string doctorReport)
        //{
        //    vVisit v = (vVisit) GetByID(visitID, new GetByIDParameters(GetSourceTypeEnum.View));

        //    // checking security that only doctor of visit can write a report
        //    long doctorUserID = v.DoctorID;
        //    if (doctorUserID != FWUtils.SecurityUtils.GetCurrentUserIDLong())
        //    {
        //        throw new ServiceSecurityException(BusinessErrorStrings.Visit.OnlyDoctorOfVisitCanWriteAReport);
        //    }

        //    UpdateDoctorReportInDatabase(visitID, doctorReport);
        //}

        ///// <summary>
        ///// Updates the doctor report in database.
        ///// </summary>
        ///// <param name="visitID">The visit identifier.</param>
        ///// <param name="doctorReport">The doctor report.</param>
        //private void UpdateDoctorReportInDatabase(long visitID, string doctorReport)
        //{
        //    Visit v = (Visit)GetByID(visitID, new GetByIDParameters());
        //    v.DoctorReport = doctorReport;
        //    Update(v, new UpdateParameters());
        //}


        /// <summary>
        /// Gets value of a section for a visit
        /// </summary>
        /// <param name="p">parameters</param>
        /// <returns></returns>
        public string GetSectionValues(VisitGetSectionSP p)
        {
            vVisit obj = (vVisit)GetByIDV(p.VisitID);

            if (obj == null)
            {
                return(null);
            }
            else
            {
                OwnerPatientOrADoctorSecurity.Check("Get the information of an appointment", obj, vVisit.ColumnNames.PatientUserID);

                if (p.SectionName == "SysReview")
                {
                    return(obj.DoctorSystemReviewJson);
                }
                else
                {
                    throw new ImpossibleExecutionException(p.SectionName);
                }
            }
        }