Exemple #1
0
        //Please write your properties and functions here. This part will not be replaced.

        public IList <vDailyActivityChart> GetByUserID(GetByUserIDSP p)
        {
            OwnerPatientOrADoctorSecurity.CheckValue("Get data", p.UserID);

            FilterExpression filter = new FilterExpression();

            filter.AddFilter(vDailyActivityChart.ColumnNames.UserID, p.UserID);
            var list = GetByFilterV(new GetByFilterParameters(filter, null, 0, 10000, null, GetSourceTypeEnum.View));

            if (list.Count > 0)
            {
                OwnerPatientOrADoctorSecurity.Check("Get data", list[0], vDailyActivityChart.ColumnNames.UserID);
            }

            return(list);
        }
Exemple #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);
                }
            }
        }