private void FillForm() { //this is not refined enough to be called more than once on the form because it will not //remember the toolbars that were selected. ToolButItems.Refresh(); ProgramProperties.Refresh(); textProgName.Text = ProgramCur.ProgName; textProgDesc.Text = ProgramCur.ProgDesc; checkEnabled.Checked = ProgramCur.Enabled; textPath.Text = ProgramCur.Path; textCommandLine.Text = ProgramCur.CommandLine; textNote.Text = ProgramCur.Note; ToolButItems.GetForProgram(ProgramCur.ProgramNum); listToolBars.Items.Clear(); for (int i = 0; i < Enum.GetNames(typeof(ToolBarsAvail)).Length; i++) { listToolBars.Items.Add(Enum.GetNames(typeof(ToolBarsAvail))[i]); } for (int i = 0; i < ToolButItems.ForProgram.Count; i++) { listToolBars.SetSelected((int)((ToolButItem)ToolButItems.ForProgram[i]).ToolBar, true); } if (ToolButItems.ForProgram.Count > 0) //the text on all buttons will be the same for now { textButtonText.Text = ((ToolButItem)ToolButItems.ForProgram[0]).ButtonText; } ProgramPropertiesForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); listProperties.Items.Clear(); for (int i = 0; i < ProgramPropertiesForProgram.Count; i++) { listProperties.Items.Add(((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyDesc + ": " + ((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyValue); } }
private void FormPayConnectSetup_Load(object sender, EventArgs e) { _progCur = Programs.GetCur(ProgramName.PayConnect); if (_progCur == null) { MsgBox.Show(this, "The PayConnect entry is missing from the database."); //should never happen return; } checkEnabled.Checked = _progCur.Enabled; if (!PrefC.HasClinicsEnabled) //clinics are not enabled, use ClinicNum 0 to indicate 'Headquarters' or practice level program properties { checkEnabled.Text = Lan.g(this, "Enabled"); groupPaySettings.Text = Lan.g(this, "Payment Settings"); comboClinic.Visible = false; labelClinic.Visible = false; labelClinicEnable.Visible = false; _listUserClinicNums = new List <long>() { 0 }; //if clinics are disabled, programproperty.ClinicNum will be set to 0 } else //Using clinics { groupPaySettings.Text = Lan.g(this, "Clinic Payment Settings"); _listUserClinicNums = new List <long>(); comboClinic.Items.Clear(); //if PayConnect is enabled and the user is restricted to a clinic, don't allow the user to disable for all clinics if (Security.CurUser.ClinicIsRestricted) { if (checkEnabled.Checked) { checkEnabled.Enabled = false; } } else { comboClinic.Items.Add(Lan.g(this, "Headquarters")); //this way both lists have the same number of items in it and if 'Headquarters' is selected the programproperty.ClinicNum will be set to 0 _listUserClinicNums.Add(0); comboClinic.SelectedIndex = 0; } List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser); for (int i = 0; i < listClinics.Count; i++) { comboClinic.Items.Add(listClinics[i].Abbr); _listUserClinicNums.Add(listClinics[i].ClinicNum); if (Clinics.ClinicNum == listClinics[i].ClinicNum) { comboClinic.SelectedIndex = i; if (!Security.CurUser.ClinicIsRestricted) { comboClinic.SelectedIndex++; //increment the SelectedIndex to account for 'Headquarters' in the list at position 0 if the user is not restricted. } } } _indexClinicRevert = comboClinic.SelectedIndex; } _listProgProps = ProgramProperties.GetForProgram(_progCur.ProgramNum); FillFields(); }
///<summary>Syncs any changes made by the user to the list of Program Properties that indicates this Program Link's button should be hidden ///per clinic. Only syncs changes made to ProgramProperties for clinics the user has access to.</summary> private void SyncHiddenProgramProperties() { //Get the users total list of unrestricted clinics, then acquire their list of ProgramProperties so we can tell which PL buttons //should be hidden based upon the ProgramProperty PropertyDesc indicator. List <Clinic> listUserClinics = Clinics.GetForUserod(Security.CurUser, doIncludeHQ: true, hqClinicName: Lan.g(this, "HQ")); //Get the cached list of button hiding ProgramProperties for clinics this user has access to, i.e. the "Old" list. List <ProgramProperty> listHiddenForUserOld = ProgramProperties.GetForProgram(_progNumCur) .Where(x => x.PropertyDesc == ProgramProperties.PropertyDescs.ClinicHideButton && x.ClinicNum.In(listUserClinics.Select(y => y.ClinicNum))).ToList(); //Compares the old list of ProgramProperties to the new one, if a clinic exists in the old list but not the new list then it was deleted by the //user and we remove it from the db. foreach (ProgramProperty propOld in listHiddenForUserOld) { if (!propOld.ProgramPropertyNum.In(_listProgramPropertiesHiddenClinics.Select(x => x.ProgramPropertyNum))) //Clinic was Removed from List { ProgramProperties.Delete(propOld); //Remove from ProgramProperty } } //Compares the new list of ProgramProperties to the old one, if a clinic exists in the new list but not the old one then it was added by the //user and we should add it to the db. foreach (ProgramProperty propNew in _listProgramPropertiesHiddenClinics) { if (!propNew.ProgramPropertyNum.In(listHiddenForUserOld.Select(x => x.ProgramPropertyNum))) //Clinic was Added to List { ProgramProperties.Insert(propNew); //Insert ProgramProperty } } }
private void FillForm() { ProgramProperties.RefreshCache(); PropertyList = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); textProgName.Text = ProgramCur.ProgName; textProgDesc.Text = ProgramCur.ProgDesc; checkEnabled.Checked = ProgramCur.Enabled; textHL7FolderOut.Text = PrefC.GetString(PrefName.HL7FolderOut); }
private void FillForm(){ ProgramProperties.RefreshCache(); PropertyList=ProgramProperties.GetForProgram(ProgramCur.ProgramNum); textProgName.Text=ProgramCur.ProgName; textProgDesc.Text=ProgramCur.ProgDesc; checkEnabled.Checked=ProgramCur.Enabled; if(GetProp("HideChartRxButtons")=="1") { checkHideButChartRx.Checked=true; } else { checkHideButChartRx.Checked=false; } if(GetProp("ProcRequireSignature")=="1") { checkProcRequireSignature.Checked=true; } else { checkProcRequireSignature.Checked=false; } if(GetProp("ProcNotesNoIncomplete")=="1") { checkProcNotesNoIncomplete.Checked=true; } else { checkProcNotesNoIncomplete.Checked=false; } SetModeRadioButtons(GetProp("eClinicalWorksMode")); SetModeVisibilities(); textECWServer.Text=GetProp("eCWServer");//this property will not exist if using Oracle, eCW will never use Oracle if(HL7Defs.IsExistingHL7Enabled()) { HL7Def def=HL7Defs.GetOneDeepEnabled(); textHL7Server.Text=def.HL7Server; textHL7ServiceName.Text=def.HL7ServiceName; textHL7FolderIn.Text=def.OutgoingFolder;//because these are the opposite of the way they are in the HL7Def textHL7FolderOut.Text=def.IncomingFolder; checkQuadAsToothNum.Checked=def.IsQuadAsToothNum; } else { textHL7Server.Text=GetProp("HL7Server");//this property will not exist if using Oracle, eCW will never use Oracle textHL7ServiceName.Text=GetProp("HL7ServiceName");//this property will not exist if using Oracle, eCW will never use Oracle textHL7FolderIn.Text=PrefC.GetString(PrefName.HL7FolderIn); textHL7FolderOut.Text=PrefC.GetString(PrefName.HL7FolderOut); //if a def is enabled, the value associated with the def will override this setting checkQuadAsToothNum.Checked=GetProp("IsQuadAsToothNum")=="1";//this property will not exist if using Oracle, eCW will never use Oracle } textODServer.Text=MiscData.GetODServer(); comboDefaultUserGroup.Items.Clear(); _listUserGroups=UserGroups.GetList(); for(int i=0;i<_listUserGroups.Count;i++) { comboDefaultUserGroup.Items.Add(_listUserGroups[i].Description); if(GetProp("DefaultUserGroup")==_listUserGroups[i].UserGroupNum.ToString()) { comboDefaultUserGroup.SelectedIndex=i; } } checkShowImages.Checked=GetProp("ShowImagesModule")=="1"; checkFeeSchedules.Checked=GetProp("FeeSchedulesSetManually")=="1"; textMedPanelURL.Text=GetProp("MedicalPanelUrl");//this property will not exist if using Oracle, eCW will never use Oracle checkLBSessionId.Checked=GetProp("IsLBSessionIdExcluded")=="1"; }
private void FillGrid() { List <ProgramProperty> ProgramPropertiesForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); Plugins.HookAddCode(this, "FormProgramLinkEdit.FillGrid_GetProgramProperties", ProgramPropertiesForProgram, ProgramCur); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g(this, "Property"), 260); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Value"), 130); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; foreach (ProgramProperty property in ProgramPropertiesForProgram) { if (property.PropertyDesc.In("Disable Advertising", ProgramProperties.PropertyDescs.ClinicHideButton)) //Don't display in grid { continue; } row = new GridRow(); row.Cells.Add(property.PropertyDesc); if (ProgramCur.ProgName == ProgramName.XVWeb.ToString() && property.PropertyDesc == XVWeb.ProgramProps.Password) { string decrypted; CDT.Class1.Decrypt(property.PropertyValue, out decrypted); row.Cells.Add(new string('*', decrypted.Length)); //Show the password as '*' } else if (ProgramCur.ProgName == ProgramName.XVWeb.ToString() && property.PropertyDesc == XVWeb.ProgramProps.ImageCategory) { Def imageCat = Defs.GetDefsForCategory(DefCat.ImageCats).FirstOrDefault(x => x.DefNum == PIn.Long(property.PropertyValue)); if (imageCat == null) { row.Cells.Add(""); } else if (imageCat.IsHidden) { row.Cells.Add(imageCat.ItemName + " " + Lans.g(this, "(hidden)")); } else { row.Cells.Add(imageCat.ItemName); } } else { row.Cells.Add(property.PropertyValue); } row.Tag = property; gridMain.ListGridRows.Add(row); } gridMain.EndUpdate(); }
private void gridMain_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { FormProgramProperty FormPP = new FormProgramProperty(); FormPP.ProgramPropertyCur = (ProgramProperty)ProgramPropertiesForProgram[e.Row]; FormPP.ShowDialog(); if (FormPP.DialogResult != DialogResult.OK) { return; } ProgramProperties.RefreshCache(); ProgramPropertiesForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); FillGrid(); }
///<summary>If Clinics are enabled, and the Program Link button is hidden for at least one clinic, display the warning label ///labelClinicStateWarning.</summary> private void ShowPLButHiddenLabel() { List <ProgramProperty> listProps = ProgramProperties.GetForProgram(ProgramCur.ProgramNum) .Where(x => x.PropertyDesc == ProgramProperties.PropertyDescs.ClinicHideButton).ToList(); if (PrefC.HasClinicsEnabled && !listProps.IsNullOrEmpty()) //If anything is in list, they have a hidden clinic. { labelClinicStateWarning.Visible = true; } else { labelClinicStateWarning.Visible = false; } }
///<summary>Handles both visibility and checking of checkHideButtons.</summary> private void SetAdvertising() { checkHideButtons.Visible = true; ProgramProperty prop = ProgramProperties.GetForProgram(_progCur.ProgramNum).FirstOrDefault(x => x.PropertyDesc == "Disable Advertising"); if (checkEnabled.Checked || prop == null) { checkHideButtons.Visible = false; } if (prop != null) { checkHideButtons.Checked = (prop.PropertyValue == "1"); } }
private void FormDoseSpotAssignUserId_Load(object sender, EventArgs e) { _listClinicsInComboBox = Clinics.GetForUserod(Security.CurUser, true, "Headquarters"); List <ProgramProperty> listProgramProperties = ProgramProperties.GetForProgram(Programs.GetCur(ProgramName.eRx).ProgramNum); _listClinicIDs = listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicID); _listClinicKeys = listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicKey); _listClinicsInComboBox.RemoveAll(x =>//Remove all clinics that already have a DoseSpot Clinic ID OR Clinic Key entered _listClinicIDs.FindAll(y => !string.IsNullOrWhiteSpace(y.PropertyValue)).Select(y => y.ClinicNum).Contains(x.ClinicNum) || _listClinicKeys.FindAll(y => !string.IsNullOrWhiteSpace(y.PropertyValue)).Select(y => y.ClinicNum).Contains(x.ClinicNum) ); FillComboBox(); textClinicId.Text = _clinicErxCur.ClinicId; //ClinicID passed from Alert textClinicKey.Text = _clinicErxCur.ClinicKey; //ClinicKey passed from Alert textClinicDesc.Text = _clinicErxCur.ClinicDesc; //ClinicDesc passed from Alert }
private void UpsertProgramPropertiesForClinics() { List <ProgramProperty> listLocationIDsFromDb = ProgramProperties.GetForProgram(_progCur.ProgramNum).FindAll(x => x.PropertyDesc == Podium.PropertyDescs.LocationID); List <ProgramProperty> listLocationIDsCur = _dictLocationIDs.Values.ToList(); foreach (ProgramProperty ppCur in listLocationIDsCur) { if (listLocationIDsFromDb.Exists(x => x.ProgramPropertyNum == ppCur.ProgramPropertyNum)) { UpdateProgramProperty(listLocationIDsFromDb[listLocationIDsFromDb.FindIndex(x => x.ProgramPropertyNum == ppCur.ProgramPropertyNum)], ppCur.PropertyValue); //ppCur.PropertyValue will match textLocationID.Text } else { ProgramProperties.Insert(ppCur); //Program property for that clinicnum didn't exist, so insert it into the db. _hasProgramPropertyChanged = true; } } }
private void butClinicLink_Click(object sender, EventArgs e) { //Get the users total list of unrestricted clinics, then acquire their list of ProgramProperties so we can tell which PL buttons //should be hidden based upon ProgramProperty.PropertyDesc/ClinicNum. List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser, doIncludeHQ: true, hqClinicName: Lan.g(this, "HQ")); //Include HQ if user not restricted. //Filter the list of all Hidden button ProgramProperties down to the clinics the user has access to. This will be passed to FormProgramLinkHideClinics. List <ProgramProperty> listPropsForUser = ProgramProperties.GetForProgram(ProgramCur.ProgramNum) .Where(x => x.PropertyDesc == ProgramProperties.PropertyDescs.ClinicHideButton && x.ClinicNum.In(listClinics.Select(y => y.ClinicNum))) .ToList(); FormProgramLinkHideClinics formProgramLinkHideClinics = new FormProgramLinkHideClinics(ProgramCur, listPropsForUser, listClinics); if (formProgramLinkHideClinics.ShowDialog() == DialogResult.OK) { //Ensure other WS update their "hidden by clinic" properties. DataValid.SetInvalid(InvalidType.Programs, InvalidType.ToolBut); } ShowPLButHiddenLabel(); //Set the "Hide Button for Clinics" button based on the updated list. }
private void FormXchargeSetup_Load(object sender, EventArgs e) { prog = Programs.GetCur("Xcharge"); if (prog == null) { return; } checkEnabled.Checked = prog.Enabled; textPath.Text = prog.Path; prop = (ProgramProperty)ProgramProperties.GetForProgram(prog.ProgramNum)[0]; for (int i = 0; i < DefB.Short[(int)DefCat.PaymentTypes].Length; i++) { comboPaymentType.Items.Add(DefB.Short[(int)DefCat.PaymentTypes][i].ItemName); if (DefB.Short[(int)DefCat.PaymentTypes][i].DefNum.ToString() == prop.PropertyValue) { comboPaymentType.SelectedIndex = i; } } }
private void checkHideButtons_CheckedChanged(object sender, EventArgs e) { if (_isLoading) { return; } ProgramProperty property = ProgramProperties.GetForProgram(ProgramCur.ProgramNum).FirstOrDefault(x => x.PropertyDesc == "Disable Advertising"); if (property == null) { return; //should never happen. } if (checkHideButtons.Checked) { property.PropertyValue = "1"; } else { property.PropertyValue = "0"; } ProgramProperties.Update(property); }
private void FillGrid() { ProgramPropertiesForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "Property"), 260); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Value"), 130); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < ProgramPropertiesForProgram.Count; i++) { row = new ODGridRow(); row.Cells.Add(((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyDesc); row.Cells.Add(((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyValue); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
public static void SendData(Program ProgramCur, Patient pat) { if (pat == null) { MsgBox.Show("EvaSoft", "You must select a patient first."); return; } Process[] evaSoftInstances = Process.GetProcessesByName("EvaSoft"); if (evaSoftInstances.Length == 0) { MsgBox.Show("EvaSoft", "EvaSoft is not running. EvaSoft must be running before the bridge will work."); return; } List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); UdpClient udpClient = new UdpClient(); string udpMessage = "REQUEST01123581321~~~0.1b~~~pmaddpatient~~~"; //Patient id can be any string format ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum"); if (PPCur.PropertyValue == "0") { udpMessage += pat.PatNum.ToString(); } else { udpMessage += pat.ChartNumber.Replace(",", "").Trim(); //Remove any commas. Not likely to exist, but just to be safe. } udpMessage += "," + pat.FName.Replace(",", "").Trim(); //Remove commas from data, because they are the separator. udpMessage += "," + pat.LName.Replace(",", "").Trim(); //Remove commas from data, because they are the separator. udpMessage += "," + pat.Birthdate.ToString("MM/dd/yyyy"); udpMessage += "," + ((pat.Gender == PatientGender.Female)?"female":"male"); udpMessage += "," + (pat.Address + " " + pat.Address2).Replace(",", "").Trim(); //Remove commas from data, because they are the separator. udpMessage += "," + pat.City.Replace(",", "").Trim(); //Remove commas from data, because they are the separator. udpMessage += "," + pat.State.Replace(",", "").Trim(); //Remove commas from data, because they are the separator. udpMessage += "," + pat.Zip.Replace(",", "").Trim(); //Remove commas from data, because they are the separator. byte[] udpMessageBytes = Encoding.ASCII.GetBytes(udpMessage); udpClient.Send(udpMessageBytes, udpMessageBytes.Length, "localhost", 35678); }
private void listProperties_DoubleClick(object sender, System.EventArgs e) { if (listProperties.SelectedIndex == -1) { return; } //ProgramProperty ProgramPropertyCur= FormProgramProperty FormPP = new FormProgramProperty(); FormPP.ProgramPropertyCur = (ProgramProperty)ProgramPropertiesForProgram[listProperties.SelectedIndex]; FormPP.ShowDialog(); if (FormPP.DialogResult != DialogResult.OK) { return; } ProgramProperties.Refresh(); ProgramPropertiesForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); listProperties.Items.Clear(); for (int i = 0; i < ProgramPropertiesForProgram.Count; i++) { listProperties.Items.Add(((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyDesc + ": " + ((ProgramProperty)ProgramPropertiesForProgram[i]).PropertyValue); } }
private void FormXDRSetup_Load(object sender, EventArgs e) { if (PrefC.HasClinicsEnabled) //Using clinics { _listUserClinicNums = new List <long>(); comboClinic.Items.Clear(); comboClinic.Items.Add(Lan.g(this, "Headquarters")); //This way both lists have the same number of items in it and if 'Headquarters' is selected the programproperty.ClinicNum will be set to 0 _listUserClinicNums.Add(0); comboClinic.SelectedIndex = 0; _clinicNumCur = 0; List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser); for (int i = 0; i < listClinics.Count; i++) { comboClinic.Items.Add(listClinics[i].Abbr); _listUserClinicNums.Add(listClinics[i].ClinicNum); if (Clinics.ClinicNum == listClinics[i].ClinicNum) { comboClinic.SelectedIndex = i; if (!Security.CurUser.ClinicIsRestricted) { comboClinic.SelectedIndex++; //increment the SelectedIndex to account for 'Headquarters' in the list at position 0 if the user is not restricted. } _clinicNumCur = _listUserClinicNums[comboClinic.SelectedIndex]; } } } else //clinics are not enabled, use ClinicNum 0 to indicate 'Headquarters' or practice level program properties { comboClinic.Visible = false; labelClinic.Visible = false; _listUserClinicNums = new List <long>() { 0 }; //if clinics are disabled, programproperty.ClinicNum will be set to 0 _clinicNumCur = 0; } _progCur = Programs.GetCur(ProgramName.XDR); if (_progCur == null) { MsgBox.Show(this, "The XDR bridge is missing from the database."); //should never happen DialogResult = DialogResult.Cancel; return; } try { long clinicNum = 0; if (comboClinic.SelectedIndex > 0) //0 is always "All" so only check for greater than 0. { clinicNum = _listUserClinicNums[comboClinic.SelectedIndex]; } _listProgramProperties = ProgramProperties.GetListForProgramAndClinicWithDefault(_progCur.ProgramNum, clinicNum); _patNumOrChartNum = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == XDR.PropertyDescs.PatNumOrChartNum); _infoFilePath = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == XDR.PropertyDescs.InfoFilePath); List <ProgramProperty> listLocationIDs = ProgramProperties.GetForProgram(_progCur.ProgramNum).FindAll(x => x.PropertyDesc == XDR.PropertyDescs.LocationID); _dictLocationIDs.Clear(); //If clinics is off, this will only grab the program property with a 0 clinicNum (_listUserClinicNums will only have 0). foreach (ProgramProperty ppCur in listLocationIDs) { if (_dictLocationIDs.ContainsKey(ppCur.ClinicNum) || !_listUserClinicNums.Contains(ppCur.ClinicNum)) { continue; } _dictLocationIDs.Add(ppCur.ClinicNum, ppCur); } } catch (Exception ex) { ex.DoNothing(); MsgBox.Show(this, "You are missing a program property for XDR. Please contact support to resolve this issue."); DialogResult = DialogResult.Cancel; return; } FillForm(); }
private List <CreditCard> FilterCardList() { int verified = 0; int invalid = 0; textVerified.Text = verified.ToString(); textInvalid.Text = invalid.ToString(); for (int i = CardList.Count - 1; i >= 0; i--) { Program prog = Programs.GetCur(ProgramName.Xcharge); string path = Programs.GetProgramPath(prog); ProgramProperty prop = (ProgramProperty)ProgramProperties.GetForProgram(prog.ProgramNum)[0]; ProcessStartInfo info = new ProcessStartInfo(path); string resultfile = Path.Combine(Path.GetDirectoryName(path), "XResult.txt"); File.Delete(resultfile); //delete the old result file. info.Arguments += "/TRANSACTIONTYPE:ARCHIVEVAULTQUERY "; info.Arguments += "/XCACCOUNTID:" + CardList[i].XChargeToken + " "; info.Arguments += "/RESULTFILE:\"" + resultfile + "\" "; info.Arguments += "/USERID:" + ProgramProperties.GetPropVal(prog.ProgramNum, "Username") + " "; info.Arguments += "/PASSWORD:"******"Password") + " "; info.Arguments += "/AUTOPROCESS "; info.Arguments += "/AUTOCLOSE "; info.Arguments += "/NORESULTDIALOG "; Process process = new Process(); process.StartInfo = info; process.EnableRaisingEvents = true; process.Start(); while (!process.HasExited) { Application.DoEvents(); } Thread.Sleep(200); //Wait 2/10 second to give time for file to be created. string resulttext = ""; string line = ""; string account = ""; string exp = ""; using (TextReader reader = new StreamReader(resultfile)) { line = reader.ReadLine(); while (line != null) { if (resulttext != "") { resulttext += "\r\n"; } resulttext += line; if (line.StartsWith("ACCOUNT=")) { account = line.Substring(8); } else if (line.StartsWith("EXPIRATION=")) { exp = line.Substring(11); } line = reader.ReadLine(); } if (CardList[i].CCNumberMasked.Length > 4 && account.Length > 4 && CardList[i].CCNumberMasked.Substring(CardList[i].CCNumberMasked.Length - 4) == account.Substring(account.Length - 4) && CardList[i].CCExpiration.ToString("MMyy") == exp) { //The credit card on file matches the one in X-Charge, so remove from the list. CardList.Remove(CardList[i]); verified++; } else { invalid++; } } textVerified.Text = verified.ToString(); textInvalid.Text = invalid.ToString(); } return(CardList); }
private void FormErxSetup_Load(object sender, EventArgs e) { try { _progCur = Programs.GetCur(ProgramName.eRx); if (_progCur == null) { throw new Exception("The eRx bridge is missing from the database."); } _listProgramProperties = ProgramProperties.GetForProgram(_progCur.ProgramNum); checkEnabled.Checked = _progCur.Enabled; _eRxOption = PIn.Enum <ErxOption>(ErxOptionPP.PropertyValue); if (_eRxOption == ErxOption.Legacy) { radioNewCrop.Checked = true; } else if (_eRxOption == ErxOption.DoseSpot) { radioDoseSpot.Checked = true; //HideLegacy(); } else if (_eRxOption == ErxOption.DoseSpotWithLegacy) { radioDoseSpotLegacy.Checked = true; //HideLegacy(); } textNewCropAccountID.Text = PrefC.GetString(PrefName.NewCropAccountId); List <ProgramProperty> listClinicIDs = _listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicID); List <ProgramProperty> listClinicKeys = _listProgramProperties.FindAll(x => x.PropertyDesc == Erx.PropertyDescs.ClinicKey); //Always make sure clinicnum 0 (HQ) exists, regardless of if clinics are enabled if (!listClinicIDs.Exists(x => x.ClinicNum == 0)) { ProgramProperty ppClinicID = new ProgramProperty(); ppClinicID.ProgramNum = _progCur.ProgramNum; ppClinicID.ClinicNum = 0; ppClinicID.PropertyDesc = Erx.PropertyDescs.ClinicID; ppClinicID.PropertyValue = ""; _listProgramProperties.Add(ppClinicID); } if (!listClinicKeys.Exists(x => x.ClinicNum == 0)) { ProgramProperty ppClinicKey = new ProgramProperty(); ppClinicKey.ProgramNum = _progCur.ProgramNum; ppClinicKey.ClinicNum = 0; ppClinicKey.PropertyDesc = Erx.PropertyDescs.ClinicKey; ppClinicKey.PropertyValue = ""; _listProgramProperties.Add(ppClinicKey); } if (PrefC.HasClinicsEnabled) { foreach (Clinic clinicCur in Clinics.GetAllForUserod(Security.CurUser)) { if (!listClinicIDs.Exists(x => x.ClinicNum == clinicCur.ClinicNum)) //Only add a program property if it doesn't already exist. { ProgramProperty ppClinicID = new ProgramProperty(); ppClinicID.ProgramNum = _progCur.ProgramNum; ppClinicID.ClinicNum = clinicCur.ClinicNum; ppClinicID.PropertyDesc = Erx.PropertyDescs.ClinicID; ppClinicID.PropertyValue = ""; _listProgramProperties.Add(ppClinicID); } if (!listClinicKeys.Exists(x => x.ClinicNum == clinicCur.ClinicNum)) //Only add a program property if it doesn't already exist. { ProgramProperty ppClinicKey = new ProgramProperty(); ppClinicKey.ProgramNum = _progCur.ProgramNum; ppClinicKey.ClinicNum = clinicCur.ClinicNum; ppClinicKey.PropertyDesc = Erx.PropertyDescs.ClinicKey; ppClinicKey.PropertyValue = ""; _listProgramProperties.Add(ppClinicKey); } } } else { checkShowHiddenClinics.Visible = false; } FillGridDoseSpot(); SetRadioButtonChecked(_eRxOption); } catch (Exception ex) { MessageBox.Show(Lan.g(this, "Error loading the eRx program: ") + ex.Message); DialogResult = DialogResult.Cancel; return; } }
private void butOK_Click(object sender, EventArgs e) { if (!VerifyData()) { return; } CreditCardCur.Address = textAddress.Text; CreditCardCur.CCNumberMasked = textCardNumber.Text; CreditCardCur.PatNum = PatCur.PatNum; CreditCardCur.Zip = textZip.Text; if (IsXCharge) //Only update recurring if using X-Charge. { CreditCardCur.ChargeAmt = PIn.Double(textChargeAmt.Text); CreditCardCur.DateStart = PIn.Date(textDateStart.Text); CreditCardCur.DateStop = PIn.Date(textDateStop.Text); CreditCardCur.Note = textNote.Text; if (comboPaymentPlans.SelectedIndex > 0) { CreditCardCur.PayPlanNum = PayPlanList[comboPaymentPlans.SelectedIndex - 1].PayPlanNum; } else { CreditCardCur.PayPlanNum = 0; //Allows users to change from a recurring payplan charge to a normal one. } } if (CreditCardCur.IsNew) { List <CreditCard> itemOrderCount = CreditCards.Refresh(PatCur.PatNum); CreditCardCur.ItemOrder = itemOrderCount.Count; CreditCards.Insert(CreditCardCur); } else { #region X-Charge //Special logic for had a token and changed number or expiration date if (CreditCardCur.XChargeToken != "" && IsXCharge && (CreditCardOld.CCNumberMasked != CreditCardCur.CCNumberMasked || CreditCardOld.CCExpiration != CreditCardCur.CCExpiration)) { Program prog = Programs.GetCur(ProgramName.Xcharge); if (prog == null) { MsgBox.Show(this, "X-Charge entry is missing from the database."); //should never happen return; } if (!prog.Enabled) { if (Security.IsAuthorized(Permissions.Setup)) { FormXchargeSetup FormX = new FormXchargeSetup(); FormX.ShowDialog(); } return; } if (!File.Exists(prog.Path)) { MsgBox.Show(this, "Path is not valid."); if (Security.IsAuthorized(Permissions.Setup)) { FormXchargeSetup FormX = new FormXchargeSetup(); FormX.ShowDialog(); } return; } //Either update the exp date or update credit card number by deleting archive so new token can be created next time it's used. ProgramProperty prop = (ProgramProperty)ProgramProperties.GetForProgram(prog.ProgramNum)[0]; ProcessStartInfo info = new ProcessStartInfo(prog.Path); string resultfile = Path.Combine(Path.GetDirectoryName(prog.Path), "XResult.txt"); File.Delete(resultfile); //delete the old result file. if (CreditCardOld.CCNumberMasked != CreditCardCur.CCNumberMasked) //They changed card number which we have to delete archived token which will create a new one next time card is charged. { info.Arguments += "/TRANSACTIONTYPE:ARCHIVEVAULTDELETE "; info.Arguments += "/XCACCOUNTID:" + CreditCardCur.XChargeToken + " "; info.Arguments += "/RESULTFILE:\"" + resultfile + "\" "; info.Arguments += "/USERID:" + ProgramProperties.GetPropVal(prog.ProgramNum, "Username") + " "; info.Arguments += "/PASSWORD:"******"Password") + " "; info.Arguments += "/AUTOPROCESS "; info.Arguments += "/AUTOCLOSE "; CreditCardCur.XChargeToken = ""; //Clear the XChargeToken in our db. } else //We can only change exp date for X-Charge via ARCHIVEAULTUPDATE. { info.Arguments += "/TRANSACTIONTYPE:ARCHIVEVAULTUPDATE "; info.Arguments += "/XCACCOUNTID:" + CreditCardCur.XChargeToken + " "; if (CreditCardCur.CCExpiration != null && CreditCardCur.CCExpiration.Year > 2005) { info.Arguments += "/EXP:" + CreditCardCur.CCExpiration.ToString("MMyy") + " "; } info.Arguments += "/RESULTFILE:\"" + resultfile + "\" "; info.Arguments += "/USERID:" + ProgramProperties.GetPropVal(prog.ProgramNum, "Username") + " "; info.Arguments += "/PASSWORD:"******"Password") + " "; info.Arguments += "/AUTOPROCESS "; info.Arguments += "/AUTOCLOSE "; } Cursor = Cursors.WaitCursor; Process process = new Process(); process.StartInfo = info; process.EnableRaisingEvents = true; process.Start(); while (!process.HasExited) { Application.DoEvents(); } Thread.Sleep(200); //Wait 2/10 second to give time for file to be created. Cursor = Cursors.Default; string resulttext = ""; string line = ""; using (TextReader reader = new StreamReader(resultfile)) { line = reader.ReadLine(); while (line != null) { if (resulttext != "") { resulttext += "\r\n"; } resulttext += line; if (line.StartsWith("RESULT=")) { if (line != "RESULT=SUCCESS") { CreditCardCur = CreditCards.GetOne(CreditCardCur.CreditCardNum); FillData(); return; } } line = reader.ReadLine(); } } } //End of special token logic #endregion CreditCards.Update(CreditCardCur); } DialogResult = DialogResult.OK; }
private void butClose_Click(object sender, EventArgs e) { if (textSubInterval.errorProvider1.GetError(textSubInterval) != "") { MsgBox.Show(this, "Please fix data entry errors first."); return; } bool changed = false; foreach (APIKey apiKeyHQ in _listApiKeysHQ) { APIKey apiKeyLocal = _listApiKeysLocal.FirstOrDefault(x => x.Key == apiKeyHQ.Key); if (apiKeyLocal == null || //A new key was generated but then Cancel was clicked on FormFHIRAPIKeyEdit. apiKeyLocal.DeveloperName != apiKeyHQ.DeveloperName || apiKeyLocal.DeveloperEmail != apiKeyHQ.DeveloperEmail || apiKeyLocal.DeveloperPhone != apiKeyHQ.DeveloperPhone || apiKeyLocal.ListPermissions.Any(x => !apiKeyHQ.ListPermissions.Contains(x)) || apiKeyHQ.ListPermissions.Any(x => !apiKeyLocal.ListPermissions.Contains(x))) { changed = true; break; } } if (changed && !UpdateKeysForOffice(_listApiKeysLocal)) { return; } Program prog = Programs.GetCur(ProgramName.FHIR); prog.Enabled = checkEnabled.Checked; Programs.Update(prog); ProgramProperty progProp = ProgramProperties.GetPropByDesc("SubscriptionProcessingFrequency", ProgramProperties.GetForProgram(prog.ProgramNum)); ProgramProperties.UpdateProgramPropertyWithValue(progProp, textSubInterval.Text); DataValid.SetInvalid(InvalidType.Programs); Close(); }
private void FormPodiumSetup_Load(object sender, EventArgs e) { if (PrefC.HasClinicsEnabled) //Using clinics { _listUserClinicNums = new List <long>(); comboClinic.Items.Clear(); if (Security.CurUser.ClinicIsRestricted) { if (checkEnabled.Checked) { checkEnabled.Enabled = false; _clinicNumCur = 0; } } else { comboClinic.Items.Add(Lan.g(this, "Headquarters")); //this way both lists have the same number of items in it and if 'Headquarters' is selected the programproperty.ClinicNum will be set to 0 _listUserClinicNums.Add(0); comboClinic.SelectedIndex = 0; _clinicNumCur = 0; } List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser); for (int i = 0; i < listClinics.Count; i++) { comboClinic.Items.Add(listClinics[i].Abbr); _listUserClinicNums.Add(listClinics[i].ClinicNum); if (Clinics.ClinicNum == listClinics[i].ClinicNum) { comboClinic.SelectedIndex = i; if (!Security.CurUser.ClinicIsRestricted) { comboClinic.SelectedIndex++; //increment the SelectedIndex to account for 'Headquarters' in the list at position 0 if the user is not restricted. } _clinicNumCur = _listUserClinicNums[comboClinic.SelectedIndex]; } } } else //clinics are not enabled, use ClinicNum 0 to indicate 'Headquarters' or practice level program properties { comboClinic.Visible = false; labelClinic.Visible = false; _listUserClinicNums = new List <long>() { 0 }; //if clinics are disabled, programproperty.ClinicNum will be set to 0 _clinicNumCur = 0; } _progCur = Programs.GetCur(ProgramName.Podium); if (_progCur == null) { MsgBox.Show(this, "The Podium bridge is missing from the database."); //should never happen DialogResult = DialogResult.Cancel; return; } try { long clinicNum = 0; if (comboClinic.SelectedIndex > 0) //0 is always "All" so only check for greater than 0. { clinicNum = _listUserClinicNums[comboClinic.SelectedIndex]; } _listProgramProperties = ProgramProperties.GetListForProgramAndClinicWithDefault(_progCur.ProgramNum, clinicNum); _useService = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.UseService); _disableAdvertising = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.DisableAdvertising); _apptSetCompleteMins = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.ApptSetCompletedMinutes); _apptTimeArrivedMins = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.ApptTimeArrivedMinutes); _apptTimeDismissedMins = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.ApptTimeDismissedMinutes); _compName = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.ComputerNameOrIP); _apiToken = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.APIToken); List <ProgramProperty> listLocationIDs = ProgramProperties.GetForProgram(_progCur.ProgramNum).FindAll(x => x.PropertyDesc == Podium.PropertyDescs.LocationID); _dictLocationIDs.Clear(); foreach (ProgramProperty ppCur in listLocationIDs) //If clinics is off, this will only grab the program property with a 0 clinic num (_listUserClinicNums will only have 0). { if (_dictLocationIDs.ContainsKey(ppCur.ClinicNum) || !_listUserClinicNums.Contains(ppCur.ClinicNum)) { continue; } _dictLocationIDs.Add(ppCur.ClinicNum, ppCur); } _newPatTriggerType = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.NewPatientTriggerType); _existingPatTriggerType = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.ExistingPatientTriggerType); _showCommlogsInChartAndAccount = _listProgramProperties.FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.ShowCommlogsInChartAndAccount); } catch (Exception) { MsgBox.Show(this, "You are missing a program property for Podium. Please contact support to resolve this issue."); DialogResult = DialogResult.Cancel; return; } FillForm(); SetAdvertising(); }
private void FormTransworldSetup_Load(object sender, EventArgs e) { _progCur = Programs.GetCur(ProgramName.Transworld); if (_progCur == null) { MsgBox.Show(this, "The Transworld entry is missing from the database. Please contact support."); //should never happen return; } checkEnabled.Checked = _progCur.Enabled; if (!PrefC.HasClinicsEnabled) //clinics are not enabled, use ClinicNum 0 to indicate 'Headquarters' or practice level program properties { checkEnabled.Text = Lan.g(this, "Enabled"); groupClinicSettings.Text = Lan.g(this, "Transworld Settings"); comboClinic.Visible = false; labelClinic.Visible = false; labelClinicEnable.Visible = false; _listUserClinicNums = new List <long>() { 0 }; //if clinics are disabled, programproperty.ClinicNum will be set to 0 groupSendActivity.Text = Lan.g(this, "Account Activity Updates"); //remove '(affects all clinics)' from text _selectedClinicNum = 0; } else //Using clinics { groupClinicSettings.Text = Lan.g(this, "Transworld Clinic Settings"); _listUserClinicNums = new List <long>(); //if Transworld is enabled and the user is restricted to a clinic, don't allow the user to disable for all clinics if (Security.CurUser.ClinicIsRestricted) { if (checkEnabled.Checked) { checkEnabled.Enabled = false; } } else { comboClinic.Items.Add(Lan.g(this, "Headquarters")); //this way both lists have the same number of items in it and if 'Headquarters' is selected the programproperty.ClinicNum will be set to 0 _listUserClinicNums.Add(0); comboClinic.SelectedIndex = 0; } List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser); foreach (Clinic clinicCur in listClinics) { comboClinic.Items.Add(clinicCur.Abbr); _listUserClinicNums.Add(clinicCur.ClinicNum); if (Clinics.ClinicNum == clinicCur.ClinicNum) //set selected index to the currently selected clinic in FormOpenDental { _selectedClinicNum = clinicCur.ClinicNum; comboClinic.SelectedIndex = comboClinic.Items.Count - 1; } } } _dictClinicListProgProps = ProgramProperties.GetForProgram(_progCur.ProgramNum) //get list of all props for the program .GroupBy(x => x.ClinicNum) //group each clinic .ToDictionary(x => x.Key, x => x.ToList()); //turn list into a dictionary of key=ClinicNum, value=List<ProgramProperty> for the clinic DateTime dateTSend = PrefC.GetDateT(PrefName.TransworldServiceTimeDue); if (dateTSend != DateTime.MinValue) { textUpdatesTimeOfDay.Text = dateTSend.ToShortTimeString(); } comboSendFrequencyUnits.Items.AddRange(Enum.GetNames(typeof(FrequencyUnit))); string[] sendFreqStrs = PrefC.GetString(PrefName.TransworldServiceSendFrequency).Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (sendFreqStrs.Length == 2) { int sendFreq = PIn.Int(sendFreqStrs[0], false); FrequencyUnit sendFreqUnit; if (sendFreq > 0 && Enum.TryParse(sendFreqStrs[1], out sendFreqUnit)) { numericSendFrequency.Value = sendFreq; comboSendFrequencyUnits.SelectedIndex = (int)sendFreqUnit; } } else //if not set, default to repeat once a day { comboSendFrequencyUnits.SelectedIndex = (int)FrequencyUnit.Days; numericSendFrequency.Value = 1; } FillComboBoxes(); FillFields(); }
private void butOK_Click(object sender, System.EventArgs e) { if (textDateFrom.errorProvider1.GetError(textDateFrom) != "" || textDateTo.errorProvider1.GetError(textDateTo) != "" ) { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } DateTime FromDate; DateTime ToDate; if (textDateFrom.Text == "") { MessageBox.Show(Lan.g(this, "From Date cannot be left blank.")); return; } FromDate = PIn.PDate(textDateFrom.Text); if (textDateTo.Text == "") { ToDate = DateTime.MaxValue.AddDays(-1); } else { ToDate = PIn.PDate(textDateTo.Text); } //Create the file and first row-------------------------------------------------------- ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Export Path"); string fileName = PPCur.PropertyValue + "Appt.txt"; if (!Directory.Exists(PPCur.PropertyValue)) { Directory.CreateDirectory(PPCur.PropertyValue); } StreamWriter sr = File.CreateText(fileName); sr.WriteLine("\"LastName\",\"FirstName\",\"PatientNumber\",\"HomePhone\",\"WorkNumber\"," + "\"EmailAddress\",\"SendEmail\",\"Address\",\"Address2\",\"City\",\"State\",\"Zip\"," + "\"ApptDate\",\"ApptTime\",\"ApptReason\",\"DoctorNumber\",\"DoctorName\",\"IsNewPatient\""); //now, the query-------------------------------------------------------------------------- //Appointment Reminder Fields- numbers are as they come back from db----------------------- //0-LastName //1-FirstName (or we substitute 2-Preferred Name if exists) // PatientNumber (Can be 3-PatNum or 4-ChartNumber, depending on what user selected) //5-HomePhone //6-WorkNumber //7-EmailAddress // SendEmail (this will be true if email address exists. Might change later) //8-Address //9-Address2 (although they did not offer this as an option) //10-City //11-State //12-Zip //13-ApptDate //13-ApptTime //14-ApptReason (procedures descriptions-user can't edit) //15-DoctorNumber (for the Doctor, we currently use the patient primary provider. Otherwise, we would run into trouble with appointments assigned to a specific hygienist.) //15-DoctorName //16-IsNewPatient string command = @"SELECT patient.LName,patient.FName,patient.Preferred ,patient.PatNum,patient.ChartNumber,patient.HmPhone,patient.WkPhone ,patient.Email,patient.Address,patient.Address2,patient.City,patient.State ,patient.Zip ,appointment.AptDateTime,appointment.ProcDescript ,patient.PriProv ,appointment.IsNewPatient FROM patient,appointment WHERE patient.PatNum=appointment.PatNum " + "AND (appointment.AptStatus=1 OR appointment.AptStatus=4) " //sched or ASAP + "AND appointment.AptDateTime > " + POut.PDate(FromDate) //> midnight + " AND appointment.AptDateTime < " + POut.PDate(ToDate.AddDays(1)); //< midnight DataTable table = General.GetTable(command); bool usePatNum = false; PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; if (PPCur.PropertyValue == "0") { usePatNum = true; } DateTime aptDT; for (int i = 0; i < table.Rows.Count; i++) { sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][0].ToString())) + "\","); //0-LastName if (table.Rows[i][2].ToString() != "") //if Preferred Name exists { sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][2].ToString())) + "\","); //2-PrefName } else { sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][1].ToString())) + "\","); //1-FirstName } if (usePatNum) { sr.Write("\"" + table.Rows[i][3].ToString() + "\","); //3-PatNum } else { sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][4].ToString())) + "\","); //4-ChartNumber } sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][5].ToString())) + "\","); //5-HomePhone sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][6].ToString())) + "\","); //6-WorkNumber sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][7].ToString())) + "\","); //7-EmailAddress if (table.Rows[i][7].ToString() != "") //if an email exists { sr.Write("\"T\","); //SendEmail } else { sr.Write("\"F\","); } sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][8].ToString())) + "\","); //8-Address sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][9].ToString())) + "\","); //9-Address2 sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][10].ToString())) + "\","); //10-City sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][11].ToString())) + "\","); //11-State sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][12].ToString())) + "\","); //12-Zip aptDT = PIn.PDateT(table.Rows[i][13].ToString()); sr.Write("\"" + aptDT.ToString("MM/dd/yyyy") + "\","); //13-ApptDate sr.Write("\"" + aptDT.ToString("hh:mm tt") + "\","); //13-ApptTime eg 01:30 PM sr.Write("\"" + Dequote(PIn.PString(table.Rows[i][14].ToString())) + "\","); //14-ApptReason sr.Write("\"" + table.Rows[i][15].ToString() + "\","); //15-DoctorNumber. might possibly be 0 //15-DoctorName. Can handle 0 without any problem. sr.Write("\"" + Dequote(Providers.GetLName(PIn.PInt(table.Rows[i][15].ToString()))) + "\","); if (table.Rows[i][16].ToString() == "1") //16-IsNewPatient { sr.WriteLine("\"T\""); //SendEmail } else { sr.WriteLine("\"F\""); } } sr.Close(); MessageBox.Show("Done"); DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, System.EventArgs e) { if (textDateFrom.errorProvider1.GetError(textDateFrom) != "" || textDateTo.errorProvider1.GetError(textDateTo) != "" ) { MessageBox.Show(Lan.g(this, "Please fix data entry errors first.")); return; } DateTime FromDate; DateTime ToDate; if (textDateFrom.Text == "") { MessageBox.Show(Lan.g(this, "From Date cannot be left blank.")); return; } FromDate = PIn.Date(textDateFrom.Text); if (textDateTo.Text == "") { ToDate = DateTime.MaxValue.AddDays(-1); } else { ToDate = PIn.Date(textDateTo.Text); } //Create the file and first row-------------------------------------------------------- List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Export Path"); string fileName = PPCur.PropertyValue + "Appt.txt"; if (!Directory.Exists(PPCur.PropertyValue)) { Directory.CreateDirectory(PPCur.PropertyValue); } StreamWriter sr = File.CreateText(fileName); sr.WriteLine("\"LastName\",\"FirstName\",\"PatientNumber\",\"HomePhone\",\"WorkNumber\"," + "\"EmailAddress\",\"SendEmail\",\"Address\",\"Address2\",\"City\",\"State\",\"Zip\"," + "\"ApptDate\",\"ApptTime\",\"ApptReason\",\"DoctorNumber\",\"DoctorName\",\"IsNewPatient\",\"WirelessPhone\""); DataTable table = HouseCallsQueries.GetHouseCalls(FromDate, ToDate); bool usePatNum = false; PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; if (PPCur.PropertyValue == "0") { usePatNum = true; } DateTime aptDT; for (int i = 0; i < table.Rows.Count; i++) { sr.Write("\"" + Dequote(PIn.String(table.Rows[i][0].ToString())) + "\","); //0-LastName if (table.Rows[i][2].ToString() != "") //if Preferred Name exists { sr.Write("\"" + Dequote(PIn.String(table.Rows[i][2].ToString())) + "\","); //2-PrefName } else { sr.Write("\"" + Dequote(PIn.String(table.Rows[i][1].ToString())) + "\","); //1-FirstName } if (usePatNum) { sr.Write("\"" + table.Rows[i][3].ToString() + "\","); //3-PatNum } else { sr.Write("\"" + Dequote(PIn.String(table.Rows[i][4].ToString())) + "\","); //4-ChartNumber } sr.Write("\"" + Dequote(PIn.String(table.Rows[i][5].ToString())) + "\","); //5-HomePhone sr.Write("\"" + Dequote(PIn.String(table.Rows[i][6].ToString())) + "\","); //6-WorkNumber sr.Write("\"" + Dequote(PIn.String(table.Rows[i][7].ToString())) + "\","); //7-EmailAddress if (table.Rows[i][7].ToString() != "") //if an email exists { sr.Write("\"T\","); //SendEmail } else { sr.Write("\"F\","); } sr.Write("\"" + Dequote(PIn.String(table.Rows[i][8].ToString())) + "\","); //8-Address sr.Write("\"" + Dequote(PIn.String(table.Rows[i][9].ToString())) + "\","); //9-Address2 sr.Write("\"" + Dequote(PIn.String(table.Rows[i][10].ToString())) + "\","); //10-City sr.Write("\"" + Dequote(PIn.String(table.Rows[i][11].ToString())) + "\","); //11-State sr.Write("\"" + Dequote(PIn.String(table.Rows[i][12].ToString())) + "\","); //12-Zip aptDT = PIn.DateT(table.Rows[i][13].ToString()); sr.Write("\"" + aptDT.ToString("MM/dd/yyyy") + "\","); //13-ApptDate sr.Write("\"" + aptDT.ToString("hh:mm tt") + "\","); //13-ApptTime eg 01:30 PM sr.Write("\"" + Dequote(PIn.String(table.Rows[i][14].ToString())) + "\","); //14-ApptReason sr.Write("\"" + table.Rows[i][15].ToString() + "\","); //15-DoctorNumber. might possibly be 0 //15-DoctorName. Can handle 0 without any problem. sr.Write("\"" + Dequote(Providers.GetLName(PIn.Long(table.Rows[i][15].ToString()))) + "\","); if (table.Rows[i][16].ToString() == "1") //16-IsNewPatient { sr.Write("\"T\","); //SendEmail } else { sr.Write("\"F\","); } sr.Write("\"" + Dequote(PIn.String(table.Rows[i][17].ToString())) + "\""); //17-WirelessPhone sr.WriteLine(); //Must be last. } sr.Close(); MessageBox.Show("Done"); DialogResult = DialogResult.OK; }
private void butClose_Click(object sender, EventArgs e) { if (!textSubInterval.IsValid) { MsgBox.Show(this, "Please fix data entry errors first."); return; } if (comboPayType.SelectedIndex < 0) { MsgBox.Show(this, "Please select a payment type."); return; } Program prog = Programs.GetCur(ProgramName.FHIR); prog.Enabled = checkEnabled.Checked; Programs.Update(prog); ProgramProperty progProp = ProgramProperties.GetPropByDesc("SubscriptionProcessingFrequency", ProgramProperties.GetForProgram(prog.ProgramNum)); ProgramProperties.UpdateProgramPropertyWithValue(progProp, textSubInterval.Text); DataValid.SetInvalid(InvalidType.Programs); if (Prefs.UpdateLong(PrefName.ApiPaymentType, comboPayType.GetSelectedDefNum())) { DataValid.SetInvalid(InvalidType.Prefs); } Close(); }