Exemplo n.º 1
0
        private void LoadEdit(string id)
        {
            btnSubmit.Visible = false;
            CaseID            = id;
            Cases o = new Cases();//.Select(UsersID);

            o = Cases.Select(id);

            CustomerID       = o.CustomerID;
            customerCbx.Text = CustomerDictionary.First(e => e.Value == o.CustomerID).Key;
            customerCbx_SelectedIndexChanged(null, null);
            try
            {
                practitionerCbx.Text = PractitionerDictionary.First(e => e.Value == o.PractitionerID).Key;
                practitionerCbx_SelectedIndexChanged(null, null);
            }
            catch (Exception r)
            {
                Helper.Exceptions(r.Message, "No practitioner is defined  on loading existing case " + CaseID);
            }
            reqStart.Text             = Convert.ToDateTime(o.ReqStart).ToString();
            practictionerTypeCbx.Text = o.PractitionerType;
            reqEnd.Text         = Convert.ToDateTime(o.ReqEnd).ToString();
            roleTypeCbx.Text    = o.RoleType;
            providerNoTxt.Text  = o.ProvideNo;
            informationTxt.Text = o.Information;
            try
            {
                coverageCbx.Text = CoverDictionary.First(e => e.Value == o.CoverageID).Key;
            }
            catch (Exception r)
            {
                Helper.Exceptions(r.Message, "edit case loading Coverage Cbx" + r.Message);
            }
            coverageID = o.CoverageID;
            coverageCbx_SelectedIndexChanged(null, null);

            Dictionary <string, bool> typeValues = JsonConvert.DeserializeObject <Dictionary <string, bool> >(o.Type);
            string type = "";

            typeListBx.Items.Clear();
            foreach (var t in typeValues)
            {
                typeListBx.Items.Add(t.Key, t.Value);
            }

            Dictionary <string, bool> placeValues = JsonConvert.DeserializeObject <Dictionary <string, bool> >(o.Place);

            placeListBx.Items.Clear();
            foreach (var t in placeValues)
            {
                placeListBx.Items.Add(t.Key, t.Value);
            }


            string Q = "SELECT * FROM ICD10 WHERE caseID = '" + o.Id + "' ";

            GenericCollection.icd10 = ICD10.List(Q);
            string Q2 = "SELECT * FROM casetransaction WHERE caseID = '" + o.Id + "' ";

            foreach (CaseTransaction j in CaseTransaction.List(Q2))
            {
                CaseTransaction t = new CaseTransaction(j.Id, j.Date, j.No, j.ItemID, j.CaseID, "", Convert.ToDouble(j.Qty), Convert.ToDouble(j.Cost), j.Units, j.Total, j.Tax, j.Coverage, j.Self, j.Payable, j.Limits, j.Setting, j.Period, j.Height, j.Weight, j.Instruction, j.Created, j.Sync, Helper.CompanyID);
                GenericCollection.caseTransactions.Add(t);
            }

            LoadDiagnosis();
            LoadCaseTransactions();
        }
Exemplo n.º 2
0
        private void LoadOrder(string no)
        {
            updateBtn.Visible = false;
            Orders o;

            GenericCollection.caseTransactions = new List <CaseTransaction>();
            No                    = no;
            noTxt.Text            = no;
            o                     = new Orders();//.Select(UsersID);
            o                     = Orders.SelectNo(no);
            CustomerID            = o.CustomerID;
            PractitionerID        = o.PractitionerID;
            No                    = o.No;
            providerIDTxt.Text    = Helper.NPI;
            providerNameTxt.Text  = Helper.CompanyName;
            providerUserTxt.Text  = Helper.UserName;
            providerPhoneTxt.Text = Helper.CompanyContact;
            UserID                = o.UserID;

            try
            {
                //CustomerID = CustomerDictionary[customerCbx.Text];
                c = new Customer();                //.Select(ItemID);
                c = Customer.Select(CustomerID);
                subscriberInfoTxt.Text = "Name: " + c.Name + "\t DOB: " + c.Dob + " \r\n Address: " + c.Address + "\r\n City/state: " + c.City + " " + c.State + "\t Zip: " + c.Zip + " \r\n  Phone: " + c.Contact + "\t Soc.Sec.#: " + c.Ssn;

                System.Drawing.Image  img = Helper.Base64ToImage(c.Image);
                System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(img);
                cusPbx.Image = bmp;
                GraphicsPath gp = new GraphicsPath();
                gp.AddEllipse(cusPbx.DisplayRectangle);
                cusPbx.Region       = new Region(gp);
                cusPbx.SizeMode     = PictureBoxSizeMode.StretchImage;
                patientNameTxt.Text = c.Name;
                idTxt.Text          = c.No;
                dobTxt.Text         = c.Dob;
                contactTxt.Text     = c.Contact;
            }
            catch { }

            try
            {
                PractitionerID = o.PractitionerID;
                Practitioner c = new Practitioner();                //.Select(ItemID);
                c = Practitioner.Select(PractitionerID);
                physicianTxt.Text = "Name: " + c.Name + "\t Speciality" + c.Speciality + " \r\n Address: " + c.Address + "\r\n City/state: " + c.City + " " + c.State + "\t Zip: " + c.Zip + " \r\n  Phone: " + c.Contact + "\t";

                System.Drawing.Image  img = Helper.Base64ToImage(c.Image);
                System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(img);
                userPbx.Image = bmp;
                GraphicsPath gp = new GraphicsPath();
                gp.AddEllipse(cusPbx.DisplayRectangle);
                userPbx.Region       = new Region(gp);
                userPbx.SizeMode     = PictureBoxSizeMode.StretchImage;
                pracIDTxt.Text       = c.ProviderID;
                practitionerTxt.Text = c.Name;
                signatureTxt.Text    = "";
                dateTxt.Text         = Convert.ToDateTime(DateTime.Now).ToString("MM/dd/yyyy");
                phoneTxt.Text        = c.Contact;
            }
            catch { }
            GenericCollection.caseTransactions.Clear();
            GenericCollection.icd10.Clear();
            string Q = "SELECT * FROM casetransaction WHERE no = '" + noTxt.Text + "'";

            foreach (CaseTransaction j in CaseTransaction.List(Q))
            {
                //try
                //{

                CaseTransaction t = new CaseTransaction(j.Id, j.Date, j.No, j.ItemID, j.CaseID, j.DeliveryID, j.Qty, j.Cost, j.Units, j.Total, j.Tax, j.Coverage, j.Self, j.Payable, j.Limits, j.Setting, j.Period, j.Height, j.Weight, j.Instruction, j.Created, "false", Helper.CompanyID);
                GenericCollection.caseTransactions.Add(t);
                //}
                //catch { }
            }
            LoadCaseTransactions();
            dateTxt.Text = Convert.ToDateTime(DateTime.Now).ToString("MM/dd/yyyy");
            dayTxt.Text  = Convert.ToDateTime(DateTime.Now).ToString("MM/dd/yyyy");

            GenericCollection.icd10.Clear();
            string Qs = "SELECT * FROM icd10 WHERE no = '" + noTxt.Text + "'";

            GenericCollection.icd10 = ICD10.List(Qs);
            LoadDiagnosis();
            string exists = "";

            try
            {
                exists = MySQL.value("SELECT no FROM certificate WHERE no  = '" + noTxt.Text + "'");
            }
            catch (Exception y)
            {
                exists = "";
            }
            if (!string.IsNullOrEmpty(exists))
            {
                LoadEdit(noTxt.Text);
            }
        }