예제 #1
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);

            //Example CerPI.exe -<patNum>;<fname>;<lname>;<birthday DD.MM.YYYY>; (Date format specified in the windows Regional Settings)
            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //should start Cerec without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            string info = " -";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                info += pat.PatNum.ToString() + ";";
            }
            else
            {
                info += pat.ChartNumber.ToString() + ";";
            }
            info += pat.FName + ";" + pat.LName + ";" + pat.Birthdate.ToShortDateString() + ";";
            try {
                ODFileUtils.ProcessStart(path, info);
            }
            catch {
                MessageBox.Show(path + " is not available, or there is an error in the command line options.");
            }
        }
예제 #2
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{
                    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);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
예제 #3
0
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //shold start rayMage without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
            else
            {
                string info = " /PATID \"";
                if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
                {
                    info += pat.PatNum.ToString();
                }
                else
                {
                    info += pat.ChartNumber;
                }
                info += "\" /NAME \"" + pat.FName.Replace(" ", "").Replace("\"", "") + "\" /SURNAME \"" + pat.LName.Replace(" ", "").Replace("\"", "") + "\"";
                try {
                    ODFileUtils.ProcessStart(path, ProgramCur.CommandLine + info);
                }
                catch {
                    MessageBox.Show(path + " is not available, or there is an error in the command line options.");
                }
            }
        }
예제 #4
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);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //should start i-Dixel without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
            else
            {
                string args = " ";
                if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
                {
                    args += pat.PatNum + " ";
                }
                else
                {
                    args += pat.ChartNumber + " ";
                }
                args += pat.FName + " " + pat.LName + " " + (pat.Gender == PatientGender.Female ? "F" : "M");
                try {
                    ODFileUtils.ProcessStart(path, args);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
예제 #5
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.</summary>

        /*Data like the following:
         * [PATIENT]
         * PatID=100011PC        <--- This is the key from the PMS that we will use to locate the Patient in Panda.
         * Title=Miss
         * FirstName=Janet
         * LastName=Wang
         * MiddleInitial=L
         * NickName=
         * Sex=F
         * BirthDate=12/28/1950
         * HomePhone=(360)897-5555
         * WorkPhone=(360)748-7777
         * WorkPhoneExt=
         * SSN=697-12-8888
         * ProviderName=David S North, DDS
         * [ACCOUNT]
         * AccountNO=100003
         * Title=
         * FirstName=Pamela
         * LastName=Courtney
         * MiddleInitial=J
         * Suffix=
         * HomePhone=(360)987-5555
         * WorkPhone=(360)748-7777
         * WorkPhoneExt=
         * Street=23665 Malmore Rd
         * City=Rochester
         * State=WA
         * Zip=98579
         * [REFERDR]
         * RefdrID=NELS12345          <--- This is the key from the PMS that we will use to locate the Referring Doctor in Panda.
         * RefdrLastName=Nelson
         * RefdrfirstName=Michael
         * RefdrMiddleInitial=
         * RefdrNickName=Mike
         * RefdrStreet=1234 Anywhere St.
         * RefdrStreet2=Suite 214
         * RefdrCity=Centralia
         * RefdrState=WA
         * RefdrZip=98531
         * RefdrWorkPhone=(360)256-3258
         * RefdrFax=
         *
         * Should appear in the following file: C:/Program Files/Panda Perio/PandaPerio.ini
         */
        public static void SendData(Program programCur, Patient pat)
        {
            string path = Programs.GetProgramPath(programCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            if (pat.Birthdate.Year < 1880)
            {
                MessageBox.Show("Patient must have a valid birthdate.");
                return;
            }
            string iniPath = GetIniFromRegistry();

            if (string.IsNullOrEmpty(iniPath))
            {
                MsgBox.Show("PandaPerioAdvanced", "The ini file is not available.");
                return;
            }
            try {
                ODFileUtils.WriteAllTextThenStart(iniPath, GetIniString(pat, programCur), path);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #6
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.");
            }
        }
예제 #7
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            string str = "";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                str += "/ID:" + TidyAndEncapsulate(pat.PatNum.ToString()) + " ";
            }
            else
            {
                str += "/ID:" + TidyAndEncapsulate(pat.ChartNumber) + " ";
            }
            str += "/LN:" + TidyAndEncapsulate(pat.LName) + " ";
            str += "/N:" + TidyAndEncapsulate(pat.FName) + " ";
            try {
                ODFileUtils.ProcessStart(path, str);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #8
0
        ///<summary>This bridge has not yet been added to the database.  CaptureLink reads the bridge parameters from the clipboard.</summary>
        //Command format: LName FName PatID
        public static void SendData(Program ProgramCur, Patient pat)
        {
            if (pat == null)
            {
                MessageBox.Show("No patient selected.");
                return;
            }
            string path = Programs.GetProgramPath(ProgramCur);
            string info = Tidy(pat.LName) + " ";

            info += Tidy(pat.FName) + " ";
            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                info += pat.PatNum.ToString();
            }
            else
            {
                if (pat.ChartNumber == null || pat.ChartNumber == "")
                {
                    MsgBox.Show("CaptureLink", "This patient does not have a chart number.");
                    return;
                }
                info += Tidy(pat.ChartNumber);
            }
            Clipboard.Clear();
            ODClipboard.SetClipboard(info);
            try {
                ODFileUtils.ProcessStart(path);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #9
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            if (pat == null)
            {
                MsgBox.Show("OrthoCAD", "Please select a patient first.");
                return;
            }
            string path = Programs.GetProgramPath(ProgramCur);
            string cmd  = "";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                cmd += "-patient_id=" + POut.Long(pat.PatNum);
            }
            else
            {
                cmd += "-chart_number=" + pat.ChartNumber;
            }
            try {
                ODFileUtils.ProcessStart(path, cmd);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #10
0
 private void butRecord_Click(object sender, EventArgs e)
 {
     //The following article was used to figure out how to launch the appropriate executable:
     //http://blogs.microsoft.co.il/blogs/tamir/archive/2007/12/04/seek-and-hide-x64-or-where-my-sound-recoder.aspx
     try{
         //Try to launch the sound recorder program within the Windows operating system
         //for all versions of Windows prior to Windows Vista.
         ODFileUtils.ProcessStart("sndrec32.exe");
         //Process.Start("sndrec32.exe");
     }
     catch {
         //We are on a Windows Vista or later Operating System.
         //The path to the SoundRecorder.exe changes depending on if the Operating System
         //is 32 bit or 64 bit.
         try{
             //First try to launch the SoundRecorder.exe for 32 bit Operating Systems.
             ODFileUtils.ProcessStart("SoundRecorder.exe", "/file outputfile.wav");
             //Process.Start("SoundRecorder.exe","/file outputfile.wav");
         }
         catch {
             //This is a 64 bit Operating System. A special environment variable path must be used to indirectly access
             //the SoundRecoder.exe file. The resulting path inside of the soundRecoderVirtualPath variable will only
             //exist inside of this program and does not actually exist if one tries to browse to it.
             string soundRecorderVirtualPath = Environment.ExpandEnvironmentVariables(@"%systemroot%\Sysnative") + "\\SoundRecorder.exe";
             try {
                 ODFileUtils.ProcessStart(soundRecorderVirtualPath, "/file outputfile.wav");
                 //Process.Start(soundRecorderVirtualPath,"/file outputfile.wav");
             }
             catch {
                 //Windows 10 does not have this sound recorder program anymore.
                 MsgBox.Show(this, "Cannot find Windows Sound Recorder. Use the 'Record New' button to record a message sound.");
             }
         }
     }
 }
예제 #11
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                MsgBox.Show("Adstra", "Please select a patient first.");
                return;
            }
            string str = "";

            str += Tidy(pat.LName) + ",";
            str += Tidy(pat.FName) + ",";
            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                str += pat.PatNum.ToString() + ",,";
            }
            else
            {
                str += "," + Tidy(pat.ChartNumber) + ",";
            }
            //If birthdates are optional, only send them if they are valid.
            str += pat.Birthdate.ToString("yyyy/MM/dd");           //changed to match bridge format. Was MM/dd/yyy
            try {
                ODFileUtils.ProcessStart(path, str);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #12
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{
                ODFileUtils.ProcessStart(path, info);
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
        }
예제 #13
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.///</summary>

/*The command line integration works as follows:
 *
 * C:\Program Files\MiDentView\Cmdlink.exe /ID=12345 /FN=JOHN /LN=DOE /BD=10/01/1985 /Sex=M
 *
 * Parameters:'/ID=' for ID number, '/FN=' for Firstname, '/LN=' for Lastname, '/BD=' for Birthdate, '/Sex=' for Sex.
 *
 * Example of a name with special characters (in this case, spaces):
 * C:\Program Files\MiDentView\Cmdlink.exe /ID=12345 /FN=Oscar /LN=De La Hoya /BD=10/01/1985 /Sex=M
 */
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //should start MiPACS without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
            string gender = (pat.Gender == PatientGender.Female)?"F":"M";        //M for Male, F for Female, M for Unknown.
            string info   = "";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                info += "/ID=" + pat.PatNum.ToString();
            }
            else
            {
                info += "/ID=" + pat.ChartNumber;
            }
            info += " /FN=" + pat.FName            //special characters claimed to be ok
                    + " /LN=" + pat.LName
                    + " /BD=" + pat.Birthdate.ToShortDateString()
                    + " /Sex=" + gender;
            try {
                ODFileUtils.ProcessStart(path, info);
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
        }
예제 #14
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.");
            }
        }
예제 #15
0
 ///<summary></summary>
 public static void ShowPage()
 {
     try {
         ODFileUtils.ProcessStart("http://www.opendental.com/resources/redirects/redirectcds.html");
     }
     catch {
         MsgBox.Show("CDS", "Failed to open web browser.  Please make sure you have a default browser set and are connected to the internet then try again.");
     }
 }
예제 #16
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                MsgBox.Show("Office", "Please select a patient first.");
                return;
            }
            string fileName    = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Document folder");
            string oldFileName = ODFileUtils.CombinePaths(fileName, Tidy(pat.LName + pat.FName));

            //ProgramProperties.GetPropVal() is the way to get program properties.
            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                fileName     = ODFileUtils.CombinePaths(fileName, pat.PatNum.ToString());
                oldFileName += pat.PatNum.ToString();
            }
            else
            {
                fileName     = ODFileUtils.CombinePaths(fileName, Tidy(pat.ChartNumber));
                oldFileName += Tidy(pat.ChartNumber);
            }
            fileName    += ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "File extension");
            oldFileName += ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "File extension");
            Process          process   = new Process();
            ProcessStartInfo startInfo = new ProcessStartInfo();

            if (!File.Exists(fileName))
            {
                if (File.Exists(oldFileName))
                {
                    fileName = oldFileName;
                }
                else
                {
                    try {
                        startInfo.WindowStyle = ProcessWindowStyle.Hidden;
                        string cmdLocation = Environment.GetFolderPath(Environment.SpecialFolder.Windows) + @"\system32\cmd.exe"; //This is incase the user doesn't have C: as their default drive letter.
                        startInfo.FileName  = cmdLocation;                                                                        //Path for the cmd prompt
                        startInfo.Arguments = "/c copy nul " + fileName;
                        process.StartInfo   = startInfo;
                        ODFileUtils.ProcessStart(process);
                    }
                    catch (Exception ex) {
                        MessageBox.Show(ex.Message);
                        return;
                    }
                }
            }
            try {
                ODFileUtils.ProcessStart(path, fileName);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #17
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.///</summary>

/*Data like the following:
 * [Patient]
 * ID=A123456789
 * Gender=Male
 * First=John
 * Last=Smith
 * Year=1955
 * Month=1
 * Day=23
 * [Dentist]
 * ID=001
 * Password=1234
 *
 * Should appear in the following file: C:/Program Files/Digirex/Switch.ini
 * and should be accessed/opened by C:/Program Files/Digirex/digirex.ini
 */
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //should start Apixia without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
            else
            {
                string iniString = "[Patient]\r\n";
                if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
                {
                    iniString += "ID=" + pat.PatNum.ToString() + "\r\n";
                }
                else
                {
                    iniString += "ID=" + pat.ChartNumber + "\r\n";
                }
                Provider priProv = Providers.GetProv(pat.PriProv);
                if (priProv == null)
                {
                    MsgBox.Show("Apixia", "Invalid provider for the selected patient.");
                    return;
                }
                iniString += "Gender=" + pat.Gender.ToString() + "\r\n"
                             + "First=" + pat.FName + "\r\n"
                             + "Last=" + pat.LName + "\r\n"
                             + "Year=" + pat.Birthdate.Year.ToString() + "\r\n"
                             + "Month=" + pat.Birthdate.Month.ToString() + "\r\n"
                             + "Day=" + pat.Birthdate.Day.ToString() + "\r\n"
                             + "[Dentist]\r\n"
                             + "ID=" + priProv.Abbr + "\r\n"//Abbreviation is guaranteed non-blank, because of UI validation in the provider edit window.
                             + "Password=digirex";
                // Write the string to a file.
                string iniPath = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "System path to Apixia Digital Imaging ini file");
                try {
                    StreamWriter iniFile = new System.IO.StreamWriter(iniPath);
                    iniFile.WriteLine(iniString);
                    iniFile.Close();
                    ODFileUtils.ProcessStart(path);
                }
                catch (UnauthorizedAccessException ex) {
                    MessageBox.Show(ex.Message);
                }
                catch (Exception ex) {
                    ex.DoNothing();
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
예제 #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.");
                }
            }
        }
예제 #19
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            try {
                ODFileUtils.ProcessStart(path, ProgramCur.CommandLine);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #20
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.");
            }
        }
예제 #21
0
        ///<summary>Opens the homepage for Midway Dental's website</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            try {
                ODFileUtils.ProcessStart(path);
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
            return;
        }
예제 #22
0
 ///<summary>Returns true if the communications were successful, and false if they failed.</summary>
 public static bool Launch(Clearinghouse clearinghouseClin, int batchNum)         //called from Eclaims.cs. Clinic-level clearinghouse passed in.
 {
     try {
         ODFileUtils.ProcessStart(clearinghouseClin.ClientProgram, doWaitForODCloudClientResponse: true);
     }
     catch (Exception ex) {
         //X12.Rollback(clearhouse,batchNum);//doesn't actually do anything
         ErrorMessage = ex.Message;
         return(false);
     }
     return(true);
 }
예제 #23
0
        /// <summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)           //Launch program without any patient.
            {
                try {
                    ODFileUtils.ProcessStart(path);
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            //Documentation for command line arguments is very vague.
            //See \\serverfiles\Storage\OPEN DENTAL\Programmers Documents\Bridge Info\RemoteExecuter for documentation on how this is being used by NADG
            List <string> listArgs = new List <string>();

            listArgs.Add(ProgramCur.CommandLine);
            listArgs.Add("-first=\"" + Tidy(pat.FName) + "\"");
            listArgs.Add("-last=\"" + Tidy(pat.LName) + "\"");
            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                listArgs.Add("-id=\"" + pat.PatNum.ToString() + "\"");
            }
            else
            {
                listArgs.Add("-id=\"" + Tidy(pat.ChartNumber) + "\"");
            }
            //Required. Should update automatically based on pat id, in the case where first bridged with b-date 01/01/0001, although we don't know for sure
            listArgs.Add("-DOB=\"" + pat.Birthdate.ToString("yyyy-MM-dd") + "\"");
            if (pat.Gender == PatientGender.Female)
            {
                //Probably what they use for female, based on their example for male, although we do not know for sure because the specification does not say.
                listArgs.Add("-sex=\"f\"");
            }
            else if (pat.Gender == PatientGender.Male)
            {
                listArgs.Add("-sex=\"m\"");                //This option is valid, because it is part of the example inside the specification.
            }
            else
            {
                //Probably what they use for unknown (if unknown is even an option), based on their example for male, although we do not know for sure because
                //the specification does not say.
                listArgs.Add("-sex=\"u\"");
            }
            try {
                ODFileUtils.ProcessStart(path, string.Join(" ", listArgs));
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #24
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            //filepath.exe -patid 123 -fname John -lname Doe -dob 01/25/1962 -ssn 123456789 -gender M
            if (pat == null)
            {
                MessageBox.Show("Please select a patient first");
                return;
            }
            string info = "-patid ";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                info += pat.PatNum.ToString() + " ";
            }
            else
            {
                info += pat.ChartNumber + " ";
            }
            info += "-fname " + Tidy(pat.FName) + " "
                    + "-lname " + Tidy(pat.LName) + " ";
            if (pat.Birthdate.Year > 1880)
            {
                info += "-dob " + pat.Birthdate.ToShortDateString() + " ";
            }
            else
            {
                info += "-dob  ";
            }
            if (pat.SSN.Replace("0", "").Trim() != "")          //An SSN which is all zeros will be treated as a blank SSN.  Needed for eCW, since eCW sets SSN to 000-00-0000 if the patient does not have an SSN.
            {
                info += "-ssn " + pat.SSN + " ";
            }
            else
            {
                info += "-ssn  ";
            }
            if (pat.Gender == PatientGender.Female)
            {
                info += "-gender F";
            }
            else
            {
                info += "-gender M";
            }
            try {
                ODFileUtils.ProcessStart(path, info);
            }
            catch {
                MessageBox.Show(path + " is not available.");
            }
        }
예제 #25
0
        ///<summary>Launches the program using a combination of command line characters and the patient.Cur data.
        ///Arguments: tscan.exe [-fFirstname [-mMiddlename] -lLastname -iPatientid [-dBirthday] [-jBirthmonth] [-yBirthyear] [-gGender]]
        ///Example: tscan.exe -fBrent -lThompson -iBT1000 -d07 -j02 -y1962 -g2</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);                    //should start Tscan without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
                return;
            }
            string info = "-f" + Tidy(pat.FName) + " "; //First name can only be alpha-numeric, so we remove non-alpha-numeric characters.

            if (Tidy(pat.MiddleI) != "")                //Only send middle name if available, since it is optional.
            {
                info += "-m" + Tidy(pat.MiddleI) + " "; //Middle name can only be alpha-numeric, so we remove non-alpha-numeric characters.
            }
            info += "-l" + Tidy(pat.LName) + " ";       //Last name can only be alpha-numeric, so we remove non-alpha-numeric characters.
            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                info += "-i" + pat.PatNum.ToString() + " ";
            }
            else
            {
                info += "-i" + Tidy(pat.ChartNumber) + " ";          //Patient id only alpha-numeric as required.
            }
            //Birthdate is optional, so we only send if valid.
            if (pat.Birthdate.Year > 1880)
            {
                info += "-d" + pat.Birthdate.Day.ToString().PadLeft(2, '0') + " ";   //The example in specification shows days with two digits, so we pad.
                info += "-j" + pat.Birthdate.Month.ToString().PadLeft(2, '0') + " "; //The example in specification shows months with two digits, so we pad.
                info += "-y" + pat.Birthdate.Year.ToString() + " ";                  //The example specification shows years 4 digits long.
            }
            //Gender is optional, so we only send if not Unknown.
            if (pat.Gender == PatientGender.Female)
            {
                info += "-g1 ";
            }
            else if (pat.Gender == PatientGender.Male)
            {
                info += "-g2 ";
            }
            try {
                ODFileUtils.ProcessStart(path, info);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #26
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.");
            }
        }
예제 #27
0
        ///<summary>Process existing insurance plan updates from the ALLPLANS.TXT file.</summary>
        private static void ProcessTrojanPlanUpdates(string file)
        {
            if (!File.Exists(file))
            {
                //Nothing to process.
                return;
            }
            MessageBox.Show("Trojan update found.  Please print or save the text file when it opens, then close it.  You will be given a chance to cancel the update after that.");
            ODFileUtils.ProcessStart(file);
            if (!MsgBox.Show("Trojan", true, "Trojan plans will now be updated."))
            {
                return;
            }
            Cursor.Current = Cursors.WaitCursor;
            string allplantext = "";

            using (StreamReader sr = new StreamReader(file)) {
                allplantext = sr.ReadToEnd();
            }
            if (allplantext == "")
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show("Could not read file contents: " + file);
                return;
            }
            bool updateBenefits = MsgBox.Show("Trojan", MsgBoxButtons.YesNo, "Also update benefits?  Any customized benefits will be overwritten.");
            bool updateNote     = MsgBox.Show("Trojan", MsgBoxButtons.YesNo, "Automatically update plan notes?  Any existing notes will be overwritten.  If you click No, you will be presented with each change for each plan so that you can edit the notes as needed.");

            string[] trojanplans   = allplantext.Split(new string[] { "TROJANID" }, StringSplitOptions.RemoveEmptyEntries);
            int      plansAffected = 0;

            try {
                for (int i = 0; i < trojanplans.Length; i++)
                {
                    trojanplans[i] = "TROJANID" + trojanplans[i];
                    plansAffected += ProcessTrojanPlan(trojanplans[i], updateBenefits, updateNote);
                }
            }
            catch (Exception e) {           //this will happen if user clicks cancel in a note box.
                MessageBox.Show("Error: " + e.Message + "\r\n\r\nWe will need a copy of the ALLPLANS.txt.");
                return;
            }
            Cursor.Current = Cursors.Default;
            MessageBox.Show(plansAffected.ToString() + " plans updated.");
            try{
                File.Delete(file);
            }
            catch {
                MessageBox.Show(file + " could not be deleted.  Please delete manually.");
            }
        }
예제 #28
0
        ///<summary>Sends data for Patient.Cur by command line interface.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                MsgBox.Show("VixWinNumbered", "Please select a patient first.");
                return;
            }
            string ppImagePath = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Image Path");

            if (ppImagePath.Trim() == "")
            {
                MsgBox.Show("VixWinNumbered", "Missing Image Path.");
                return;
            }
            string subDirNumbers = (pat.PatNum % 100).ToString().PadLeft(2, '0');       //Take the rightmost 2 numbers, preceeding with 0 if patnum<10
            string fullPath      = ODFileUtils.CombinePaths(ppImagePath.Trim(), subDirNumbers, pat.PatNum.ToString());

            if (!ODBuild.IsWeb() && !Directory.Exists(fullPath))
            {
                try {
                    Directory.CreateDirectory(fullPath);
                }
                catch {
                    MessageBox.Show(Lan.g("VixWinNumbered", "Patient image path could not be created.  This usually indicates a permission issue.  Path") + ":\r\n"
                                    + fullPath);
                    return;
                }
            }
            //Example: c:\vixwin\vixwin -I 123ABC -N Bill^Smith -P X:\VXImages\02\196402\
            string info = "-I ";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                info += pat.PatNum.ToString();
            }
            else
            {
                info += pat.ChartNumber;                                                    //max 64 char
            }
            info += " -N " + pat.FName.Replace(" ", "") + "^" + pat.LName.Replace(" ", ""); //no spaces allowed
            info += " -P " + fullPath;                                                      //This is the Numbered Mode subdirectory
            try {
                ODFileUtils.ProcessStart(path, info, createDirIfNeeded: fullPath);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message + "\r\nFile and command line:\r\n" + path + " " + info);
            }
        }
예제 #29
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 {
                    ODFileUtils.ProcessStart(path);                    //should start Owandy without bringing up a pt.
                }
                catch {
                    MessageBox.Show(path + " is not available.");
                }
            }
        }
예제 #30
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.");
            }
        }