// GET: PatientLog/EditAll public ActionResult EditAll() { var fromD = new DateTime(); var toD = new DateTime(); //List<string> hospitals = new List<string>(); if (Session["patientLogFromDate"] != null && Session["patientLogToDate"] != null) { fromD = Convert.ToDateTime(Session["patientLogFromDate"]); toD = Convert.ToDateTime(Session["patientLogToDate"]); } else { fromD = DateTime.Now.AddDays(intDayFallback); toD = DateTime.Now; } //if (Session["patientLogHospitals"] != null) //{ // hospitals = (List<string>)Session["patientLogHospitals"]; //} PatientLogEditAllViewModel viewM = new PatientLogEditAllViewModel(); viewM.FromDate = fromD.ToShortDateString(); viewM.ToDate = toD.ToShortDateString(); //viewM.isAdmin = (HubSecurity.isAdmin || HubSecurity.isSiteLeader); PatientLogEditViewModel oneEntry; List <int> patientList = (List <int>)Session["patientLogListOfID"]; //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 = getGender(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 = getPatientClass(oneEntry.Patient.PatientClass); //oneEntry.PhysicianList = getAIMSPhy(oneEntry.Patient.Hospital, oneEntry.Patient.Physician); viewM.Patients.Add(oneEntry); } } return(View("EditAll", viewM)); }
// 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)); }
// GET: ReferringPractice public ActionResult Index() { ReferringPracticeIndexViewModel viewM = new ReferringPracticeIndexViewModel(); string strPracName = ""; string strAddress1 = ""; string strAddress2 = ""; string strCity = ""; string strFax = ""; List <string> hospitals = new List <string>(); List <string> refphys = new List <string>(); if (Session["refPracName"] != null) { strPracName = Session["refPracName"].ToString(); } if (Session["refAddress1"] != null) { strAddress1 = Session["refAddress1"].ToString(); } if (Session["refAddress2"] != null) { strAddress2 = Session["refAddress2"].ToString(); } if (Session["refCity"] != null) { strCity = Session["refCity"].ToString(); } if (Session["refFax"] != null) { strFax = Session["refFax"].ToString(); } if (Session["refHospitals"] != null) { hospitals = (List <string>)Session["refHospitals"]; } if (Session["refRefPhys"] != null) { refphys = (List <string>)Session["refRefPhys"]; } viewM.ReferringPractices = refPracQueryGenerator(strPracName, strAddress1, strAddress2, strCity, strFax, hospitals, refphys).AsEnumerable(); viewM.filterPracticeName = strPracName; viewM.filterAddressLine1 = strAddress1; viewM.filterCity = strCity; viewM.filterFax = strFax; viewM.SelectedHospitals = hospitals; viewM.SelectedRefPhy = refphys; viewM.HospitalList = DataCollections.getHospital(db); viewM.RefPhyList = DataCollections.getPCP(db); return(View(viewM)); }
//Returns JSON list of PCPs that match the specified site public ActionResult jsonPCP(string site) { //var query = from u in db.Users // join ud in db.UserDetails on u.UserID equals ud.UserID // where (ud.UserType == "RefPhy") && (ud.DefaultHospital == site) // orderby u.LastName // select new { Value = (u.LastName + ", " + u.FirstName) }; var query = DataCollections.getPCP(db, site); return(Json(query, JsonRequestBehavior.AllowGet)); }
public ActionResult Index(ReferringPracticeIndexViewModel viewM) { string strPracName = ""; string strAddress1 = ""; string strAddress2 = ""; string strCity = ""; string strFax = ""; string[] splitList; List <string> hospitals = new List <string>(); List <string> refphys = new List <string>(); //if (viewM.filterPracticeName != null) //{ // strPracName = viewM.filterPracticeName; //} //if (viewM.filterAddressLine1 != null) //{ // strAddress1 = viewM.filterAddressLine1; //} //if (viewM.filterCity != null) //{ // strCity = viewM.filterCity; //} //if (viewM.filterFax != null) //{ // strFax = viewM.filterFax; //} //if (viewM.hidHospitals != null) //{ // splitList = viewM.hidHospitals.Split(new char[] { ',' }); // hospitals = splitList.ToList(); //} //if (viewM.hidRefPhy != null) //{ // splitList = viewM.hidRefPhy.Split(new char[] { ',' }); // refphys = splitList.ToList(); //} ReferringPracticeIndexViewModel returnM = new ReferringPracticeIndexViewModel(); returnM.ReferringPractices = refPracQueryGenerator(strPracName, strAddress1, strAddress2, strCity, strFax, hospitals, refphys).AsEnumerable(); returnM.filterPracticeName = strPracName; returnM.filterAddressLine1 = strAddress1; returnM.filterCity = strCity; returnM.filterFax = strFax; returnM.SelectedHospitals = hospitals; returnM.SelectedRefPhy = refphys; returnM.HospitalList = DataCollections.getHospital(db); returnM.RefPhyList = DataCollections.getPCP(db); return(View(returnM)); }
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)); }
// 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)); }