예제 #1
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);
            }
        }
예제 #2
0
        private void butPrint_Click(object sender, EventArgs e)
        {
            string fileName = CodeBase.ODFileUtils.CombinePaths(PrefC.GetTempFolderPath(), "results.txt");

            ODFileUtils.WriteAllTextThenStart(fileName, textResults.Text, "");
            MsgBox.Show(this, "Please print from the text editor.");
        }
예제 #3
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (pat == null)
            {
                MsgBox.Show("Carestream", "Please select a patient first.");
                return;
            }
            string infoFile = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Patient.ini path");

            if (infoFile.Length > 150)
            {
                MsgBox.Show("Carestream", "Patient.ini file folder path too long.  Must be 150 characters or less.");
                return;
            }
            string id = "";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                id = pat.PatNum.ToString();
            }
            else
            {
                id = pat.ChartNumber;
            }
            StringBuilder sw = new StringBuilder();

            sw.AppendLine("[PATIENT]");
            sw.AppendLine("ID=" + Tidy(id, 15));
            sw.AppendLine("FIRSTNAME=" + Tidy(pat.FName, 255));
            if (!string.IsNullOrEmpty(pat.Preferred))
            {
                sw.AppendLine("COMMONNAME=" + Tidy(pat.Preferred, 255));
            }
            sw.AppendLine("LASTNAME=" + Tidy(pat.LName, 255));
            if (!string.IsNullOrEmpty(pat.MiddleI))
            {
                sw.AppendLine("MIDDLENAME=" + Tidy(pat.MiddleI, 255));
            }
            if (pat.Birthdate.Year > 1880)
            {
                sw.AppendLine("DOB=" + pat.Birthdate.ToString("yyyyMMdd"));
            }
            if (pat.Gender == PatientGender.Female)
            {
                sw.Append("GENDER=F");
            }
            else if (pat.Gender == PatientGender.Male)
            {
                sw.Append("GENDER=M");
            }
            try {
                string arguments = @"-I """ + infoFile + @"""";
                ODFileUtils.WriteAllTextThenStart(infoFile, sw.ToString(), path, arguments);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #4
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path    = Programs.GetProgramPath(ProgramCur);
            string iniFile = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Import.ini path");

            if (pat == null)
            {
                MsgBox.Show("Scanora", "Please select a patient first.");
                return;
            }
            //Start with a blank line per Scanora's example ini file, and then another blank line following the Header.
            string iniText = "\r\n[PracticeManagementInterface]\r\n\r\n"
                             + "CLEAR_PRACTICE_MANAGEMENT_AUTOMATICALLY = 1\r\n"
                             + "USE_PRACTICE_MANAGEMENT = 1\r\n"
                             + "PATID = ";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                iniText += pat.PatNum.ToString();
            }
            else
            {
                iniText += Tidy(pat.ChartNumber);
            }
            iniText += "\r\n";
            iniText += "PATLNAME = " + Tidy(pat.LName) + "\r\n";
            iniText += "PATMNAME = " + Tidy(pat.MiddleI) + "\r\n";
            iniText += "PATFNAME = " + Tidy(pat.FName) + "\r\n";
            iniText += "PATSOCSEC = ";
            if (pat.SSN.Replace("0", "").Trim() != "")
            {
                iniText += pat.SSN;
            }
            iniText += "\r\n";
            //We changed the date format from yyyy-MM-dd to ToShortDateString() because of an email from Chris Bope (Product Manager for Sorodex).
            //Chris said that a valid date must be in ToShortDateString() because their program assumes that is the format when it gets saved.
            //The email copy can be found on PatNum 23172 on a commlog dated 12/29/2015.
            iniText += "PATBD = " + pat.Birthdate.ToShortDateString() + "\r\n";
            iniText += "PROVIDER1 = " + Providers.GetFormalName(pat.PriProv) + "\r\n";
            iniText += "PROVIDER2 = " + Providers.GetFormalName(pat.SecProv) + "\r\n";
            iniText += "ADDRESS1 = " + Tidy(pat.Address) + "\r\n";
            iniText += "ADDRESS2 = " + Tidy(pat.Address2) + "\r\n";
            iniText += "CITY = " + Tidy(pat.City) + "\r\n";
            iniText += "STATE = " + Tidy(pat.State) + "\r\n";
            iniText += "ZIP = " + Tidy(pat.Zip) + "\r\n";
            iniText += "HOMEPHONE = " + new string(pat.HmPhone.Where(x => char.IsDigit(x)).ToArray()) + "\r\n";
            iniText += "WORKPHONE = " + new string(pat.WkPhone.Where(x => char.IsDigit(x)).ToArray()) + "\r\n";
            iniText += "EMAIL1 = " + Tidy(pat.Email) + "\r\n";
            try {
                //Chris Bope (Product Manager for Sorodex) said "ANSI" is the preferred encoding.
                //Code page 1252 is the most commonly used ANSI code page, and we use 1252 in other bridges as well.
                ODFileUtils.WriteAllTextThenStart(iniFile, iniText, Encoding.GetEncoding(1252), path, "");
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
예제 #5
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.");
            }
        }
예제 #6
0
        ///<summary>Sends data for the patient to linkage.xml and launches the program.</summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (!File.Exists(path))
            {
                MessageBox.Show(path + " could not be found.");
                return;
            }
            string dir     = Path.GetDirectoryName(path);
            string linkage = CodeBase.ODFileUtils.CombinePaths(dir, "linkage.xml");

            if (!ODBuild.IsWeb() && File.Exists(linkage))            //Will never exist for WEB version.
            {
                File.Delete(linkage);
            }
            if (pat != null)
            {
                StringBuilder     strb     = new StringBuilder();
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent             = true;
                settings.IndentChars        = "   ";
                settings.NewLineChars       = "\r\n";
                settings.OmitXmlDeclaration = true;
                XmlWriter writer = XmlWriter.Create(strb, settings);
                writer.WriteStartElement("LinkageParameter");
                writer.WriteStartElement("Patient");
                writer.WriteAttributeString("LastName", pat.LName);
                writer.WriteAttributeString("FirstName", pat.FName);
                if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
                {
                    writer.WriteAttributeString("ChartNumber", pat.PatNum.ToString());
                }
                else
                {
                    writer.WriteAttributeString("ChartNumber", pat.ChartNumber);
                }
                writer.WriteElementString("Birthday", pat.Birthdate.ToString("dd/MM/yyyy"));
                string addr = pat.Address;
                if (pat.Address2 != "")
                {
                    addr += ", " + pat.Address2;
                }
                addr += ", " + pat.City + ", " + pat.State;
                writer.WriteElementString("Address", addr);
                writer.WriteElementString("ZipCode", pat.Zip);
                writer.WriteElementString("Phone", pat.HmPhone);
                writer.WriteElementString("Mobile", pat.WirelessPhone);
                writer.WriteElementString("SocialID", pat.SSN);
                if (pat.Gender == PatientGender.Female)
                {
                    writer.WriteElementString("Gender", "Female");
                }
                else
                {
                    writer.WriteElementString("Gender", "Male");
                }
                writer.WriteEndElement();                //Patient
                writer.WriteEndElement();                //LinkageParameter
                writer.Flush();
                writer.Close();
                try {
                    ODFileUtils.WriteAllTextThenStart(linkage, strb.ToString(), path);
                    return;
                }
                catch (Exception e) {
                    e.DoNothing();
                }
            }
            try {
                //whether there is a patient or not.
                ODFileUtils.ProcessStart(path);
            }
            catch {
                MessageBox.Show("Error launching " + path);
            }
        }
예제 #7
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path = Programs.GetProgramPath(ProgramCur);

            if (!File.Exists(path))
            {
                MessageBox.Show(path + " could not be found.");
                return;
            }
            Process[] checkProg = Process.GetProcessesByName("AxCeph");
            string    dir       = Path.GetDirectoryName(path);
            string    updatexml = CodeBase.ODFileUtils.CombinePaths(dir, "update.xml");

            if (File.Exists(updatexml))
            {
                File.Delete(updatexml);
            }
            if (checkProg.Length == 0)
            {
                MessageBox.Show("AxCeph.exe not found. Please make sure AudaxCeph is running and try again.");
            }
            else if (pat == null)
            {
                ODFileUtils.ProcessStart(path);
            }
            else
            {
                StringBuilder     strb     = new StringBuilder();
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent             = true;
                settings.IndentChars        = "   ";
                settings.NewLineChars       = "\r\n";
                settings.OmitXmlDeclaration = true;
                XmlWriter writer = XmlWriter.Create(strb, settings);
                writer.WriteProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
                writer.WriteStartElement("AxCephComData");
                writer.WriteStartElement("Patients");
                writer.WriteStartElement("Patient");
                writer.WriteElementString("PIDOutside", pat.PatNum.ToString());
                writer.WriteElementString("NameOfPatient", Tidy(pat.LName) + ", " + Tidy(pat.FName));
                writer.WriteElementString("DateOfBirth", pat.Birthdate.ToString("yyyyMMdd"));
                if (pat.Gender.ToString() == "Female")
                {
                    writer.WriteElementString("Sex", "F");
                }
                else
                {
                    writer.WriteElementString("Sex", "M");
                }
                writer.WriteElementString("Active", "1");
                writer.WriteEndElement();                //Patient
                writer.WriteEndElement();                //Patients
                writer.WriteElementString("Command", "UpdateOrInsertPatient");
                writer.WriteElementString("ResultXMLFileName", "result.xml");
                writer.WriteElementString("ResultStatus", "");
                writer.WriteElementString("ResultMessage", "0");
                writer.WriteEndElement();                //AxCephComData
                writer.Flush();
                writer.Close();
                try {
                    ODFileUtils.WriteAllTextThenStart(updatexml, strb.ToString(), path, " update.xml");
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                }
            }
        }
예제 #8
0
        ///<summary>Typically used when user clicks a button to a Program link.  This method attempts to identify and execute the program based on the given programNum.</summary>
        public static void Execute(long programNum, Patient pat)
        {
            Program prog = Programs.GetFirstOrDefault(x => x.ProgramNum == programNum);

            if (prog == null)           //no match was found
            {
                MessageBox.Show("Error, program entry not found in database.");
                return;
            }
            if (pat != null && PrefC.GetBool(PrefName.ShowFeaturePatientClone))
            {
                pat = Patients.GetOriginalPatientForClone(pat);
            }
            if (prog.PluginDllName != "")
            {
                if (pat == null)
                {
                    Plugins.LaunchToolbarButton(programNum, 0);
                }
                else
                {
                    Plugins.LaunchToolbarButton(programNum, pat.PatNum);
                }
                return;
            }
            if (ODBuild.IsWeb() && prog.ProgName.In(Programs.GetListDisabledForWeb().Select(x => x.ToString())))
            {
                MsgBox.Show("ProgramLinks", "Bridge is not available while viewing through the web.");
                return;                //bridge is not available for web users at this time.
            }
            if (prog.ProgName == ProgramName.ActeonImagingSuite.ToString())
            {
                ActeonImagingSuite.SendData(prog, pat);
                return;
            }
            if (prog.ProgName == ProgramName.Adstra.ToString())
            {
                Adstra.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Apixia.ToString())
            {
                Apixia.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Apteryx.ToString())
            {
                Apteryx.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.AudaxCeph.ToString())
            {
                AudaxCeph.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.BencoPracticeManagement.ToString())
            {
                Benco.SendData(prog);
                return;
            }
            else if (prog.ProgName == ProgramName.BioPAK.ToString())
            {
                BioPAK.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.CADI.ToString())
            {
                CADI.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Camsight.ToString())
            {
                Camsight.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.CaptureLink.ToString())
            {
                CaptureLink.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Carestream.ToString())
            {
                Carestream.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Cerec.ToString())
            {
                Cerec.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.CleaRay.ToString())
            {
                CleaRay.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.CliniView.ToString())
            {
                Cliniview.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.ClioSoft.ToString())
            {
                ClioSoft.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.DBSWin.ToString())
            {
                DBSWin.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.DemandForce.ToString())
            {
                DemandForce.SendData(prog, pat);
                return;
            }
#if !DISABLE_WINDOWS_BRIDGES
            else if (prog.ProgName == ProgramName.DentalEye.ToString())
            {
                DentalEye.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.DentalStudio.ToString())
            {
                DentalStudio.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.DentX.ToString())
            {
                DentX.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.DrCeph.ToString())
            {
                DrCeph.SendData(prog, pat);
                return;
            }
#endif
            else if (prog.ProgName == ProgramName.DentalTekSmartOfficePhone.ToString())
            {
                DentalTek.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.DentForms.ToString())
            {
                DentForms.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Dexis.ToString())
            {
                Dexis.SendData(prog, pat);
                return;
            }
#if !DISABLE_WINDOWS_BRIDGES
            else if (prog.ProgName == ProgramName.DexisIntegrator.ToString())
            {
                DexisIntegrator.SendData(prog, pat);
                return;
            }
#endif
            else if (prog.ProgName == ProgramName.Digora.ToString())
            {
                Digora.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Dimaxis.ToString())
            {
                Planmeca.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Office.ToString())
            {
                Office.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Dolphin.ToString())
            {
                Dolphin.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.DXCPatientCreditScore.ToString())
            {
                DentalXChange.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Dxis.ToString())
            {
                Dxis.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.EvaSoft.ToString())
            {
                EvaSoft.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.EwooEZDent.ToString())
            {
                Ewoo.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.FloridaProbe.ToString())
            {
                FloridaProbe.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Guru.ToString())
            {
                Guru.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.HandyDentist.ToString())
            {
                HandyDentist.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.HouseCalls.ToString())
            {
                FormHouseCalls FormHC = new FormHouseCalls();
                FormHC.ProgramCur = prog;
                FormHC.ShowDialog();
                return;
            }
            else if (prog.ProgName == ProgramName.iCat.ToString())
            {
                ICat.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.HdxWill.ToString())
            {
                HdxWill.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.iDixel.ToString())
            {
                iDixel.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.ImageFX.ToString())
            {
                ImageFX.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.iRYS.ToString())
            {
                Irys.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Lightyear.ToString())
            {
                Lightyear.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.NewTomNNT.ToString())
            {
                NewTomNNT.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.MediaDent.ToString())
            {
                MediaDent.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Midway.ToString())
            {
                Midway.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.MiPACS.ToString())
            {
                MiPACS.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.OrthoCAD.ToString())
            {
                OrthoCad.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Oryx.ToString())
            {
                Oryx.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.OrthoInsight3d.ToString())
            {
                OrthoInsight3d.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Owandy.ToString())
            {
                Owandy.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.PandaPerio.ToString())
            {
                PandaPerio.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.PandaPerioAdvanced.ToString())
            {
                PandaPerioAdvanced.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Patterson.ToString())
            {
                Patterson.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.PDMP.ToString())
            {
                string response = "";
                if (PDMP.TrySendData(prog, pat, out response))
                {
                    FormWebBrowser formWebBrowser = new FormWebBrowser(response);
                    formWebBrowser.Show();
                }
                else
                {
                    MessageBox.Show(response, "PDMP");
                }
                return;
            }
            else if (prog.ProgName == ProgramName.PerioPal.ToString())
            {
                PerioPal.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.PracticeByNumbers.ToString())
            {
                PracticeByNumbers.ShowPage();
                return;
            }
            else if (prog.ProgName == ProgramName.Progeny.ToString())
            {
                Progeny.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.PT.ToString())
            {
                PaperlessTechnology.SendData(prog, pat, false);
                return;
            }
            else if (prog.ProgName == ProgramName.PTupdate.ToString())
            {
                PaperlessTechnology.SendData(prog, pat, true);
                return;
            }
            else if (prog.ProgName == ProgramName.RayMage.ToString())
            {
                RayMage.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Romexis.ToString())
            {
                Romexis.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Scanora.ToString())
            {
                Scanora.SendData(prog, pat);
                return;
            }
#if !DISABLE_WINDOWS_BRIDGES
            else if (prog.ProgName == ProgramName.Schick.ToString())
            {
                Schick.SendData(prog, pat);
                return;
            }
#endif
            else if (prog.ProgName == ProgramName.Sirona.ToString())
            {
                Sirona.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.SMARTDent.ToString())
            {
                SmartDent.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Sopro.ToString())
            {
                Sopro.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.TigerView.ToString())
            {
                TigerView.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Triana.ToString())
            {
                Triana.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.TrojanExpressCollect.ToString())
            {
                using (FormTrojanCollect FormT = new FormTrojanCollect(pat)) {
                    FormT.ShowDialog();
                }
                return;
            }
            else if (prog.ProgName == ProgramName.Trophy.ToString())
            {
                Trophy.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.TrophyEnhanced.ToString())
            {
                TrophyEnhanced.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.Tscan.ToString())
            {
                Tscan.SendData(prog, pat);
                return;
            }
#if !DISABLE_WINDOWS_BRIDGES
            else if (prog.ProgName == ProgramName.Vipersoft.ToString())
            {
                Vipersoft.SendData(prog, pat);
                return;
            }
#endif
            else if (prog.ProgName == ProgramName.visOra.ToString())
            {
                Visora.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.VistaDent.ToString())
            {
                VistaDent.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.VixWin.ToString())
            {
                VixWin.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.VixWinBase36.ToString())
            {
                VixWinBase36.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.VixWinBase41.ToString())
            {
                VixWinBase41.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.VixWinNumbered.ToString())
            {
                VixWinNumbered.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.VixWinOld.ToString())
            {
                VixWinOld.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.XDR.ToString())
            {
                XDR.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.XVWeb.ToString())
            {
                XVWeb.SendData(prog, pat);
                return;
            }
            else if (prog.ProgName == ProgramName.ZImage.ToString())
            {
                ZImage.SendData(prog, pat);
                return;
            }
            //all remaining programs:
            try{
                string cmdline        = prog.CommandLine;
                string path           = Programs.GetProgramPath(prog);
                string outputFilePath = prog.FilePath;
                string fileTemplate   = prog.FileTemplate;
                if (pat != null)
                {
                    cmdline = ReplaceHelper(cmdline, pat);
                    path    = ReplaceHelper(path, pat);
                    if (!String.IsNullOrEmpty(outputFilePath) && !String.IsNullOrEmpty(fileTemplate))
                    {
                        fileTemplate = ReplaceHelper(fileTemplate, pat);
                        fileTemplate = fileTemplate.Replace("\n", "\r\n");
                        ODFileUtils.WriteAllTextThenStart(outputFilePath, fileTemplate, path, cmdline);
                        //Nothing else to do so return;
                        return;
                    }
                }
                //We made it this far and we haven't started the program yet so start it.
                ODFileUtils.ProcessStart(path, cmdline);
            }
            catch (Exception e) {
                MessageBox.Show(prog.ProgDesc + " is not available.");
                return;
            }
        }
예제 #9
0
        ///<summary></summary>
        public static void SendData(Program ProgramCur, Patient pat)
        {
            string path    = Programs.GetProgramPath(ProgramCur);
            string iniFile = ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Import.ini path");
            string cmd     = "-F" + iniFile;    //No space between -F and the ini path on purpose per Genoray Triana documentation.

            if (pat == null)
            {
                try {
                    ODFileUtils.ProcessStart(path);
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                }
                return;
            }
            string iniText = "[OPERATION]\r\n"
                             + "EXECUTE=3\r\n"  //EXECUTE=3 will register the patient and then open them. If patient is already registered, it will just open them.
                             + "[PATIENT]\r\n"
                             + "PATIENTID=";

            if (ProgramProperties.GetPropVal(ProgramCur.ProgramNum, "Enter 0 to use PatientNum, or 1 to use ChartNum") == "0")
            {
                iniText += pat.PatNum.ToString() + "\r\n";
            }
            else
            {
                iniText += Tidy(pat.ChartNumber) + "\r\n";
            }
            iniText += "FIRSTNAME=" + Tidy(pat.FName) + "\r\n";
            iniText += "LASTNAME=" + Tidy(pat.LName) + "\r\n";
            iniText += "SOCIAL_SECURITY=";
            //If SSN is allowed by the bridge software, then it will always be optional, because SSNs are not common enough to require.
            //Additionally, Open Dental does not require SSN when creating a patient, so we cannot guarantee that the SSN exists.
            if (pat.SSN.Replace("0", "").Trim() != "")
            {
                iniText += pat.SSN;
            }
            iniText += "\r\n";
            iniText += "BIRTHDAY=";
            if (pat.Birthdate.Year > 1880)
            {
                iniText += pat.Birthdate.ToString("yyyyMMdd");
            }
            iniText += "\r\n";
            iniText += "PATIENTCOMMENT=\r\n";          //No need to import patient comments
            iniText += "GENDER=";
            if (pat.Gender == PatientGender.Male)
            {
                iniText += "1";
            }
            else if (pat.Gender == PatientGender.Female)
            {
                iniText += "2";
            }
            else
            {
                iniText += "3";
            }
            try {
                ODFileUtils.WriteAllTextThenStart(iniFile, iniText, Encoding.GetEncoding(1252), path, cmd);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }