public PharmaciesDTO(Pharmacies pharmacy)
 {
     Id   = pharmacy.GetId();
     Name = pharmacy.GetName();
     Key  = pharmacy.GetKey();
     Link = pharmacy.GetLink();
 }
Exemple #2
0
        //Retrieves the names and ids of pharmacies from the database
        public static void retrievePharmacies()
        {
            pharmacies.Clear();
            pharmaciesId.Clear();
            DataTable       dataTable = new DataTable();
            string          connStr   = "server=csdatabase.eku.edu;user=stu_csc340;database=csc340_db;port=3306;password=Colonels18;SSLMode=none";
            MySqlConnection conn      = new MySqlConnection(connStr);

            try
            {
                Console.WriteLine("Connecting to MySQL...");
                conn.Open();
                string           sql       = @"SELECT name, id FROM dixonpharmacy";
                MySqlCommand     cmd       = new MySqlCommand(sql, conn);
                MySqlDataAdapter myAdapter = new MySqlDataAdapter(cmd);
                myAdapter.Fill(dataTable);
                Console.WriteLine("Table is ready.");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            foreach (DataRow row in dataTable.Rows)
            {
                Pharmacies.Add(row["name"].ToString());
                PharmaciesId.Add((int)row["id"]);
            }
            conn.Close();
        }
Exemple #3
0
        private void FillGrid()
        {
            if (PharmacyC.Listt.Count < 1)
            {
                MsgBox.Show(this, "Need to set up at least one pharmacy.");
                return;
            }
            listRx = RxPats.GetQueue();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableQueue", "Patient"), 150);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableQueue", "Provider"), 150);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableQueue", "Rx"), 150);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableQueue", "Pharmacy"), 150);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < listRx.Count; i++)
            {
                Patient patCur = Patients.GetLim(listRx[i].PatNum);
                row = new ODGridRow();
                row.Cells.Add(Patients.GetNameLF(patCur.LName, patCur.FName, patCur.Preferred, patCur.MiddleI));
                row.Cells.Add(Providers.GetAbbr(listRx[i].ProvNum));
                row.Cells.Add(listRx[i].Drug);
                row.Cells.Add(Pharmacies.GetDescription(listRx[i].PharmacyNum));
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemple #4
0
        ///<summary>The values returned are sent to the webserver.</summary>
        public static List <Pharmacym> GetMultPharmacyms(List <long> PharmacyNums)
        {
            List <Pharmacy>  pharmacyList  = Pharmacies.GetMultPharmacies(PharmacyNums);
            List <Pharmacym> pharmacymList = ConvertListToM(pharmacyList);

            return(pharmacymList);
        }
        async Task ExecuteLoadPharmaciesCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Pharmacies.Clear();
                var items = await DataStore.GetItemsAsync(true);

                foreach (var item in items)
                {
                    Pharmacies.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemple #6
0
 public ActionResult UpdatePharmacy(FormCollection form)
 {
     try
     {
         var pharm = new Pharmacies
         {
             Id             = Convert.ToInt32(form.Get("Id")),
             Address        = form.Get("adress"),
             City           = form.Get("city"),
             Contact        = form.Get("contact"),
             CommercialName = form.Get("names"),
             Country        = Convert.ToInt32(form.Get("country")),
             ManagerContact = form.Get("mcontact"),
             ManagerNames   = form.Get("manager"),
             Rccm           = form.Get("rccm"),
             TimeZone       = form.Get("timezone"),
             Currency       = form.Get("currency")
         };
         client.UpdatePharmacy(pharm);
         TempData["success"] = "Modification effectuée avec succès";
         return(RedirectToAction("Profil", new { id = form.Get("Id") }));
     }
     catch (FaultException ex)
     {
         TempData["error"] = ex.Message;
         return(RedirectToAction("Profil", new { id = form.Get("Id") }));
     }
     catch (Exception ex)
     {
         TempData["error"] = ex.Message;
         return(RedirectToAction("Profil", new { id = form.Get("Id") }));
     }
 }
 public void SetUp()
 {
     pharmacies = new Pharmacies(driver);
     //logInPage.FillInEmailField(loginModel.ValidEmail);
     //logInPage.FillInPasswordField(loginModel.ValidPassword);
     //logInPage.ClickOnLogInButton();
     //homePage.WaitUntilHomePageAppears();
 }
        public void Add_pharmacy()
        {
            PharmacyService pharmacyService = new PharmacyService(CreateStubRepository());

            Pharmacies pharmacy = pharmacyService.AddEntity(new Pharmacies("NekaApoteka", "APi1", "nekilink1"));

            Assert.NotNull(pharmacy);
        }
Exemple #9
0
        public static Pharmacies PharmacyDtoToPharmacy(PharmaciesDTO dto)
        {
            Pharmacies pharmacy = new Pharmacies();

            pharmacy.Name = dto.Name;
            pharmacy.Key  = dto.Key;
            pharmacy.Link = dto.Link;
            return(pharmacy);
        }
Exemple #10
0
        public static PharmaciesDTO PharmacyToPharmacyDto(Pharmacies pharmacy)
        {
            PharmaciesDTO dto = new PharmaciesDTO();

            dto.Name = pharmacy.Name;
            dto.Key  = pharmacy.Key;
            dto.Link = pharmacy.Link;
            return(dto);
        }
Exemple #11
0
 public static void CreatePharmacy(string name, string addr, string city, string state, string zip, string phone)
 {
     Pharmacies.Insert(new Pharmacy()
     {
         StoreName = name,
         Address   = addr,
         City      = city,
         State     = state,
         Zip       = zip,
         Phone     = phone,
     });
 }
Exemple #12
0
        public IActionResult AddPharmacy([FromBody] PharmaciesDTO dto)
        {
            PharmacyValidation validation = new PharmacyValidation();

            if (!validation.ValidatePharmacy(dto))
            {
                return(BadRequest("The data which were entered are incorrect!"));
            }
            Pharmacies pharmacy = PharmacyMapper.PharmacyDtoToPharmacy(dto);

            App.Instance().PharmacyService.AddEntity(pharmacy);
            return(Ok());
        }
Exemple #13
0
        private void butPick_Click(object sender, EventArgs e)
        {
            FormPharmacies FormP = new FormPharmacies();

            FormP.IsSelectionMode     = true;
            FormP.SelectedPharmacyNum = RxPatCur.PharmacyNum;
            FormP.ShowDialog();
            if (FormP.DialogResult != DialogResult.OK)
            {
                return;
            }
            RxPatCur.PharmacyNum = FormP.SelectedPharmacyNum;
            textPharmacy.Text    = Pharmacies.GetDescription(RxPatCur.PharmacyNum);
        }
Exemple #14
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textStoreName.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Store name cannot be blank."));
         return;
     }
     if (CultureInfo.CurrentCulture.Name == "en-US")
     {
         if (textPhone.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textPhone.Text) == "")
         {
             MessageBox.Show(Lan.g(this, "Phone number must be in a 10-digit format."));
             return;
         }
         if (textFax.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textFax.Text) == "")
         {
             MessageBox.Show(Lan.g(this, "Fax number must be in a 10-digit format."));
             return;
         }
     }
     PharmCur.StoreName = textStoreName.Text;
     PharmCur.PharmID   = "";
     PharmCur.Phone     = textPhone.Text;
     PharmCur.Fax       = textFax.Text;
     PharmCur.Address   = textAddress.Text;
     PharmCur.Address2  = textAddress2.Text;
     PharmCur.City      = textCity.Text;
     PharmCur.State     = textState.Text;
     PharmCur.Zip       = textZip.Text;
     PharmCur.Note      = textNote.Text;
     try{
         if (PharmCur.IsNew)
         {
             Pharmacies.Insert(PharmCur);
         }
         else
         {
             Pharmacies.Update(PharmCur);
         }
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
Exemple #15
0
        private void FillGrid()
        {
            Pharmacies.RefreshCache();
            _listPharmacies = Pharmacies.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TablePharmacies", "Store Name"), 130);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Phone"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Fax"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Address"), 120);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "City"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Note"), 100);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;
            string    txt;

            for (int i = 0; i < _listPharmacies.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(_listPharmacies[i].StoreName);
                row.Cells.Add(_listPharmacies[i].Phone);
                if (Programs.GetCur(ProgramName.DentalTekSmartOfficePhone).Enabled)
                {
                    row.Cells[row.Cells.Count - 1].ColorText = Color.Blue;
                    row.Cells[row.Cells.Count - 1].Underline = YN.Yes;
                }
                row.Cells.Add(_listPharmacies[i].Fax);
                txt = _listPharmacies[i].Address;
                if (_listPharmacies[i].Address2 != "")
                {
                    txt += "\r\n" + _listPharmacies[i].Address2;
                }
                row.Cells.Add(txt);
                row.Cells.Add(_listPharmacies[i].City);
                row.Cells.Add(_listPharmacies[i].Note);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemple #16
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (PharmCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, true, "Delete this Pharmacy?"))
     {
         return;
     }
     try{
         Pharmacies.DeleteObject(PharmCur.PharmacyNum);
         DialogResult = DialogResult.OK;
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #17
0
 public JsonResult CreatePharmacie(FormCollection form)
 {
     try
     {
         var rs = client.PharmacyExists(form.Get("email"));
         if (rs)
         {
             return(Json(new { success = false, message = "Une pharmacie avec cette addresse email exist déjà" }));
         }
         var p = new Pharmacies
         {
             Username       = form.Get("email").ToLower(),
             Password       = EasyEncryption.MD5.ComputeMD5Hash(form.Get("password")),
             Active         = true,
             Address        = form.Get("address"),
             City           = form.Get("city"),
             CommercialName = form.Get("firstname"),
             Rccm           = form.Get("rccm"),
             Contact        = form.Get("contact"),
             EmailAddress   = form.Get("email"),
             Country        = Convert.ToInt32(form.Get("country")),
             ManagerContact = form.Get("mcontact"),
             ManagerNames   = form.Get("manager"),
             TimeZone       = form.Get("timezone"),
             Description    = form.Get("desc"),
             Latitude       = form.Get("lat"),
             Longitude      = form.Get("long"),
             Tva            = decimal.Parse("10"),
             Currency       = form.Get("currency")
         };
         var uid = client.CreatePharmacy(p);
         return(Json(new { success = true, id = uid }));
     }
     catch (FaultException ex)
     {
         return(Json(new { success = false, message = ex.Message }));
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, message = ex.Message }));
     }
 }
Exemple #18
0
        private void FillGrid()
        {
            Pharmacies.RefreshCache();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TablePharmacies", "Store Name"), 130);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Phone"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Fax"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Address"), 120);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "City"), 90);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TablePharmacies", "Note"), 100);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;
            string    txt;

            for (int i = 0; i < PharmacyC.Listt.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(PharmacyC.Listt[i].StoreName);
                row.Cells.Add(PharmacyC.Listt[i].Phone);
                row.Cells.Add(PharmacyC.Listt[i].Fax);
                txt = PharmacyC.Listt[i].Address;
                if (PharmacyC.Listt[i].Address2 != "")
                {
                    txt += "\r\n" + PharmacyC.Listt[i].Address2;
                }
                row.Cells.Add(txt);
                row.Cells.Add(PharmacyC.Listt[i].City);
                row.Cells.Add(PharmacyC.Listt[i].Note);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemple #19
0
        private void butSend_Click(object sender, EventArgs ea)
        {
            if (gridMain.SelectedIndices.Length != 1)
            {
                MsgBox.Show(this, "Exactly one Rx must be selected.");
                return;
            }
            Pharmacy      pharmacy = Pharmacies.GetOne(listRx[gridMain.SelectedIndices[0]].PharmacyNum);
            StringBuilder strb     = new StringBuilder();
            //These characters will be replaced in a production by unprintable characters, but hardcoded for debugging.
            char   f = ':';        //separates fields within a composite element
            char   e = '+';        //(separates composite elements) SureScripts may require an unprintable character here.
            char   d = '.';        //decimal notation
            char   r = '/';        //release indicator
            char   p = '*';        //repetition separator
            string s = "'\r\n";    //segment separator

                        #if DEBUG
            if (true)
            {
                //Set false if you want to use unprintable characters to simulate running in release mode.
            }
            else
            {
                //f=''; we don't know the values for these characters yet.
                //e='';
                //d='';
                //r='';
                //p='';
                //s='';
            }
                        #else
            //f=''; we don't know the values for these characters yet.
            //e='';
            //d='';
            //r='';
            //p='';
            //s='';
                        #endif
            RxPat          rx          = listRx[gridMain.SelectedIndices[0]];
            Patient        pat         = Patients.GetPat(rx.PatNum);
            Provider       prov        = Providers.GetProv(rx.ProvNum);
            PatPlan        patPlan     = PatPlans.GetPatPlan(pat.PatNum, 1);
            Family         fam         = Patients.GetFamily(pat.PatNum);
            List <InsSub>  subList     = InsSubs.RefreshForFam(fam);
            List <InsPlan> planList    = InsPlans.RefreshForSubList(subList);
            InsSub         sub         = InsSubs.GetOne(patPlan.InsSubNum);
            InsPlan        plan        = InsPlans.GetPlan(sub.PlanNum, planList);
            Carrier        car         = Carriers.GetCarrier(plan.CarrierNum);
            DateTime       msgTimeSent = DateTime.Now;
            //Hardcoded values should never change. Ex:Message type, version, release should always be SCRIPT:010:006
            //Hardcoded values allowed to change until released version.
            //UNA:+./*'------------------------------------------------------------------------------------------------
            strb.Append("UNA" + f + e + d + r + p + s);
            //UIB+UNOA:0++1234567+++77777777:C:PASSWORDQ+7701630:P+19971001:081522'------------------------------------
            strb.Append("UIB" + e);                                                                                                //000
            strb.Append("UNOA" + f + "0" + e);                                                                                     //010 Syntax identifier and version
            strb.Append(e);                                                                                                        //020 not used
            strb.Append(Sout(POut.Long(rx.RxNum)) + e);                                                                            //030 Transaction reference (Clinic system trace number.) Sender creates a Unique Trace number for each message sent.
            strb.Append(e);                                                                                                        //040 not used
            strb.Append(e);                                                                                                        //050 not used
            strb.Append("56873771" + f + "C" + f + "PASSWORDQ" + e);                                                               //060 Sender identification (This is the Clinic ID of the sender; C means it is a Clinic.)
            strb.Append(Sout(pharmacy.PharmID) + f + "P" + e);                                                                     //070 Recipient ID (NCPDP Provider ID Number of pharmacy; P means it is a pharmacy.)
            strb.Append(Sout(msgTimeSent.ToString("yyyyMMdd")) + f + Sout(msgTimeSent.ToString("HHmmss")) + s);                    //080 Date of initiation CCYYMMDD:HHMMSS,S
            //UIH+SCRIPT:010:006:NEWRX+110072+++19971001:081522'-------------------------------------------------------
            strb.Append("UIH" + e);                                                                                                //000
            strb.Append("SCRIPT" + f + "010" + f + "006" + f + "NEWRX" + e);                                                       //010 Message type:version:release:function.
            //Clinic's reference number for message. Usually this is the folio number for the patient. However, this is the ID by which the clinic will be able to refer to this prescription.
            strb.Append(Sout(rx.RxNum.ToString()) + e);                                                                            //020 Message reference number (Must match number in UIT segment below, must be unique. Recommend using rx num)
            strb.Append(e);                                                                                                        //030 conditional Dialogue Reference
            strb.Append(e);                                                                                                        //040 not used
            strb.Append(Sout(msgTimeSent.ToString("yyyyMMdd")) + f + Sout(msgTimeSent.ToString("HHmmss")) + s);                    //050 Date of initiation
            //PVD+P1+7701630:D3+++++MAIN STREET PHARMACY++6152205656:TE'-----------------------------------------------
            strb.Append("PVD" + e);                                                                                                //000
            strb.Append("P1" + e);                                                                                                 //010 Provider coded (see external code list pg.109)
            strb.Append(Sout(pharmacy.PharmID) + f + "D3" + e);                                                                    //020 Reference number and qualifier (Pharmacy ID)
            strb.Append(e);                                                                                                        //030 not used
            strb.Append(e);                                                                                                        //040 conditional Provider specialty
            strb.Append(e);                                                                                                        //050 conditional The name of the prescriber or pharmacist or supervisor
            strb.Append(e);                                                                                                        //060 not used
            strb.Append(e);                                                                                                        //070 conditional The clinic or pharmacy name
            strb.Append(Sout(pharmacy.Address) + f + Sout(pharmacy.City) + f + Sout(pharmacy.State) + f + Sout(pharmacy.Zip) + e); //080 Address
            strb.Append(Regex.Replace(Sout(pharmacy.Phone), @"[-()]", string.Empty) + f + "TE" + s);                               //090 Communication number and qualifier
            //PVD+PC+6666666:0B+++JONES:MARK++++6152219800:TE'---------------------------------------------------------
            strb.Append("PVD" + e);                                                                                                //000
            strb.Append("PC" + e);                                                                                                 //010 Provider coded
            strb.Append(Sout(prov.StateRxID) + f + "0B" + e);                                                                      //020 Reference number and qualifier (0B: Provider State License Number)
            strb.Append(e);                                                                                                        //030 not used
            strb.Append(e);                                                                                                        //040 conditional Provider specialty
            strb.Append(Sout(prov.LName) + f + Sout(prov.FName) + e);                                                              //050 The name of the prescriber or pharmacist or supervisor
            strb.Append(e);                                                                                                        //060 not used
            strb.Append(e);                                                                                                        //070 conditional The clinic or pharmacy name
            strb.Append(e);                                                                                                        //080 conditional Address
            strb.Append(Regex.Replace(Sout(PrefC.GetString(PrefName.PracticePhone)), @"[-()]", string.Empty) + f + "TE" + s);      //090 Communication number and qualifier
            //PTT++19541225+SMITH:MARY+F+333445555:SY'-----------------------------------------------------------------
            strb.Append("PTT" + e);                                                                                                //000
            strb.Append(e);                                                                                                        //010 conditional Individual relationship
            strb.Append(Sout(pat.Birthdate.ToString("yyyyMMdd")) + e);                                                             //020 Birth date of patient YYYYMMDD
            strb.Append(Sout(pat.LName) + f + Sout(pat.FName) + e);                                                                //030 Name
            strb.Append(Sout(pat.Gender.ToString().Substring(0, 1)) + e);                                                          //040 Gender (M,F,U)
            strb.Append(Sout(pat.SSN.Replace("-", "")) + f + "SY" + s);                                                            //050 Patient ID and/or SSN and qualifier
            //COO+123456:BO+INSURANCE COMPANY NAME++123456789++AA112'--------------------------------------------------
            strb.Append("COO" + e);                                                                                                //000
            strb.Append(Sout(plan.RxBIN) + f + "BO" + e);                                                                          //010 Payer ID Information and qualifier (Primary Payer's identification number? BO is for BIN Location Number.)
            strb.Append(Sout(car.CarrierName) + e);                                                                                //020 Payer name
            strb.Append(e);                                                                                                        //030 conditional Service type, coded
            strb.Append(Sout(sub.SubscriberID) + e);                                                                               //040 Cardholder ID
            strb.Append(e);                                                                                                        //050 conditional Cardholder name
            strb.Append(Sout(plan.GroupNum) + s);                                                                                  //060 Group ID
            //DRU------------------------------------------------------------------------------------------------------
            //DRU+P:CALAN SR 240MG::::240:::::::AA:C42998:AB:C28253+::60:38:AC:C48542+:1 TID -TAKE ONE TABLET TWO TIMES A DAY UNTIL GONE+85:19971001:102*ZDS:30:804+0+R:1'
            strb.Append("DRU" + e);          //000
            //P means prescribed. Drug prescribed is Calan Sr 240mg.
            //240 is the strength (free text); AA is the Source for NCI Pharmaceutical Dosage Form. C42998 is the code for “Tablet dosing form”.
            //AB is the Source for NCI Units of Presentation. C28253 is the code for “Milligram”. So this means the prescription is for 240mg tablets.
            //There's AA, AB and AC - AC is Potency Unit
            //The definitions for C42998 and C28253 and be found @ http://nciterms.nci.nih.gov/ncitbrowser/pages/vocabulary.jsf?dictionary=NCI_Thesaurus
            strb.Append("P" + f + Sout(rx.Drug) + f + f + f + f + f + f + Sout(rx.RxCui.ToString()) + f + "SBD" + e); //f+f+f+f+"AA"+f+"C42998"+f+"AB"+f+"C28253"+e);//010 Item Description Identification
            //This means dispense 60 tablets. 38 is the code value for Original Qty. AC is the Source for NCI Potency Units. C48542 is the code for “Tablet dosing unit”.
            strb.Append("" + f + f + Sout(rx.Disp) + f + f + "AA" + f + Sout(rx.DosageCode) + e);                     //020 Quantity
            strb.Append(f + Sout(rx.Sig) + e);                                                                        //030 Directions
            //85 qualifier for Date Issued (Written date) 102 is qualifier for CCYYMMDD format.
            //ZDS is the qualifier for Days Supply. 30 is the number of days supply. 804 is the qualifier for Quantity of Days.
            strb.Append("85" + f + Sout(rx.RxDate.ToString("yyyyMMdd")) + f + "102" + e); //+p+"ZDS"+f+"30"+f+"804"+e);//040 Date Note: It is strongly recommended that Days Supply (value “ZDS”) be supported.
            strb.Append("0" + e);                                                         //050 Product/Service substitution, coded
            strb.Append("R" + f + Sout(rx.Refills) + s);                                  //060 Refill and quantity
            //UIT+110072+6'---------------------------------------------------------------------------------------------
            strb.Append("UIT" + e);                                                       //000
            strb.Append(Sout(rx.RxNum.ToString()) + e);                                   //010 Message reference number
            strb.Append("5" + s);                                                         //020 Mandatory field. This is the count of the number of segments in the message including the UIH and UIT
            //UIZ++1'---------------------------------------------------------------------------------------------------
            strb.Append("UIZ" + e);                                                       //000
            strb.Append(e);                                                               //010 not used
            strb.Append("1" + s);                                                         //020 Number of messages per interchange. The count of UIH-UIT occurrences
            //Uncomment if you want to see the message text:
            //MsgBoxCopyPaste msgbox=new MsgBoxCopyPaste(strb.ToString());
            //msgbox.ShowDialog();
            Cursor = Cursors.WaitCursor;
            try {
                                #if EHRTEST
                EHR.EhrEmail.Send("10.6 SCRIPT for NEWRX", "SCRIPT.txt", strb.ToString());
                                #else
                //can't send email unless in debug/ehrtest mode.
                                #endif
            }
            catch (Exception ex) {
                Cursor = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            Cursor = Cursors.Default;
            MessageBox.Show("Sent");
            rx.SendStatus = RxSendStatus.SentElect;          //Removes the Rx from the grid.
            RxPats.Update(rx);
            FillGrid();
        }
Exemple #20
0
 private void FormRxEdit_Load(object sender, System.EventArgs e)
 {
     butSend.Visible = false;          //this is here temporarily until we actually have Rx send capability.
     if (HideSendBut)
     {
         butSend.Visible = false;
     }
     if (IsNew)
     {
         butView.Visible   = false;
         labelView.Visible = false;
         sheet             = null;
     }
     else
     {
         sheet = Sheets.GetRx(RxPatCur.PatNum, RxPatCur.RxNum);
         if (sheet == null)
         {
             butView.Visible   = false;
             labelView.Visible = false;
         }
         else
         {
             butPrint.Visible = false;
         }
     }
     //security is handled on the Rx button click in the Chart module
     for (int i = 0; i < ProviderC.ListShort.Count; i++)
     {
         this.listProv.Items.Add(ProviderC.ListShort[i].GetLongDesc());
         if (ProviderC.ListShort[i].ProvNum == RxPatCur.ProvNum)
         {
             listProv.SelectedIndex = i;
         }
     }
     if (listProv.SelectedIndex == -1)
     {
         listProv.SelectedIndex = 0;
     }
     textDate.Text           = RxPatCur.RxDate.ToString("d");
     checkControlled.Checked = RxPatCur.IsControlled;
     for (int i = 0; i < Enum.GetNames(typeof(RxSendStatus)).Length; i++)
     {
         comboSendStatus.Items.Add(Enum.GetNames(typeof(RxSendStatus))[i]);
     }
     comboSendStatus.SelectedIndex = (int)RxPatCur.SendStatus;
     textDrug.Text    = RxPatCur.Drug;
     textSig.Text     = RxPatCur.Sig;
     textDisp.Text    = RxPatCur.Disp;
     textRefills.Text = RxPatCur.Refills;
     textRxNorm.Text  = RxPatCur.RxCui.ToString();
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         textDosageCode.Text = RxPatCur.DosageCode;
     }
     else
     {
         labelDosageCode.Visible = false;
         textDosageCode.Visible  = false;
     }
     textNotes.Text    = RxPatCur.Notes;
     textPharmacy.Text = Pharmacies.GetDescription(RxPatCur.PharmacyNum);
 }
Exemple #21
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textStoreName.Text == "")
            {
                MessageBox.Show(Lan.g(this, "Store name cannot be blank."));
                return;
            }
            if (CultureInfo.CurrentCulture.Name == "en-US")
            {
                if (textPhone.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textPhone.Text) == "")
                {
                    MessageBox.Show(Lan.g(this, "Phone number must be in a 10-digit format."));
                    return;
                }
                if (textFax.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textFax.Text) == "")
                {
                    MessageBox.Show(Lan.g(this, "Fax number must be in a 10-digit format."));
                    return;
                }
            }
            PharmCur.StoreName = textStoreName.Text;
            PharmCur.PharmID   = "";
            PharmCur.Phone     = textPhone.Text;
            PharmCur.Fax       = textFax.Text;
            PharmCur.Address   = textAddress.Text;
            PharmCur.Address2  = textAddress2.Text;
            PharmCur.City      = textCity.Text;
            PharmCur.State     = textState.Text;
            PharmCur.Zip       = textZip.Text;
            PharmCur.Note      = textNote.Text;
            try{
                if (PharmCur.IsNew)
                {
                    Pharmacies.Insert(PharmCur);
                }
                else
                {
                    Pharmacies.Update(PharmCur);
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            //Update PharmClinic links
            List <PharmClinic> listPharmClinicOld = (List <PharmClinic>)comboClinic.Tag;
            List <PharmClinic> listPharmClinicNew = new List <PharmClinic>();

            //comboClinic.All might be selected, and would result in ListSelectedClinicNums containing only the clinics showing in the combobox, which very will not include clinics that user does not have permissions for.  "All" is not separately tested for.  Because the new list is synched against the old list, clinics that aren't showing are not affected one way or the other.
            foreach (long clinicNumNew in comboClinic.ListSelectedClinicNums)
            {
                if (listPharmClinicOld.Any(x => x.ClinicNum == clinicNumNew))               //if it existed before, add it to the list
                {
                    listPharmClinicNew.Add(listPharmClinicOld.First(x => x.ClinicNum == clinicNumNew));
                }
                else                  //otherwise, create a new link.
                {
                    listPharmClinicNew.Add(new PharmClinic(PharmCur.PharmacyNum, clinicNumNew));
                }
            }
            PharmClinics.Sync(listPharmClinicNew, listPharmClinicOld);
            DialogResult = DialogResult.OK;
        }
Exemple #22
0
 ///<summary>The values returned are sent to the webserver.</summary>
 public static List <long> GetChangedSincePharmacyNums(DateTime changedSince)
 {
     return(Pharmacies.GetChangedSincePharmacyNums(changedSince));
 }
Exemple #23
0
 private void FormRxEdit_Load(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         butView.Visible   = false;
         labelView.Visible = false;
         sheet             = null;
         if (PrefC.GetBool(PrefName.ShowFeatureEhr) && Security.CurUser.ProvNum != 0)               //Is CPOE
         {
             labelCPOE.Visible    = true;
             comboProvNum.Enabled = false;
             butPickProv.Enabled  = false;
             RxPatCur.ProvNum     = Security.CurUser.ProvNum;
         }
     }
     else
     {
         sheet = Sheets.GetRx(RxPatCur.PatNum, RxPatCur.RxNum);
         if (sheet == null)
         {
             butView.Visible   = false;
             labelView.Visible = false;
         }
         else
         {
             butPrint.Visible = false;
         }
     }
     //security is handled on the Rx button click in the Chart module
     _provNumSelected = RxPatCur.ProvNum;
     comboProvNum.Items.Clear();
     for (int i = 0; i < ProviderC.ListShort.Count; i++)
     {
         comboProvNum.Items.Add(ProviderC.ListShort[i].GetLongDesc());                //Only visible provs added to combobox.
         if (ProviderC.ListShort[i].ProvNum == RxPatCur.ProvNum)
         {
             comboProvNum.SelectedIndex = i;                  //Sets combo text too.
         }
     }
     if (_provNumSelected == 0)           //Is new
     {
         comboProvNum.SelectedIndex = 0;
         _provNumSelected           = ProviderC.ListShort[0].ProvNum;
     }
     if (comboProvNum.SelectedIndex == -1)                            //The provider exists but is hidden
     {
         comboProvNum.Text = Providers.GetLongDesc(_provNumSelected); //Appends "(hidden)" to the end of the long description.
     }
     textDate.Text           = RxPatCur.RxDate.ToString("d");
     checkControlled.Checked = RxPatCur.IsControlled;
     for (int i = 0; i < Enum.GetNames(typeof(RxSendStatus)).Length; i++)
     {
         comboSendStatus.Items.Add(Enum.GetNames(typeof(RxSendStatus))[i]);
     }
     comboSendStatus.SelectedIndex = (int)RxPatCur.SendStatus;
     textDrug.Text    = RxPatCur.Drug;
     textSig.Text     = RxPatCur.Sig;
     textDisp.Text    = RxPatCur.Disp;
     textRefills.Text = RxPatCur.Refills;
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         textDosageCode.Text = RxPatCur.DosageCode;
     }
     else
     {
         labelDosageCode.Visible = false;
         textDosageCode.Visible  = false;
     }
     textNotes.Text    = RxPatCur.Notes;
     textPharmacy.Text = Pharmacies.GetDescription(RxPatCur.PharmacyNum);
 }
Exemple #24
0
 private void FormRxEdit_Load(object sender, System.EventArgs e)
 {
     RxPatCur.IsNew = IsNew;
     _rxPatOld      = RxPatCur.Copy();
     if (IsNew)
     {
         butAudit.Visible  = false;
         butView.Visible   = false;
         labelView.Visible = false;
         sheet             = null;
         if (PrefC.GetBool(PrefName.ShowFeatureEhr) && Security.CurUser.ProvNum != 0)               //Is CPOE
         {
             labelCPOE.Visible    = true;
             comboProvNum.Enabled = false;
             butPickProv.Enabled  = false;
             RxPatCur.ProvNum     = Security.CurUser.ProvNum;
         }
     }
     else
     {
         sheet = Sheets.GetRx(RxPatCur.PatNum, RxPatCur.RxNum);
         if (sheet == null)
         {
             butView.Visible   = false;
             labelView.Visible = false;
         }
         else
         {
             butPrint.Visible = false;
         }
         if (!Security.IsAuthorized(Permissions.RxEdit))
         {
             textDate.Enabled          = false;
             checkControlled.Enabled   = false;
             checkProcRequired.Enabled = false;
             comboProcCode.Enabled     = false;
             textDaysOfSupply.Enabled  = false;
             textDrug.Enabled          = false;
             textSig.Enabled           = false;
             textDisp.Enabled          = false;
             textRefills.Enabled       = false;
             comboProvNum.Enabled      = false;
             butPickProv.Enabled       = false;
             textDosageCode.Enabled    = false;
             textNotes.Enabled         = false;
             butPick.Enabled           = false;
             comboSendStatus.Enabled   = false;
             butDelete.Enabled         = false;
         }
     }
     //security is handled on the Rx button click in the Chart module
     _provNumSelected = RxPatCur.ProvNum;
     comboProvNum.Items.Clear();
     _listProviders = Providers.GetDeepCopy(true);
     for (int i = 0; i < _listProviders.Count; i++)
     {
         comboProvNum.Items.Add(_listProviders[i].GetLongDesc());                //Only visible provs added to combobox.
         if (_listProviders[i].ProvNum == RxPatCur.ProvNum)
         {
             comboProvNum.SelectedIndex = i;                  //Sets combo text too.
         }
     }
     if (_provNumSelected == 0)           //Is new
     {
         comboProvNum.SelectedIndex = 0;
         _provNumSelected           = _listProviders[0].ProvNum;
     }
     if (comboProvNum.SelectedIndex == -1)                            //The provider exists but is hidden
     {
         comboProvNum.Text = Providers.GetLongDesc(_provNumSelected); //Appends "(hidden)" to the end of the long description.
     }
     textDate.Text           = RxPatCur.RxDate.ToString("d");
     checkControlled.Checked = RxPatCur.IsControlled;
     comboProcCode.Items.Clear();
     if (PrefC.GetBool(PrefName.RxHasProc))
     {
         checkProcRequired.Checked = RxPatCur.IsProcRequired;
         comboProcCode.Items.Add(Lan.g(this, "none"));
         comboProcCode.SelectedIndex = 0;
         List <ProcedureCode> listProcCodes = ProcedureCodes.GetListDeep();
         DateTime             rxDate        = PIn.Date(textDate.Text);
         if (rxDate.Year < 1880)
         {
             rxDate = DateTime.Today;
         }
         _listInUseProcs = Procedures.Refresh(RxPatCur.PatNum)
                           .FindAll(x => x.ProcNum == RxPatCur.ProcNum ||
                                    (x.ProcStatus == ProcStat.C && x.DateComplete <= rxDate && x.DateComplete >= rxDate.AddYears(-1)) ||
                                    x.ProcStatus == ProcStat.TP)
                           .OrderBy(x => x.ProcStatus.ToString())
                           .ThenBy(x => (x.ProcStatus == ProcStat.C)?x.DateComplete:x.DateTP)
                           .ToList();
         foreach (Procedure proc in _listInUseProcs)
         {
             ProcedureCode procCode = ProcedureCodes.GetProcCode(proc.CodeNum, listProcCodes);
             string        itemText = proc.ProcStatus.ToString().PadLeft(2, ' ');
             if (proc.ProcStatus == ProcStat.C)
             {
                 itemText += " " + proc.DateComplete.ToShortDateString();
             }
             else
             {
                 itemText += " " + proc.DateTP.ToShortDateString();
             }
             itemText += " " + Procedures.GetDescription(proc);
             comboProcCode.Items.Add(itemText);
             if (proc.ProcNum == RxPatCur.ProcNum)
             {
                 comboProcCode.SelectedIndex = comboProcCode.Items.Count - 1;
             }
         }
         if (RxPatCur.DaysOfSupply != 0)
         {
             textDaysOfSupply.Text = RxPatCur.DaysOfSupply.ToString();
         }
     }
     else
     {
         checkProcRequired.Enabled = false;
         labelProcedure.Enabled    = false;
         comboProcCode.Enabled     = false;
         labelDaysOfSupply.Enabled = false;
         textDaysOfSupply.Enabled  = false;
     }
     for (int i = 0; i < Enum.GetNames(typeof(RxSendStatus)).Length; i++)
     {
         comboSendStatus.Items.Add(Enum.GetNames(typeof(RxSendStatus))[i]);
     }
     comboSendStatus.SelectedIndex = (int)RxPatCur.SendStatus;
     textDrug.Text    = RxPatCur.Drug;
     textSig.Text     = RxPatCur.Sig;
     textDisp.Text    = RxPatCur.Disp;
     textRefills.Text = RxPatCur.Refills;
     if (PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         textDosageCode.Text = RxPatCur.DosageCode;
     }
     else
     {
         labelDosageCode.Visible = false;
         textDosageCode.Visible  = false;
     }
     textNotes.Text     = RxPatCur.Notes;
     textPharmInfo.Text = RxPatCur.ErxPharmacyInfo;
     textPharmacy.Text  = Pharmacies.GetDescription(RxPatCur.PharmacyNum);
 }
        private void FillGrid()
        {
            Pharmacies.RefreshCache();
            _listPharmacies = Pharmacies.GetDeepCopy();
            //Key=>PharmacyNum & Value=>List of clinics
            SerializableDictionary <long, List <Clinic> > dictPharmClinics = null;

            if (PrefC.HasClinicsEnabled)
            {
                dictPharmClinics = Clinics.GetDictClinicsForPharmacy(_listPharmacies.Select(x => x.PharmacyNum).ToArray());
            }
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col = new GridColumn(Lan.g("TablePharmacies", "Store Name"), 130);

            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TablePharmacies", "Phone"), 90);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TablePharmacies", "Fax"), 90);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TablePharmacies", "Address"), 120);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g("TablePharmacies", "City"), 90);
            gridMain.ListGridColumns.Add(col);
            if (PrefC.HasClinicsEnabled)
            {
                col = new GridColumn(Lan.g("TablePharmacies", "Clinics"), 115);
                gridMain.ListGridColumns.Add(col);
            }
            col = new GridColumn(Lan.g("TablePharmacies", "Note"), 100);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;
            string  txt;

            foreach (Pharmacy pharm in _listPharmacies)
            {
                row = new GridRow();
                row.Cells.Add(pharm.StoreName);
                row.Cells.Add(pharm.Phone);
                if (Programs.GetCur(ProgramName.DentalTekSmartOfficePhone).Enabled)
                {
                    row.Cells[row.Cells.Count - 1].ColorText = Color.Blue;
                    row.Cells[row.Cells.Count - 1].Underline = YN.Yes;
                }
                row.Cells.Add(pharm.Fax);
                txt = pharm.Address;
                if (pharm.Address2 != "")
                {
                    txt += "\r\n" + pharm.Address2;
                }
                row.Cells.Add(txt);
                row.Cells.Add(pharm.City);
                if (PrefC.HasClinicsEnabled)
                {
                    List <Clinic> listClinics;
                    if (!dictPharmClinics.TryGetValue(pharm.PharmacyNum, out listClinics))
                    {
                        listClinics = new List <Clinic>();
                    }
                    row.Cells.Add(string.Join(",", listClinics.Select(x => x.Abbr)));
                }
                row.Cells.Add(pharm.Note);
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }