Example #1
0
        // GET: PatientLog/Create
        public ActionResult Create()
        {
            PatientLogCreateViewModel viewM = new PatientLogCreateViewModel();

            viewM.GenderList       = DataCollections.getGender(db);
            viewM.ServiceTypeList  = DataCollections.getServiceType(db);
            viewM.HospitalList     = DataCollections.getHospital(db);
            viewM.PatientClassList = DataCollections.getPatientClass(db);
            viewM.PCPList          = DataCollections.getPCP(db, "BRO");
            return(View(viewM));
        }
        public ActionResult Correction()
        {
            string        patient            = "";
            List <string> hospitals          = new List <string>();
            List <string> services           = new List <string>();
            BillingCorrectionViewModel viewM = new BillingCorrectionViewModel();

            if (Session["billingCorrectionServiceDate"] != null)
            {
                viewM.SearchServiceDate = Session["billingCorrectionServiceDate"].ToString();
            }
            else
            {
                viewM.SearchServiceDate = DateTime.Now.ToShortDateString();
                Session["billingCorrectionServiceDate"] = viewM.SearchServiceDate;
            }
            if (Session["billingCorrectionPatient"] != null)
            {
                patient = Session["billingCorrectionPatient"].ToString();
            }
            if (Session["billingCorrectionHospitals"] != null)
            {
                hospitals = (List <string>)Session["billingCorrectionHospitals"];
            }
            if (Session["billingCorrectionServices"] != null)
            {
                services = (List <string>)Session["billingCorrectionServices"];
            }

            viewM.Patients          = new List <BillingIndexPatient>().AsEnumerable();
            viewM.GenderList        = DataCollections.getGender(db);
            viewM.PhysicianList     = DataCollections.getAIMSPhy(db);
            viewM.PCPList           = DataCollections.getPCP(db, "BRO");
            viewM.HospitalList      = DataCollections.getHospital(db);
            viewM.ServiceList       = DataCollections.getServiceType(db);
            viewM.SelectedHospitals = hospitals;
            viewM.SelectedServices  = services;
            viewM.SearchPatientName = patient;

            return(View(viewM));
        }
        public ActionResult Correction(BillingCorrectionViewModel viewM)
        {
            DateTime      fromD     = getValidDate(viewM.SearchServiceDate, true);
            DateTime      toD       = getValidDate(viewM.SearchServiceDate, false);
            string        patient   = viewM.SearchPatientName;
            List <string> hospitals = new List <string>();
            List <string> services  = new List <string>();

            string[] splitList;

            if (viewM.hidHospitals != null && viewM.hidHospitals != "")
            {
                splitList = viewM.hidHospitals.Split(new char[] { ',' });
                hospitals = splitList.ToList <string>();
            }
            if (viewM.hidServices != null && viewM.hidServices != "")
            {
                splitList = viewM.hidServices.Split(new char[] { ',' });
                services  = splitList.ToList <string>();
            }

            BillingCorrectionViewModel returnM = new BillingCorrectionViewModel();

            returnM.Patients          = billingCorrectionQueryGenerator(fromD, toD, patient, hospitals, services);
            returnM.GenderList        = DataCollections.getGender(db);
            returnM.PhysicianList     = DataCollections.getAIMSPhy(db);
            returnM.PCPList           = DataCollections.getPCP(db, "BRO");
            returnM.HospitalList      = DataCollections.getHospital(db);
            returnM.ServiceList       = DataCollections.getServiceType(db);
            returnM.SearchPatientName = patient;
            returnM.SearchServiceDate = fromD.ToShortDateString();
            returnM.SelectedHospitals = hospitals;
            returnM.SelectedServices  = services;

            return(View(returnM));
        }
Example #4
0
        // GET: PatientLog/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PatientLog patientLog = await db.PatientLogs.FindAsync(id);

            PatientLogEditViewModel viewM = new PatientLogEditViewModel();

            if (patientLog == null)
            {
                return(HttpNotFound());
            }
            viewM.Patient = patientLog;

            //Checks if service type is faxable
            bool foundType = db.FaxServiceTypes.AsEnumerable().Any(f => f.Service == patientLog.ServiceType);

            //If faxable, check that a notification was not sent already, and return the result
            if (foundType)
            {
                string faxType = (from f in db.FaxServiceTypes
                                  where f.Service == patientLog.ServiceType
                                  select f.FaxType).Single() + "Notification";

                bool commSent = db.PCPCommunications.AsEnumerable().Where(c => c.PLRecord == id && c.DocumentType == faxType).Any();
                viewM.isFaxable    = !commSent;
                viewM.alreadyFaxed = commSent;
            }
            else
            {
                viewM.isFaxable = false;
            }

            List <int> idList = (List <int>)Session["patientLogListOfID"];

            //Populates index variables that the view uses to set up previous/next logic
            for (int i = 0; i < idList.Count; i++)
            {
                if (id == idList[i])
                {
                    viewM.Indexer = i;
                    break;
                }
            }
            viewM.IndexerDisplay = viewM.Indexer + 1;
            if (idList.Count() == 1)
            {
                viewM.SafeIndexerPrev = 0;
                viewM.SafeIndexerNext = 0;
            }
            else
            {
                if (viewM.Indexer == 0)
                {
                    viewM.SafeIndexerPrev = 1;
                }
                else
                {
                    viewM.SafeIndexerPrev = viewM.Indexer - 1;
                }
                if (viewM.Indexer == (idList.Count() - 1))
                {
                    viewM.SafeIndexerNext = viewM.Indexer - 1;
                }
                else
                {
                    viewM.SafeIndexerNext = viewM.Indexer + 1;
                }
            }

            //Populates dropdownlists with selected value of current patient
            viewM.GenderList       = DataCollections.getGender(db, viewM.Patient.Gender);
            viewM.HospitalList     = DataCollections.getHospital(db, viewM.Patient.Hospital);
            viewM.PCPList          = DataCollections.getPCP(db, viewM.Patient.Hospital, viewM.Patient.PCP_Practice);
            viewM.ServiceTypeList  = DataCollections.getServiceType(db, viewM.Patient.ServiceType);
            viewM.PatientClassList = DataCollections.getPatientClass(db, viewM.Patient.PatientClass);
            viewM.PhysicianList    = DataCollections.getAIMSPhy(db, viewM.Patient.Hospital, viewM.Patient.Physician);
            return(View(viewM));
        }
Example #5
0
        //public FileResult ExportFile()
        //{


        //    return File("C:\\Users\\Ficke\\Desktop\\Import2.xlsx", "application/xlsx", "NewImportYay.xlsx");
        //}

        // GET: PatientAssignment/EditAll
        public ActionResult EditAll()
        {
            var fromD = new DateTime();
            var toD   = new DateTime();

            //List<string> physicians = new List<string>();
            //List<string> hospitals = new List<string>();
            //string hospitals;

            if (Session["patientAssignmentFromDate"] != null && Session["patientAssignmentToDate"] != null)
            {
                fromD = Convert.ToDateTime(Session["patientAssignmentFromDate"]);
                toD   = Convert.ToDateTime(Session["patientAssignmentToDate"]);
            }
            else
            {
                fromD = DateTime.Now.AddDays(intDayFallback);
                toD   = DateTime.Now;
            }
            //if (Session["patientAssignmentPhysicians"] != null)
            //{
            //    physicians = (List<string>)Session["patientAssignmentPhysicians"];
            //}
            //else
            //{
            //    physicians.Add(HubSecurity.getLoggedInUserID());
            //}
            //if (Session["patientAssignmentHospitals"] != null)
            //{
            //    hospitals = Session["patientAssignmentHospitals"].ToString();
            //}

            PatientAssignmentEditAllViewModel viewM = new PatientAssignmentEditAllViewModel();

            viewM.FromDate = fromD.ToShortDateString();
            viewM.ToDate   = toD.ToShortDateString();
            viewM.isAdmin  = (HubSecurity.isAdmin || HubSecurity.isSiteLeader);

            PatientLogEditViewModel oneEntry;
            List <int> patientList = (List <int>)Session["patientAssignmentListOfID"];

            //Checks if list is null, this should never be the case but stops page from erroring out. This session variable is only empty
            //if you browse to this page before using the Index page
            if (patientList != null)
            {
                foreach (int patID in patientList)
                {
                    oneEntry         = new PatientLogEditViewModel();
                    oneEntry.Patient = db.PatientLogs.Find(patID);

                    oneEntry.GenderList       = DataCollections.getGender(db, oneEntry.Patient.Gender);
                    oneEntry.HospitalList     = DataCollections.getHospital(db, oneEntry.Patient.Hospital);
                    oneEntry.PCPList          = DataCollections.getPCP(db, oneEntry.Patient.Hospital, oneEntry.Patient.PCP_Practice);
                    oneEntry.ServiceTypeList  = DataCollections.getServiceType(db, oneEntry.Patient.ServiceType);
                    oneEntry.PatientClassList = DataCollections.getPatientClass(db, oneEntry.Patient.PatientClass);
                    oneEntry.PhysicianList    = DataCollections.getAIMSPhy(db, oneEntry.Patient.Hospital, oneEntry.Patient.Physician);

                    viewM.Patients.Add(oneEntry);
                }
            }

            return(View("EditAll", viewM));
        }