private void FormWebSchedASAPSend_Load(object sender, EventArgs e) { Clinic curClinic = Clinics.GetClinic(_clinicNum) ?? Clinics.GetDefaultForTexting() ?? Clinics.GetPracticeAsClinicZero(); List <long> listPatNums = (_listAppts.Select(x => x.PatNum).Union(_listRecalls.Select(x => x.PatNum))).Distinct().ToList(); _listPatComms = Patients.GetPatComms(listPatNums, curClinic, isGetFamily: false); string textTemplate = ClinicPrefs.GetPrefValue(PrefName.WebSchedAsapTextTemplate, _clinicNum); string emailTemplate = ClinicPrefs.GetPrefValue(PrefName.WebSchedAsapEmailTemplate, _clinicNum); string emailSubject = ClinicPrefs.GetPrefValue(PrefName.WebSchedAsapEmailSubj, _clinicNum); textTextTemplate.Text = AsapComms.ReplacesTemplateTags(textTemplate, _clinicNum, _dtSlotStart); _emailText = AsapComms.ReplacesTemplateTags(emailTemplate, _clinicNum, _dtSlotStart, isHtmlEmail: true); RefreshEmail(); textEmailSubject.Text = AsapComms.ReplacesTemplateTags(emailSubject, _clinicNum, _dtSlotStart); if (SmsPhones.IsIntegratedTextingEnabled()) { radioTextEmail.Checked = true; } else { radioEmail.Checked = true; } FillSendDetails(); timerUpdateDetails.Start(); }
private void gridClaims_CellDoubleClick(object sender, UI.ODGridClickEventArgs e) { if (!Security.IsAuthorized(Permissions.ClaimView)) { return; } Claim claim = Claims.GetClaim(((Claim)gridClaims.ListGridRows[e.Row].Tag).ClaimNum); //This is the easiest way to determine if the claim was deleted. if (claim == null) //Was deleted. { MsgBox.Show(this, "Claim has been deleted by another user."); gridClaims.BeginUpdate(); gridClaims.ListGridRows.RemoveAt(e.Row); //This will also deselect the row. gridClaims.EndUpdate(); return; } FormClaimEdit formCE = new FormClaimEdit(claim, Patients.GetPat(_patNum), Patients.GetFamily(_patNum)); formCE.ShowDialog(); claim = Claims.GetClaim(((Claim)gridClaims.ListGridRows[e.Row].Tag).ClaimNum); //This is the easiest way to determine if the claim was deleted. if (claim == null) //Was deleted. { gridClaims.BeginUpdate(); gridClaims.ListGridRows.RemoveAt(e.Row); //This will also deselect the row. gridClaims.EndUpdate(); return; } if (formCE.DialogResult == DialogResult.OK) { //Update row UI.GridRow row = new UI.GridRow(); row.Tag = claim; row.Cells.Add(claim.DateService.ToShortDateString()); //DOS row.Cells.Add(Carriers.GetName(InsPlans.RefreshOne(claim.PlanNum).CarrierNum)); //Carrier row.Cells.Add(Claims.GetClaimStatusString(claim.ClaimStatus)); //Status if (PrefC.HasClinicsEnabled) //Using clinics { Clinic clinic = Clinics.GetClinic(claim.ClinicNum); if (clinic == null) { row.Cells.Add(""); //Clinic } else { row.Cells.Add(clinic.Description); //Clinic } } row.Cells.Add(claim.ClaimFee.ToString("f")); //Claimfee gridClaims.BeginUpdate(); gridClaims.ListGridRows[e.Row] = row; gridClaims.EndUpdate(); gridClaims.SetSelected(e.Row, true); //Reselect Row } }
public void LoadTemplate(string subject,string bodyText,List<EmailAttach> attachments) { List<Appointment> listApts=Appointments.GetFutureSchedApts(PatNum); Appointment aptNext=null; if(listApts.Count > 0){ aptNext=listApts[0]; //next sched appt. If none, null. } Clinic clinic=Clinics.GetClinic(ClinicNum); Subject=ReplaceTemplateFields(subject,_patCur,aptNext,clinic);; BodyText=ReplaceTemplateFields(bodyText,_patCur,aptNext,clinic); _emailMessage.Attachments.AddRange(attachments); _hasMessageTextChanged=true; FillAttachments(); }
private void FormRpInsAging_Load(object sender, System.EventArgs e) { _listProviders = Providers.GetListReports(); DateTime lastAgingDate = PrefC.GetDate(PrefName.DateLastAging); if (lastAgingDate.Year < 1880) { textDate.Text = ""; } else if (PrefC.GetBool(PrefName.AgingCalculatedMonthlyInsteadOfDaily)) { textDate.Text = lastAgingDate.ToShortDateString(); } else { textDate.Text = DateTime.Today.ToShortDateString(); } _listBillingTypeDefs = Defs.GetDefsForCategory(DefCat.BillingTypes, true); listBillType.Items.AddRange(_listBillingTypeDefs.Select(x => x.ItemName).ToArray()); listBillType.SelectedIndex = (listBillType.Items.Count > 0?0:-1); checkBillTypesAll.Checked = true; //all billing types by default, event handler will set visibility listProv.Items.AddRange(_listProviders.Select(x => x.GetLongDesc()).ToArray()); listProv.SelectedIndex = (listProv.Items.Count > 0?0:-1); checkProvAll.Checked = true; //all provs by default, event handler will set visibility if (!PrefC.HasClinicsEnabled) { checkAllClin.Visible = false; //event handler may set listClin to visible, so hide explicitly after setting unchecked just in case listClin.Visible = false; labelClin.Visible = false; } else { List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser, true, "Unassigned").ToList(); if (!listClinics.Exists(x => x.ClinicNum == Clinics.ClinicNum)) //Could have a hidden clinic selected { listClinics.Add(Clinics.GetClinic(Clinics.ClinicNum)); } listClin.Items.AddRange(listClinics.Select(x => new ODBoxItem <Clinic>(x.Abbr + (x.IsHidden?(" " + Lan.g(this, "(hidden)")):""), x)).ToArray()); listClin.SelectedIndex = listClinics.FindIndex(x => x.ClinicNum == Clinics.ClinicNum); //FindIndex could return -1, which is fine checkAllClin.Checked = (Clinics.ClinicNum == 0); //event handler will set visibility } if (PrefC.GetBool(PrefName.FutureTransDatesAllowed) || PrefC.GetBool(PrefName.AccountAllowFutureDebits) || PrefC.GetBool(PrefName.AllowFutureInsPayments)) { labelFutureTrans.Visible = true; //Set to false in designer } if (!checkOnlyShowPatsOutstandingClaims.Checked) { groupFilter.Visible = false; } }
private void SetFlags() { labelValue.Text = "Value"; textValue.ReadOnly = false; butPickValueLoinc.Enabled = false; butPickValueSnomedct.Enabled = false; butPickValueIcd9.Enabled = false; butPickValueIcd10.Enabled = false; if (listValueType.SelectedIndex == (int)EhrAptObsType.Coded) { labelValue.Text = _strValCodeSystem + " Value"; textValue.ReadOnly = true; butPickValueLoinc.Enabled = true; butPickValueSnomedct.Enabled = true; butPickValueIcd9.Enabled = true; butPickValueIcd10.Enabled = true; } if (listValueType.SelectedIndex == (int)EhrAptObsType.Numeric) { comboUnits.Enabled = true; } else { comboUnits.Enabled = false; } if (listValueType.SelectedIndex == (int)EhrAptObsType.Address) { labelValue.Text = "Facility Address"; textValue.ReadOnly = true; string sendingFacilityName = PrefC.GetString(PrefName.PracticeTitle); string sendingFacilityAddress1 = PrefC.GetString(PrefName.PracticeAddress); string sendingFacilityAddress2 = PrefC.GetString(PrefName.PracticeAddress2); string sendingFacilityCity = PrefC.GetString(PrefName.PracticeCity); string sendingFacilityState = PrefC.GetString(PrefName.PracticeST); string sendingFacilityZip = PrefC.GetString(PrefName.PracticeZip); if (!PrefC.GetBool(PrefName.EasyNoClinics) && _appt.ClinicNum != 0) //Using clinics and a clinic is assigned. { Clinic clinic = Clinics.GetClinic(_appt.ClinicNum); sendingFacilityName = clinic.Description; sendingFacilityAddress1 = clinic.Address; sendingFacilityAddress2 = clinic.Address2; sendingFacilityCity = clinic.City; sendingFacilityState = clinic.State; sendingFacilityZip = clinic.Zip; } textValue.Text = sendingFacilityAddress1 + " " + sendingFacilityAddress2 + " " + sendingFacilityCity + " " + sendingFacilityState + " " + sendingFacilityZip; } }
public void RenderPerioPrintout(Graphics g, Patient pat, Rectangle marginBounds) { string clinicName = ""; //This clinic name could be more accurate here in the future if we make perio exams clinic specific. //Perhaps if there were a perioexam.ClinicNum column. if (pat.ClinicNum != 0) { Clinic clinic = Clinics.GetClinic(pat.ClinicNum); clinicName = clinic.Description; } else { clinicName = PrefC.GetString(PrefName.PracticeTitle); } float y = 70; SizeF sizeFPage = new SizeF(marginBounds.Width, marginBounds.Height); SizeF sizeStr; Font font = new Font("Arial", 15); string titleStr = Lan.g(this, "Periodontal Examination"); sizeStr = g.MeasureString(titleStr, font); g.DrawString(titleStr, font, Brushes.Black, new PointF(sizeFPage.Width / 2f - sizeStr.Width / 2f, y)); y += sizeStr.Height; //Clinic Name font = new Font("Arial", 11); sizeStr = g.MeasureString(clinicName, font); g.DrawString(clinicName, font, Brushes.Black, new PointF(sizeFPage.Width / 2f - sizeStr.Width / 2f, y)); y += sizeStr.Height; //PatientName string patNameStr = _patCur.GetNameFLFormal(); sizeStr = g.MeasureString(patNameStr, font); g.DrawString(patNameStr, font, Brushes.Black, new PointF(sizeFPage.Width / 2f - sizeStr.Width / 2f, y)); y += sizeStr.Height; //We put the exam date instead of the current date because the exam date isn't anywhere else on the printout. string examDateStr = _perioExamCur.ExamDate.ToShortDateString(); //Locale specific exam date. sizeStr = g.MeasureString(examDateStr, font); g.DrawString(examDateStr, font, Brushes.Black, new PointF(sizeFPage.Width / 2f - sizeStr.Width / 2f, y)); y += sizeStr.Height; Bitmap bitmapTC = toothChart.GetBitmap(); g.DrawImage(bitmapTC, sizeFPage.Width / 2f - bitmapTC.Width / 2f, y, bitmapTC.Width, bitmapTC.Height); }
public void LoadTemplate(string subject, string bodyText, List <EmailAttach> attachments) { List <Appointment> listApts = Appointments.GetFutureSchedApts(PatNum); Appointment aptNext = null; if (listApts.Count > 0) { aptNext = listApts[0]; //next sched appt. If none, null. } Clinic clinic = Clinics.GetClinic(ClinicNum); Subject = subject; //patient information Subject = Patients.ReplacePatient(Subject, _patCur); //Next Scheduled Appointment Information Subject = Appointments.ReplaceAppointment(Subject, aptNext); //handles null nextApts. //Currently Logged in User Information Subject = FormMessageReplacements.ReplaceUser(Subject, Security.CurUser); //Clinic Information Subject = Clinics.ReplaceOffice(Subject, clinic); //Misc Information Subject = FormMessageReplacements.ReplaceMisc(Subject); BodyText = bodyText; //patient information BodyText = Patients.ReplacePatient(BodyText, _patCur); //Next Scheduled Appointment Information BodyText = Appointments.ReplaceAppointment(BodyText, aptNext); //handles null nextApts. //Currently Logged in User Information BodyText = FormMessageReplacements.ReplaceUser(BodyText, Security.CurUser); //Clinic Information BodyText = Clinics.ReplaceOffice(BodyText, clinic); //Misc Information BodyText = FormMessageReplacements.ReplaceMisc(BodyText); _emailMessage.Attachments.AddRange(attachments); FillAttachments(); _hasMessageChanged = false; }
private void FillGrid() { if (_listAsapCommHists == null || datePicker.GetDateTimeFrom() < _prevDateFrom || datePicker.GetDateTimeTo() > _prevDateTo || comboClinic.ListSelectedClinicNums.Any(x => !x.In(_prevSelectedClinicNums))) { //The user is asking for data that we have not fetched yet. GetData(); } bool isClinicsEnabled = PrefC.HasClinicsEnabled; List <AsapComms.AsapCommHist> listHist = _listAsapCommHists.Where(x => x.AsapComm.DateTimeEntry .Between(datePicker.GetDateTimeFrom(), datePicker.GetDateTimeTo())) .Where(x => !isClinicsEnabled || x.AsapComm.ClinicNum.In(comboClinic.ListSelectedClinicNums)).ToList(); gridHistory.BeginUpdate(); gridHistory.Columns.Clear(); ODGridColumn col; col = new ODGridColumn(Lan.g(this, "Patient"), 120); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Status"), 120); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "SMS Send Time"), 140); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Email Send Time"), 140); gridHistory.Columns.Add(col); if (PrefC.HasClinicsEnabled) { col = new ODGridColumn(Lan.g(this, "Clinic"), 120); gridHistory.Columns.Add(col); } col = new ODGridColumn(Lan.g(this, "Original Appt Time"), 140); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Slot Start"), 140); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Slot Stop"), 140); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Date Entry"), 140); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "SMS Message Text"), 250); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Email Message Text"), 250); gridHistory.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Note"), 250); gridHistory.Columns.Add(col); gridHistory.Rows.Clear(); foreach (AsapComms.AsapCommHist asapHist in listHist) { ODGridRow row = new ODGridRow(); row.Cells.Add(asapHist.PatientName); row.Cells.Add(Lan.g(this, asapHist.AsapComm.ResponseStatus.GetDescription())); string smsSent; if (asapHist.AsapComm.SmsSendStatus == AutoCommStatus.SendSuccessful) { smsSent = asapHist.AsapComm.DateTimeSmsSent.ToString(); } else if (asapHist.AsapComm.SmsSendStatus == AutoCommStatus.SendNotAttempted) { smsSent = asapHist.AsapComm.DateTimeSmsScheduled.ToString(); } else { smsSent = ""; } row.Cells.Add(smsSent); string emailSent; if (asapHist.AsapComm.EmailSendStatus == AutoCommStatus.SendSuccessful) { emailSent = asapHist.AsapComm.DateTimeEmailSent.ToString(); } else { emailSent = ""; } row.Cells.Add(emailSent); if (PrefC.HasClinicsEnabled) { row.Cells.Add(ODMethodsT.Coalesce(Clinics.GetClinic(asapHist.AsapComm.ClinicNum)).Abbr); } row.Cells.Add(asapHist.AsapComm.DateTimeOrig.Year > 1880 ? asapHist.AsapComm.DateTimeOrig.ToString() : ""); row.Cells.Add(asapHist.DateTimeSlotStart.ToString()); row.Cells.Add(asapHist.DateTimeSlotEnd.ToString()); row.Cells.Add(asapHist.AsapComm.DateTimeEntry.ToString()); row.Cells.Add(asapHist.SMSMessageText); row.Cells.Add(asapHist.EmailMessageText); row.Cells.Add(asapHist.AsapComm.Note); row.Tag = asapHist; gridHistory.Rows.Add(row); } gridHistory.EndUpdate(); textFilled.Text = listHist.Select(x => x.AsapComm) .Where(x => x.ResponseStatus == AsapRSVPStatus.AcceptedAndMoved) .DistinctBy(x => x.FKey).Count().ToString(); textTextsSent.Text = listHist.Select(x => x.AsapComm) .Where(x => x.SmsSendStatus == AutoCommStatus.SendSuccessful) .DistinctBy(x => x.GuidMessageToMobile).Count().ToString(); }
///<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)PrefC.GetLong(PrefName.RecallPostcardsPerSheet)); Graphics g=ev.Graphics; int yAdj=(int)(PrefC.GetDouble(PrefName.RecallAdjustDown)*100); int xAdj=(int)(PrefC.GetDouble(PrefName.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(PrefC.GetBool(PrefName.RecallCardsShowReturnAdd)){ if(PrefC.GetBool(PrefName.EasyNoClinics) || PIn.Long(AddrTable.Rows[patientsPrinted]["ClinicNum"].ToString())==0) {//No clinics or no clinic selected for this appt str=PrefC.GetString(PrefName.PracticeTitle)+"\r\n"; g.DrawString(str,new Font(FontFamily.GenericSansSerif,9,FontStyle.Bold),Brushes.Black,xPos+45,yPos+60); str=PrefC.GetString(PrefName.PracticeAddress)+"\r\n"; if(PrefC.GetString(PrefName.PracticeAddress2)!="") { str+=PrefC.GetString(PrefName.PracticeAddress2)+"\r\n"; } str+=PrefC.GetString(PrefName.PracticeCity)+", "+PrefC.GetString(PrefName.PracticeST)+" "+PrefC.GetString(PrefName.PracticeZip)+"\r\n"; string phone=PrefC.GetString(PrefName.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; } } else {//Clinics enabled and clinic selected Clinic clinic=Clinics.GetClinic(PIn.Long(AddrTable.Rows[patientsPrinted]["ClinicNum"].ToString())); str=clinic.Description+"\r\n"; g.DrawString(str,new Font(FontFamily.GenericSansSerif,9,FontStyle.Bold),Brushes.Black,xPos+45,yPos+60); str=clinic.Address+"\r\n"; if(clinic.Address2!="") { str+=clinic.Address2+"\r\n"; } str+=clinic.City+", "+clinic.State+" "+clinic.Zip+"\r\n"; string phone=clinic.Phone; 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------------------------------------------------------------------------------- str=PrefC.GetString(PrefName.ConfirmPostcardMessage); //textPostcardMessage.Text; str=str.Replace("[date]",PIn.Date(AddrTable.Rows[patientsPrinted]["AptDateTime"].ToString()).ToShortDateString()); str=str.Replace("[time]",PIn.Date(AddrTable.Rows[patientsPrinted]["AptDateTime"].ToString()).ToShortTimeString()); g.DrawString(str,new Font(FontFamily.GenericSansSerif,10),Brushes.Black,new RectangleF(xPos+45,yPos+180,250,190)); //Patient's Address----------------------------------------------------------------------- str=AddrTable.Rows[patientsPrinted]["FName"].ToString()+" " +AddrTable.Rows[patientsPrinted]["MiddleI"].ToString()+" " +AddrTable.Rows[patientsPrinted]["LName"].ToString()+"\r\n" +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(PrefC.GetLong(PrefName.RecallPostcardsPerSheet)==1){ yPos+=400; } else if(PrefC.GetLong(PrefName.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 butSend_Click(object sender, EventArgs e) { if (!SmsPhones.IsIntegratedTextingEnabled()) { MsgBox.Show(this, "Integrated Texting has not been enabled."); return; } if (textMessage.Text == "") { MsgBox.Show(this, "Please enter a message first."); return; } if (textMessage.Text.ToLower().Contains("[date]") || textMessage.Text.ToLower().Contains("[time]")) { MsgBox.Show(this, "Please replace or remove the [Date] and [Time] tags."); return; } if (PrefC.HasClinicsEnabled && !Clinics.IsTextingEnabled(_clinicNum)) //Checking for specific clinic. { if (_clinicNum != 0) { MessageBox.Show(Lans.g(this, "Integrated Texting has not been enabled for the following clinic") + ":\r\n" + Clinics.GetClinic(_clinicNum).Description + "."); } else { //Should never happen. This message is precautionary. MsgBox.Show(this, "The default texting clinic has not been set."); } return; } Cursor = Cursors.WaitCursor; int numTextsSent = 0; foreach (PatComm patComm in _listPatComms) { try { string textMsgText = textMessage.Text.Replace("[NameF]", patComm.FName); if (SendText(patComm, _clinicNum, textMsgText)) { numTextsSent++; } } catch (Exception ex) { ex.DoNothing(); Cursor = Cursors.Default; string errorMsg = Lan.g(this, "There was an error sending to") + " " + patComm.WirelessPhone + ". " + Lan.g(this, "Do you want to continue sending messages?"); if (MessageBox.Show(errorMsg, "", MessageBoxButtons.YesNo) == DialogResult.No) { break; } Cursor = Cursors.WaitCursor; } } Cursor = Cursors.Default; MessageBox.Show(numTextsSent + " " + Lan.g(this, "texts sent successfully.")); DialogResult = DialogResult.OK; }
///<summary>Fills the paysplit grid.</summary> private void FillGridSplits() { //Fill left grid with paysplits created gridSplits.BeginUpdate(); gridSplits.ListGridColumns.Clear(); gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Date"), 65, HorizontalAlignment.Center)); gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Prov"), 40)); if (PrefC.HasClinicsEnabled) //Clinics { gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Clinic"), 40)); } gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Patient"), 100)); gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "ProcCode"), 60)); gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Type"), 100)); gridSplits.ListGridColumns.Add(new GridColumn(Lan.g(this, "Amount"), 55, HorizontalAlignment.Right)); gridSplits.ListGridRows.Clear(); GridRow row; decimal splitTotal = 0; Dictionary <long, Procedure> dictProcs = Procedures.GetManyProc(_listSplitsCur.Where(x => x.ProcNum > 0).Select(x => x.ProcNum).Distinct().ToList(), false).ToDictionary(x => x.ProcNum); for (int i = 0; i < _listSplitsCur.Count; i++) { splitTotal += (decimal)_listSplitsCur[i].SplitAmt; row = new GridRow(); row.Tag = _listSplitsCur[i]; row.Cells.Add(_listSplitsCur[i].DatePay.ToShortDateString()); //Date row.Cells.Add(Providers.GetAbbr(_listSplitsCur[i].ProvNum)); //Prov if (PrefC.HasClinicsEnabled) //Clinics { if (_listSplitsCur[i].ClinicNum != 0) { row.Cells.Add(Clinics.GetClinic(_listSplitsCur[i].ClinicNum).Description); //Clinic } else { row.Cells.Add(""); //Clinic } } Patient patCur; if (!_dictPatients.TryGetValue(_listSplitsCur[i].PatNum, out patCur)) { patCur = Patients.GetPat(_listSplitsCur[i].PatNum); } row.Cells.Add(patCur.GetNameFL()); //Patient Procedure proc = new Procedure(); if (_listSplitsCur[i].ProcNum > 0 && !dictProcs.TryGetValue(_listSplitsCur[i].ProcNum, out proc)) { proc = Procedures.GetOneProc(_listSplitsCur[i].ProcNum, false); } row.Cells.Add(ProcedureCodes.GetStringProcCode(proc?.CodeNum ?? 0)); //ProcCode string type = ""; if (_listSplitsCur[i].PayPlanNum != 0) { type += "PayPlanCharge"; //Type if (_listSplitsCur[i].IsInterestSplit && _listSplitsCur[i].ProcNum == 0 && _listSplitsCur[i].ProvNum != 0) { type += " (interest)"; } } if (_listSplitsCur[i].ProcNum != 0) //Procedure { string procDesc = Procedures.GetDescription(proc ?? new Procedure()); if (type != "") { type += "\r\n"; } type += "Proc: " + procDesc; //Type } if (_listSplitsCur[i].ProvNum == 0) //Unattached split { if (type != "") { type += "\r\n"; } type += "Unallocated"; //Type } if (_listSplitsCur[i].ProvNum != 0 && _listSplitsCur[i].UnearnedType != 0) { if (type != "") { type += "\r\n"; } type += Defs.GetDef(DefCat.PaySplitUnearnedType, _listSplitsCur[i].UnearnedType).ItemName; } row.Cells.Add(type); if (row.Cells[row.Cells.Count - 1].Text == "Unallocated") { row.Cells[row.Cells.Count - 1].ColorText = Color.Red; } row.Cells.Add(_listSplitsCur[i].SplitAmt.ToString("f")); //Amount gridSplits.ListGridRows.Add(row); } gridSplits.EndUpdate(); textSplitTotal.Text = splitTotal.ToString("f"); FillGridCharges(); }
private void FillGridObservations() { gridObservations.BeginUpdate(); gridObservations.ListGridColumns.Clear(); gridObservations.ListGridColumns.Add(new UI.GridColumn("Observation", 200)); //0 gridObservations.ListGridColumns.Add(new UI.GridColumn("Value Type", 200)); //1 gridObservations.ListGridColumns.Add(new UI.GridColumn("Value", 0)); //2 gridObservations.ListGridRows.Clear(); List <EhrAptObs> listEhrAptObses = EhrAptObses.Refresh(_appt.AptNum); for (int i = 0; i < listEhrAptObses.Count; i++) { EhrAptObs obs = listEhrAptObses[i]; UI.GridRow row = new UI.GridRow(); row.Tag = obs; row.Cells.Add(obs.IdentifyingCode.ToString()); //0 Observation if (obs.ValType == EhrAptObsType.Coded) { row.Cells.Add(obs.ValType.ToString() + " - " + obs.ValCodeSystem); //1 Value Type if (obs.ValCodeSystem == "LOINC") { Loinc loincValue = Loincs.GetByCode(obs.ValReported); row.Cells.Add(loincValue.NameShort); //2 Value } else if (obs.ValCodeSystem == "SNOMEDCT") { Snomed snomedValue = Snomeds.GetByCode(obs.ValReported); row.Cells.Add(snomedValue.Description); //2 Value } else if (obs.ValCodeSystem == "ICD9") { ICD9 icd9Value = ICD9s.GetByCode(obs.ValReported); row.Cells.Add(icd9Value.Description); //2 Value } else if (obs.ValCodeSystem == "ICD10") { Icd10 icd10Value = Icd10s.GetByCode(obs.ValReported); row.Cells.Add(icd10Value.Description); //2 Value } } else if (obs.ValType == EhrAptObsType.Address) { string sendingFacilityAddress1 = PrefC.GetString(PrefName.PracticeAddress); string sendingFacilityAddress2 = PrefC.GetString(PrefName.PracticeAddress2); string sendingFacilityCity = PrefC.GetString(PrefName.PracticeCity); string sendingFacilityState = PrefC.GetString(PrefName.PracticeST); string sendingFacilityZip = PrefC.GetString(PrefName.PracticeZip); if (PrefC.HasClinicsEnabled && _appt.ClinicNum != 0) //Using clinics and a clinic is assigned. { Clinic clinic = Clinics.GetClinic(_appt.ClinicNum); sendingFacilityAddress1 = clinic.Address; sendingFacilityAddress2 = clinic.Address2; sendingFacilityCity = clinic.City; sendingFacilityState = clinic.State; sendingFacilityZip = clinic.Zip; } row.Cells.Add(obs.ValType.ToString()); //1 Value Type row.Cells.Add(sendingFacilityAddress1 + " " + sendingFacilityAddress2 + " " + sendingFacilityCity + " " + sendingFacilityState + " " + sendingFacilityZip); //2 Value } else { row.Cells.Add(obs.ValType.ToString()); //1 Value Type row.Cells.Add(obs.ValReported); //2 Value } gridObservations.ListGridRows.Add(row); } gridObservations.EndUpdate(); }
private void FormAging_Load(object sender, System.EventArgs e) { _listProviders = Providers.GetListReports(); DateTime lastAgingDate = PrefC.GetDate(PrefName.DateLastAging); if (lastAgingDate.Year < 1880) { textDate.Text = ""; } else if (PrefC.GetBool(PrefName.AgingCalculatedMonthlyInsteadOfDaily)) { textDate.Text = lastAgingDate.ToShortDateString(); } else { textDate.Text = DateTime.Today.ToShortDateString(); } _listBillingTypeDefs = Defs.GetDefsForCategory(DefCat.BillingTypes, true); for (int i = 0; i < _listBillingTypeDefs.Count; i++) { listBillType.Items.Add(_listBillingTypeDefs[i].ItemName); } if (listBillType.Items.Count > 0) { listBillType.SelectedIndex = 0; } listBillType.Visible = false; checkBillTypesAll.Checked = true; for (int i = 0; i < _listProviders.Count; i++) { listProv.Items.Add(_listProviders[i].GetLongDesc()); } if (listProv.Items.Count > 0) { listProv.SelectedIndex = 0; } checkProvAll.Checked = true; listProv.Visible = false; if (!PrefC.HasClinicsEnabled) { listClin.Visible = false; labelClin.Visible = false; checkAllClin.Visible = false; } else { List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser, true, "Unassigned").ToList(); if (!listClinics.Exists(x => x.ClinicNum == Clinics.ClinicNum)) //Could have a hidden clinic selected { listClinics.Add(Clinics.GetClinic(Clinics.ClinicNum)); } foreach (Clinic clin in listClinics) { ODBoxItem <Clinic> boxItemCur; if (clin.IsHidden) { boxItemCur = new ODBoxItem <Clinic>(clin.Abbr + " " + Lan.g(this, "(hidden)"), clin); } else { boxItemCur = new ODBoxItem <Clinic>(clin.Abbr, clin); } listClin.Items.Add(boxItemCur); if (clin.ClinicNum == Clinics.ClinicNum) { listClin.SelectedItem = boxItemCur; } } if (Clinics.ClinicNum == 0) { checkAllClin.Checked = true; listClin.Visible = false; } } checkAgeNegAdjs.Checked = PrefC.GetBool(PrefName.AgingNegativeAdjsByAdjDate); if (PrefC.GetBool(PrefName.AgingReportShowAgePatPayplanPayments)) { //Visibility set to false in designer, only set to visible here. No UI for pref, only set true via query for specific customer. checkAgePatPayPlanPayments.Visible = true; } if (PrefC.GetBool(PrefName.FutureTransDatesAllowed) || PrefC.GetBool(PrefName.AccountAllowFutureDebits) || PrefC.GetBool(PrefName.AllowFutureInsPayments)) { labelFutureTrans.Visible = true; //Set to false in designer } }
private void FormVaccinePatEdit_Load(object sender, EventArgs e) { Patient pat = Patients.GetLim(VaccinePatCur.PatNum); if (pat.Age != 0 && pat.Age < 3) { labelDocument.Text = "Document reason not given below. Reason can include a contraindication due to a specific allergy, adverse effect, intollerance, or specific disease."; //less leeway with reasons for kids. } _listVaccineDefs = VaccineDefs.GetDeepCopy(); comboVaccine.Items.Clear(); for (int i = 0; i < _listVaccineDefs.Count; i++) { comboVaccine.Items.Add(_listVaccineDefs[i].CVXCode + " - " + _listVaccineDefs[i].VaccineName); if (_listVaccineDefs[i].VaccineDefNum == VaccinePatCur.VaccineDefNum) { comboVaccine.SelectedIndex = i; } } if (!IsNew && VaccinePatCur.VaccineDefNum != 0) { VaccineDef vaccineDef = VaccineDefs.GetOne(VaccinePatCur.VaccineDefNum); //Need vaccine to get manufacturer. DrugManufacturer manufacturer = DrugManufacturers.GetOne(vaccineDef.DrugManufacturerNum); textManufacturer.Text = manufacturer.ManufacturerCode + " - " + manufacturer.ManufacturerName; } if (VaccinePatCur.DateTimeStart.Year > 1880) { textDateTimeStart.Text = VaccinePatCur.DateTimeStart.ToString(); } if (VaccinePatCur.DateTimeEnd.Year > 1880) { textDateTimeStop.Text = VaccinePatCur.DateTimeEnd.ToString(); } if (VaccinePatCur.AdministeredAmt != 0) { textAmount.Text = VaccinePatCur.AdministeredAmt.ToString(); } _listDrugUnits = DrugUnits.GetDeepCopy(); comboUnits.Items.Clear(); comboUnits.Items.Add("none"); comboUnits.SelectedIndex = 0; for (int i = 0; i < _listDrugUnits.Count; i++) { comboUnits.Items.Add(_listDrugUnits[i].UnitIdentifier); if (_listDrugUnits[i].DrugUnitNum == VaccinePatCur.DrugUnitNum) { comboUnits.SelectedIndex = i + 1; } } textLotNum.Text = VaccinePatCur.LotNumber; if (VaccinePatCur.DateExpire.Year > 1880) { textDateExpiration.Text = VaccinePatCur.DateExpire.ToShortDateString(); } listRefusalReason.Items.Clear(); string[] arrayVaccineRefusalReasons = Enum.GetNames(typeof(VaccineRefusalReason)); for (int i = 0; i < arrayVaccineRefusalReasons.Length; i++) { listRefusalReason.Items.Add(arrayVaccineRefusalReasons[i]); VaccineRefusalReason refusalReason = (VaccineRefusalReason)i; if (refusalReason == VaccinePatCur.RefusalReason) { listRefusalReason.SelectedIndex = i; } } listCompletionStatus.Items.Clear(); string[] arrayCompletionStatuses = Enum.GetNames(typeof(VaccineCompletionStatus)); for (int i = 0; i < arrayCompletionStatuses.Length; i++) { listCompletionStatus.Items.Add(arrayCompletionStatuses[i]); VaccineCompletionStatus completionStatus = (VaccineCompletionStatus)i; if (completionStatus == VaccinePatCur.CompletionStatus) { listCompletionStatus.SelectedIndex = i; } } textNote.Text = VaccinePatCur.Note; if (IsNew) { if (pat.ClinicNum == 0) { VaccinePatCur.FilledCity = PrefC.GetString(PrefName.PracticeCity); VaccinePatCur.FilledST = PrefC.GetString(PrefName.PracticeST); } else { Clinic clinic = Clinics.GetClinic(pat.ClinicNum); VaccinePatCur.FilledCity = clinic.City; VaccinePatCur.FilledST = clinic.State; } } textFilledCity.Text = VaccinePatCur.FilledCity; textFilledSt.Text = VaccinePatCur.FilledST; if (IsNew) { VaccinePatCur.UserNum = Security.CurUser.UserNum; } Userod user = Userods.GetUser(VaccinePatCur.UserNum); if (user != null) //Will be null for vaccines entered in older versions, before the UserNum column was created. { textUser.Text = user.UserName; } _provNumSelectedOrdering = VaccinePatCur.ProvNumOrdering; comboProvNumOrdering.Items.Clear(); _listProviders = Providers.GetDeepCopy(true); for (int i = 0; i < _listProviders.Count; i++) { comboProvNumOrdering.Items.Add(_listProviders[i].GetLongDesc()); //Only visible provs added to combobox. if (_listProviders[i].ProvNum == VaccinePatCur.ProvNumOrdering) { comboProvNumOrdering.SelectedIndex = i; //Sets combo text too. } } if (comboProvNumOrdering.SelectedIndex == -1) //The provider exists but is hidden { comboProvNumOrdering.Text = Providers.GetLongDesc(_provNumSelectedOrdering); //Appends "(hidden)" to the end of the long description. } _provNumSelectedAdministering = VaccinePatCur.ProvNumAdminister; comboProvNumAdministering.Items.Clear(); for (int i = 0; i < _listProviders.Count; i++) { comboProvNumAdministering.Items.Add(_listProviders[i].GetLongDesc()); //Only visible provs added to combobox. if (_listProviders[i].ProvNum == VaccinePatCur.ProvNumAdminister) { comboProvNumAdministering.SelectedIndex = i; //Sets combo text too. } } if (comboProvNumAdministering.SelectedIndex == -1) //The provider exists but is hidden { comboProvNumAdministering.Text = Providers.GetLongDesc(_provNumSelectedAdministering); //Appends "(hidden)" to the end of the long description. } comboAdministrationRoute.Items.Clear(); string[] arrayVaccineAdministrationRoutes = Enum.GetNames(typeof(VaccineAdministrationRoute)); for (int i = 0; i < arrayVaccineAdministrationRoutes.Length; i++) { comboAdministrationRoute.Items.Add(arrayVaccineAdministrationRoutes[i]); VaccineAdministrationRoute administrationRoute = (VaccineAdministrationRoute)i; if (administrationRoute == VaccinePatCur.AdministrationRoute) { comboAdministrationRoute.SelectedIndex = i; } } comboAdministrationSite.Items.Clear(); string[] arrayVaccineAdministrationSites = Enum.GetNames(typeof(VaccineAdministrationSite)); for (int i = 0; i < arrayVaccineAdministrationSites.Length; i++) { comboAdministrationSite.Items.Add(arrayVaccineAdministrationSites[i]); VaccineAdministrationSite administrationSite = (VaccineAdministrationSite)i; if (administrationSite == VaccinePatCur.AdministrationSite) { comboAdministrationSite.SelectedIndex = i; } } listAdministrationNote.Items.Clear(); string[] arrayAdministrationNotes = Enum.GetNames(typeof(VaccineAdministrationNote)); for (int i = 0; i < arrayAdministrationNotes.Length; i++) { listAdministrationNote.Items.Add(arrayAdministrationNotes[i]); VaccineAdministrationNote administrationNote = (VaccineAdministrationNote)i; if (administrationNote == VaccinePatCur.AdministrationNoteCode) { listAdministrationNote.SelectedIndex = i; } } listAction.Items.Clear(); string[] arrayVaccineActions = Enum.GetNames(typeof(VaccineAction)); for (int i = 0; i < arrayVaccineActions.Length; i++) { listAction.Items.Add(arrayVaccineActions[i]); VaccineAction action = (VaccineAction)i; if (action == VaccinePatCur.ActionCode) { listAction.SelectedIndex = i; } } _listVaccineObservations = VaccineObses.GetForVaccine(VaccinePatCur.VaccinePatNum); FillObservations(); }
private void RxSelected() { if (gridMain.GetSelectedIndex() == -1) { //this should never happen return; } RxDef RxDefCur = (RxDef)gridMain.ListGridRows[gridMain.GetSelectedIndex()].Tag; if (PrefC.GetBool(PrefName.ShowFeatureEhr) && RxDefCur.RxCui == 0) { string strMsgText = Lan.g(this, "The selected prescription is missing an RxNorm") + ".\r\n" + Lan.g(this, "Prescriptions without RxNorms cannot be exported in EHR documents") + ".\r\n"; if (!Security.IsAuthorized(Permissions.RxEdit, true)) { //Show the message but don't allow to edit. Continue creating rx MessageBox.Show(strMsgText); } else if (MessageBox.Show(strMsgText + Lan.g(this, "Edit RxNorm in Rx Template?"), "", MessageBoxButtons.YesNo) == DialogResult.Yes) { FormRxDefEdit form = new FormRxDefEdit(RxDefCur); form.ShowDialog(); RxDefCur = RxDefs.GetOne(RxDefCur.RxDefNum); //FormRxDefEdit does not modify the RxDefCur object, so we must get the updated RxCui from the db. } } if (RxDefCur == null) //Can occur if the RxDef is deleted. Refresh list and fill grid { _arrayRxDefs = RxDefs.Refresh(); FillGrid(); return; } //Alert if (!RxAlertL.DisplayAlerts(PatCur.PatNum, RxDefCur.RxDefNum)) { return; } //User OK with alert RxPat RxPatCur = new RxPat(); RxPatCur.RxDate = DateTime.Today; RxPatCur.PatNum = PatCur.PatNum; RxPatCur.ClinicNum = PatCur.ClinicNum; RxPatCur.Drug = RxDefCur.Drug; RxPatCur.IsControlled = RxDefCur.IsControlled; if (PrefC.GetBool(PrefName.RxHasProc) && (Clinics.ClinicNum == 0 || Clinics.GetClinic(Clinics.ClinicNum).HasProcOnRx)) { RxPatCur.IsProcRequired = RxDefCur.IsProcRequired; } RxPatCur.Sig = RxDefCur.Sig; RxPatCur.Disp = RxDefCur.Disp; RxPatCur.Refills = RxDefCur.Refills; if (PrefC.GetBool(PrefName.RxSendNewToQueue)) { RxPatCur.SendStatus = RxSendStatus.InElectQueue; } else { RxPatCur.SendStatus = RxSendStatus.Unsent; } RxPatCur.PatientInstruction = RxDefCur.PatientInstruction; //Notes not copied: we don't want these kinds of notes cluttering things FormRxEdit FormE = new FormRxEdit(PatCur, RxPatCur); FormE.IsNew = true; FormE.ShowDialog(); if (FormE.DialogResult != DialogResult.OK) { return; } bool isProvOrder = false; if (Security.CurUser.ProvNum != 0) //The user who is currently logged in is a provider. { isProvOrder = true; } _medOrderNum = MedicationPats.InsertOrUpdateMedOrderForRx(RxPatCur, RxDefCur.RxCui, isProvOrder); //RxDefCur.RxCui can be 0. EhrMeasureEvent newMeasureEvent = new EhrMeasureEvent(); newMeasureEvent.DateTEvent = DateTime.Now; newMeasureEvent.EventType = EhrMeasureEventType.CPOE_MedOrdered; newMeasureEvent.PatNum = PatCur.PatNum; newMeasureEvent.MoreInfo = ""; newMeasureEvent.FKey = _medOrderNum; EhrMeasureEvents.Insert(newMeasureEvent); DialogResult = DialogResult.OK; }
///<summary>Gets all claims for the patient selected. Fills gridClaims and tags each row with its corrisponding claim object.</summary> private void FillGridClaims() { int sortByColIdx = gridClaims.SortedByColumnIdx; //Keep previous sorting bool isSortAsc = gridClaims.SortedIsAscending; if (sortByColIdx == -1) { sortByColIdx = 0; isSortAsc = false; } gridClaims.BeginUpdate(); gridClaims.Rows.Clear(); gridClaims.Columns.Clear(); gridClaims.Columns.Add(new UI.ODGridColumn("Date Service", 100, HorizontalAlignment.Center) { SortingStrategy = UI.GridSortingStrategy.DateParse }); gridClaims.Columns.Add(new UI.ODGridColumn("Carrier", 240, HorizontalAlignment.Center) { SortingStrategy = UI.GridSortingStrategy.StringCompare }); gridClaims.Columns.Add(new UI.ODGridColumn("Status", 120, HorizontalAlignment.Center) { SortingStrategy = UI.GridSortingStrategy.StringCompare }); if (!PrefC.GetBool(PrefName.EasyNoClinics)) //Using clinics { gridClaims.Columns.Add(new UI.ODGridColumn("Clinic", 190, HorizontalAlignment.Left) { SortingStrategy = UI.GridSortingStrategy.StringCompare }); } gridClaims.Columns.Add(new UI.ODGridColumn("ClaimFee", 70, HorizontalAlignment.Right) { SortingStrategy = UI.GridSortingStrategy.AmountParse }); List <Claim> listClaims = Claims.Refresh(_patNum); for (int i = 0; i < listClaims.Count; i++) { UI.ODGridRow row = new UI.ODGridRow(); row.Tag = listClaims[i]; row.Cells.Add(listClaims[i].DateService.ToShortDateString()); //DOS row.Cells.Add(Carriers.GetName(InsPlans.RefreshOne(listClaims[i].PlanNum).CarrierNum)); //Carrier row.Cells.Add(Claims.GetClaimStatusString(listClaims[i].ClaimStatus)); //Status if (!PrefC.GetBool(PrefName.EasyNoClinics)) //Using clinics { Clinic clinic = Clinics.GetClinic(listClaims[i].ClinicNum); if (clinic == null) { row.Cells.Add(""); //Clinic } else { row.Cells.Add(clinic.Description); //Clinic } } row.Cells.Add(listClaims[i].ClaimFee.ToString("f")); //Claimfee gridClaims.Rows.Add(row); } gridClaims.EndUpdate(); gridClaims.SortForced(sortByColIdx, isSortAsc); }
/// <summary>May be called from other parts of the program without showing this form. You must still create an instance of this form though. /// Checks CallFire bridge, if it is OK to send a text, etc. (Buttons to load this form are usually disabled if it is not OK, /// but this is needed for Confirmations, Recalls, etc.). CanIncreaseLimit will prompt the user to increase the spending limit if sending the /// text would exceed that limit. Should only be true when this method is called from this form. </summary> public bool SendText(long patNum, string wirelessPhone, string message, YN txtMsgOk, long clinicNum, SmsMessageSource smsMessageSource, bool canIncreaseLimit = false) { if (Plugins.HookMethod(this, "FormTxtMsgEdit.SendText_Start", patNum, wirelessPhone, message, txtMsgOk)) { return(false); } if (Plugins.HookMethod(this, "FormTxtMsgEdit.SendText_Start2", patNum, wirelessPhone, message, txtMsgOk)) { return(true); } if (wirelessPhone == "") { MsgBox.Show(this, "Please enter a phone number."); return(false); } if (SmsPhones.IsIntegratedTextingEnabled()) { if (!PrefC.HasClinicsEnabled && PrefC.GetDateT(PrefName.SmsContractDate).Year < 1880) //Checking for practice (clinics turned off). { MsgBox.Show(this, "Integrated Texting has not been enabled."); return(false); } else if (PrefC.HasClinicsEnabled && !Clinics.IsTextingEnabled(clinicNum)) //Checking for specific clinic. //This is likely to happen a few times per office until they setup texting properly. { if (clinicNum != 0) { MessageBox.Show(Lans.g(this, "Integrated Texting has not been enabled for the following clinic") + ":\r\n" + Clinics.GetClinic(clinicNum).Description + "."); } else { //Should never happen. This message is precautionary. MsgBox.Show(this, "The default texting clinic has not been set."); } return(false); } } else if (!Programs.IsEnabled(ProgramName.CallFire)) { MsgBox.Show(this, "CallFire Program Link must be enabled."); return(false); } if (patNum != 0 && txtMsgOk == YN.Unknown && PrefC.GetBool(PrefName.TextMsgOkStatusTreatAsNo)) { MsgBox.Show(this, "It is not OK to text this patient."); return(false); } if (patNum != 0 && txtMsgOk == YN.No) { MsgBox.Show(this, "It is not OK to text this patient."); return(false); } if (SmsPhones.IsIntegratedTextingEnabled()) { try { SmsToMobiles.SendSmsSingle(patNum, wirelessPhone, message, clinicNum, smsMessageSource, user: Security.CurUser); //Can pass in 0 as PatNum if no patient selected. return(true); } catch (Exception ex) { //ProcessSendSmsException handles the spending limit has been reached error, or returns false if the exception is different. if (!canIncreaseLimit || !FormEServicesSetup.ProcessSendSmsException(ex)) { MsgBox.Show(this, ex.Message); } return(false); } } else { if (message.Length > 160) //only a limitation for CallFire { MsgBox.Show(this, "Text length must be less than 160 characters."); return(false); } return(SendCallFire(patNum, wirelessPhone, message)); //Can pass in 0 as PatNum if no patient selected. } }
///<summary>Fills the big main grid.</summary> private void FillGridMobileAppDevices() { gridMobileAppDevices.BeginUpdate(); //Columns gridMobileAppDevices.ListGridColumns.Clear(); gridMobileAppDevices.AddColumn("Device Name", 0); gridMobileAppDevices.AddColumn("Last Attempt", 0); gridMobileAppDevices.AddColumn("Last Login", 0); if (PrefC.HasClinicsEnabled) { gridMobileAppDevices.AddColumn("Clinic", 0); } gridMobileAppDevices.ListGridColumns.Add(new GridColumn("Enabled", 50, HorizontalAlignment.Center)); if (_eClipboardAllowEdit) { gridMobileAppDevices.ListGridColumns.Add(new GridColumn("Delete", 45, HorizontalAlignment.Center)); } //Rows gridMobileAppDevices.ListGridRows.Clear(); List <MobileAppDevice> listDevicesToShow = MobileAppDevices.GetForUser(Security.CurUser); if (_clinicNumEClipboardTab > 0) { listDevicesToShow.RemoveAll(x => x.ClinicNum != _clinicNumEClipboardTab); } foreach (MobileAppDevice device in listDevicesToShow) { GridRow row = new GridRow(); row.Cells.Add(device.DeviceName + "\r\n(" + device.UniqueID + ")"); row.Cells.Add((device.LastAttempt.Year > 1880 ? device.LastAttempt.ToString() : "")); row.Cells.Add((device.LastLogin.Year > 1880 ? device.LastLogin.ToString() : "")); if (PrefC.HasClinicsEnabled) { row.Cells.Add((device.ClinicNum == 0 ? Clinics.GetPracticeAsClinicZero() : Clinics.GetClinic(device.ClinicNum)).Abbr); } row.Cells.Add((device.IsAllowed ? "X" : "")); if (_eClipboardAllowEdit) { #region Delete click handler void DeleteClick(object sender, EventArgs e) { if (device.PatNum > 0) { MsgBox.Show("A patient is currently using this device. Please clear the patient from the device using the Kiosk Manager" + " or wait until the patient is no longer using the device."); return; } if (!MsgBox.Show(MsgBoxButtons.YesNo, "This will immediately remove the device from the database and all other workstations." + " Continue?")) { return; } MobileAppDevices.Delete(device.MobileAppDeviceNum); FillGridMobileAppDevices(); } #endregion Delete click handler GridCell cell = new GridCell("Delete"); cell.ColorBackG = Color.LightGray; cell.ClickEvent = DeleteClick; row.Cells.Add(cell); } row.Tag = device; gridMobileAppDevices.ListGridRows.Add(row); } gridMobileAppDevices.EndUpdate(); }
///<summary>When viewing an existing message, the "Send" button text will be "Reply" and _webMailMode will be View. Pressing the button will ///reload this form as a reply message. ///When composing a new message or replying to an existing message, the button text will be "Send" and _webMailMode will be ///either Compose or Reply. Pressing the button will cause an attempt to send the secure and insecure message if applicable.</summary> private void butSend_Click(object sender, EventArgs e) { if (_webMailMode == WebMailMode.View) { _webMailMode = WebMailMode.Reply; FillFields(); return; } if (!Security.IsAuthorized(Permissions.WebMailSend)) { return; } VerifyInputs(); if (!VerifyOutputs()) { return; } if (!VerifyFromProvider()) { return; } butSend.Enabled = false; //Insert the message. The patient will not see this as an actual email. //Rather, they must login to the patient portal (secured) and view the message that way. //This is how we get around sending the patient a secure message, which would be a hassle for all involved. _secureMessage = new EmailMessage(); _secureMessage.FromAddress = textFrom.Text; _secureMessage.ToAddress = textTo.Text; _secureMessage.PatNum = _patCur.PatNum; _secureMessage.SentOrReceived = EmailSentOrReceived.WebMailSent; //this is secure so mark as webmail sent _secureMessage.ProvNumWebMail = _provCur.ProvNum; _secureMessage.Subject = textSubject.Text; _secureMessage.BodyText = textBody.Text; _secureMessage.MsgDateTime = DateTime.Now; _secureMessage.PatNumSubj = GetPatNumSubj(); if (_allowSendNotificationMessage) { _insecureMessage = new EmailMessage(); _insecureMessage.FromAddress = _emailAddressSender.SenderAddress; _insecureMessage.ToAddress = _patCur.Email; _insecureMessage.PatNum = _patCur.PatNum; _insecureMessage.Subject = SubjectInsecure; Clinic clinic = Clinics.GetClinic(_patCur.ClinicNum) ?? Clinics.GetPracticeAsClinicZero(); _insecureMessage.BodyText = Clinics.ReplaceOffice(BodyTextInsecure, clinic, isHtmlEmail: true, doReplaceDisclaimer: true); _insecureMessage.SentOrReceived = EmailSentOrReceived.Sent; //this is not secure so just mark as regular sent //Send an insecure notification email to the patient. _insecureMessage.MsgDateTime = DateTime.Now; _insecureMessage.PatNumSubj = GetPatNumSubj(); try { EmailMessages.PrepHtmlEmail(_insecureMessage); EmailMessages.SendEmailUnsecure(_insecureMessage, _emailAddressSender); //Insert the notification email into the emailmessage table so we have a record that it was sent. EmailMessages.Insert(_insecureMessage); } catch (Exception ex) { MessageBox.Show(this, "An error occurred sending the message. Please try again later or contact support."); Logger.openlog.LogMB(this, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message, Logger.Severity.ERROR); butSend.Enabled = true; return; } } _secureMessage.Attachments = _listAttachments; EmailMessages.Insert(_secureMessage); SecurityLogs.MakeLogEntry(Permissions.WebMailSend, 0, Lan.g(this, "Web Mail sent")); MsgBox.Show(this, "Message Sent"); DialogResult = DialogResult.OK; }