private void FormRxSetupPrinting_Load(object sender, EventArgs e) { if (PrefB.GetBool("RxOrientVert")) { radioVertical.Checked = true; } else { radioHorizontal.Checked = true; } textRight.Text = PrefB.GetDouble("RxAdjustRight").ToString(); textDown.Text = PrefB.GetDouble("RxAdjustDown").ToString(); if (PrefB.GetInt("RxGeneric") == 0) { radioGeneric.Checked = true; } else if (PrefB.GetInt("RxGeneric") == 1) { radioNeither.Checked = true; } else { radioTwoSig.Checked = true; } }
private void FormRecallSetup_Load(object sender, System.EventArgs e) { textPatternAdult.Text = PrefB.GetString("RecallPattern"); textProcsAdult.Text = ((Pref)PrefB.HList["RecallProcedures"]).ValueString; textPatternChild.Text = PrefB.GetString("RecallPatternChild"); textProcsChild.Text = ((Pref)PrefB.HList["RecallProceduresChild"]).ValueString; textPatternPerio.Text = PrefB.GetString("RecallPatternPerio"); textProcsPerio.Text = ((Pref)PrefB.HList["RecallProceduresPerio"]).ValueString; textPerioTriggerProcs.Text = ((Pref)PrefB.HList["RecallPerioTriggerProcs"]).ValueString; textBW.Text = ((Pref)PrefB.HList["RecallBW"]).ValueString; textFMXPanoProc.Text = ((Pref)PrefB.HList["RecallFMXPanoProc"]).ValueString; checkDisableAutoFilms.Checked = PrefB.GetBool("RecallDisableAutoFilms"); checkDisablePerioAlt.Checked = PrefB.GetBool("RecallDisablePerioAlt"); textFMXPanoYrInterval.Text = PrefB.GetInt("RecallFMXPanoYrInterval").ToString(); checkGroupFamilies.Checked = PrefB.GetBool("RecallGroupByFamily"); textPostcardMessage.Text = PrefB.GetString("RecallPostcardMessage"); textPostcardFamMsg.Text = PrefB.GetString("RecallPostcardFamMsg"); textConfirmPostcardMessage.Text = PrefB.GetString("ConfirmPostcardMessage"); textPostcardsPerSheet.Text = PrefB.GetInt("RecallPostcardsPerSheet").ToString(); checkReturnAdd.Checked = PrefB.GetBool("RecallCardsShowReturnAdd"); checkGroupFamilies.Checked = PrefB.GetBool("RecallGroupByFamily"); textDaysPast.Text = PrefB.GetInt("RecallDaysPast").ToString(); textDaysFuture.Text = PrefB.GetInt("RecallDaysFuture").ToString(); textRight.Text = PrefB.GetDouble("RecallAdjustRight").ToString(); textDown.Text = PrefB.GetDouble("RecallAdjustDown").ToString(); listProcs.Items.Clear(); for (int i = 0; i < ProcedureCodes.RecallAL.Count; i++) { listProcs.Items.Add(((ProcedureCode)ProcedureCodes.RecallAL[i]).Descript); } }
///<summary>Updates a pref of type double. Returns true if a change was required, or false if no change needed.</summary> public static bool UpdateDouble(string prefName, double newValue) { if (!PrefB.HList.ContainsKey(prefName)) { MessageBox.Show(prefName + " is an invalid pref name."); return(false); } if (PrefB.GetDouble(prefName) == newValue) { return(false); //no change needed } string command = "UPDATE preference SET " + "ValueString = '" + POut.PDouble(newValue) + "' " + "WHERE PrefName = '" + POut.PString(prefName) + "'"; General.NonQ(command); return(true); }
///<summary>raised for each page to be printed.</summary> private void pdCards_PrintPage(object sender, PrintPageEventArgs ev) { int totalPages = (int)Math.Ceiling((double)AddrTable.Rows.Count / (double)PrefB.GetInt("RecallPostcardsPerSheet")); Graphics g = ev.Graphics; int yAdj = (int)(PrefB.GetDouble("RecallAdjustDown") * 100); int xAdj = (int)(PrefB.GetDouble("RecallAdjustRight") * 100); float yPos = 0 + yAdj;//these refer to the upper left origin of each postcard float xPos = 0 + xAdj; string str; while (yPos < ev.PageBounds.Height - 100 && patientsPrinted < AddrTable.Rows.Count) { //Return Address-------------------------------------------------------------------------- if (PrefB.GetBool("RecallCardsShowReturnAdd")) { str = PrefB.GetString("PracticeTitle") + "\r\n"; g.DrawString(str, new Font(FontFamily.GenericSansSerif, 9, FontStyle.Bold), Brushes.Black, xPos + 45, yPos + 60); str = PrefB.GetString("PracticeAddress") + "\r\n"; if (PrefB.GetString("PracticeAddress2") != "") { str += PrefB.GetString("PracticeAddress2") + "\r\n"; } str += PrefB.GetString("PracticeCity") + ", " + PrefB.GetString("PracticeST") + " " + PrefB.GetString("PracticeZip") + "\r\n"; string phone = PrefB.GetString("PracticePhone"); if (CultureInfo.CurrentCulture.Name == "en-US" && phone.Length == 10) { str += "(" + phone.Substring(0, 3) + ")" + phone.Substring(3, 3) + "-" + phone.Substring(6); } else //any other phone format { str += phone; } g.DrawString(str, new Font(FontFamily.GenericSansSerif, 8), Brushes.Black, xPos + 45, yPos + 75); } //Body text------------------------------------------------------------------------------- if (checkGroupFamilies.Checked && AddrTable.Rows[patientsPrinted]["FamList"].ToString() != "") //print family card { str = PrefB.GetString("RecallPostcardFamMsg").Replace //textFamilyMessage.Text.Replace ("?FamilyList", AddrTable.Rows[patientsPrinted]["FamList"].ToString()); } else //print single card { str = PrefB.GetString("RecallPostcardMessage").Replace //textPostcardMessage.Text.Replace ("?DueDate", PIn.PDate(AddrTable.Rows[patientsPrinted]["DateDue"].ToString()).ToShortDateString()); } g.DrawString(str, new Font(FontFamily.GenericSansSerif, 10), Brushes.Black, new RectangleF(xPos + 45, yPos + 180, 250, 190)); //Patient's Address----------------------------------------------------------------------- if (checkGroupFamilies.Checked && AddrTable.Rows[patientsPrinted]["FamList"].ToString() != "") //print family card { str = AddrTable.Rows[patientsPrinted]["LName"].ToString() + " " + Lan.g(this, "Household") + "\r\n"; } else //print single card { str = AddrTable.Rows[patientsPrinted]["FName"].ToString() + " " + AddrTable.Rows[patientsPrinted]["MiddleI"].ToString() + " " + AddrTable.Rows[patientsPrinted]["LName"].ToString() + "\r\n"; } str += AddrTable.Rows[patientsPrinted]["Address"].ToString() + "\r\n"; if (AddrTable.Rows[patientsPrinted]["Address2"].ToString() != "") { str += AddrTable.Rows[patientsPrinted]["Address2"].ToString() + "\r\n"; } str += AddrTable.Rows[patientsPrinted]["City"].ToString() + ", " + AddrTable.Rows[patientsPrinted]["State"].ToString() + " " + AddrTable.Rows[patientsPrinted]["Zip"].ToString() + "\r\n"; g.DrawString(str, new Font(FontFamily.GenericSansSerif, 11), Brushes.Black, xPos + 320, yPos + 240); if (PrefB.GetInt("RecallPostcardsPerSheet") == 1) { yPos += 400; } else if (PrefB.GetInt("RecallPostcardsPerSheet") == 3) { yPos += 366; } else //4 { xPos += 550; if (xPos > 1000) { xPos = 0 + xAdj; yPos += 425; } } patientsPrinted++; } //while pagesPrinted++; if (pagesPrinted == totalPages) { ev.HasMorePages = false; pagesPrinted = 0; patientsPrinted = 0; } else { ev.HasMorePages = true; } }
private void pd2_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { Graphics g = e.Graphics; Pen penDashBorder = new Pen(Color.Black, (float)(.125)); SolidBrush brush = new SolidBrush(Color.Black); penDashBorder.DashStyle = DashStyle.Dot; int x; int y; int xAdj = (int)(PrefB.GetDouble("RxAdjustRight") * 100); int yAdj = (int)(PrefB.GetDouble("RxAdjustDown") * 100); string text; Font font = new Font(FontFamily.GenericSansSerif, 8); Font fontRX = new Font(FontFamily.GenericSerif, 24); Font fontBold = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold); int fontH = (int)font.GetHeight(g) + 3; Provider prov = Providers.GetProv(RxPatCur.ProvNum); if (PrefB.GetBool("RxOrientVert")) { g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 425 + xAdj, 0 + yAdj); g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 0 + xAdj, 550 + yAdj); g.DrawLine(penDashBorder, 425 + xAdj, 0 + yAdj, 425 + xAdj, 550 + yAdj); g.DrawLine(penDashBorder, 0 + xAdj, 550 + yAdj, 425 + xAdj, 550 + yAdj); } else //horizontal { g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 550 + xAdj, 0 + yAdj); g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 0 + xAdj, 425 + yAdj); g.DrawLine(penDashBorder, 550 + xAdj, 0 + yAdj, 550 + xAdj, 425 + yAdj); g.DrawLine(penDashBorder, 0 + xAdj, 425 + yAdj, 550 + xAdj, 425 + yAdj); } //Dr-------------------------------------------------------------------------------------------------- //Left Side x = 50 + xAdj; y = 37 + yAdj; text = prov.FName + " " + prov.MI + " " + prov.LName + ", " + prov.Suffix; g.DrawString(text, fontBold, brush, x, y); y += fontH; text = PrefB.GetString("PracticeAddress"); g.DrawString(text, font, brush, x, y); y += fontH; text = PrefB.GetString("PracticeAddress2"); if (text != "") { g.DrawString(text, font, brush, x, y); y += fontH; } text = PrefB.GetString("PracticeCity") + ", " + PrefB.GetString("PracticeST") + " " + PrefB.GetString("PracticeZip"); g.DrawString(text, font, brush, x, y); y = 100 + yAdj; if (PrefB.GetBool("RxOrientVert")) { g.DrawLine(Pens.Black, 25 + xAdj, y, 400 + xAdj, y); } else { g.DrawLine(Pens.Black, 25 + xAdj, y, 525 + xAdj, y); } //Right Side x = 280 + xAdj; y = 38 + yAdj; text = PrefB.GetString("PracticePhone"); if (text.Length == 10) { text = "(" + text.Substring(0, 3) + ")" + text.Substring(3, 3) + "-" + text.Substring(6); } g.DrawString(text, font, brush, x, y); y += fontH; text = RxPatCur.RxDate.ToShortDateString(); g.DrawString(text, font, brush, x, y); y += fontH; text = Lan.g(this, "DEA#: ") + prov.DEANum; g.DrawString(text, font, brush, x, y); //Patient--------------------------------------------------------------------------------------------------- //Upper Left x = 90 + xAdj; y = 105 + yAdj; text = PatCur.GetNameFL(); g.DrawString(text, fontBold, brush, x, y); y += fontH; text = Lan.g(this, "DOB: ") + PatCur.Birthdate.ToShortDateString(); g.DrawString(text, fontBold, brush, x, y); y += fontH; text = PatCur.HmPhone; g.DrawString(text, font, brush, x, y); y += fontH; //x=280+xAdj; //y=120+yAdj; text = PatCur.Address; g.DrawString(text, font, brush, x, y); y += fontH; text = PatCur.Address2; if (text != "") { g.DrawString(text, font, brush, x, y); y += fontH; } text = PatCur.City + ", " + PatCur.State + " " + PatCur.Zip; g.DrawString(text, font, brush, x, y); y += fontH; //RX----------------------------------------------------------------------------------------------------- y = 190 + yAdj; x = 40 + xAdj; g.DrawString(Lan.g(this, "Rx"), fontRX, brush, x, y); y = 205 + yAdj; x = 90 + xAdj; g.DrawString(RxPatCur.Drug, fontBold, brush, x, y); y += (int)(fontH * 1.5); g.DrawString(Lan.g(this, "Disp:") + " " + RxPatCur.Disp, font, brush, x, y); y += (int)(fontH * 1.5); g.DrawString(Lan.g(this, "Sig:") + " " + RxPatCur.Sig, font, brush, new RectangleF(x, y, 325, fontH * 2)); y += (int)(fontH * 2.5); g.DrawString(Lan.g(this, "Refills:") + " " + RxPatCur.Refills, font, brush, x, y); //Generic Subst---------------------------------------------------------------------------------------------- if (PrefB.GetInt("RxGeneric") == 2) //two signature lines { text = Lan.g(this, "Generic Substitution Permitted"); if (PrefB.GetBool("RxOrientVert")) { y = 380 + yAdj; g.DrawLine(Pens.Black, 90 + xAdj, y, 325 + xAdj, y); x = 207 + xAdj - (int)(g.MeasureString(text, font).Width / 2); } else { y = 360 + yAdj; g.DrawLine(Pens.Black, 50 + xAdj, y, 260 + xAdj, y); x = 145 + xAdj - (int)(g.MeasureString(text, font).Width / 2); } y += 4; g.DrawString(text, font, brush, x, y); } else //check boxes { x = 50 + xAdj; y = 343 + yAdj; g.DrawRectangle(Pens.Black, x, y, 12, 12); x += 17; text = Lan.g(this, "Dispense as Written"); g.DrawString(text, font, brush, x, y); x -= 17; y += 25; g.DrawRectangle(Pens.Black, x, y, 12, 12); if (PrefB.GetInt("RxGeneric") == 0) //generic checked { g.DrawLine(Pens.Black, x, y, x + 12, y + 12); g.DrawLine(Pens.Black, x + 12, y, x, y + 12); } x += 17; text = Lan.g(this, "Generic Substitution Permitted"); g.DrawString(text, font, brush, x, y); } //Signature Line-------------------------------------------------------------------------------------------- if (PrefB.GetInt("RxGeneric") == 2) //two signature lines { text = Lan.g(this, "Dispense as Written"); } else { text = Lan.g(this, "Signature of Prescriber"); } if (PrefB.GetBool("RxOrientVert")) { y = 460 + yAdj; g.DrawLine(Pens.Black, 90 + xAdj, y, 325 + xAdj, y); x = 207 + xAdj - (int)(g.MeasureString(text, font).Width / 2); } else { y = 360 + yAdj; g.DrawLine(Pens.Black, 300 + xAdj, y, 530 + xAdj, y); x = 412 + xAdj - (int)(g.MeasureString(text, font).Width / 2); } y += 4; g.DrawString(text, font, brush, x, y); g.Dispose(); }