Exemplo n.º 1
0
        public static ReferringPractice getPractice(PatientLogModel db, string PracID)
        {
            int ID = Convert.ToInt32(PracID);
            ReferringPractice prac = (from r in db.ReferringPractices where r.PracID == ID select r).Single();

            return(prac);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            ReferringPractice referringPractice = db.ReferringPractices.Find(id);

            db.ReferringPractices.Remove(referringPractice);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "PracID,PracName,Address1,Address2,Address3,City,State,Zip,Phone,Fax,Email,OfficeManager,Other,PDFPassword,EmailNotification,FaxNotification")] ReferringPractice referringPractice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(referringPractice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(referringPractice));
 }
Exemplo n.º 4
0
        public JsonResult jsonSubmitCommunicationMethod(ReferringPractice prac)
        {
            string            result  = "";
            ReferringPractice newPrac = DataCollections.getPractice(db, prac.PracID);

            newPrac.EmailNotification = prac.EmailNotification;
            newPrac.FaxNotification   = prac.FaxNotification;

            DataSubmissions.SavePractice(db, newPrac);

            result = "Communication Methods Saved";
            return(Json(result));
        }
        // GET: ReferringPractice/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ReferringPractice referringPractice = db.ReferringPractices.Find(id);

            if (referringPractice == null)
            {
                return(HttpNotFound());
            }
            return(View(referringPractice));
        }
Exemplo n.º 6
0
        public static void SavePractice(PatientLogModel db, ReferringPractice prac)
        {
            ReferringPractice practice = (from r in db.ReferringPractices where r.PracID == prac.PracID select r).FirstOrDefault();

            //If user preference query returns a value, update it. If not, create a new entry in the db
            if (practice != null)
            {
                db.Entry(practice).State = EntityState.Modified;
            }
            else
            {
                db.ReferringPractices.Add(prac);
            }
            db.SaveChanges();
        }
Exemplo n.º 7
0
        public JsonResult jsonSubmitPracticeInformation(ReferringPractice prac)
        {
            string            result  = "";
            ReferringPractice newPrac = DataCollections.getPractice(db, prac.PracID);

            newPrac.Address1      = prac.Address1;
            newPrac.Address2      = prac.Address2;
            newPrac.Address3      = prac.Address3;
            newPrac.City          = prac.City;
            newPrac.State         = prac.State;
            newPrac.Zip           = prac.Zip;
            newPrac.Phone         = prac.Phone;
            newPrac.Fax           = prac.Fax;
            newPrac.Email         = prac.Email;
            newPrac.OfficeManager = prac.OfficeManager;
            newPrac.Other         = prac.Other;
            newPrac.PDFPassword   = prac.PDFPassword;

            DataSubmissions.SavePractice(db, newPrac);

            result = "Practice Information Saved";
            return(Json(result));
        }
Exemplo n.º 8
0
        private void sendCommunications(string ids)
        {
            List <int> listofID = new List <int>();

            string[] splitList;
            splitList = ids.Split(new char[] { ',' });

            foreach (string i in splitList)
            {
                int theID = Convert.ToInt32(i);

                //Query patient record
                PatientLog pat = db.PatientLogs.Find(theID);

                //Determine fax type from table
                string faxType = (from f in db.FaxServiceTypes
                                  where f.Service == pat.ServiceType
                                  select f.FaxType).Single() + "Notice";

                //Break apart PCP name
                string[] splitName;
                splitName = pat.PCP_Practice.Split(new char[] { ',' });
                string pcpName   = splitName[1] + " " + splitName[0];
                string firstname = splitName[1].Trim(); //LINQ doesn't like arrays, throws error
                string lastname  = splitName[0].Trim();
                string pcpID     = (from u in db.Users where u.FirstName == firstname && u.LastName == lastname select u.UserID).Single();

                //Get practice info of PCP, default to AIMS otherwise
                ReferringPractice prac = new ReferringPractice();
                try
                {
                    prac = (from p in db.ReferringPractices
                            join r in db.RefPracUsers on p.PracID equals r.PracID
                            where r.UserID == pcpID
                            select p).Single();
                }
                catch
                {
                    prac.Fax             = "248-354-4807";
                    prac.FaxNotification = true;
                }

                //Create new reportviewer object and set parameters
                ReportViewer report = new ReportViewer();
                report.ProcessingMode         = ProcessingMode.Local;
                report.LocalReport.ReportPath = Server.MapPath("~") + "AdDisNotice\\" + faxType + pat.Hospital + ".rdlc";

                //Cannot perform ToShortDateString on pat.ServiceDate because of DateTime? type
                DateTime thed = new DateTime();
                thed = Convert.ToDateTime(pat.ServiceDate);
                DateTime birth = new DateTime();

                //Null values will cause the reportviewer control to error out
                try
                {
                    birth = Convert.ToDateTime(pat.DOB);
                }
                catch
                {
                    birth = DateTime.Parse("1/1/1900");
                }
                if (pat.PatientName == null)
                {
                    pat.PatientName = "";
                }
                if (pat.Comments == null)
                {
                    pat.Comments = "";
                }
                if (pat.MRN_FIN == null)
                {
                    pat.MRN_FIN = "";
                }

                ReportParameter dateparam      = new ReportParameter("Date", thed.ToShortDateString());
                ReportParameter faxparam       = new ReportParameter("Fax", prac.Fax);
                ReportParameter faxtoparam     = new ReportParameter("FaxTo", pcpName);
                ReportParameter dischargeparam = new ReportParameter("DischargeDate", thed.ToShortDateString());
                ReportParameter patientparam   = new ReportParameter("Patient", pat.PatientName);
                ReportParameter treatmentparam = new ReportParameter("Treatment", pat.Comments);
                ReportParameter mrnparam       = new ReportParameter("MRN", pat.MRN_FIN);
                ReportParameter physicianparam = new ReportParameter("Physician", HubSecurity.getLoggedInDisplayName());
                ReportParameter dobparam       = new ReportParameter("DOB", birth.ToShortDateString());

                ReportParameterCollection theparams = new ReportParameterCollection()
                {
                    dateparam, faxparam, faxtoparam, dischargeparam, patientparam, treatmentparam, mrnparam, physicianparam, dobparam
                };
                report.LocalReport.SetParameters(theparams);
                report.LocalReport.Refresh();

                string notificationTypes = "";
                if (prac.FaxNotification == true)
                {
                    notificationTypes += "Fax;";
                }
                if (prac.EmailNotification == true)
                {
                    notificationTypes += "Email;";
                }

                GenerateComms gcomm = new GenerateComms();
                gcomm.SendFax(faxType, report, FAX_FOLDER, prac.Fax, pat.Hospital, HubSecurity.getLoggedInUserID(), pcpID, pcpName,
                              pat.ID, pat.PatientName, pat.Comments, "", notificationTypes, birth.ToShortDateString(),
                              prac.PDFPassword, pat.Hospital + faxType, prac.Email, "");
            }
        }
Exemplo n.º 9
0
        public static ReferringPractice getPractice(PatientLogModel db, int PracID)
        {
            ReferringPractice prac = (from r in db.ReferringPractices where r.PracID == PracID select r).Single();

            return(prac);
        }