コード例 #1
0
 public List <string> GetListFrequency()
 {
     using (var context = new DefaulDataContext())
     {
         var listFrequency = context.Frequencies.OrderBy(p => p.OrderNumber).Select(t => t.Name).ToList();
         return(listFrequency);
     }
 }
コード例 #2
0
 public List <string> GetListRoute()
 {
     using (var context = new DefaulDataContext())
     {
         var listRoute = context.Routes.OrderBy(p => p.Name).Select(t => t.Name).ToList();
         return(listRoute);
     }
 }
コード例 #3
0
 public List <string> GetListCounty(int stateId)
 {
     using (var context = new DefaulDataContext())
     {
         var listIcd = context.Counties.Where(o => o.StateId == stateId).Select(t => t.Name).ToList();
         return(listIcd);
     }
 }
コード例 #4
0
 public List <string> GetListPrimaryLanguage()
 {
     using (var context = new DefaulDataContext())
     {
         var listPrimaryLanguage = context.PrimaryLanguages.OrderBy(p => p.Name).Select(t => t.Name).ToList();
         return(listPrimaryLanguage);
     }
 }
コード例 #5
0
        private List <ProviderMpiVo> GetData(QueryGridProvider queryInfo)
        {
            var resultPro    = new List <ProviderMpiVo>();
            var providerList = new List <ProviderMpiVo>();

            using (var context = new DefaulDataContext())
            {
                var provider = (from item in context.ProviderAgencies
                                select item);

                bool isQuery = false;
                if (!string.IsNullOrEmpty(queryInfo.Npi))
                {
                    provider = provider.Where(o => o.Npi.ToLower().Contains(queryInfo.Npi.ToLower()));
                    isQuery  = true;
                }
                else if (!string.IsNullOrEmpty(queryInfo.Mpi))
                {
                    provider = provider.Where(o => o.Mpi.ToLower().Contains(queryInfo.Mpi.ToLower()));
                    isQuery  = true;
                }
                else if (!string.IsNullOrEmpty(queryInfo.AgencyName))
                {
                    provider = provider.Where(o => o.Name.ToLower().Contains(queryInfo.AgencyName.ToLower()));
                    isQuery  = true;
                }

                if (!isQuery)
                {
                    return(new List <ProviderMpiVo>());
                }

                providerList = (from p in provider
                                select new ProviderMpiVo()
                {
                    Id = p.Mpi,
                    Mpi = p.Mpi,
                    Npi = p.Npi,
                    Name = p.Name,
                    Address1 = p.Address1,
                    Address2 = p.Address2,
                    City = p.City,
                    State = p.State,
                    Zip = p.Zip,
                    Phone = p.Phone,
                    Email = p.Email,
                }).ToList();

                resultPro = providerList.ToList();
            }

            foreach (var item in providerList.Where(item => !CheckEffectiveDate(item.Mpi)))
            {
                resultPro.Remove(item);
            }

            return(resultPro);
        }
コード例 #6
0
        public List <SectionVo> GetHtmlToDisplay()
        {
            var SectionVos = new List <SectionVo>();

            using (var context = new DefaulDataContext())
            {
                var sections = context.Sections.ToList();
                foreach (var section in sections)
                {
                    var obj = new SectionVo
                    {
                        Id               = section.Id,
                        Content          = section.Content,
                        Name             = section.Name,
                        Order            = section.Order,
                        SectionQuestions = new List <SectionQuestionVo>(),
                    };
                    foreach (var question in section.SectionQuestions)
                    {
                        var objSectionQuestionVo = new SectionQuestionVo
                        {
                            Id                    = question.Id,
                            Content               = question.Content,
                            Order                 = question.Order,
                            Parameters            = question.Parameters,
                            Calculator            = question.Calculator,
                            Name                  = question.Name,
                            IsSignature           = question.IsSignature.GetValueOrDefault(),
                            IsSignatureDate       = question.IsSignatureDate.GetValueOrDefault(),
                            IsBathing             = question.IsBathing.GetValueOrDefault(),
                            IsADLsCal             = question.IsADLsCal.GetValueOrDefault(),
                            IsMOT                 = question.IsMOT.GetValueOrDefault(),
                            IsMedicalAppointments = question.IsMedicalAppointments.GetValueOrDefault(),
                            IsServicesIncidental  = question.IsServicesIncidental.GetValueOrDefault(),
                            IsBehaviorsMedicalConditionsSeizures =
                                question.IsBehaviorsMedicalConditionsSeizures.GetValueOrDefault(),
                            IsDiagnoses            = question.IsDiagnoses.GetValueOrDefault(),
                            IsMedications          = question.IsMedications.GetValueOrDefault(),
                            IsDME                  = question.IsDME.GetValueOrDefault(),
                            IsAllergies            = question.IsAllergies.GetValueOrDefault(),
                            IsFunctionalLimitation = question.IsFunctionalLimitation.GetValueOrDefault(),
                            IsActivitiesPermitted  = question.IsActivitiesPermitted.GetValueOrDefault(),
                            IsMentalStatus         = question.IsMentalStatus.GetValueOrDefault(),
                            IsReassessmentDue      = question.IsReassessmentDue.GetValueOrDefault(),
                            IsCheckZeroMinutesPCST = question.IsCheckZeroMinutesPCST.GetValueOrDefault(),
                            IsMid                  = question.IsMid,
                            SectionId              = question.SectionId
                        };

                        obj.SectionQuestions.Add(objSectionQuestionVo);
                        //SectionQuestionVos.Add(objSectionQuestionVo);
                    }
                    SectionVos.Add(obj);
                }
            }
            return(SectionVos);
        }
コード例 #7
0
 public List <string> GetListIcd(string query)
 {
     using (var context = new DefaulDataContext())
     {
         var listIcd = context.Icds.Where(o => string.IsNullOrEmpty(query) ||
                                          (o.Code + ":" + o.Description).ToLower().Contains(query.ToLower())).Select(s => s.Code + ":" + s.Description).Take(10).ToList();
         return(listIcd);
     }
 }
コード例 #8
0
        public bool CheckEffectiveDate(string mpi)
        {
            using (var context = new DefaulDataContext())
            {
                var mpiTrim = mpi.Trim();
                var mpiObj  = context.ProviderMpis.FirstOrDefault(o => o.Mpi == mpiTrim);
                if (mpiObj != null && !string.IsNullOrEmpty(mpiObj.EffectiveDateText))
                {
                    string effectiveStr = mpiObj.EffectiveDateText;
                    if (string.IsNullOrEmpty(effectiveStr))
                    {
                        return(false);
                    }
                    List <EffectiveDate> results = new List <EffectiveDate>();
                    int      partLength          = 8;
                    char     symbol = ';';
                    string[] part   = effectiveStr.Split(symbol);
                    for (int i = 0; i < part.Length; i++)
                    {
                        try
                        {
                            EffectiveDate efd           = new EffectiveDate();
                            string        startDateText = part[i].Substring(0, partLength);
                            int           startYear     = int.Parse(startDateText.Substring(0, 4));
                            int           startMonth    = int.Parse(startDateText.Substring(4, 2));
                            int           startDay      = int.Parse(startDateText.Substring(6, 2));
                            efd.StartDate = new DateTime(startYear, startMonth, startDay);

                            string endDateText = part[i].Substring(8, partLength);
                            int    endYear     = int.Parse(endDateText.Substring(0, 4));
                            int    endMonth    = int.Parse(endDateText.Substring(4, 2));
                            int    endDay      = int.Parse(endDateText.Substring(6, 2));
                            efd.EndDate = new DateTime(endYear, endMonth, endDay);

                            results.Add(efd);
                        }
                        catch
                        {
                            return(false);
                        }
                    }

                    var now = DateTime.Now;
                    now = new DateTime(now.Year, now.Month, now.Day);
                    foreach (var item in results)
                    {
                        if (item.StartDate <= now && now <= item.EndDate)
                        {
                            return(true);
                        }
                    }
                }

                return(false);
            }
        }
コード例 #9
0
        public ProviderMpiVo GetProviderFromName(string name)
        {
            var providerVo = new ProviderMpiVo();

            if (string.IsNullOrEmpty(name.Trim()))
            {
                return(providerVo);
            }
            using (var context = new DefaulDataContext())
            {
                var provider = (from item in context.ProviderAgencies
                                where item.Name.ToLower().Contains(name.Trim().ToLower())
                                select item);
                var providerList = (from p in provider
                                    select new ProviderMpiVo()
                {
                    Id = p.Mpi,
                    Mpi = p.Mpi,
                    Npi = p.Npi,
                    Name = p.Name,
                    Address1 = p.Address1,
                    Address2 = p.Address2,
                    City = p.City,
                    State = p.State,
                    Zip = p.Zip,
                    Phone = p.Phone,
                    Email = p.Email,
                }).ToList().FirstOrDefault();
                if (providerList != null)
                {
                    if (!string.IsNullOrEmpty(providerList.Mpi))
                    {
                        return(providerList);
                    }
                }
            }
            return(providerVo);
        }
コード例 #10
0
        private RequestAssessmentPcsVo GetNewAssessment(string fileName = null, int id = 0)
        {
            var result     = new RequestAssessmentPcsVo();
            var SectionVos = new List <SectionVo>();

            using (var context = new DefaulDataContext())
            {
                var sections = context.Sections.ToList();
                foreach (var section in sections)
                {
                    var obj = new SectionVo
                    {
                        Id               = section.Id,
                        Content          = section.Content,
                        Name             = section.Name,
                        Order            = section.Order,
                        SectionQuestions = new List <SectionQuestionVo>(),
                    };
                    foreach (var question in section.SectionQuestions)
                    {
                        var objSectionQuestionVo = new SectionQuestionVo
                        {
                            Id                    = question.Id,
                            Content               = question.Content,
                            Order                 = question.Order,
                            Parameters            = question.Parameters,
                            Calculator            = question.Calculator,
                            Name                  = question.Name,
                            IsSignature           = question.IsSignature.GetValueOrDefault(),
                            IsSignatureDate       = question.IsSignatureDate.GetValueOrDefault(),
                            IsBathing             = question.IsBathing.GetValueOrDefault(),
                            IsADLsCal             = question.IsADLsCal.GetValueOrDefault(),
                            IsMOT                 = question.IsMOT.GetValueOrDefault(),
                            IsMedicalAppointments = question.IsMedicalAppointments.GetValueOrDefault(),
                            IsServicesIncidental  = question.IsServicesIncidental.GetValueOrDefault(),
                            IsBehaviorsMedicalConditionsSeizures =
                                question.IsBehaviorsMedicalConditionsSeizures.GetValueOrDefault(),
                            IsDiagnoses            = question.IsDiagnoses.GetValueOrDefault(),
                            IsMedications          = question.IsMedications.GetValueOrDefault(),
                            IsDME                  = question.IsDME.GetValueOrDefault(),
                            IsAllergies            = question.IsAllergies.GetValueOrDefault(),
                            IsFunctionalLimitation = question.IsFunctionalLimitation.GetValueOrDefault(),
                            IsActivitiesPermitted  = question.IsActivitiesPermitted.GetValueOrDefault(),
                            IsMentalStatus         = question.IsMentalStatus.GetValueOrDefault(),
                            IsReassessmentDue      = question.IsReassessmentDue.GetValueOrDefault(),
                            IsCheckZeroMinutesPCST = question.IsCheckZeroMinutesPCST.GetValueOrDefault(),
                            IsMid                  = question.IsMid,
                            SectionId              = question.SectionId
                        };

                        obj.SectionQuestions.Add(objSectionQuestionVo);
                        //SectionQuestionVos.Add(objSectionQuestionVo);
                    }
                    SectionVos.Add(obj);
                }
            }
            result.Sections = SectionVos;
            result.AssessmentSectionQuestions = GetAssessmentSectionQuestion(result.Sections, result);
            result.AssessmentPcsId            = id;
            result.AssessmentName             = !string.IsNullOrEmpty(fileName) ? fileName : "";
            result.DisclosureFormVo           = new DisclosureFormVo();
            return(result);
        }
コード例 #11
0
        private List <PhysicianGridVo> GetData(QueryGridPhysicianVo queryInfo)
        {
            var resultNpi = new List <PhysicianGridVo>();
            var npiList   = new List <PhysicianGridVo>();

            using (var context = new DefaulDataContext())
            {
                var npis = (from item in context.PhysicianNpis
                            select item);

                bool isQuery = false;
                if (!string.IsNullOrEmpty(queryInfo.NPI))
                {
                    npis    = npis.Where(o => o.Npi == queryInfo.NPI);
                    isQuery = true;
                }
                else
                {
                    if (!string.IsNullOrEmpty(queryInfo.FirstName))
                    {
                        npis    = npis.Where(o => o.FirstName.ToUpper() == queryInfo.FirstName.ToUpper());
                        isQuery = true;
                    }

                    if (!string.IsNullOrEmpty(queryInfo.LastName))
                    {
                        npis    = npis.Where(o => o.LastName.ToUpper() == queryInfo.LastName.ToUpper());
                        isQuery = true;
                    }
                }

                if (!isQuery)
                {
                    return(new List <PhysicianGridVo>());
                }

                npiList = (from p in npis
                           select new PhysicianGridVo()
                {
                    Mpi = p.Mpi,
                    Npi = p.Npi,
                    FirstName = p.FirstName,
                    LastName = p.LastName,
                    MiddleName = p.MiddleName,
                    Address1 = p.Address1,
                    Address2 = p.Address2,
                    City = p.City,
                    State = p.State,
                    Zip = p.Zip,
                    ZipExtension = p.ZipExtension,
                    Phone = p.Phone,
                    Fax = "",
                    ClinicName = "",
                    EffectiveDateText = p.EffectiveDateText,
                }).ToList();

                resultNpi = npiList.ToList();
            }

            foreach (var item in npiList.Where(item => !CheckEffectiveDate(item.Npi)))
            {
                resultNpi.Remove(item);
            }

            return(resultNpi);
        }