Esempio n. 1
0
        ///<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 { }
            }
        }
Esempio n. 2
0
        /*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.");
             *      }
             * }*/
        }
Esempio n. 3
0
        ///<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);
            }
        }
Esempio n. 4
0
        /*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;
            }
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        ///<summary>Launches the program using command line.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);

            if (pat != null)
            {
                string info       = "";
                string propertyId = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum").PropertyValue;
                string dobFormat  = ProgramProperties.GetCur(ForProgram, "Birthdate format (default yyyyMMdd)").PropertyValue;
                info  = (propertyId == "0"?pat.PatNum.ToString():pat.ChartNumber);
                info += " \"" + pat.LName.Replace("\"", "") + "\" \"" + pat.FName.Replace("\"", "") + "\" \"" + pat.Birthdate.ToString(dobFormat) + "\"";
                try{
                    Process.Start(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{
                    Process.Start(path);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
Esempio n. 7
0
        ///<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);

            //usage: C:\Dxis\Dxis.exe /i /t:UniqueID - Practice Name
            //The UniqueID can be a combo of patient name and id.  I think we'll combine Lname,Fname,PatNum
            if (pat == null)
            {
                MsgBox.Show("Dxis", "Please select a patient first.");
                return;
            }
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
            string info = "/i /t:" + pat.LName + " " + pat.FName + " " + pat.PatNum.ToString() + " - " + PrefC.GetString(PrefName.PracticeTitle);

            try{
                Process process = ODFileUtils.ProcessStart(path, info);
                //Don't wait for exit in WEB mode.  Since it opens a browser tab and then an unrelated process on the client,
                //we probably don't have a valid process to wait for, and the resources from Open Dental aren't the same resources from Dxis.
                if (!ODBuild.IsWeb())
                {
                    process.WaitForExit();                    //puts OD in sleep mode because the pano is so resource intensive.
                }
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
        }
Esempio n. 8
0
        ///<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.");
            }
        }
Esempio n. 9
0
        ///<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.");
            }
        }
Esempio n. 10
0
        ///<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.");
            }
        }
Esempio n. 11
0
        ///<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.");
            }
        }
Esempio n. 12
0
        ///<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]);
            }
        }
Esempio n. 13
0
        ///<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.");
            }
        }
Esempio n. 14
0
        ///<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.");
                }
            }
        }
Esempio n. 15
0
        ///<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.");
            }
        }
Esempio n. 16
0
        ///<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.");
            }
        }
Esempio n. 17
0
        ///<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.");
                }
            }
        }
Esempio n. 18
0
        ///<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.");
                }
            }
        }
Esempio n. 19
0
        ///<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.");
            }
        }
Esempio n. 20
0
        ///<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)
        {
            ArrayList 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)
                {
                    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
                    Process.Start(ProgramCur.Path, ProgramCur.CommandLine + info);
                }
                catch {
                    MessageBox.Show(ProgramCur.Path + " is not available, or there is an error in the command line options.");
                }
            }            //if patient is loaded
            else
            {
                try{
                    Process.Start(ProgramCur.Path);                    //should start Apteryx without bringing up a pt.
                }
                catch {
                    MessageBox.Show(ProgramCur.Path + " is not available.");
                }
            }
        }
Esempio n. 21
0
        ///<summary>Launches the program using command line.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            //Usage: [Application Path]PerioPal "PtChart; PtName ; PtBday; PtMedAlert;"
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);;

            if (pat == null)
            {
                return;
            }
            string          info  = "\"";
            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 += Cleanup(pat.ChartNumber);
            }
            info += ";"
                    + Cleanup(pat.LName) + ";"
                    + Cleanup(pat.FName) + ";"
                    + pat.Birthdate.ToShortDateString() + ";";
            bool hasMedicalAlert = false;

            if (pat.MedUrgNote != "")
            {
                hasMedicalAlert = true;
            }
            if (pat.Premed)
            {
                hasMedicalAlert = true;
            }
            if (hasMedicalAlert)
            {
                info += "Y;";
            }
            else
            {
                info += "N;";
            }
            //MessageBox.Show(info);
            try{
                ODFileUtils.ProcessStart(path, info);
            }
            catch {
                MessageBox.Show(path + " " + info + " is not available.");
            }
        }
Esempio n. 22
0
        private static void ProcessFile(string fullPath)
        {
            string filename = Path.GetFileName(fullPath);
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(Programs.GetProgramNum(ProgramName.iCat));
            ProgramProperty        PPCur      = ProgramProperties.GetCur(ForProgram, "XML output file path");
            string xmlOutputFile = PPCur.PropertyValue;

            if (!File.Exists(xmlOutputFile))
            {
                //No xml file, so nothing to process.
                return;
            }
            try {
                string      patId  = filename.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries)[0];
                XmlDocument docOut = new XmlDocument();
                docOut.Load(xmlOutputFile);
                XmlElement elementPatients = docOut.DocumentElement;
                if (elementPatients == null)               //if no Patients element, then document is corrupt or new
                {
                    return;
                }
                //figure out if patient is in the list------------------------------------------
                XmlElement elementPat = null;
                for (int i = 0; i < elementPatients.ChildNodes.Count; i++)
                {
                    if (elementPatients.ChildNodes[i].SelectSingleNode("ID").InnerXml == patId)
                    {
                        elementPat = (XmlElement)elementPatients.ChildNodes[i];
                    }
                }
                if (elementPat == null)
                {
                    //patient not in xml document
                    return;
                }
                elementPatients.RemoveChild(elementPat);
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent      = true;
                settings.IndentChars = "   ";
                XmlWriter writer = XmlWriter.Create(xmlOutputFile, settings);
                docOut.Save(writer);
                writer.Close();
                File.Delete(fullPath);
            }
            catch {
                return;
            }
        }
Esempio n. 23
0
        /*
         * Example Argument.ini
         *     [Patient Info = 00]
         *     PATIENT_APPLYNO=0120525150324003
         *     PATIENT_ID=20120525
         *     PATIENT_NAME=김유성
         *     PATIENT_ENAME=
         *     PATIENT_SEX=M
         *     PATIENT_AGE=30
         *     PATIENT_BIRTH_DATE=19831020
         *     PATIENT_ADDR=
         *     PATIENT_PID=
         *     PATIENT_IPDOPD=
         *     PATIENT_DOCTOR=
         *     PATIENT_PHON1=
         *     PATIENT_PHON2=
         *     PATIENT_EXAMNAME=TESTEXAM
         *     INPUT_DATE=20120531
         */

        ///<summary>Launches the program using a command line tools.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            try {
                if (pat != null)
                {
                    List <ProgramProperty> listProgramProperties = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
                    ProgramProperty        propIniFileLocation   = ProgramProperties.GetCur(listProgramProperties, "System path to HDX WILL Argument ini file");
                    string patientId  = pat.PatNum.ToString();
                    string patientId2 = pat.ChartNumber.ToString();
                    if (ProgramProperties.GetPropValFromList(listProgramProperties, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "1")
                    {
                        patientId  = pat.ChartNumber;
                        patientId2 = pat.PatNum.ToString();
                    }
                    string        filename = propIniFileLocation.PropertyValue;
                    StringBuilder txt      = new StringBuilder();
                    txt.AppendLine("[Patient Info = 00]");
                    txt.AppendLine("PATIENT_APPLYNO=" + MiscData.GetNowDateTimeWithMilli().ToString("yyyyMMddhhmmssfff").Right(16));
                    txt.AppendLine("PATIENT_ID=" + patientId);
                    txt.AppendLine("PATIENT_NAME=" + pat.FName + " " + pat.LName);
                    txt.AppendLine("PATIENT_ENAME=");
                    txt.AppendLine("PATIENT_SEX=" + pat.Gender.ToString().Left(1));
                    txt.AppendLine("PATIENT_AGE=" + pat.Age);
                    txt.AppendLine("PATIENT_BIRTH_DATE=" + pat.Birthdate.ToString("yyyyMMdd"));
                    txt.AppendLine("PATIENT_ADDR=" + pat.Address);
                    txt.AppendLine("PATIENT_PID=" + patientId2);
                    txt.AppendLine("PATIENT_IPDOPD=");
                    txt.AppendLine("PATIENT_DOCTOR=" + Providers.GetFormalName(pat.PriProv));
                    txt.AppendLine("PATIENT_PHON1=" + pat.WirelessPhone);
                    txt.AppendLine("PATIENT_PHON2=" + pat.HmPhone);
                    txt.AppendLine("PATIENT_EXAMNAME=");
                    txt.AppendLine("INPUT_DATE=" + MiscData.GetNowDateTime().ToString("yyyyMMdd"));
                    ODFileUtils.WriteAllTextThenStart(filename, txt.ToString(), path);
                    return;
                }
            }
            catch (Exception e) {
                MessageBox.Show(e.Message);
            }
            try {
                ODFileUtils.ProcessStart(path);
            }
            catch (Exception e) {
                MessageBox.Show(path + " is not available.");
            }
        }
Esempio n. 24
0
        // AAD External Call declaration for Owandy bridge (nd)

        //static extern long SendMessage(long hWnd, long Msg, long wParam, string lParam);
        ///<summary>Launches the program using command line, then passes some data using Windows API.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            List <ProgramProperty> listProgProperties = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
            //ProgramProperties.GetForProgram();
            string info;

            if (pat != null)
            {
                try {
                    //formHandle = Parent.Handle;
                    System.Diagnostics.Process.Start(path, ProgramCur.CommandLine);                   //"C /LINK "+ formHandle;
                    if (!IsWindow(hwndLink))
                    {
                        hwndLink = FindWindow("MjLinkWndClass", null);
                    }
                    // info = "/P:1,DEMO,Patient1";
                    //Patient id:
                    string          patId       = "";
                    ProgramProperty propertyCur = ProgramProperties.GetCur(listProgProperties, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
                    if (propertyCur.PropertyValue == "0")
                    {
                        patId = POut.Long(pat.PatNum);
                    }
                    else
                    {
                        patId = POut.String(pat.ChartNumber);
                    }
                    info = "/P:" + patId + "," + pat.LName + "," + pat.FName;
                    if (IsWindow(hwndLink) == true)
                    {
                        IntPtr lResp = SendMessage(hwndLink, WM_SETTEXT, 0, info);
                    }
                }
                catch {
                    MessageBox.Show(path + " is not available, or there is an error in the command line options.");
                }
            }            //if patient is loaded
            else
            {
                try {
                    Process.Start(path);                    //should start Owandy without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
Esempio n. 25
0
        ///<summary>Sends data for Patient.Cur to an import file which DBSWin will automatically recognize.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            if (pat == null)
            {
                MsgBox.Show("DBSWin", "Please select a patient first.");
                return;
            }
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
            ProgramProperty        PPCur      = ProgramProperties.GetCur(ForProgram, "Text file path");
            string infoFile = PPCur.PropertyValue;

            try{
                using (StreamWriter sw = new StreamWriter(infoFile, false)){
                    //PATLASTNAME;PATFIRSTNAME;PATBIRTHDAY;PATCARDNUMBER;PATTOWN;PATSTREET;PATPHONENUMBER;PATTITLE;PATSEX;PATPOSTALCODE;
                    //everything after birthday is optional
                    sw.Write(Tidy(pat.LName) + ";");
                    sw.Write(Tidy(pat.FName) + ";");
                    sw.Write(pat.Birthdate.ToString("d.M.yyyy") + ";");
                    PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
                    if (PPCur.PropertyValue == "0")
                    {
                        sw.Write(pat.PatNum.ToString() + ";");
                    }
                    else
                    {
                        sw.Write(Tidy(pat.ChartNumber) + ";");
                    }
                    sw.Write(Tidy(pat.City) + ";");
                    sw.Write(Tidy(pat.Address) + ";");
                    sw.Write(Tidy(pat.HmPhone) + ";");
                    sw.Write(";");                    //title
                    if (pat.Gender == PatientGender.Female)
                    {
                        sw.Write("f;");
                    }
                    else
                    {
                        sw.Write("m;");
                    }
                    sw.Write(Tidy(pat.Zip) + ";");
                }
            }
            catch (Exception e) {
                MessageBox.Show(e.Message);
            }
        }
Esempio n. 26
0
        ///<summary>Launches the program using command line.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string    path = Programs.GetProgramPath(ProgramCur);
            Process   pibridge;
            ArrayList 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(",", "");
                    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("\"", "") + "\"";
                    pibridge.Start();
                }                //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";
                    pibridge.Start();
                }
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
        }
Esempio n. 27
0
        ///<summary>Sends data for Patient.Cur to the QuikLink directory. No further action is required.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
            ProgramProperty        PPCur      = ProgramProperties.GetCur(ForProgram, "QuikLink directory.");
            string quikLinkDir = PPCur.PropertyValue;

            if (pat == null)
            {
                return;
            }
            if (!Directory.Exists(quikLinkDir))
            {
                MessageBox.Show(quikLinkDir + " is not a valid folder.");
                return;
            }
            try{
                string patID;
                PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
                if (PPCur.PropertyValue == "0")
                {
                    patID = pat.PatNum.ToString().PadLeft(6, '0');
                }
                else
                {
                    patID = pat.ChartNumber.PadLeft(6, '0');
                }
                if (patID.Length > 6)
                {
                    MessageBox.Show("Patient ID is longer than six digits, so link failed.");
                    return;
                }
                string fileName = quikLinkDir + patID + ".DDE";
                //MessageBox.Show(fileName);
                using (StreamWriter sw = new StreamWriter(fileName, false)){
                    sw.WriteLine("\"" + pat.FName + "\","
                                 + "\"" + pat.LName + "\","
                                 + "\"" + patID + "\"");
                }
            }
            catch {
                MessageBox.Show("Error creating file.");
            }
        }
Esempio n. 28
0
        ///<summary>Launches the program using the patient.Cur data.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);
            //mtconnector.exe -patid 123  -fname John  -lname Doe  -ssn 123456789  -dob 01/25/1962  -gender M
            List <ProgramProperty> ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);;

            if (pat == null)
            {
                MessageBox.Show("Please select a patient first");
                return;
            }
            string          info  = "-patid ";
            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 += "-fname " + pat.FName + "  "
                    + "-lname " + pat.LName + "  "
                    + "-ssn " + pat.SSN + "  "
                    + "-dob " + pat.Birthdate.ToShortDateString() + "  "
                    + "-gender ";
            if (pat.Gender == PatientGender.Male)
            {
                info += "M";
            }
            else
            {
                info += "F";
            }
            try{
                Process.Start(path, info);
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
        }
Esempio n. 29
0
		///<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);
			//usage: C:\Dxis\Dxis.exe /i /t:UniqueID - Practice Name
			//The UniqueID can be a combo of patient name and id.  I think we'll combine Lname,Fname,PatNum
			if(pat==null){
				MsgBox.Show("Dxis","Please select a patient first.");
				return;
			}
			ArrayList ForProgram=ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
			string info="/i /t:"+pat.LName+" "+pat.FName+" "+pat.PatNum.ToString()+" - "+PrefC.GetString(PrefName.PracticeTitle);
			Process process=new Process();
			process.StartInfo=new ProcessStartInfo(path,info);
			try{
				process.Start();
				process.WaitForExit();//puts OD in sleep mode because the pano is so resource intensive.
			}
			catch{
				MessageBox.Show(path+" is not available.");
			}
		}
Esempio n. 30
0
        ///<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);
            ArrayList ForProgram = ProgramProperties.GetForProgram(ProgramCur.ProgramNum);;

            if (pat != null)
            {
                ProgramProperty PPCur   = ProgramProperties.GetCur(ForProgram, "Storage Path");
                string          comline = "-P" + PPCur.PropertyValue + @"\";
                //Patient id can be any string format
                PPCur = ProgramProperties.GetCur(ForProgram, "Enter 0 to use PatientNum, or 1 to use ChartNum");;
                if (PPCur.PropertyValue == "0")
                {
                    comline += pat.PatNum.ToString();
                }
                else
                {
                    comline += pat.ChartNumber;
                }
                comline += " -N" + pat.LName + ", " + pat.FName;
                comline  = comline.Replace("\"", "");           //gets rid of any quotes
                comline  = comline.Replace("'", "");            //gets rid of any single quotes
                try{
                    Process.Start(path, comline);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }            //if patient is loaded
            else
            {
                try{
                    Process.Start(path);                    //should start Trophy without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }