///<summary>Opens the appropriate form to edit the program property.</summary> private void PropertyTypeDirector(ProgramProperty prop) { if (ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.ImageCategory) //imageCategory { List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ImageCats, true); int idxDef = listDefs.FindIndex(x => x.DefNum == PIn.Long(prop.PropertyValue)); InputBox inputBox = new InputBox("Choose an Image Category", listDefs.Select(x => x.ItemName).ToList(), idxDef); inputBox.ShowDialog(); if (inputBox.DialogResult != DialogResult.OK || inputBox.SelectedIndex == -1) { return; } prop.PropertyValue = POut.Long(listDefs[inputBox.SelectedIndex].DefNum); ProgramProperties.Update(prop); } else { bool propIsPassword = ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.Password; FormProgramProperty FormPP = new FormProgramProperty(propIsPassword); FormPP.ProgramPropertyCur = prop; FormPP.ShowDialog(); if (FormPP.DialogResult != DialogResult.OK) { return; } } ProgramProperties.RefreshCache(); FillGrid(); }
/*string InvalidCommandLine="999"; * string GeneralError="998"; * string NoConnect="997"; * string PatientNotFound="989"; * string ManyPatientFound="988"; * string PatientLocked="987"; * string ImageNotFound="979"; * string FileError="969"; * string OpenManyFoundOK="1"; * string OpenManyFoundCancel="2"; * string CreatePatientExist="11"; * string ChangePatientExist="21"; * string Successful="0";*/ ///<summary>We will use the clipboard interface, although there is an ole automation interface available.</summary> //Command format: $$DFWIN$$ <Command> <Options> //Return value: $$DFWOUT$$<Return value>[\nReturn string] (we will ignore this value for now) //$$DFWIN$$ OPEN -n"LName, FName" -c"PatNum" -r -a //option -r creates patient if not found, -a changes focus to Digora public static void SendData(Program ProgramCur, Patient pat) { if (pat == null) { MessageBox.Show("No patient selected."); return; } ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); //if(pat!=null){ string info = "$$DFWIN$$ OPEN -n\"" + Tidy(pat.LName) + ", " + Tidy(pat.FName) + "\" -c\""; ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; if (PPCur.PropertyValue == "0") { info += pat.PatNum.ToString(); } else { info += pat.ChartNumber; } info += "\" -r -a"; Clipboard.SetText(info, TextDataFormat.Text); //} /*else{ * try{ * Process.Start(ProgramCur.Path);//should start Apteryx without bringing up a pt. * } * catch{ * MessageBox.Show(ProgramCur.Path+" is not available."); * } * }*/ }
///<summary>Command line.</summary> public static void SendData(Program ProgramCur, Patient pat) { if (pat == null) { try { Process.Start(ProgramCur.Path); //Start iCat without bringing up a pt. } catch { MessageBox.Show(ProgramCur.Path + " is not available."); } return; } ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum"); if (PPCur.PropertyValue == "1" && pat.ChartNumber == "") { MessageBox.Show("This patient must have a ChartNumber entered first."); return; } PPCur = ProgramProperties.GetCur(ForProgram, "Acquisition computer name"); try { if (Environment.MachineName.ToUpper() == PPCur.PropertyValue.ToUpper()) { SendDataServer(ProgramCur, ForProgram, pat); } else { SendDataWorkstation(ProgramCur, ForProgram, pat); } } catch (Exception e) { MessageBox.Show("Error: " + e.Message); } }
/*string InvalidCommandLine="999"; * string GeneralError="998"; * string NoConnect="997"; * string PatientNotFound="989"; * string ManyPatientFound="988"; * string PatientLocked="987"; * string ImageNotFound="979"; * string FileError="969"; * string OpenManyFoundOK="1"; * string OpenManyFoundCancel="2"; * string CreatePatientExist="11"; * string ChangePatientExist="21"; * string Successful="0";*/ ///<summary>We will use the clipboard interface, although there is an ole automation interface available.</summary> //Command format: $$DFWIN$$ <Command> <Options> //Return value: $$DFWOUT$$<Return value>[\nReturn string] (we will ignore this value for now) //$$DFWIN$$ OPEN -n"LName, FName" -c"PatNum" -r -a //option -r creates patient if not found, -a changes focus to Digora public static void SendData(Program ProgramCur, Patient pat) { if (pat == null) { MsgBox.Show("Digora", "No patient selected."); return; } List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); string info = "$$DFWIN$$ OPEN -n\"" + Tidy(pat.LName) + ", " + Tidy(pat.FName) + "\" -c\""; ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; if (PPCur.PropertyValue == "0") { info += pat.PatNum.ToString(); } else { info += pat.ChartNumber; } info += "\" -r -a"; try { ODClipboard.SetClipboard(info); } catch (Exception) { //The clipboard will sometimes fail to SetText for many different reasons. Often times another attempt will be successful. MsgBox.Show("Digora", "Error accessing the clipboard, please try again."); return; } }
///<summary>Inserts one ProgramProperty into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ProgramProperty programProperty, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO programproperty ("; if (!useExistingPK && isRandomKeys) { programProperty.ProgramPropertyNum = ReplicationServers.GetKeyNoCache("programproperty", "ProgramPropertyNum"); } if (isRandomKeys || useExistingPK) { command += "ProgramPropertyNum,"; } command += "ProgramNum,PropertyDesc,PropertyValue,ComputerName,ClinicNum) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(programProperty.ProgramPropertyNum) + ","; } command += POut.Long(programProperty.ProgramNum) + "," + "'" + POut.String(programProperty.PropertyDesc) + "'," + "'" + POut.String(programProperty.PropertyValue) + "'," + "'" + POut.String(programProperty.ComputerName) + "'," + POut.Long(programProperty.ClinicNum) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { programProperty.ProgramPropertyNum = Db.NonQ(command, true, "ProgramPropertyNum", "programProperty"); } return(programProperty.ProgramPropertyNum); }
///<summary>Inserts one ProgramProperty into the database. Provides option to use the existing priKey.</summary> internal static long Insert(ProgramProperty programProperty, bool useExistingPK) { if (!useExistingPK && PrefC.RandomKeys) { programProperty.ProgramPropertyNum = ReplicationServers.GetKey("programproperty", "ProgramPropertyNum"); } string command = "INSERT INTO programproperty ("; if (useExistingPK || PrefC.RandomKeys) { command += "ProgramPropertyNum,"; } command += "ProgramNum,PropertyDesc,PropertyValue) VALUES("; if (useExistingPK || PrefC.RandomKeys) { command += POut.Long(programProperty.ProgramPropertyNum) + ","; } command += POut.Long(programProperty.ProgramNum) + "," + "'" + POut.String(programProperty.PropertyDesc) + "'," + "'" + POut.String(programProperty.PropertyValue) + "')"; if (useExistingPK || PrefC.RandomKeys) { Db.NonQ(command); } else { programProperty.ProgramPropertyNum = Db.NonQ(command, true); } return(programProperty.ProgramPropertyNum); }
///<summary>Launches the program using the patient.Cur data.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); //DxStart.exe ”PatientID” ”FamilyName” ”FirstName” ”BirthDate” List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); if (pat == null) { MessageBox.Show("Please select a patient first"); return; } string info = ""; //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") { info += "\"" + pat.PatNum.ToString() + "\" "; } else { info += "\"" + pat.ChartNumber.Replace("\"", "") + "\" "; } info += "\"" + pat.LName.Replace("\"", "") + "\" " + "\"" + pat.FName.Replace("\"", "") + "\" " + "\"" + pat.Birthdate.ToString("yyyyMMdd") + "\""; try{ Process.Start(path, info); } catch { MessageBox.Show(path + " is not available."); } }
///<summary>Launches the program using command line. It is confirmed that there is no space after the -P or -N</summary> public static void SendData(Program ProgramCur, Patient pat) { ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);; if (pat != null) { if (pat.TrophyFolder == "") { MessageBox.Show("You must first enter a value for the Trophy Folder in the Patient Edit Window."); return; } ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Storage Path"); string comline = "-P" + PPCur.PropertyValue + @"\"; comline += pat.TrophyFolder; comline += " -N" + pat.LName + "," + pat.FName; comline = comline.Replace("\"", ""); //gets rid of any quotes comline = comline.Replace("'", ""); //gets rid of any single quotes //MessageBox.Show(comline); try{ Process.Start(ProgramCur.Path, comline); } catch { MessageBox.Show(ProgramCur.Path + " is not available."); } } //if patient is loaded else { try{ Process.Start(ProgramCur.Path); //should start Trophy without bringing up a pt. } catch { MessageBox.Show(ProgramCur.Path + " is not available."); } } }
private static PayConnectService.Credentials GetCredentials(Program prog) { PayConnectService.Credentials cred = new OpenDental.PayConnectService.Credentials(); ArrayList props = ProgramProperties.GetForProgram(prog.ProgramNum); cred.Username = ""; cred.Password = ""; for (int i = 0; i < props.Count; i++) { ProgramProperty prop = (ProgramProperty)props[i]; if (prop.PropertyDesc == "Username") { cred.Username = prop.PropertyValue; } else if (prop.PropertyDesc == "Password") { cred.Password = prop.PropertyValue; } } cred.Client = "OpenDental2"; cred.ServiceID = "DCI Web Service ID: 006328"; //Production //cred.ServiceID="DCI Web Service ID: 002778";//Testing cred.version = "0310"; return(cred); }
///<summary></summary> public static void StartFileWatcher() { Program prog = Programs.GetCur(ProgramName.TigerView); if (!prog.Enabled) { return; } List <ProgramProperty> propertiesForProgram = ProgramProperties.GetForProgram(prog.ProgramNum); ProgramProperty programProperty = ProgramProperties.GetCur(propertiesForProgram, "TigerView EMR folder path"); string returnFolder = programProperty.PropertyValue; if (!Directory.Exists(returnFolder)) { //Do not show a message that the directory was not found because not every workstation in the office will be running this service. return; } FileSystemWatcher watcher = new FileSystemWatcher(returnFolder, "*.tig"); watcher.Created += new FileSystemEventHandler(OnCreated); watcher.EnableRaisingEvents = true; string[] arrayUnprocessedFiles = Directory.GetFiles(returnFolder, "*.tig"); for (int i = 0; i < arrayUnprocessedFiles.Length; i++) { try { ProcessFile(arrayUnprocessedFiles[i]); } catch { } } }
///<summary>Launches the program using the patient.Cur data.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); //DxStart.exe ”PatientID” ”FamilyName” ”FirstName” ”BirthDate” List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); if (pat == null) { MessageBox.Show("Please select a patient first"); return; } string info = ""; //Patient id can be any string format ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum"); string bDayFormat = ProgramProperties.GetCur(ForProgram, "Birthdate format (usually dd/MM/yyyy or MM/dd/yyyy)").PropertyValue; if (PPCur.PropertyValue == "0") { info += "\"" + pat.PatNum.ToString() + "\" "; } else { info += "\"" + pat.ChartNumber.Replace("\"", "") + "\" "; } info += "\"" + pat.LName.Replace("\"", "") + "\" " + "\"" + pat.FName.Replace("\"", "") + "\" " + "\"" + pat.Birthdate.ToString(bDayFormat) + "\""; //Format is dd/MM/yyyy by default. Planmeca also told a customer that the format should be MM/dd/yyyy (04/08/2016 cm). try { ODFileUtils.ProcessStart(path, info); } catch { MessageBox.Show(path + " is not available."); } }
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(); }
///<summary>Launches the program using the patient.Cur data.</summary> public static void SendData(Program ProgramCur, Patient pat) { //DxStart.exe ”PatientID” ”FamilyName” ”FirstName” ”BirthDate” ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); if (pat == null) { MessageBox.Show("Please select a patient first"); return; } string info = ""; //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") { info += "\"" + pat.PatNum.ToString() + "\" "; } else { info += "\"" + pat.ChartNumber.Replace("\"", "") + "\" "; } info += "\"" + pat.LName.Replace("\"", "") + "\" " + "\"" + pat.FName.Replace("\"", "") + "\" " + "\"" + pat.Birthdate.ToString("dd/MM/yyyy") + "\""; //Planmeca is a Finland based company, so their date format is dd/MM/yyyy. We used to send date format "MM/dd/yyyy" for our American customers before 12/19/2011. try{ Process.Start(ProgramCur.Path, info); } catch { MessageBox.Show(ProgramCur.Path + " is not available."); } }
private void FormDoseSpotPropertyEdit_Load(object sender, EventArgs e) { textClinicAbbr.Text = _clinicCur.Abbr; textClinicID.Text = ClinicIdVal; textClinicKey.Text = ClinicKeyVal; if (ClinicIdVal.Trim() != "" && ClinicKeyVal.Trim() != "") //The clinic has values for the clinicId/clinicKey, so they are effectively registered. { butRegisterClinic.Enabled = false; } if (_clinicCur.ClinicNum == 0) //Clinics disabled or is HQ. { menuItemSetup.Enabled = false; //There is no clinic record to edit. } Program programErx = Programs.GetCur(ProgramName.eRx); ProgramProperty ppClinicID = ListProperties .FirstOrDefault(x => x.ClinicNum != _clinicCur.ClinicNum && x.PropertyDesc == Erx.PropertyDescs.ClinicID && x.PropertyValue != ""); ProgramProperty ppClinicKey = null; if (ppClinicID != null) { ppClinicKey = ListProperties .FirstOrDefault(x => x.ClinicNum == ppClinicID.ClinicNum && x.PropertyDesc == Erx.PropertyDescs.ClinicKey && x.PropertyValue != ""); } if (ppClinicID == null || string.IsNullOrWhiteSpace(ppClinicID.PropertyValue) || ppClinicKey == null || string.IsNullOrWhiteSpace(ppClinicKey.PropertyValue)) { //No clinicID/clinicKey found. This would be the first clinic to register //Allow the first clinic to register the ability to modify the clinicID/clinicKey textboxes. textClinicID.ReadOnly = false; textClinicKey.ReadOnly = false; butRegisterClinic.Enabled = false; butClear.Enabled = false; } }
///<summary>Inserts one ProgramProperty into the database. Returns the new priKey.</summary> internal static long Insert(ProgramProperty programProperty) { if(DataConnection.DBtype==DatabaseType.Oracle) { programProperty.ProgramPropertyNum=DbHelper.GetNextOracleKey("programproperty","ProgramPropertyNum"); int loopcount=0; while(loopcount<100){ try { return Insert(programProperty,true); } catch(Oracle.DataAccess.Client.OracleException ex){ if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){ programProperty.ProgramPropertyNum++; loopcount++; } else{ throw ex; } } } throw new ApplicationException("Insert failed. Could not generate primary key."); } else { return Insert(programProperty,false); } }
///<summary>Inserts one ProgramProperty into the database. Returns the new priKey.</summary> internal static long Insert(ProgramProperty programProperty) { if (DataConnection.DBtype == DatabaseType.Oracle) { programProperty.ProgramPropertyNum = DbHelper.GetNextOracleKey("programproperty", "ProgramPropertyNum"); int loopcount = 0; while (loopcount < 100) { try { return(Insert(programProperty, true)); } catch (Oracle.DataAccess.Client.OracleException ex) { if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")) { programProperty.ProgramPropertyNum++; loopcount++; } else { throw ex; } } } throw new ApplicationException("Insert failed. Could not generate primary key."); } else { return(Insert(programProperty, false)); } }
///<summary>Launches the main Patient Document window of Schick.</summary> public static void SendData(Program ProgramCur, Patient pat) { if (pat == null) { return; } List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum"); string patID = ""; if (PPCur.PropertyValue == "0") { patID = pat.PatNum.ToString(); } else { patID = pat.ChartNumber; } try { string version4or5 = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Schick Version 4 or 5"); if (version4or5 == "5") { ShowExam(pat, patID); } else { VBbridges.Schick3.Launch(patID, pat.LName, pat.FName); } } catch { MessageBox.Show("Error launching Schick CDR Dicom."); } }
///<summary></summary> public static void StartFileWatcher() { Program prog = Programs.GetCur(ProgramName.iCat); if (!prog.Enabled || ODBuild.IsWeb()) { return; } List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(Programs.GetProgramNum(ProgramName.iCat)); ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Return folder path"); string returnFolder = PPCur.PropertyValue; if (!Directory.Exists(returnFolder)) { return; } FileSystemWatcher watcher = new FileSystemWatcher(returnFolder, "*.xml"); watcher.Created += new FileSystemEventHandler(OnCreated); watcher.Renamed += new RenamedEventHandler(OnRenamed); watcher.EnableRaisingEvents = true; //process all waiting files string[] existingFiles = Directory.GetFiles(returnFolder, "*.xml"); for (int i = 0; i < existingFiles.Length; i++) { ProcessFile(existingFiles[i]); } }
/// <summary>Chooses which type of form to open based on current program and selected property.</summary> private void gridMain_CellDoubleClick(object sender, OpenDental.UI.ODGridClickEventArgs e) { ProgramProperty programProperty = (ProgramProperty)gridMain.ListGridRows[e.Row].Tag; switch (ProgramCur.ProgName) { case nameof(ProgramName.XVWeb): switch (programProperty.PropertyDesc) { case XVWeb.ProgramProps.ImageCategory: List <string> listDefNums = Defs.GetDefsForCategory(DefCat.ImageCats, true).Select(x => POut.Long(x.DefNum)).ToList(); List <string> listItemNames = Defs.GetDefsForCategory(DefCat.ImageCats, true).Select(x => x.ItemName).ToList(); ShowComboBoxForProgramProperty(programProperty, listDefNums, listItemNames, Lans.g(this, "Choose an Image Category")); return; case XVWeb.ProgramProps.ImageQuality: List <string> listOptions = Enum.GetValues(typeof(XVWebImageQuality)).Cast <XVWebImageQuality>().Select(x => x.ToString()).ToList(); List <string> listDisplay = listOptions.Select(x => Lans.g(this, x)).ToList(); ShowComboBoxForProgramProperty(programProperty, listOptions, listDisplay, Lans.g(this, "Choose an Image Quality")); return; } break; } ShowFormProgramProperty(programProperty); }
public string[] GetUniformBlocks(int programID) { int noOfUniformBlocks; GL.GetProgram(programID, GetProgramParameterName.ActiveUniformBlocks, out noOfUniformBlocks); int noOfUniformBlockBindings; GL.GetInteger(GetPName.MaxUniformBufferBindings, out noOfUniformBlockBindings); var names = new string[noOfUniformBlocks]; for (int i = 0; i < noOfUniformBlocks; i += 1) { names[i] = GL.GetActiveUniformBlockName(programID, i); var index = GL.GetUniformBlockIndex(programID, names[i]); int length; var queries = new ProgramProperty[] { ProgramProperty.BufferBinding, ProgramProperty.ReferencedByFragmentShader, ProgramProperty.ReferencedByVertexShader, ProgramProperty.BufferDataSize }; var props = new int[queries.Length]; GL.GetProgramResource(programID, ProgramInterface.UniformBlock, i, queries.Length, queries, props.Length, out length, props); } return(names); }
///<summary>Handles both visibility and checking of checkHideButtons.</summary> private void SetAdvertising() { ProgramProperty prop = _dictClinicListProgProps[0].FirstOrDefault(x => x.PropertyDesc == "Disable Advertising"); //dict guaranteed to contain key 0 checkHideButtons.Visible = (prop != null && !checkEnabled.Checked); //show check box if disable prop exists and program is not enabled checkHideButtons.Checked = (prop?.PropertyValue == "1"); //check box checked if disable prop exists and is set to "1" for HQ }
///<summary>Inserts one ProgramProperty into the database. Provides option to use the existing priKey.</summary> public static long Insert(ProgramProperty programProperty,bool useExistingPK){ if(!useExistingPK && PrefC.RandomKeys) { programProperty.ProgramPropertyNum=ReplicationServers.GetKey("programproperty","ProgramPropertyNum"); } string command="INSERT INTO programproperty ("; if(useExistingPK || PrefC.RandomKeys) { command+="ProgramPropertyNum,"; } command+="ProgramNum,PropertyDesc,PropertyValue,ComputerName) VALUES("; if(useExistingPK || PrefC.RandomKeys) { command+=POut.Long(programProperty.ProgramPropertyNum)+","; } command+= POut.Long (programProperty.ProgramNum)+"," +"'"+POut.String(programProperty.PropertyDesc)+"'," +"'"+POut.String(programProperty.PropertyValue)+"'," +"'"+POut.String(programProperty.ComputerName)+"')"; if(useExistingPK || PrefC.RandomKeys) { Db.NonQ(command); } else { programProperty.ProgramPropertyNum=Db.NonQ(command,true); } return programProperty.ProgramPropertyNum; }
///<summary>Launches the program using the patient.Cur data.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);; if (pat == null) { MessageBox.Show("Please select a patient first"); return; } string info = ""; //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") { info += "-i \"" + pat.PatNum.ToString() + "\" "; } else { info += "-i \"" + pat.ChartNumber.Replace("\"", "") + "\" "; } info += "-n \"" + pat.LName.Replace("\"", "") + ", " + pat.FName.Replace("\"", "") + "\""; //MessageBox.Show(info); try{ Process.Start(path, info); } catch { MessageBox.Show(path + " is not available."); } }
///<summary>Sends data for Patient.Cur by command line interface.</summary> public static void SendData(Program ProgramCur, Patient pat) { ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);; if (pat == null) { return; } //Example: c:\vixwin\vixwin -I 123ABC -N Bill^Smith string info = "-I "; ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; if (PPCur.PropertyValue == "0") { info += pat.PatNum.ToString(); } else { info += pat.ChartNumber; //max 64 char } info += " -N " + pat.FName.Replace(" ", "") + "^" + pat.LName.Replace(" ", ""); //no spaces allowed //MessageBox.Show(info); try { Process.Start(ProgramCur.Path, info); } catch { MessageBox.Show(ProgramCur.Path + " is not available."); } }
///<summary>Launches the main Patient Document window of Schick.</summary> public static void SendData(Program ProgramCur, Patient pat) { if (pat == null) { return; } ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);; ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");; string patID = ""; if (PPCur.PropertyValue == "0") { patID = pat.PatNum.ToString(); } else { patID = pat.ChartNumber; } try { VBbridges.Schick.Launch(patID, pat.LName, pat.FName); } catch { MessageBox.Show("Error launching Schick CDR Dicom."); } }
///<summary>Updates the in memory dictionary with any changes made to the current locationID for each clinic before showing the next one.</summary> private void SaveClinicCurProgramPropertiesToDict() { //First check if Headquarters (default) is selected. if (_clinicNumCur == 0) { //Headquarters is selected so only update the location ID (might have changed) on all other location ID properties that match the "old" location ID of HQ. if (_dictLocationIDs.ContainsKey(_clinicNumCur)) { //Get the location ID so that we correctly update all program properties with a matching location ID. string locationIdOld = _dictLocationIDs[_clinicNumCur].PropertyValue; foreach (KeyValuePair <long, ProgramProperty> item in _dictLocationIDs) { ProgramProperty ppCur = item.Value; if (ppCur.PropertyValue == locationIdOld) { ppCur.PropertyValue = textLocationID.Text; } } } return; //No other clinic specific changes could have been made, we need to return. } //Update or Insert clinic specific properties into memory ProgramProperty ppLocationID = new ProgramProperty(); if (_dictLocationIDs.ContainsKey(_clinicNumCur)) { ppLocationID = _dictLocationIDs[_clinicNumCur]; //Override the database's property with what is in memory. } else //Get default programproperty from db. { ppLocationID = ProgramProperties.GetListForProgramAndClinicWithDefault(_progCur.ProgramNum, _clinicNumCur) .FirstOrDefault(x => x.PropertyDesc == Podium.PropertyDescs.LocationID); } if (ppLocationID.ClinicNum == 0) //No program property for current clinic, since _clinicNumCur!=0 { ProgramProperty ppLocationIDNew = ppLocationID.Copy(); ppLocationIDNew.ProgramPropertyNum = 0; ppLocationIDNew.ClinicNum = _clinicNumCur; ppLocationIDNew.PropertyValue = textLocationID.Text; if (!_dictLocationIDs.ContainsKey(_clinicNumCur)) //Should always happen { _dictLocationIDs.Add(_clinicNumCur, ppLocationIDNew); } return; } //At this point we know that the clinicnum isn't 0 and the database has a property for that clinicnum. if (_dictLocationIDs.ContainsKey(_clinicNumCur)) //Should always happen { ppLocationID.PropertyValue = textLocationID.Text; _dictLocationIDs[_clinicNumCur] = ppLocationID; } else { _dictLocationIDs.Add(_clinicNumCur, ppLocationID); //Should never happen. } }
private void UpdateProgramProperty(ProgramProperty ppFromDb, string newpropertyValue) { if (ppFromDb.PropertyValue == newpropertyValue) { return; } ppFromDb.PropertyValue = newpropertyValue; ProgramProperties.Update(ppFromDb); _hasProgramPropertyChanged = true; }
///<summary>Updates one ProgramProperty in the database.</summary> internal static void Update(ProgramProperty programProperty) { string command = "UPDATE programproperty SET " + "ProgramNum = " + POut.Long(programProperty.ProgramNum) + ", " + "PropertyDesc = '" + POut.String(programProperty.PropertyDesc) + "', " + "PropertyValue = '" + POut.String(programProperty.PropertyValue) + "' " + "WHERE ProgramPropertyNum = " + POut.Long(programProperty.ProgramPropertyNum); Db.NonQ(command); }
///<summary></summary> public static void Update(ProgramProperty Cur) { string command = "UPDATE programproperty SET " + "ProgramNum = '" + POut.PInt(Cur.ProgramNum) + "'" + ",PropertyDesc = '" + POut.PString(Cur.PropertyDesc) + "'" + ",PropertyValue = '" + POut.PString(Cur.PropertyValue) + "'" + " WHERE ProgramPropertyNum = '" + POut.PInt(Cur.ProgramPropertyNum) + "'"; General.NonQ(command); }
///<summary>Launches the program using command line.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); Process pibridge; List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); try{ if (pat != null) { ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum"); string id = ""; if (PPCur.PropertyValue == "0") { id = pat.PatNum.ToString(); } else { id = pat.ChartNumber; } string lname = pat.LName.Replace("\"", "").Replace(",", ""); string fname = pat.FName.Replace("\"", "").Replace(",", ""); if (pat.Birthdate.Year < 1880) { throw new ODException(Lans.g("Progeny", "Invalid birthdate for") + " " + pat.GetNameFL()); } //Progeny software uses local computer's date format settings, per PIBridge.exe documentation (launch exe to view). string birthdate = pat.Birthdate.ToShortDateString(); pibridge = new Process(); pibridge.StartInfo.CreateNoWindow = false; pibridge.StartInfo.UseShellExecute = true; pibridge.StartInfo.FileName = path; //Double-quotes are removed from id and name to prevent malformed command. ID could have double-quote if chart number. pibridge.StartInfo.Arguments = "cmd=open id=\"" + id.Replace("\"", "") + "\" first=\"" + fname.Replace("\"", "") + "\" last=\"" + lname.Replace("\"", "") + "\" dob=\"" + birthdate.Replace("\"", "") + "\""; ODFileUtils.ProcessStart(pibridge); } //if patient is loaded else { //Should start Progeny without bringing up a pt. pibridge = new Process(); pibridge.StartInfo.CreateNoWindow = false; pibridge.StartInfo.UseShellExecute = true; pibridge.StartInfo.FileName = path; pibridge.StartInfo.Arguments = "cmd=start"; ODFileUtils.ProcessStart(pibridge); } } catch (ODException ex) { MessageBox.Show(ex.Message); } catch { MessageBox.Show(path + " is not available."); } }
///<summary>Launches the program using a combination of command line characters and the patient.Cur data.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); if (pat != null) { //We remove double-quotes from the first and last name of the patient so extra double-quotes don't //cause confusion in the command line parameters for Apteryx. string info = "\"" + pat.LName.Replace("\"", "") + ", " + pat.FName.Replace("\"", "") + "::"; if (pat.SSN.Length == 9 && pat.SSN != "000000000") //SSN is optional. eCW customers often use 000-00-0000 for any patient that does not have an SSN (mostly young children). { info += pat.SSN.Substring(0, 3) + "-" + pat.SSN.Substring(3, 2) + "-" + pat.SSN.Substring(5, 4); } //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") { info += "::" + pat.PatNum.ToString(); } else { info += "::" + pat.ChartNumber; } info += "::" + pat.Birthdate.ToShortDateString() + "::"; if (pat.Gender == PatientGender.Female) { info += "F"; } else { info += "M"; } info += "\""; try{ //commandline default is /p ODFileUtils.ProcessStart(path, ProgramCur.CommandLine + info); } catch { MessageBox.Show(path + " is not available, or there is an error in the command line options."); } } //if patient is loaded else { try{ ODFileUtils.ProcessStart(path); //should start Apteryx without bringing up at pt. } catch { MessageBox.Show(path + " is not available."); } } }
///<summary>Sends data for Patient.Cur to the InfoFile and launches the program.</summary> public static void SendData(Program ProgramCur, Patient pat) { string path = Programs.GetProgramPath(ProgramCur); ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum); ProgramProperty PPCur = ProgramProperties.GetCur(ForProgram, "InfoFile path"); string infoFile = PPCur.PropertyValue; if (pat != null) { try { //patientID can be any string format, max 8 char. //There is no validation to ensure that length is 8 char or less. PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum"); string id = ""; if (PPCur.PropertyValue == "0") { id = pat.PatNum.ToString(); } else { id = pat.ChartNumber; } using (StreamWriter sw = new StreamWriter(infoFile, false)) { sw.WriteLine(pat.LName + ", " + pat.FName + " " + pat.Birthdate.ToShortDateString() + " (" + id + ")"); sw.WriteLine("PN=" + id); //sw.WriteLine("PN="+pat.PatNum.ToString()); sw.WriteLine("LN=" + pat.LName); sw.WriteLine("FN=" + pat.FName); sw.WriteLine("BD=" + pat.Birthdate.ToShortDateString()); if (pat.Gender == PatientGender.Female) { sw.WriteLine("SX=F"); } else { sw.WriteLine("SX=M"); } } Process.Start(path, "@" + infoFile); } catch { MessageBox.Show(path + " is not available."); } } //if patient is loaded else { try { Process.Start(path); //should start Dexis without bringing up a pt. } catch { MessageBox.Show(path + " is not available."); } } }
///<summary>Converts a DataTable to a list of objects.</summary> public static List<ProgramProperty> TableToList(DataTable table){ List<ProgramProperty> retVal=new List<ProgramProperty>(); ProgramProperty programProperty; for(int i=0;i<table.Rows.Count;i++) { programProperty=new ProgramProperty(); programProperty.ProgramPropertyNum= PIn.Long (table.Rows[i]["ProgramPropertyNum"].ToString()); programProperty.ProgramNum = PIn.Long (table.Rows[i]["ProgramNum"].ToString()); programProperty.PropertyDesc = PIn.String(table.Rows[i]["PropertyDesc"].ToString()); programProperty.PropertyValue = PIn.String(table.Rows[i]["PropertyValue"].ToString()); programProperty.ComputerName = PIn.String(table.Rows[i]["ComputerName"].ToString()); retVal.Add(programProperty); } return retVal; }
///<summary>Updates one ProgramProperty in the database. Uses an old object to compare to, and only alters changed fields. This prevents collisions and concurrency problems in heavily used tables.</summary> public static void Update(ProgramProperty programProperty,ProgramProperty oldProgramProperty){ string command=""; if(programProperty.ProgramNum != oldProgramProperty.ProgramNum) { if(command!=""){ command+=",";} command+="ProgramNum = "+POut.Long(programProperty.ProgramNum)+""; } if(programProperty.PropertyDesc != oldProgramProperty.PropertyDesc) { if(command!=""){ command+=",";} command+="PropertyDesc = '"+POut.String(programProperty.PropertyDesc)+"'"; } if(programProperty.PropertyValue != oldProgramProperty.PropertyValue) { if(command!=""){ command+=",";} command+="PropertyValue = '"+POut.String(programProperty.PropertyValue)+"'"; } if(programProperty.ComputerName != oldProgramProperty.ComputerName) { if(command!=""){ command+=",";} command+="ComputerName = '"+POut.String(programProperty.ComputerName)+"'"; } if(command==""){ return; } command="UPDATE programproperty SET "+command +" WHERE ProgramPropertyNum = "+POut.Long(programProperty.ProgramPropertyNum); Db.NonQ(command); }
///<summary>Updates one ProgramProperty in the database.</summary> public static void Update(ProgramProperty programProperty){ string command="UPDATE programproperty SET " +"ProgramNum = "+POut.Long (programProperty.ProgramNum)+", " +"PropertyDesc = '"+POut.String(programProperty.PropertyDesc)+"', " +"PropertyValue = '"+POut.String(programProperty.PropertyValue)+"', " +"ComputerName = '"+POut.String(programProperty.ComputerName)+"' " +"WHERE ProgramPropertyNum = "+POut.Long(programProperty.ProgramPropertyNum); Db.NonQ(command); }