Esempio n. 1
0
        public HoursEntryVM GetCatalsytHoursVM(int entryID)
        {
            var entry     = Context.CatalystPreloadEntries.Find(entryID);
            var provider  = Context.Providers.Find(entry.ProviderID);
            var c         = Context.Cases.Find(entry.CaseID);
            var insurance = c.GetActiveInsuranceAtDate(entry.Date);
            var model     = new HoursEntryVM
            {
                IsOnAideLegacyMode = SessionReportService.IsOnAideLegacyMode(provider),
                IsEditable         = true,
                Status             = (int)Domain2.Hours.HoursStatus.Pending,
                HasData            = true,
                CatalystPreloadID  = entryID,
                IsAdminMode        = false,
                Date             = entry.Date,
                EntryID          = null,
                ProviderID       = entry.ProviderID,
                ProviderTypeID   = provider.ProviderTypeID,
                ProviderTypeCode = provider.ProviderType.Code,
                PatientID        = c.PatientID,
                PatientName      = c.Patient.CommonName,
                InsuranceID      = insurance?.ID,
                InsuranceName    = insurance?.Insurance.Name ?? "Select a date to determine the active insurance",
                TimeIn           = null,
                TimeOut          = null,
                Note             = entry.Notes,
                ServiceID        = null,
                ServiceLocations = GetServiceLocations(),
                IsTrainingEntry  = false,
                Services         = GetHoursEntryServices((Domain2.Providers.ProviderTypeIDs)provider.ProviderTypeID),
                ActivePatients   = GetHoursEntryActivePatients(entry.ProviderID, entry.Date),
                NoteGroups       = GetNewHoursEntryNoteGroups(provider.ProviderTypeID)
            };

            model.ServiceLocationID = model.ServiceLocations.Where(x => x.Name == "Home").FirstOrDefault()?.ID;
            return(model);
        }
Esempio n. 2
0
        public HoursEntryVM GetNewHoursEntryDataTemplate(int caseID, int providerID, DateTime?date)
        {
            var provider = Context.Providers.Find(providerID);
            var c        = Context.Cases.Find(caseID);
            var model    = new HoursEntryVM
            {
                IsOnAideLegacyMode = SessionReportService.IsOnAideLegacyMode(provider),
                IsEditable         = true, // this always has to be true, because a date won't be selected until later via the UI
                Status             = (int)HoursStatus.Pending,
                HasData            = false,
                CaseID             = c.ID,
                IsAdminMode        = EntryMode == HoursEntryMode.ManagementEntry,
                EntryID            = null,
                ProviderID         = providerID,
                ProviderTypeID     = provider.ProviderTypeID,
                ProviderTypeCode   = provider.ProviderType.Code,
                PatientID          = c.PatientID,
                PatientName        = c.Patient.CommonName,
                InsuranceID        = null,
                InsuranceName      = "Select a date to determine the active insurance",
                Date             = date,
                TimeIn           = null,
                TimeOut          = null,
                Note             = null,
                ServiceID        = null,
                ServiceLocations = GetServiceLocations(),
                IsTrainingEntry  = false,
                ActivePatients   = new List <HoursEntryActivePatientVM>(), // can't get these before we have a date on file...
                NoteGroups       = GetNewHoursEntryNoteGroups(provider.ProviderTypeID),
                Services         = date.HasValue ? GetHoursEntryServices(c, provider, date.Value) : new List <HoursEntryServiceVM>(),
                SessionReport    = new DomainServices.Sessions.SessionReport()
            };

            model.ServiceLocationID = model.ServiceLocations.Where(x => x.Name == "Home").FirstOrDefault()?.ID;
            return(model);
        }