コード例 #1
0
ファイル: BCBSGA.cs プロジェクト: royedwards/DRDNet
        ///<summary>Retrieves any waiting reports from this clearinghouse. Returns true if the communications were successful, and false if they failed.</summary>
        public static bool Retrieve(Clearinghouse clearinghouseClin, bool isAutomatic, ITerminalConnector terminalConnector, IODProgressExtended progress = null)
        {
            progress = progress ?? new ODProgressExtendedNull();
            bool retVal = true;

            try {
                progress.UpdateProgress(Lans.g(progress.LanThis, "Contacting web server and downloading reports"), "reports", "17%", 17);
                if (progress.IsPauseOrCancel())
                {
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                    return(false);
                }
                terminalConnector.ShowForm();
                terminalConnector.OpenConnection(clearinghouseClin.ModemPort);
                terminalConnector.Dial("17065713158");
                //2. Wait for connect, then pause 3 seconds
                terminalConnector.WaitFor("CONNECT 9600", 50000);
                terminalConnector.Pause(3000);
                terminalConnector.ClearRxBuff();
                //1. Send submitter login record
                string submitterLogin =
                    "******"                                                    //1,6 /SLRON=Submitter login
                    + terminalConnector.Sout(clearinghouseClin.LoginID, 12, 12) //7,12 Submitter ID
                    + terminalConnector.Sout(clearinghouseClin.Password, 8, 8)  //19,8 submitter password
                    + "   "                                                     //27,3 use 3 spaces
                    //Possible issue with Trans ID
                    + "12345678"                                                //30,8. they did not explain this field very well in documentation
                    + "*              "                                         //38,15 "    *          "=All available. spacing ok?
                    + "X"                                                       //53,1 X=Xmodem, or Y for transmission protocol
                    + "MDD "                                                    //54,4 use 'MDD '
                    + "VND"                                                     //58,3 Vendor ID is yet to be assigned by BCBS
                    + "00";                                                     //61,2 Software version not important
                byte   response     = (byte)'Y';
                string retrieveFile = "";
                progress.UpdateProgress(Lans.g(progress.LanThis, "Web server contact successful."));
                progress.UpdateProgress(Lans.g(progress.LanThis, "Downloading files"), "reports", "33%", 33);
                if (progress.IsPauseOrCancel())
                {
                    return(false);
                }
                while (response == (byte)'Y')
                {
                    terminalConnector.ClearRxBuff();
                    terminalConnector.Send(submitterLogin);
                    response = 0;
                    while (response != (byte)'N' && response != (byte)'Y' && response != (byte)'Z')
                    {
                        response = terminalConnector.GetOneByte(20000);
                        terminalConnector.ClearRxBuff();
                        Application.DoEvents();
                    }
                    //2. If not accepted, N is returned
                    //3. and must receive transmission acknowledgement
                    if (response == (byte)'N')
                    {
                        progress.UpdateProgress(terminalConnector.Receive(10000));
                        break;
                    }
                    //4. If login accepted, but no records, Z is returned. Hang up.
                    if (response == (byte)'Z')
                    {
                        progress.UpdateProgress(Lans.g(progress.LanThis, "No reports to retrieve."));
                        break;
                    }
                    //5. If record(s) available, Y is returned, followed by dos filename and 32 char subj.
                    //less than one second since all text is supposed to immediately follow the Y
                    retrieveFile = terminalConnector.Receive(800).Substring(0, 12);                 //12 char in dos filename
                    terminalConnector.ClearRxBuff();
                    //6. Pause for 200 ms. (already mostly handled);
                    terminalConnector.Pause(200);
                    //7. Receive file using Xmodem
                    //path must include trailing slash for now.
                    terminalConnector.DownloadXmodem(clearinghouseClin.ResponsePath + retrieveFile);
                    //8. Pause for 5 seconds.
                    terminalConnector.Pause(5000);
                    //9. Repeat all steps including login until a Z is returned.
                }
                progress.UpdateProgress(Lans.g(progress.LanThis, "Closing connection to web server"), "reports", "50%", 50);
                if (progress.IsPauseOrCancel())
                {
                    return(false);
                }
            }
            catch (Exception ex) {
                ErrorMessage = ex.Message;
                retVal       = false;
            }
            finally {
                terminalConnector.CloseConnection();
            }
            return(retVal);
        }
コード例 #2
0
        private void FillGrid()
        {
            Cursor = Cursors.WaitCursor;
            gridMain.BeginUpdate();
            List <DisplayField> fields = DisplayFields.GetForCategory(DisplayFieldCategory.CEMTSearchPatients);

            if (gridMain.Columns.Count == 0)           //Init only once.
            {
                foreach (DisplayField field in fields)
                {
                    string heading = field.InternalName;
                    if (string.IsNullOrEmpty(heading))
                    {
                        heading = field.Description;
                    }
                    gridMain.Columns.Add(new ODGridColumn(heading, field.ColumnWidth));
                }
            }
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < _dataConnPats.Tables.Count; i++)
            {
                for (int j = 0; j < _dataConnPats.Tables[i].Rows.Count; j++)
                {
                    row = new ODGridRow();
                    foreach (DisplayField field in fields)
                    {
                        switch (field.InternalName)
                        {
                            #region Row Cell Filling
                        case "Conn":
                            row.Cells.Add(_dataConnPats.Tables[i].TableName);
                            break;

                        case "PatNum":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["PatNum"].ToString());
                            break;

                        case "LName":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["LName"].ToString());
                            break;

                        case "FName":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["FName"].ToString());
                            break;

                        case "SSN":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["SSN"].ToString());
                            break;

                        case "PatStatus":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["PatStatus"].ToString());
                            break;

                        case "Age":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["age"].ToString());
                            break;

                        case "City":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["City"].ToString());
                            break;

                        case "State":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["State"].ToString());
                            break;

                        case "Address":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["Address"].ToString());
                            break;

                        case "Wk Phone":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["WkPhone"].ToString());
                            break;

                        case "Email":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["Email"].ToString());
                            break;

                        case "ChartNum":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["ChartNumber"].ToString());
                            break;

                        case "MI":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["MiddleI"].ToString());
                            break;

                        case "Pref Name":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["Preferred"].ToString());
                            break;

                        case "Hm Phone":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["HmPhone"].ToString());
                            break;

                        case "Bill Type":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["BillingType"].ToString());
                            break;

                        case "Pri Prov":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["PriProv"].ToString());
                            break;

                        case "Birthdate":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["Birthdate"].ToString());
                            break;

                        case "Site":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["site"].ToString());
                            break;

                        case "Clinic":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["clinic"].ToString());
                            break;

                        case "Wireless Ph":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["WirelessPhone"].ToString());
                            break;

                        case "Sec Prov":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["SecProv"].ToString());
                            break;

                        case "LastVisit":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["lastVisit"].ToString());
                            break;

                        case "NextVisit":
                            row.Cells.Add(_dataConnPats.Tables[i].Rows[j]["nextVisit"].ToString());
                            break;
                            #endregion
                        }
                    }
                    row.Tag = ListConns.Find(x => ((x.ServerName + ", " + x.DatabaseName) == _dataConnPats.Tables[i].TableName || x.ServiceURI == _dataConnPats.Tables[i].TableName));
                    gridMain.Rows.Add(row);
                }
            }
            gridMain.EndUpdate();
            Cursor = Cursors.Default;
            if (_complConnAmt == ListConns.Count)
            {
                ODThread.QuitSyncThreadsByGroupName(1, "FetchPats");               //Clean up finished threads.
                butRefresh.Text    = Lans.g(this, "Refresh");
                labelFetch.Visible = false;
                if (!_hasWarningShown && _invalidConnsLog != "")
                {
                    _hasWarningShown = true;                  //Keeps the message box from showing up for subsequent threads.
                    MessageBox.Show(this, Lan.g(this, "Could not connect to the following servers") + ":" + _invalidConnsLog);
                }
            }
            else
            {
                butRefresh.Text    = Lans.g(this, "Stop Refresh");
                labelFetch.Visible = true;
            }
        }
コード例 #3
0
ファイル: ApptDrawing.cs プロジェクト: steev90/opendental
        ///<summary></summary>
        public static void DrawMinutes(Graphics g, DateTime startTime, DateTime stopTime)
        {
            Font font  = new Font(FontFamily.GenericSansSerif, 8);                 //was msSans
            Font bfont = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold); //was Arial

            g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;      //to make printing clearer
            DateTime    hour;
            CultureInfo ci      = (CultureInfo)CultureInfo.CurrentCulture.Clone();
            string      hFormat = Lans.GetShortTimeFormat(ci);
            string      sTime;
            int         stop = stopTime.Hour;

            if (stop == 0)           //12AM, but we want to end on the next day so set to 24
            {
                stop = 24;
            }
            int index = 0;          //This will cause drawing times to always start at the top.

            for (int i = startTime.Hour; i < stop; i++)
            {
                hour  = new DateTime(2000, 1, 1, i, 0, 0);        //hour is the only important part of this time.
                sTime = hour.ToString(hFormat, ci);
                SizeF sizef = g.MeasureString(sTime, bfont);
                g.DrawString(sTime, bfont, new SolidBrush(Color.Black), TimeWidth - sizef.Width - 2, index * LineH * RowsPerHr + 1);
                g.DrawString(sTime, bfont, new SolidBrush(Color.Black)
                             , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + 1);
                if (MinPerIncr == 5)
                {
                    g.DrawString(":15", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 3);
                    g.DrawString(":30", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 6);
                    g.DrawString(":45", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 9);
                    g.DrawString(":15", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 3);
                    g.DrawString(":30", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 6);
                    g.DrawString(":45", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 9);
                }
                else if (MinPerIncr == 10)
                {
                    g.DrawString(":10", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr);
                    g.DrawString(":20", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 2);
                    g.DrawString(":30", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 3);
                    g.DrawString(":40", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 4);
                    g.DrawString(":50", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 5);
                    g.DrawString(":10", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr);
                    g.DrawString(":20", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 2);
                    g.DrawString(":30", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 3);
                    g.DrawString(":40", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 4);
                    g.DrawString(":50", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 5);
                }
                else                  //15
                {
                    g.DrawString(":15", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr);
                    g.DrawString(":30", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 2);
                    g.DrawString(":45", font, new SolidBrush(Color.Black)
                                 , TimeWidth - 19, index * LineH * RowsPerHr + LineH * RowsPerIncr * 3);
                    g.DrawString(":15", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr);
                    g.DrawString(":30", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 2);
                    g.DrawString(":45", font, new SolidBrush(Color.Black)
                                 , TimeWidth + ColWidth * ColCount + ProvWidth * ProvCount, index * LineH * RowsPerHr + LineH * RowsPerIncr * 3);
                }
                index++;
            }
        }
コード例 #4
0
        ///<summary>Makes an API call to get an Oryx URL to launch that is specific to the current user and patient.</summary>
        public static void SendData(Program progOryx, Patient pat)
        {
            string clientUrl = "";

            try {
                clientUrl = OpenDentBusiness.ProgramProperties.GetPropVal(progOryx.ProgramNum, ProgramProperties.ClientUrl);
                if (clientUrl == "")               //Office has not signed up with Oryx yet, launch a promotional page.
                {
                    string promoUrl = "http://www.opendental.com/resources/redirects/redirectoryx.html";
#if DEBUG
                    promoUrl = "http://www.opendental.com/resources/redirects/redirectoryxdebug.html";
#endif
                    ODFileUtils.ProcessStart(promoUrl);
                    return;
                }
                if (!progOryx.Enabled)
                {
                    MsgBox.Show("Oryx", "Oryx must be enabled in Program Links.");
                    return;
                }
                if (!clientUrl.ToLower().StartsWith("http"))
                {
                    clientUrl = "https://" + clientUrl;
                }
                UserOdPref userNamePref = UserOdPrefs.GetByUserFkeyAndFkeyType(Security.CurUser.UserNum, progOryx.ProgramNum, UserOdFkeyType.ProgramUserName)
                                          .FirstOrDefault();
                UserOdPref passwordPref = UserOdPrefs.GetByUserFkeyAndFkeyType(Security.CurUser.UserNum, progOryx.ProgramNum, UserOdFkeyType.ProgramPassword)
                                          .FirstOrDefault();
                if ((userNamePref == null || userNamePref.ValueString == "") && (passwordPref == null || passwordPref.ValueString == ""))
                {
                    //User hasn't entered credentials yet. Launch the office's Oryx page where the user can then log in.
                    ODFileUtils.ProcessStart(clientUrl);
                    return;
                }
                string apiUrl = clientUrl.TrimEnd('/') + "/api/auth/opendental/v1/login";
                string passwordPlain;
                if (!CDT.Class1.Decrypt(passwordPref.ValueString, out passwordPlain))
                {
                    MsgBox.Show("Oryx", "Unable to decrypt password");
                    return;
                }
                var content = new {
                    username  = userNamePref.ValueString,
                    password  = passwordPlain,
                    patientId = (pat != null ? pat.PatNum.ToString() : ""),
                };
                string contentJson = JsonConvert.SerializeObject(content);
                string responseStr;
                using (WebClient client = new WebClient()) {
                    client.Headers[HttpRequestHeader.ContentType] = "application/json";
                    responseStr = client.UploadString(apiUrl, "POST", contentJson);
                }
                var response = new {
                    success      = false,
                    redirectUrl  = "",
                    errorMessage = "",
                };
                response = JsonConvert.DeserializeAnonymousType(responseStr, response);
                if (!response.success)
                {
                    MessageBox.Show(Lans.g("Orxy", "Error message from Oryx:") + " " + response.errorMessage);
                    return;
                }
                ODFileUtils.ProcessStart(response.redirectUrl);
            }
            catch (Exception ex) {
                string errorMessage = "Unable to launch Oryx.";
                if (ex is NotSupportedException && ex.Message == "The given path's format is not supported.")
                {
                    //Oryx has asked us to give a more helpful error message when this happens.
                    errorMessage += " This is likely because the Client URL is invalid.\r\nClient URL: " + clientUrl;
                }
                FriendlyException.Show(Lans.g("Oryx", errorMessage), ex);
            }
        }
コード例 #5
0
        ///<summary>Returns true if the communications were successful, and false if they failed. Both sends and retrieves.</summary>
        public static bool Launch(Clearinghouse clearinghouseClin, int batchNum, IODProgressExtended progress = null)       //called from FormClaimReports and Eclaims.cs. clinic-level clearinghouse passed in.
        //Before this function is called, the X12 file for the current batch has already been generated in
        //the clearinghouse export folder. The export folder will also contain batch files which have failed
        //to upload from previous attempts and we must attempt to upload these older batch files again if
        //there are any.
        //Step 1: Retrieve reports regarding the existing pending claim statuses.
        //Step 2: Send new claims in a new batch.
        {
            progress = progress ?? new ODProgressExtendedNull();
            bool success = true;
            //Connect to the Denti-Cal SFTP server.
            Session     session = null;
            Channel     channel = null;
            ChannelSftp ch      = null;
            JSch        jsch    = new JSch();

            progress.UpdateProgress(Lans.g(progress.LanThis, "Contacting web server"), "reports", "17%", 17);
            if (progress.IsPauseOrCancel())
            {
                progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                return(false);
            }
            try {
                string remoteHost = "sftp.mft.oxisaas.com";
                int    remotePort = 2222;
                if (!string.IsNullOrEmpty(clearinghouseClin.ClientProgram))
                {
                    if (clearinghouseClin.ClientProgram.Contains(":"))                     //if the user included the port number
                    {
                        remoteHost = clearinghouseClin.ClientProgram.Split(':')[0];
                        remotePort = PIn.Int(clearinghouseClin.ClientProgram.Split(':')[1], false);
                        if (remotePort == 0)
                        {
                            remotePort = 2222;
                        }
                    }
                    else
                    {
                        remoteHost = clearinghouseClin.ClientProgram;
                    }
                }
                session = jsch.getSession(clearinghouseClin.LoginID, remoteHost);
                session.setPassword(clearinghouseClin.Password);
                Hashtable config = new Hashtable();
                config.Add("StrictHostKeyChecking", "no");
                session.setConfig(config);
                session.setPort(remotePort);
                session.connect();
                channel = session.openChannel("sftp");
                channel.connect();
                ch = (ChannelSftp)channel;
            }
            catch (Exception ex) {
                ErrorMessage = Lans.g("DentiCal", "Connection Failed") + ": " + ex.Message;
                return(false);
            }
            progress.UpdateProgress(Lans.g(progress.LanThis, "Web server contact successful."));
            try {
                string homeDir = "/";             //new production home root dir
                //At this point we are connected to the Denti-Cal SFTP server.
                if (batchNum == 0)                //Retrieve reports.
                {
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Downloading reports"), "reports", "33%", 33);
                    if (progress.IsPauseOrCancel())
                    {
                        progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                        return(false);
                    }
                    if (!Directory.Exists(clearinghouseClin.ResponsePath))
                    {
                        progress.UpdateProgress(Lans.g(progress.LanThis, "Clearinghouse response path is invalid."));
                        return(false);

                        throw new Exception("Clearinghouse response path is invalid.");
                    }
                    //Only retrieving reports so do not send new claims.
                    //Although the documentation we received from Denti-Cal says that the folder name should start "OXi", that was not the case for a customer
                    //that we connected to and Barbara Castelli from Denti-Cal informed us that the folder name should start with "dcaprod".
                    string retrievePath = homeDir + "dcaprod_" + clearinghouseClin.LoginID + "_out/";
                    Tamir.SharpSsh.java.util.Vector fileList;
                    try {
                        fileList = ch.ls(retrievePath);
                    }
                    catch (Exception ex) {
                        ex.DoNothing();
                        //Try again with the path as described in the documentation.
                        retrievePath = homeDir + "OXi_" + clearinghouseClin.LoginID + "_out/";
                        fileList     = ch.ls(retrievePath);
                    }
                    for (int i = 0; i < fileList.Count; i++)
                    {
                        int percent = (i / fileList.Count) * 100;
                        //We re-use the bar again for importing later, hence the tag.
                        progress.UpdateProgress(Lans.g(progress.LanThis, "Getting file:") + i + " / " + fileList.Count, "import", percent + "%", percent);
                        if (progress.IsPauseOrCancel())
                        {
                            progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                            return(false);
                        }
                        string listItem = fileList[i].ToString().Trim();
                        if (listItem[0] == 'd')
                        {
                            continue;                            //Skip directories and focus on files.
                        }
                        Match  fileNameMatch  = Regex.Match(listItem, ".*\\s+(.*)$");
                        string getFileName    = fileNameMatch.Result("$1");
                        string getFilePath    = retrievePath + getFileName;
                        string exportFilePath = CodeBase.ODFileUtils.CombinePaths(clearinghouseClin.ResponsePath, getFileName);
                        Tamir.SharpSsh.java.io.InputStream fileStream = null;
                        FileStream exportFileStream = null;
                        try {
                            fileStream       = ch.get(getFilePath);
                            exportFileStream = File.Open(exportFilePath, FileMode.Create, FileAccess.Write);                        //Creates or overwrites.
                            byte[] dataBytes = new byte[4096];
                            int    numBytes  = fileStream.Read(dataBytes, 0, dataBytes.Length);
                            while (numBytes > 0)
                            {
                                exportFileStream.Write(dataBytes, 0, numBytes);
                                numBytes = fileStream.Read(dataBytes, 0, dataBytes.Length);
                            }
                            float overallpercent = 33 + (i / fileList.Count) * 17;                    //33 is starting point. 17 is the amount of bar space we have before our next major spot (50%)
                            progress.UpdateProgress(Lans.g(progress.LanThis, "Getting files"), "reports", overallpercent + "%", (int)overallpercent);
                            if (progress.IsPauseOrCancel())
                            {
                                progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                                return(false);
                            }
                        }
                        catch {
                            success = false;
                        }
                        finally {
                            if (exportFileStream != null)
                            {
                                exportFileStream.Dispose();
                            }
                            if (fileStream != null)
                            {
                                fileStream.Dispose();
                            }
                            progress.UpdateProgress("", "import", "");                          //Clear import bar for now
                        }
                        if (success)
                        {
                            //Removed the processed report from the Denti-Cal SFTP so it does not get processed again in the future.
                            try {
                                ch.rm(getFilePath);
                                progress.UpdateProgress(Lans.g(progress.LanThis, "Reports downloaded successfully."));
                            }
                            catch {
                            }
                        }
                    }
                }
                else                   //Send batch of claims.
                {
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Sending batch of claims"), "reports", "33%", 33);
                    if (progress.IsPauseOrCancel())
                    {
                        progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                        return(false);
                    }
                    if (!Directory.Exists(clearinghouseClin.ExportPath))
                    {
                        throw new Exception(Lans.g(progress.LanThis, "Clearinghouse export path is invalid."));
                    }
                    string[] files = Directory.GetFiles(clearinghouseClin.ExportPath);
                    //Try to find a folder that starts with "dcaprod" or "OXi".
                    string uploadPath = homeDir + "dcaprod_" + clearinghouseClin.LoginID + "_in/";
                    Tamir.SharpSsh.java.util.Vector fileList;
                    try {
                        fileList = ch.ls(uploadPath);
                    }
                    catch (Exception ex) {
                        ex.DoNothing();
                        //Try again with the path as described in the documentation.
                        uploadPath = homeDir + "OXi_" + clearinghouseClin.LoginID + "_in/";
                        fileList   = ch.ls(uploadPath);
                    }
                    //We have successfully found the folder where we need to put the files.
                    for (int i = 0; i < files.Length; i++)
                    {
                        float overallpercent = 33 + (i / files.Length) * 17;                //33 is starting point. 17 is the amount of bar space we have before our next major spot (50%)
                        progress.UpdateProgress(Lans.g(progress.LanThis, "Sending claims"), "reports", overallpercent + "%", (int)overallpercent);
                        if (progress.IsPauseOrCancel())
                        {
                            progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                            return(false);
                        }
                        //First upload the batch file to a temporary file name. Denti-Cal does not process file names unless they start with the Login ID.
                        //Uploading to a temporary file and then renaming the file allows us to avoid partial file uploads if there is connection loss.
                        string tempRemoteFilePath = uploadPath + "temp_" + Path.GetFileName(files[i]);
                        ch.put(files[i], tempRemoteFilePath);
                        //Denti-Cal requires the file name to start with the Login ID followed by a period and end with a .txt extension.
                        //The middle part of the file name can be anything.
                        string remoteFilePath = uploadPath + Path.GetFileName(files[i]);
                        ch.rename(tempRemoteFilePath, remoteFilePath);
                        File.Delete(files[i]);                        //Remove the processed file.
                    }
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Claims sent successfully."));
                }
            }
            catch (Exception ex) {
                success       = false;
                ErrorMessage += ex.Message;
            }
            finally {
                progress.UpdateProgress(Lans.g(progress.LanThis, "Closing connection"), "reports", "50%", 50);
                //Disconnect from the Denti-Cal SFTP server.
                channel.disconnect();
                ch.disconnect();
                session.disconnect();
            }
            return(success);
        }
コード例 #6
0
ファイル: DefL.cs プロジェクト: royedwards/DRDNet
        public static List <DefCatOptions> GetOptionsForDefCats(Array defCatVals)
        {
            List <DefCatOptions> listDefCatOptions = new List <DefCatOptions>();

            foreach (DefCat defCatCur in defCatVals)
            {
                if (defCatCur.GetDescription() == "NotUsed")
                {
                    continue;
                }
                if (defCatCur.GetDescription().Contains("HqOnly") && !PrefC.IsODHQ)
                {
                    continue;
                }
                DefCatOptions defCOption = new DefCatOptions(defCatCur);
                switch (defCatCur)
                {
                case DefCat.AccountColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Changes the color of text for different types of entries in Account Module");
                    break;

                case DefCat.AccountQuickCharge:
                    defCOption.CanDelete   = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Procedure Codes");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Account Proc Quick Add items.  Each entry can be a series of procedure codes separated by commas (e.g. D0180,D1101,D8220).  Used in the account module to quickly charge patients for items.");
                    break;

                case DefCat.AdjTypes:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "+, -, or dp");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Plus increases the patient balance.  Minus decreases it.  Dp means discount plan.  Not allowed to change value after creating new type since changes affect all patient accounts.");
                    break;

                case DefCat.AppointmentColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Changes colors of background in Appointments Module, and colors for completed appointments.");
                    break;

                case DefCat.ApptConfirmed:
                    defCOption.EnableColor = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Abbrev");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Color shows on each appointment if Appointment View is set to show ConfirmedColor.");
                    break;

                case DefCat.ApptProcsQuickAdd:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "ADA Code(s)");
                    if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These are the procedures that you can quickly add to the treatment plan from within the appointment editing window.  Multiple procedures may be separated by commas with no spaces. These definitions may be freely edited without affecting any patient records.");
                    }
                    else
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These are the procedures that you can quickly add to the treatment plan from within the appointment editing window.  They must not require a tooth number. Multiple procedures may be separated by commas with no spaces. These definitions may be freely edited without affecting any patient records.");
                    }
                    break;

                case DefCat.AutoDeposit:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Account Number");
                    break;

                case DefCat.AutoNoteCats:
                    defCOption.CanDelete     = true;
                    defCOption.CanHide       = false;
                    defCOption.EnableValue   = true;
                    defCOption.IsValueDefNum = true;
                    defCOption.ValueText     = Lans.g("FormDefinitions", "Parent Category");
                    defCOption.HelpText      = Lans.g("FormDefinitions", "Leave the Parent Category blank for categories at the root level. Assign a Parent Category to move a category within another. The order set here will only affect the order within the assigned Parent Category in the Auto Note list. For example, a category may be moved above its parent in this list, but it will still be within its Parent Category in the Auto Note list.");
                    break;

                case DefCat.BillingTypes:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "E=Email bill, C=Collection");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "It is recommended to use as few billing types as possible.  They can be useful when running reports to separate delinquent accounts, but can cause 'forgotten accounts' if used without good office procedures. Changes affect all patients.");
                    break;

                case DefCat.BlockoutTypes:
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Blockout types are used in the appointments module.");
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Flags");
                    break;

                case DefCat.ChartGraphicColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These colors will be used to graphically display treatments.");
                    }
                    else
                    {
                        defCOption.HelpText = Lans.g("FormDefinitions", "These colors will be used on the graphical tooth chart to draw restorations.");
                    }
                    break;

                case DefCat.ClaimCustomTracking:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = false;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Days Suppressed");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Some offices may set up claim tracking statuses such as 'review', 'hold', 'riskmanage', etc.") + "\r\n"
                                             + Lans.g("FormDefinitions", "Set the value of 'Days Suppressed' to the number of days the claim will be suppressed from the Outstanding Claims Report "
                                                      + "when the status is changed to the selected status.");
                    break;

                case DefCat.ClaimErrorCode:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = false;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Description");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Used to track error codes when entering claim custom statuses.");
                    break;

                case DefCat.ClaimPaymentTracking:
                    defCOption.ValueText = Lans.g("FormDefinitions", "Value");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "EOB adjudication method codes to be used for insurance payments.  Last entry cannot be hidden.");
                    break;

                case DefCat.ClaimPaymentGroups:
                    defCOption.ValueText = Lans.g("FormDefinitions", "Value");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "Used to group claim payments in the daily payments report.");
                    break;

                case DefCat.ClinicSpecialty:
                    defCOption.CanHide   = true;
                    defCOption.CanDelete = false;
                    defCOption.HelpText  = Lans.g("FormDefinitions", "You can add as many specialties as you want.  Changes affect all current records.");
                    break;

                case DefCat.CommLogTypes:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "APPT,FIN,RECALL,MISC,TEXT");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Changes affect all current commlog entries.  In the second column, you can optionally specify APPT,FIN,RECALL,MISC,or TEXT. Only one of each. This helps automate new entries.");
                    break;

                case DefCat.ContactCategories:
                    defCOption.HelpText = Lans.g("FormDefinitions", "You can add as many categories as you want.  Changes affect all current contact records.");
                    break;

                case DefCat.Diagnosis:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "1 or 2 letter abbreviation");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "The diagnosis list is shown when entering a procedure.  Ones that are less used should go lower on the list.  The abbreviation is shown in the progress notes.  BE VERY CAREFUL.  Changes affect all patients.");
                    break;

                case DefCat.FeeColors:
                    defCOption.CanEditName = false;
                    defCOption.CanHide     = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "These are the colors associated to fee types.");
                    break;

                case DefCat.ImageCats:
                    defCOption.ValueText = Lans.g("FormDefinitions", "Usage");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "These are the categories that will be available in the image and chart modules.  If you hide a category, images in that category will be hidden, so only hide a category if you are certain it has never been used.  Multiple categories can be set to show in the Chart module, but only one category should be set for patient pictures, statements, and tooth charts. Selecting multiple categories for treatment plans will save the treatment plan in each category. Affects all patient records.");
                    break;

                case DefCat.InsurancePaymentType:
                    defCOption.CanDelete   = true;
                    defCOption.CanHide     = false;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "N=Not selected for deposit");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "These are claim payment types for insurance payments attached to claims.");
                    break;

                case DefCat.InsuranceVerificationStatus:
                    defCOption.HelpText = Lans.g("FormDefinitions", "These are statuses for the insurance verification list.");
                    break;

                case DefCat.JobPriorities:
                    defCOption.CanDelete   = false;
                    defCOption.CanHide     = true;
                    defCOption.EnableValue = true;
                    defCOption.EnableColor = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Comma-delimited keywords");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "These are job priorities that determine how jobs are sorted in the Job Manager System.  Required values are: OnHold, Low, Normal, MediumHigh, High, Urgent, BugDefault, JobDefault, DocumentationDefault.");
                    break;

                case DefCat.LetterMergeCats:
                    defCOption.HelpText = Lans.g("FormDefinitions", "Categories for Letter Merge.  You can safely make any changes you want.");
                    break;

                case DefCat.MiscColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = "";
                    break;

                case DefCat.PaymentTypes:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "N=Not selected for deposit");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Types of payments that patients might make. Any changes will affect all patients.");
                    break;

                case DefCat.PayPlanCategories:
                    defCOption.HelpText = Lans.g("FormDefinitions", "Assign payment plans to different categories");
                    break;

                case DefCat.PaySplitUnearnedType:
                    defCOption.HelpText = Lans.g("FormDefinitions", "Usually only used by offices that use accrual basis accounting instead of cash basis accounting. Any changes will affect all patients.");
                    break;

                case DefCat.ProcButtonCats:
                    defCOption.HelpText = Lans.g("FormDefinitions", "These are similar to the procedure code categories, but are only used for organizing and grouping the procedure buttons in the Chart module.");
                    break;

                case DefCat.ProcCodeCats:
                    defCOption.HelpText = Lans.g("FormDefinitions", "These are the categories for organizing procedure codes. They do not have to follow ADA categories.  There is no relationship to insurance categories which are setup in the Ins Categories section.  Does not affect any patient records.");
                    break;

                case DefCat.ProgNoteColors:
                    defCOption.CanEditName = false;
                    defCOption.EnableColor = true;
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Changes color of text for different types of entries in the Chart Module Progress Notes.");
                    break;

                case DefCat.Prognosis:
                    //Nothing special. Might add HelpText later.
                    break;

                case DefCat.ProviderSpecialties:
                    defCOption.HelpText = Lans.g("FormDefinitions", "Provider specialties cannot be deleted.  Changes to provider specialties could affect e-claims.");
                    break;

                case DefCat.RecallUnschedStatus:
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "Abbreviation");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Recall/Unsched Status.  Abbreviation must be 7 characters or less.  Changes affect all patients.");
                    break;

                case DefCat.Regions:
                    defCOption.CanHide  = false;
                    defCOption.HelpText = Lans.g("FormDefinitions", "The region identifying the clinic it is assigned to.");
                    break;

                case DefCat.SupplyCats:
                    defCOption.CanDelete = true;
                    defCOption.CanHide   = false;
                    defCOption.HelpText  = Lans.g("FormDefinitions", "The categories for inventory supplies.");
                    break;

                case DefCat.TaskPriorities:
                    defCOption.EnableColor = true;
                    defCOption.EnableValue = true;
                    defCOption.ValueText   = Lans.g("FormDefinitions", "D = Default, R = Reminder");
                    defCOption.HelpText    = Lans.g("FormDefinitions", "Priorities available for selection within the task edit window.  Task lists are sorted using the order of these priorities.  They can have any description and color.  At least one priority should be Default (D).  If more than one priority is flagged as the default, the last default in the list will be used.  If no default is set, the last priority will be used.  Use (R) to indicate the initial reminder task priority to use when creating reminder tasks.  Changes affect all tasks where the definition is used.");
                    break;

                case DefCat.TxPriorities:
                    defCOption.EnableColor            = true;
                    defCOption.EnableValue            = true;
                    defCOption.DoShowItemOrderInValue = true;
                    defCOption.ValueText = Lan.g(_lanThis, "Internal Priority");
                    defCOption.HelpText  = Lan.g(_lanThis, "Displayed order should match order of priority of treatment.  They are used in Treatment Plan and Chart "
                                                 + "modules. They can be simple numbers or descriptive abbreviations 7 letters or less.  Changes affect all procedures where the "
                                                 + "definition is used.  'Internal Priority' does not show, but is used for list order and for automated selection of which procedures "
                                                 + "are next in a planned appointment.");
                    break;

                case DefCat.WebSchedNewPatApptTypes:
                    defCOption.CanDelete = true;
                    defCOption.CanHide   = false;
                    defCOption.ValueText = Lans.g("FormDefinitions", "Appointment Type");
                    defCOption.HelpText  = Lans.g("FormDefinitions", "Appointment types to be displayed in the Web Sched New Pat Appt web application.  These are selectable for the new patients and will be saved to the appointment note.");
                    break;

                case DefCat.CarrierGroupNames:
                    defCOption.CanHide  = true;
                    defCOption.HelpText = Lans.g("FormDefinitions", "These are group names for Carriers.");
                    break;
                }
                listDefCatOptions.Add(defCOption);
            }
            return(listDefCatOptions);
        }
コード例 #7
0
ファイル: Eclaims.cs プロジェクト: ChemBrain/OpenDental
 ///<summary>Fills the missing data field on the queueItem that was passed in.  This contains all missing data on this claim.  Claim will not be allowed to be sent electronically unless this string comes back empty.</summary>
 public static ClaimSendQueueItem GetMissingData(Clearinghouse clearinghouseClin, ClaimSendQueueItem queueItem)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetObject <ClaimSendQueueItem>(MethodBase.GetCurrentMethod(), clearinghouseClin, queueItem));
     }
     if (queueItem == null)
     {
         return(new ClaimSendQueueItem()
         {
             MissingData = Lans.g("Eclaims", "Unable to fill claim data. Please recreate claim.")
         });
     }
     queueItem.Warnings             = "";
     queueItem.MissingData          = "";
     queueItem.ErrorsPreventingSave = "";
     //this is usually just the default clearinghouse or the clearinghouse for the PayorID.
     if (clearinghouseClin == null)
     {
         if (queueItem.MedType == EnumClaimMedType.Dental)
         {
             queueItem.MissingData += "No default dental clearinghouse set.";
         }
         else
         {
             queueItem.MissingData += "No default medical/institutional clearinghouse set.";
         }
         return(queueItem);
     }
     #region Data Sanity Checking (for Replication)
     //Example: We had one replication customer who was able to delete an insurance plan for which was attached to a claim.
     //Imagine two replication servers, server A and server B.  An insplan is created which is not associated to any claims.
     //Both databases have a copy of the insplan.  The internet connection is lost.  On server A, a user deletes the insurance
     //plan (which is allowed because no claims are attached).  On server B, a user creates a claim with the insurance plan.
     //When the internet connection returns, the delete insplan statement is run on server B, which then creates a claim with
     //an invalid InsPlanNum on server B.  Without the checking below, the send claims window would crash for this one scenario.
     Claim   claim   = Claims.GetClaim(queueItem.ClaimNum); //This should always exist, because we just did a select to get the queue item.
     InsPlan insPlan = InsPlans.RefreshOne(claim.PlanNum);
     if (insPlan == null)                                   //Check for missing PlanNums
     {
         queueItem.ErrorsPreventingSave = Lans.g("Eclaims", "Claim insurance plan record missing.  Please recreate claim.");
         queueItem.MissingData          = Lans.g("Eclaims", "Claim insurance plan record missing.  Please recreate claim.");
         return(queueItem);
     }
     if (claim.InsSubNum2 != 0)
     {
         InsPlan insPlan2 = InsPlans.RefreshOne(claim.PlanNum2);
         if (insPlan2 == null)               //Check for missing PlanNums
         {
             queueItem.MissingData = Lans.g("Eclaims", "Claim other insurance plan record missing.  Please recreate claim.");
             return(queueItem);                   //This will let the office send other claims that passed validation without throwing an exception.
         }
     }
     #endregion Data Sanity Checking (for Replication)
     if (claim.ProvTreat == 0)           //This has only happened in the past due to a conversion.
     {
         queueItem.MissingData = Lans.g("Eclaims", "No treating provider set.");
         return(queueItem);
     }
     try {
         if (clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_4010)
         {
             X837_4010.Validate(clearinghouseClin, queueItem);                   //,out warnings);
             //return;
         }
         else if (clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_5010_dental ||
                  clearinghouseClin.Eformat == ElectronicClaimFormat.x837_5010_med_inst)
         {
             X837_5010.Validate(clearinghouseClin, queueItem);                   //,out warnings);
             //return;
         }
         else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Renaissance)
         {
             queueItem.MissingData = Renaissance.GetMissingData(queueItem);
             //return;
         }
         else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Canadian)
         {
             queueItem.MissingData = Canadian.GetMissingData(queueItem);
             //return;
         }
         else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Dutch)
         {
             Dutch.GetMissingData(queueItem);                    //,out warnings);
             //return;
         }
         else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Ramq)
         {
             Ramq.GetMissingData(clearinghouseClin, queueItem);
         }
     }
     catch (Exception e) {
         queueItem.MissingData = Lans.g("Eclaims", "Unable to validate claim data:") + " " + e.Message + Lans.g("Eclaims", " Please recreate claim.");
     }
     return(queueItem);
 }
コード例 #8
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     //We want to help EHR users meet their summary of care measure.  So all outgoing patient referrals should warn them if they didn't enter data correctly.
     if ((ReferralType)listRefType.SelectedIndex == ReferralType.RefTo && PrefC.GetBool(PrefName.ShowFeatureEhr))
     {
         string warning = "";
         if (comboProvNum.SelectedIndex < 0)
         {
             warning += Lans.g(this, "Selected patient referral does not have a referring provider set.");
         }
         if (!checkIsTransitionOfCare.Checked)
         {
             if (warning != "")
             {
                 warning += "\r\n";
             }
             warning += Lans.g(this, "Selected patient referral is not flagged as a transition of care.");
         }
         if (warning != "")
         {
             warning += "\r\n" + Lans.g(this, "It will not meet the EHR summary of care requirements.") + "  " + Lans.g(this, "Continue anyway?");
             if (MessageBox.Show(warning, Lans.g(this, "EHR Measure Warning"), MessageBoxButtons.OKCancel) == DialogResult.Cancel)
             {
                 return;
             }
         }
     }
     //this is an old pattern
     try{
         DataToCur();
         if (IsNew)
         {
             RefAttaches.Insert(RefAttachCur);
         }
         else
         {
             RefAttaches.Update(RefAttachCur, _refAttachOld);
         }
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
コード例 #9
0
ファイル: Eclaims.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Supply a list of ClaimSendQueueItems.  Called from FormClaimSend.  Can only send to one clearinghouse at a time.
        ///The queueItems must contain at least one item.  Each item in queueItems must have the same ClinicNum.  Cannot include Canadian.</summary>
        public static void SendBatch(Clearinghouse clearinghouseClin, List <ClaimSendQueueItem> queueItems, EnumClaimMedType medType,
                                     IFormClaimFormItemEdit formClaimFormItemEdit, Renaissance.FillRenaissanceDelegate fillRenaissance, ITerminalConnector terminalConnector)
        {
            string messageText = "";

            if (clearinghouseClin.Eformat == ElectronicClaimFormat.Canadian)
            {
                MessageBox.Show(Lans.g("Eclaims", "Cannot send Canadian claims as part of Eclaims.SendBatch."));
                return;
            }
            if (ODBuild.IsWeb() && Clearinghouses.IsDisabledForWeb(clearinghouseClin))
            {
                MessageBox.Show(Lans.g("Eclaims", "This clearinghouse is not available while viewing through the web."));
                return;
            }
            //get next batch number for this clearinghouse
            int batchNum = Clearinghouses.GetNextBatchNumber(clearinghouseClin);

            //---------------------------------------------------------------------------------------
            //Create the claim file for this clearinghouse
            if (clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_4010 ||
                clearinghouseClin.Eformat == ElectronicClaimFormat.x837D_5010_dental ||
                clearinghouseClin.Eformat == ElectronicClaimFormat.x837_5010_med_inst)
            {
                messageText = x837Controller.SendBatch(clearinghouseClin, queueItems, batchNum, medType, false);
            }
            else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Renaissance)
            {
                messageText = Renaissance.SendBatch(clearinghouseClin, queueItems, batchNum, formClaimFormItemEdit, fillRenaissance);
            }
            else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Dutch)
            {
                messageText = Dutch.SendBatch(clearinghouseClin, queueItems, batchNum);
            }
            else if (clearinghouseClin.Eformat == ElectronicClaimFormat.Ramq)
            {
                messageText = Ramq.SendBatch(clearinghouseClin, queueItems, batchNum);
            }
            else
            {
                messageText = "";      //(ElectronicClaimFormat.None does not get sent)
            }
            if (messageText == "")     //if failed to create claim file properly,
            {
                return;                //don't launch program or change claim status
            }
            //----------------------------------------------------------------------------------------
            //Launch Client Program for this clearinghouse if applicable
            if (clearinghouseClin.CommBridge == EclaimsCommBridge.None)
            {
                AttemptLaunch(clearinghouseClin, batchNum);
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.WebMD)
            {
                if (!WebMD.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + "\r\n" + WebMD.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.BCBSGA)
            {
                if (!BCBSGA.Launch(clearinghouseClin, batchNum, terminalConnector))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + "\r\n" + BCBSGA.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.Renaissance)
            {
                AttemptLaunch(clearinghouseClin, batchNum);
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.ClaimConnect)
            {
                if (ClaimConnect.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show("Upload successful.");
                }
                else
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + "\r\n" + ClaimConnect.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.RECS)
            {
                if (!RECS.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Claim file created, but could not launch RECS client.") + "\r\n" + RECS.ErrorMessage);
                    //continue;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.Inmediata)
            {
                if (!Inmediata.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Claim file created, but could not launch Inmediata client.") + "\r\n" + Inmediata.ErrorMessage);
                    //continue;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.AOS)           // added by SPK 7/13/05
            {
                if (!AOS.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Claim file created, but could not launch AOS Communicator.") + "\r\n" + AOS.ErrorMessage);
                    //continue;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.PostnTrack)
            {
                AttemptLaunch(clearinghouseClin, batchNum);
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.MercuryDE)
            {
                if (!MercuryDE.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + "\r\n" + MercuryDE.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.ClaimX)
            {
                if (!ClaimX.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Claim file created, but encountered an error while launching ClaimX Client.") + ":\r\n" + ClaimX.ErrorMessage);
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.EmdeonMedical)
            {
                if (!EmdeonMedical.Launch(clearinghouseClin, batchNum, medType))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + "\r\n" + EmdeonMedical.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.DentiCal)
            {
                if (!DentiCal.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + DentiCal.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.NHS)
            {
                if (!NHS.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + "\r\n" + NHS.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.EDS)
            {
                if (!EDS.Launch(clearinghouseClin, messageText))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + "\r\n" + EDS.ErrorMessage);
                    return;
                }
            }
            else if (clearinghouseClin.CommBridge == EclaimsCommBridge.Ramq)
            {
                if (!Ramq.Launch(clearinghouseClin, batchNum))
                {
                    MessageBox.Show(Lans.g("Eclaims", "Error sending.") + Ramq.ErrorMessage);
                    return;
                }
            }
            //----------------------------------------------------------------------------------------
            //finally, mark the claims sent. (only if not Canadian)
            EtransType etype = EtransType.ClaimSent;

            if (clearinghouseClin.Eformat == ElectronicClaimFormat.Renaissance)
            {
                etype = EtransType.Claim_Ren;
            }
            //Canadians cannot send in batches (see above).  RAMQ is performing a similar algorithm but the steps are in a different order in Ramq.cs.
            if (clearinghouseClin.Eformat != ElectronicClaimFormat.Canadian && clearinghouseClin.Eformat != ElectronicClaimFormat.Ramq)
            {
                //Create the etransmessagetext that all claims in the batch will point to.
                EtransMessageText etransMsgText = new EtransMessageText();
                etransMsgText.MessageText = messageText;
                EtransMessageTexts.Insert(etransMsgText);
                for (int j = 0; j < queueItems.Count; j++)
                {
                    Etrans etrans = Etranss.SetClaimSentOrPrinted(queueItems[j].ClaimNum, queueItems[j].PatNum,
                                                                  clearinghouseClin.HqClearinghouseNum, etype, batchNum, Security.CurUser.UserNum);
                    etrans.EtransMessageTextNum = etransMsgText.EtransMessageTextNum;
                    Etranss.Update(etrans);
                    //Now we need to update our cache of claims to reflect the change that took place in the database above in Etranss.SetClaimSentOrPrinted()
                    queueItems[j].ClaimStatus = "S";
                }
            }
        }
コード例 #10
0
        private void UpdateDoNotSendWithinLabel()
        {
            string daysHoursTxt = "";
            int    daysWithin   = PIn.Int(textDaysWithin.Text, false);
            int    hoursWithin  = PIn.Int(textHoursWithin.Text, false);

            if (!textDaysWithin.IsValid || !textHoursWithin.IsValid ||
                (daysWithin == 0 && hoursWithin == 0))
            {
                daysHoursTxt = "_____________";
            }
            else
            {
                if (daysWithin == 1)
                {
                    daysHoursTxt += daysWithin + " " + Lans.g(this, "day");
                }
                else if (daysWithin > 1)
                {
                    daysHoursTxt += daysWithin + " " + Lans.g(this, "days");
                }
                if (daysWithin > 0 && hoursWithin > 0)
                {
                    daysHoursTxt += " ";
                }
                if (hoursWithin == 1)
                {
                    daysHoursTxt += hoursWithin + " " + Lans.g(this, "hour");
                }
                else if (hoursWithin > 1)
                {
                    daysHoursTxt += hoursWithin + " " + Lans.g(this, "hours");
                }
            }
            labelDoNotSendWithin.Text = Lans.g(this, "Do not send within") + " " + daysHoursTxt + " " + Lans.g(this, "of appointment");
        }
コード例 #11
0
        ///<summary>Used for both sending claims and receiving reports.  Set isSilent to true to hide the cmd window popup.
        ///Returns true if the communications were successful, and false if they failed.  If they failed, a rollback will happen automatically by
        ///deleting the previously created X12 file.  The batchnum is supplied for the possible rollback.  Also used for mail retrieval.</summary>
        public static bool Launch(Clearinghouse clearinghouseClin, int batchNum, bool isSilent = false, IODProgressExtended progress = null)
        {
            //called from Eclaims and FormClaimReports.cs. Clinic-level clearinghouse passed in.
            progress = progress ?? new ODProgressExtendedNull();
            string arguments = "";

            try {
                if (!Directory.Exists(clearinghouseClin.ExportPath))
                {
                    throw new Exception(Lans.g(progress.LanThis, "Clearinghouse export path is invalid."));
                }
                if (!Directory.Exists(clearinghouseClin.ResponsePath))
                {
                    throw new Exception(Lans.g(progress.LanThis, "Clearinghouse response path is invalid."));
                }
                if (!File.Exists(clearinghouseClin.ClientProgram))
                {
                    throw new Exception(Lans.g(progress.LanThis, "Client program not installed properly."));
                }
                arguments = "\"" + ODFileUtils.RemoveTrailingSeparators(clearinghouseClin.ExportPath) + "\\" + "*.*\" " //upload claims path
                            + "\"" + ODFileUtils.RemoveTrailingSeparators(clearinghouseClin.ResponsePath) + "\" "       //Mail path
                            + "316 "                                                                                    //vendor number.
                                                                                                                        //LoginID is client number.  Assigned by us, and we have to coordinate for all other 'vendors' of Open Dental,
                                                                                                                        //because there is only one vendor number for OD for now.
                            + clearinghouseClin.LoginID + " "
                            + clearinghouseClin.Password;
                //call the WebMD client program
                Process process = new Process();
                process.EnableRaisingEvents = true;
                if (isSilent)
                {
                    process.StartInfo.UseShellExecute       = false;            //Required to redirect standard input on the next line.
                    process.StartInfo.RedirectStandardInput = true;             //Required to send a newline character into the input stream below.
                    process.StartInfo.CreateNoWindow        = true;
                    process.StartInfo.WindowStyle           = ProcessWindowStyle.Hidden;
                }
                process.StartInfo.FileName  = clearinghouseClin.ClientProgram;
                process.StartInfo.Arguments = arguments;
                progress.UpdateProgress(Lans.g(progress.LanThis, "Contacting web server and downloading reports"), "reports", "17%", 17);
                if (progress.IsPauseOrCancel())
                {
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                    return(false);
                }
                process.Start();
                if (isSilent)
                {
                    //If the LoginID or password are incorrect, then the WebMD client program will show an error message and wait for the user to click enter.
                    //Above we redirected standard input so that we could send a newline into the input.
                    //This way if the LoginID or password are incorrect, then the WebMD client will still exit.
                    //Write an excessive amount of newlines in case the WebMD client asks multiple questions.
                    //If we send the input before the WebMD client is ready, then the input is queued until it is needed.
                    //If no input is needed, then the input will be ignored.
                    for (int i = 0; i < 10; i++)
                    {
                        process.StandardInput.WriteLine();
                    }
                }
                process.WaitForExit();
                //delete the uploaded claims
                progress.UpdateProgress(Lans.g(progress.LanThis, "Contacting web server sucessful."));
                progress.UpdateProgress(Lans.g(progress.LanThis, "Deleting uploaded claims"), "reports", "33%", 33);
                if (progress.IsPauseOrCancel())
                {
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                    return(false);
                }
                string[] files = Directory.GetFiles(clearinghouseClin.ExportPath);
                for (int i = 0; i < files.Length; i++)
                {
                    float overallpercent = 33 + (i / files.Length) * 11;            //33 is starting point. 11 is the amount of bar space we have before our next major spot (44%)
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Getting files"), "reports", overallpercent + "%", (int)overallpercent);
                    //string t=files[i];
                    File.Delete(files[i]);
                }
                //rename the downloaded mail files to end with txt
                progress.UpdateProgress(Lans.g(progress.LanThis, "Deleteing uploaded claims successful."));
                progress.UpdateProgress("Renaming downloaded files", "reports", "44%", 44);
                if (progress.IsPauseOrCancel())
                {
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Canceled by user."));
                    return(false);
                }
                files = Directory.GetFiles(clearinghouseClin.ResponsePath);
                for (int i = 0; i < files.Length; i++)
                {
                    float overallpercent = 44 + (i / files.Length) * 11;            //44 is starting point. 11 is the amount of bar space we have before our next major spot (55%)
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Getting files"), "reports", overallpercent + "%", (int)overallpercent);
                    //string t=files[i];
                    if (Path.GetExtension(files[i]) != ".txt")
                    {
                        File.Move(files[i], files[i] + ".txt");
                    }
                }
                progress.UpdateProgress(Lans.g(progress.LanThis, "File rename successful."));
            }
            catch (Exception e) {
                ErrorMessage = e.Message;
                progress.UpdateProgress(Lans.g(progress.LanThis, "Error encountered:") + "\r\n" + ErrorMessage);
                if (batchNum != 0)
                {
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Rolling back batch."));
                    progress.UpdateProgressDetailed(Lans.g(progress.LanThis, "Rolling back batch"), tagString: "reports", marqSpeed: 20, progStyle: ProgBarStyle.Marquee);
                    x837Controller.Rollback(clearinghouseClin, batchNum);
                    progress.UpdateProgressDetailed(Lans.g(progress.LanThis, "Done rolling back"), tagString: "reports", marqSpeed: 20, progStyle: ProgBarStyle.Marquee);
                    progress.UpdateProgress(Lans.g(progress.LanThis, "Rolling back batch complete."));
                }
                return(false);
            }
            return(true);
        }
コード例 #12
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textAdjDate.errorProvider1.GetError(textAdjDate) != "" ||
         textProcDate.errorProvider1.GetError(textProcDate) != "" ||
         textAmount.errorProvider1.GetError(textAmount) != ""
         )
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (textAmount.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Please enter an amount."));
         return;
     }
     if (listTypeNeg.SelectedIndex == -1 && listTypePos.SelectedIndex == -1)
     {
         MsgBox.Show(this, "Please select a type first.");
         return;
     }
     if (IsNew)
     {
         //prevents backdating of initial adjustment
         if (!Security.IsAuthorized(Permissions.AdjustmentCreate, PIn.Date(textAdjDate.Text), true)) //Give message later.
         {
             if (!checkZeroAmount)                                                                   //Let user create as long as Amount is zero and has edit zero permissions.  This was checked on load.
             {
                 MessageBox.Show(Lans.g("Security", "Not authorized for") + "\r\n" + GroupPermissions.GetDesc(Permissions.AdjustmentCreate));
                 return;
             }
         }
     }
     else
     {
         //Editing an old entry will already be blocked if the date was too old, and user will not be able to click OK button
         //This catches it if user changed the date to be older.
         if (!Security.IsAuthorized(Permissions.AdjustmentEdit, PIn.Date(textAdjDate.Text)))
         {
             return;
         }
     }
     //DateEntry not allowed to change
     AdjustmentCur.AdjDate  = PIn.Date(textAdjDate.Text);
     AdjustmentCur.ProcDate = PIn.Date(textProcDate.Text);
     if (comboProv.SelectedIndex == -1)           //might be a hidden provider, so don't change.
     //	AdjustmentCur.ProvNum=PatCur.PriProv;
     {
     }
     else
     {
         AdjustmentCur.ProvNum = ProviderC.ListShort[comboProv.SelectedIndex].ProvNum;
     }
     if (!PrefC.GetBool(PrefName.EasyNoClinics))
     {
         if (comboClinic.SelectedIndex == 0)
         {
             AdjustmentCur.ClinicNum = 0;
         }
         else
         {
             AdjustmentCur.ClinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum;
         }
     }
     if (listTypePos.SelectedIndex != -1)
     {
         AdjustmentCur.AdjType = DefC.Short[(int)DefCat.AdjTypes][(int)PosIndex[listTypePos.SelectedIndex]].DefNum;
     }
     if (listTypeNeg.SelectedIndex != -1)
     {
         AdjustmentCur.AdjType = DefC.Short[(int)DefCat.AdjTypes][(int)NegIndex[listTypeNeg.SelectedIndex]].DefNum;
     }
     if (DefC.GetValue(DefCat.AdjTypes, AdjustmentCur.AdjType) == "+")         //pos
     {
         AdjustmentCur.AdjAmt = PIn.Double(textAmount.Text);
     }
     else             //neg
     {
         AdjustmentCur.AdjAmt = -PIn.Double(textAmount.Text);
     }
     if (checkZeroAmount)
     {
         if (AdjustmentCur.AdjAmt != 0)
         {
             MsgBox.Show(this, "Amount has to be 0.00 due to security permission.");
             return;
         }
     }
     AdjustmentCur.AdjNote = textNote.Text;
     try{
         if (IsNew)
         {
             Adjustments.Insert(AdjustmentCur);
         }
         else
         {
             Adjustments.Update(AdjustmentCur);
         }
     }
     catch (Exception ex) {          //even though it doesn't currently throw any exceptions
         MessageBox.Show(ex.Message);
         return;
     }
     if (IsNew)
     {
         SecurityLogs.MakeLogEntry(Permissions.AdjustmentCreate, AdjustmentCur.PatNum,
                                   Patients.GetLim(AdjustmentCur.PatNum).GetNameLF() + ", "
                                   + AdjustmentCur.AdjAmt.ToString("c"));
     }
     else
     {
         SecurityLogs.MakeLogEntry(Permissions.AdjustmentEdit, AdjustmentCur.PatNum,
                                   Patients.GetLim(AdjustmentCur.PatNum).GetNameLF() + ", "
                                   + AdjustmentCur.AdjAmt.ToString("c"));
     }
     DialogResult = DialogResult.OK;
 }
コード例 #13
0
 private void FormAdjust_Load(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         if (!Security.IsAuthorized(Permissions.AdjustmentCreate, true))                //Date not checked here.  Message will show later.
         {
             if (!Security.IsAuthorized(Permissions.AdjustmentEditZero, true))          //Let user create an adjustment of zero if they have this perm.
             {
                 MessageBox.Show(Lans.g("Security", "Not authorized for") + "\r\n" + GroupPermissions.GetDesc(Permissions.AdjustmentCreate));
                 DialogResult = DialogResult.Cancel;
                 return;
             }
             //Make sure amount is 0 after OK click.
             checkZeroAmount = true;
         }
     }
     else
     {
         if (!Security.IsAuthorized(Permissions.AdjustmentEdit, AdjustmentCur.AdjDate))
         {
             butOK.Enabled     = false;
             butDelete.Enabled = false;
             //User can't edit but has edit zero amount perm.  Allow delete only if date is today.
             if (Security.IsAuthorized(Permissions.AdjustmentEditZero, true) &&
                 AdjustmentCur.AdjAmt == 0 &&
                 AdjustmentCur.DateEntry.Date == MiscData.GetNowDateTime().Date)
             {
                 butDelete.Enabled = true;
             }
         }
     }
     textDateEntry.Text = AdjustmentCur.DateEntry.ToShortDateString();
     textAdjDate.Text   = AdjustmentCur.AdjDate.ToShortDateString();
     textProcDate.Text  = AdjustmentCur.ProcDate.ToShortDateString();
     if (DefC.GetValue(DefCat.AdjTypes, AdjustmentCur.AdjType) == "+")         //pos
     {
         textAmount.Text = AdjustmentCur.AdjAmt.ToString("F");
     }
     else                                                         //neg
     {
         textAmount.Text = (-AdjustmentCur.AdjAmt).ToString("F"); //shows without the neg sign
     }
     for (int i = 0; i < ProviderC.ListShort.Count; i++)
     {
         comboProv.Items.Add(ProviderC.ListShort[i].GetLongDesc());
         if (ProviderC.ListShort[i].ProvNum == AdjustmentCur.ProvNum)
         {
             comboProv.SelectedIndex = i;
         }
     }
     if (PrefC.GetBool(PrefName.EasyNoClinics))
     {
         labelClinic.Visible = false;
         comboClinic.Visible = false;
     }
     else
     {
         comboClinic.Items.Add("none");
         comboClinic.SelectedIndex = 0;
         for (int i = 0; i < Clinics.List.Length; i++)
         {
             comboClinic.Items.Add(Clinics.List[i].Description);
             if (Clinics.List[i].ClinicNum == AdjustmentCur.ClinicNum)
             {
                 comboClinic.SelectedIndex = i + 1;
             }
         }
     }
     for (int i = 0; i < DefC.Short[1].Length; i++)      //temp.AdjType
     {
         if (DefC.Short[1][i].ItemValue == "+")
         {
             PosIndex.Add(i);
             listTypePos.Items.Add(DefC.Short[1][i].ItemName);
             if (DefC.Short[1][i].DefNum == AdjustmentCur.AdjType)
             {
                 listTypePos.SelectedIndex = PosIndex.Count - 1;
             }
         }
         else if (DefC.Short[1][i].ItemValue == "-")
         {
             NegIndex.Add(i);
             listTypeNeg.Items.Add(DefC.Short[1][i].ItemName);
             if (DefC.Short[1][i].DefNum == AdjustmentCur.AdjType)
             {
                 listTypeNeg.SelectedIndex = NegIndex.Count - 1;
             }
         }
     }
     //this.listProvNum.SelectedIndex=(int)temp.ProvNum;
     this.textNote.Text = AdjustmentCur.AdjNote;
 }