Exemplo n.º 1
0
 ///<summary>Inserts one Etrans into the database.  Returns the new priKey.</summary>
 internal static long Insert(Etrans etrans)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         etrans.EtransNum=DbHelper.GetNextOracleKey("etrans","EtransNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(etrans,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     etrans.EtransNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(etrans,false);
     }
 }
Exemplo n.º 2
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <Etrans> TableToList(DataTable table)
        {
            List <Etrans> retVal = new List <Etrans>();
            Etrans        etrans;

            foreach (DataRow row in table.Rows)
            {
                etrans                      = new Etrans();
                etrans.EtransNum            = PIn.Long(row["EtransNum"].ToString());
                etrans.DateTimeTrans        = PIn.DateT(row["DateTimeTrans"].ToString());
                etrans.ClearingHouseNum     = PIn.Long(row["ClearingHouseNum"].ToString());
                etrans.Etype                = (OpenDentBusiness.EtransType)PIn.Int(row["Etype"].ToString());
                etrans.ClaimNum             = PIn.Long(row["ClaimNum"].ToString());
                etrans.OfficeSequenceNumber = PIn.Int(row["OfficeSequenceNumber"].ToString());
                etrans.CarrierTransCounter  = PIn.Int(row["CarrierTransCounter"].ToString());
                etrans.CarrierTransCounter2 = PIn.Int(row["CarrierTransCounter2"].ToString());
                etrans.CarrierNum           = PIn.Long(row["CarrierNum"].ToString());
                etrans.CarrierNum2          = PIn.Long(row["CarrierNum2"].ToString());
                etrans.PatNum               = PIn.Long(row["PatNum"].ToString());
                etrans.BatchNumber          = PIn.Int(row["BatchNumber"].ToString());
                etrans.AckCode              = PIn.String(row["AckCode"].ToString());
                etrans.TransSetNum          = PIn.Int(row["TransSetNum"].ToString());
                etrans.Note                 = PIn.String(row["Note"].ToString());
                etrans.EtransMessageTextNum = PIn.Long(row["EtransMessageTextNum"].ToString());
                etrans.AckEtransNum         = PIn.Long(row["AckEtransNum"].ToString());
                etrans.PlanNum              = PIn.Long(row["PlanNum"].ToString());
                etrans.InsSubNum            = PIn.Long(row["InsSubNum"].ToString());
                etrans.TranSetId835         = PIn.String(row["TranSetId835"].ToString());
                etrans.CarrierNameRaw       = PIn.String(row["CarrierNameRaw"].ToString());
                etrans.PatientNameRaw       = PIn.String(row["PatientNameRaw"].ToString());
                etrans.UserNum              = PIn.Long(row["UserNum"].ToString());
                retVal.Add(etrans);
            }
            return(retVal);
        }
Exemplo n.º 3
0
        ///<summary>Updates one Etrans in the database.</summary>
        internal static void Update(Etrans etrans)
        {
            string command = "UPDATE etrans SET "
                             + "DateTimeTrans       =  " + POut.DateT(etrans.DateTimeTrans) + ", "
                             + "ClearingHouseNum    =  " + POut.Long(etrans.ClearingHouseNum) + ", "
                             + "Etype               =  " + POut.Int((int)etrans.Etype) + ", "
                             + "ClaimNum            =  " + POut.Long(etrans.ClaimNum) + ", "
                             + "OfficeSequenceNumber=  " + POut.Int(etrans.OfficeSequenceNumber) + ", "
                             + "CarrierTransCounter =  " + POut.Int(etrans.CarrierTransCounter) + ", "
                             + "CarrierTransCounter2=  " + POut.Int(etrans.CarrierTransCounter2) + ", "
                             + "CarrierNum          =  " + POut.Long(etrans.CarrierNum) + ", "
                             + "CarrierNum2         =  " + POut.Long(etrans.CarrierNum2) + ", "
                             + "PatNum              =  " + POut.Long(etrans.PatNum) + ", "
                             + "BatchNumber         =  " + POut.Int(etrans.BatchNumber) + ", "
                             + "AckCode             = '" + POut.String(etrans.AckCode) + "', "
                             + "TransSetNum         =  " + POut.Int(etrans.TransSetNum) + ", "
                             + "Note                = '" + POut.String(etrans.Note) + "', "
                             + "EtransMessageTextNum=  " + POut.Long(etrans.EtransMessageTextNum) + ", "
                             + "AckEtransNum        =  " + POut.Long(etrans.AckEtransNum) + ", "
                             + "PlanNum             =  " + POut.Long(etrans.PlanNum) + ", "
                             + "InsSubNum           =  " + POut.Long(etrans.InsSubNum) + " "
                             + "WHERE EtransNum = " + POut.Long(etrans.EtransNum);

            Db.NonQ(command);
        }
Exemplo n.º 4
0
        private void gridMain_DoubleClick(object sender, EventArgs e)
        {
            int index = gridMain.GetSelectedIndex();

            if (index == -1)           //Clicked in empty space.
            {
                return;
            }
            //Mimics FormClaimsSend.gridHistory_CellDoubleClick(...)
            Cursor = Cursors.WaitCursor;
            Etrans et = (Etrans)gridMain.ListGridRows[index].Tag;

            //Sadly this is needed due to FormEtrans835Edit calling Etranss.Update .
            //See Etranss.RefreshHistory(...), this query does not select all etrans columns.
            //Mimics FormClaimsSend.gridHistory_CellDoubleClick(...)
            et = Etranss.GetEtrans(et.EtransNum);
            if (et == null)
            {
                Cursor = Cursors.Default;
                MsgBox.Show(this, "ERA could not be found, it was most likely deleted.");
                RefreshAndFillGrid();
                return;
            }
            EtransL.ViewFormForEra(et, this);
            Cursor = Cursors.Default;
        }
Exemplo n.º 5
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Etrans etrans = list[e.Row];

            if (etrans.Etype == EtransType.Eligibility_CA)
            {
                FormEtransEdit formETE = new FormEtransEdit();
                formETE.EtransCur = etrans;
                formETE.ShowDialog();
            }
            else
            {
                string settingErrors271 = X271.ValidateSettings();
                if (settingErrors271 != "")
                {
                    MessageBox.Show(settingErrors271);
                    return;
                }
                bool              isDependent = (etrans.PatNum != 0 && _subPatNum != etrans.PatNum);//Old rows will be 0, but when 0 then request was for subscriber.
                Carrier           carrierCur  = Carriers.GetCarrier(_carrierNum);
                FormEtrans270Edit formE       = new FormEtrans270Edit(PatPlanNum, PlanNum, SubNum, isDependent, _subPatNum, carrierCur.IsCoinsuranceInverted);
                formE.EtransCur = etrans;
                formE.benList   = BenList;
                formE.ShowDialog();
            }
            FillGrid();
        }
Exemplo n.º 6
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        internal static List <Etrans> TableToList(DataTable table)
        {
            List <Etrans> retVal = new List <Etrans>();
            Etrans        etrans;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                etrans                      = new Etrans();
                etrans.EtransNum            = PIn.Long(table.Rows[i]["EtransNum"].ToString());
                etrans.DateTimeTrans        = PIn.DateT(table.Rows[i]["DateTimeTrans"].ToString());
                etrans.ClearingHouseNum     = PIn.Long(table.Rows[i]["ClearingHouseNum"].ToString());
                etrans.Etype                = (EtransType)PIn.Int(table.Rows[i]["Etype"].ToString());
                etrans.ClaimNum             = PIn.Long(table.Rows[i]["ClaimNum"].ToString());
                etrans.OfficeSequenceNumber = PIn.Int(table.Rows[i]["OfficeSequenceNumber"].ToString());
                etrans.CarrierTransCounter  = PIn.Int(table.Rows[i]["CarrierTransCounter"].ToString());
                etrans.CarrierTransCounter2 = PIn.Int(table.Rows[i]["CarrierTransCounter2"].ToString());
                etrans.CarrierNum           = PIn.Long(table.Rows[i]["CarrierNum"].ToString());
                etrans.CarrierNum2          = PIn.Long(table.Rows[i]["CarrierNum2"].ToString());
                etrans.PatNum               = PIn.Long(table.Rows[i]["PatNum"].ToString());
                etrans.BatchNumber          = PIn.Int(table.Rows[i]["BatchNumber"].ToString());
                etrans.AckCode              = PIn.String(table.Rows[i]["AckCode"].ToString());
                etrans.TransSetNum          = PIn.Int(table.Rows[i]["TransSetNum"].ToString());
                etrans.Note                 = PIn.String(table.Rows[i]["Note"].ToString());
                etrans.EtransMessageTextNum = PIn.Long(table.Rows[i]["EtransMessageTextNum"].ToString());
                etrans.AckEtransNum         = PIn.Long(table.Rows[i]["AckEtransNum"].ToString());
                etrans.PlanNum              = PIn.Long(table.Rows[i]["PlanNum"].ToString());
                etrans.InsSubNum            = PIn.Long(table.Rows[i]["InsSubNum"].ToString());
                retVal.Add(etrans);
            }
            return(retVal);
        }
Exemplo n.º 7
0
        public static string RunFour(bool showForms)
        {
            string  retVal  = "";
            long    provNum = ProviderC.ListShort[1].ProvNum;       //dentist #2
            Patient pat     = Patients.GetPat(PatientTC.PatNum6);   //patient#6

            if (pat.PriProv != provNum)
            {
                Patient oldPat = pat.Copy();
                pat.PriProv = provNum;              //this script uses the primary provider for the patient
                Patients.Update(pat, oldPat);
            }
            PatPlan          patplan        = PatPlans.GetPatPlan(pat.PatNum, 1);
            InsSub           sub            = InsSubs.GetOne(patplan.InsSubNum);
            InsPlan          plan           = InsPlans.GetPlan(sub.PlanNum, new List <InsPlan>());
            long             etransNum      = CanadianOutput.SendElegibility(pat.PatNum, plan, new DateTime(1999, 1, 1), patplan.Relationship, patplan.PatID, showForms, sub);
            Etrans           etrans         = Etranss.GetEtrans(etransNum);
            string           message        = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData       = new CCDFieldInputter(message);
            string           responseStatus = formData.GetValue("G05");

            if (responseStatus != "M")
            {
                throw new Exception("Should be M");
            }
            retVal += "Eligibility #4 successful.\r\n";
            return(retVal);
        }
Exemplo n.º 8
0
 ///<summary>Inserts one Etrans into the database.  Returns the new priKey.</summary>
 internal static long Insert(Etrans etrans)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         etrans.EtransNum = DbHelper.GetNextOracleKey("etrans", "EtransNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(etrans, true));
             }
             catch (Oracle.DataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     etrans.EtransNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(etrans, false));
     }
 }
Exemplo n.º 9
0
        ///<summary>Updates one Etrans in the database.</summary>
        public static void Update(Etrans etrans)
        {
            string command = "UPDATE etrans SET "
                             + "DateTimeTrans       =  " + POut.DateT(etrans.DateTimeTrans) + ", "
                             + "ClearingHouseNum    =  " + POut.Long(etrans.ClearingHouseNum) + ", "
                             + "Etype               =  " + POut.Int((int)etrans.Etype) + ", "
                             + "ClaimNum            =  " + POut.Long(etrans.ClaimNum) + ", "
                             + "OfficeSequenceNumber=  " + POut.Int(etrans.OfficeSequenceNumber) + ", "
                             + "CarrierTransCounter =  " + POut.Int(etrans.CarrierTransCounter) + ", "
                             + "CarrierTransCounter2=  " + POut.Int(etrans.CarrierTransCounter2) + ", "
                             + "CarrierNum          =  " + POut.Long(etrans.CarrierNum) + ", "
                             + "CarrierNum2         =  " + POut.Long(etrans.CarrierNum2) + ", "
                             + "PatNum              =  " + POut.Long(etrans.PatNum) + ", "
                             + "BatchNumber         =  " + POut.Int(etrans.BatchNumber) + ", "
                             + "AckCode             = '" + POut.String(etrans.AckCode) + "', "
                             + "TransSetNum         =  " + POut.Int(etrans.TransSetNum) + ", "
                             + "Note                =  " + DbHelper.ParamChar + "paramNote, "
                             + "EtransMessageTextNum=  " + POut.Long(etrans.EtransMessageTextNum) + ", "
                             + "AckEtransNum        =  " + POut.Long(etrans.AckEtransNum) + ", "
                             + "PlanNum             =  " + POut.Long(etrans.PlanNum) + ", "
                             + "InsSubNum           =  " + POut.Long(etrans.InsSubNum) + ", "
                             + "TranSetId835        = '" + POut.String(etrans.TranSetId835) + "', "
                             + "CarrierNameRaw      = '" + POut.String(etrans.CarrierNameRaw) + "', "
                             + "PatientNameRaw      = '" + POut.String(etrans.PatientNameRaw) + "', "
                             + "UserNum             =  " + POut.Long(etrans.UserNum) + " "
                             + "WHERE EtransNum = " + POut.Long(etrans.EtransNum);

            if (etrans.Note == null)
            {
                etrans.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(etrans.Note));

            Db.NonQ(command, paramNote);
        }
Exemplo n.º 10
0
        private void FormEtrans835Edit_Load(object sender, EventArgs e)
        {
            if (_form835 != null && !_form835.IsDisposed)
            {
                if (!MsgBox.Show(this, true, "Opening another ERA will close the current ERA you already have open.  Continue?"))
                {
                    //Form already exists and user wants to keep current instance.
                    TranSetId835   = _form835.TranSetId835;
                    EtransCur      = _form835.EtransCur;
                    MessageText835 = _form835.MessageText835;
                }
                _form835.Close();     //Always close old form and open new form, so the new copy will come to front, since BringToFront() does not always work.
            }
            _form835 = this;          //Set the static variable to this form because we're always going to show this form even if they're viewing old information.
            List <Etrans835Attach> listAttached = Etrans835Attaches.GetForEtrans(EtransCur.EtransNum);

            _x835 = new X835(EtransCur, MessageText835, TranSetId835, listAttached);
            RefreshFromDb();
            FillAll();
            Menu.MenuItemCollection menuItemCollection = new Menu.MenuItemCollection(gridClaimDetailsMenu);
            List <MenuItem>         listMenuItems      = new List <MenuItem>();

            listMenuItems.Add(new MenuItem(Lan.g(this, "Go to Account"), new EventHandler(gridClaimDetails_RightClickHelper)));
            listMenuItems.Add(new MenuItem(Lan.g(this, "Add Tracking Status"), new EventHandler(gridClaimDetails_RightClickHelper)));          //Enabled by default
            menuItemCollection.AddRange(listMenuItems.ToArray());
            gridClaimDetails.ContextMenu          = gridClaimDetailsMenu;
            gridClaimDetails.AllowSortingByColumn = true;
        }
Exemplo n.º 11
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<Etrans> TableToList(DataTable table){
			List<Etrans> retVal=new List<Etrans>();
			Etrans etrans;
			for(int i=0;i<table.Rows.Count;i++) {
				etrans=new Etrans();
				etrans.EtransNum           = PIn.Long  (table.Rows[i]["EtransNum"].ToString());
				etrans.DateTimeTrans       = PIn.DateT (table.Rows[i]["DateTimeTrans"].ToString());
				etrans.ClearingHouseNum    = PIn.Long  (table.Rows[i]["ClearingHouseNum"].ToString());
				etrans.Etype               = (OpenDentBusiness.EtransType)PIn.Int(table.Rows[i]["Etype"].ToString());
				etrans.ClaimNum            = PIn.Long  (table.Rows[i]["ClaimNum"].ToString());
				etrans.OfficeSequenceNumber= PIn.Int   (table.Rows[i]["OfficeSequenceNumber"].ToString());
				etrans.CarrierTransCounter = PIn.Int   (table.Rows[i]["CarrierTransCounter"].ToString());
				etrans.CarrierTransCounter2= PIn.Int   (table.Rows[i]["CarrierTransCounter2"].ToString());
				etrans.CarrierNum          = PIn.Long  (table.Rows[i]["CarrierNum"].ToString());
				etrans.CarrierNum2         = PIn.Long  (table.Rows[i]["CarrierNum2"].ToString());
				etrans.PatNum              = PIn.Long  (table.Rows[i]["PatNum"].ToString());
				etrans.BatchNumber         = PIn.Int   (table.Rows[i]["BatchNumber"].ToString());
				etrans.AckCode             = PIn.String(table.Rows[i]["AckCode"].ToString());
				etrans.TransSetNum         = PIn.Int   (table.Rows[i]["TransSetNum"].ToString());
				etrans.Note                = PIn.String(table.Rows[i]["Note"].ToString());
				etrans.EtransMessageTextNum= PIn.Long  (table.Rows[i]["EtransMessageTextNum"].ToString());
				etrans.AckEtransNum        = PIn.Long  (table.Rows[i]["AckEtransNum"].ToString());
				etrans.PlanNum             = PIn.Long  (table.Rows[i]["PlanNum"].ToString());
				etrans.InsSubNum           = PIn.Long  (table.Rows[i]["InsSubNum"].ToString());
				etrans.TranSetId835        = PIn.String(table.Rows[i]["TranSetId835"].ToString());
				retVal.Add(etrans);
			}
			return retVal;
		}
Exemplo n.º 12
0
        private void FormEtrans270Edit_Load(object sender, EventArgs e)
        {
            MessageText    = EtransMessageTexts.GetMessageText(EtransCur.EtransMessageTextNum);
            MessageTextAck = "";
            //textMessageText.Text=MessageText;
            textNote.Text = EtransCur.Note;
            EtransAck271  = Etranss.GetEtrans(EtransCur.AckEtransNum);
            x271          = null;
            if (EtransAck271 != null)
            {
                MessageTextAck = EtransMessageTexts.GetMessageText(EtransAck271.EtransMessageTextNum);              //.Replace("~","~\r\n");
                if (EtransAck271.Etype == EtransType.BenefitResponse271)
                {
                    x271 = new X271(MessageTextAck);
                }
            }
            listDTP = new List <DTP271>();
            if (x271 != null)
            {
                listDTP = x271.GetListDtpSubscriber();
            }
            radioBenefitSendsPat.Checked = (!_isConinsuranceInverted);
            radioBenefitSendsIns.Checked = (_isConinsuranceInverted);
            FillGridDates();
            CreateListOfBenefits();
            FillGrid();
            FillGridBen();
            if (IsInitialResponse)
            {
                SelectForImport();
            }
            long patNum = (EtransCur.PatNum == 0?_subPatNum:EtransCur.PatNum);        //Older 270/217s were always for the subscriber and have etrans.PatNum of 0.

            this.Text += ": " + Patients.GetNameLF(patNum);
        }
Exemplo n.º 13
0
 private void FormEtrans270Edit_Load(object sender, EventArgs e)
 {
     MessageText    = EtransMessageTexts.GetMessageText(EtransCur.EtransMessageTextNum);
     MessageTextAck = "";
     //textMessageText.Text=MessageText;
     textNote.Text = EtransCur.Note;
     EtransAck271  = Etranss.GetEtrans(EtransCur.AckEtransNum);
     x271          = null;
     if (EtransAck271 != null)
     {
         MessageTextAck = EtransMessageTexts.GetMessageText(EtransAck271.EtransMessageTextNum);              //.Replace("~","~\r\n");
         if (EtransAck271.Etype == EtransType.BenefitResponse271)
         {
             x271 = new X271(MessageTextAck);
         }
     }
     listDTP = new List <DTP271>();
     if (x271 != null)
     {
         listDTP = x271.GetListDtpSubscriber();
     }
     FillGridDates();
     CreateListOfBenefits();
     FillGrid();
     FillGridBen();
     if (IsInitialResponse)
     {
         SelectForImport();
     }
 }
Exemplo n.º 14
0
        public static string RunOne(bool showForms)
        {
            string  retVal  = "";
            long    provNum = ProviderC.ListShort[0].ProvNum;       //dentist #1
            Patient pat     = Patients.GetPat(PatientTC.PatNum1);   //patient#1

            if (pat.PriProv != provNum)
            {
                Patient oldPat = pat.Copy();
                pat.PriProv = provNum;              //this script uses the primary provider for the patient
                Patients.Update(pat, oldPat);
            }
            PatPlan patplan = PatPlans.GetPatPlan(pat.PatNum, 1);
            InsSub  sub     = InsSubs.GetOne(patplan.InsSubNum);
            InsPlan plan    = InsPlans.GetPlan(sub.PlanNum, new List <InsPlan>());
            //the UI would block this due to carrier not supporting this transaction type.
            Clearinghouse    clearinghouseHq   = Clearinghouses.GetDefaultDental();
            Clearinghouse    clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
            long             etransNum         = CanadianOutput.SendElegibility(clearinghouseClin, pat.PatNum, plan, new DateTime(1999, 1, 1), patplan.Relationship, patplan.PatID, showForms, sub);
            Etrans           etrans            = Etranss.GetEtrans(etransNum);
            string           message           = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData          = new CCDFieldInputter(message);
            string           responseStatus    = formData.GetValue("G05");

            if (responseStatus != "R")
            {
                throw new Exception("Should be R");
            }
            retVal += "Eligibility #1 successful.\r\n";
            return(retVal);
        }
Exemplo n.º 15
0
        ///<summary>Attempts to request benefits.  If successful the 270 request is returned.
        ///Otherwise null is returned and the out error string will contain more information.  Mimics FormInsPlan.butGetElectronic_Click().</summary>
        public static Etrans TryInsVerifyRequest(InsVerify insVerify, InsPlan insPlan, Carrier carrier, InsSub insSub, out string error)
        {
            error = "";
            Etrans        etrans270Request = null;
            Clearinghouse clearinghouseHq  = Clearinghouses.GetDefaultEligibility();

            if (clearinghouseHq == null)
            {
                error = "No clearinghouse is set as default.";
                return(null);
            }
            if (!clearinghouseHq.CommBridge.In(EclaimsCommBridge.ClaimConnect, EclaimsCommBridge.EDS, EclaimsCommBridge.WebMD))
            {
                error = "So far, eligibility checks only work with ClaimConnect, EDS, WebMD (Emdeon Dental), and CDAnet.";
                return(null);
            }
            error = X271.ValidateSettings();
            if (error.IsNullOrEmpty())
            {
                Clearinghouse clearinghouse = Clearinghouses.OverrideFields(clearinghouseHq, insVerify.ClinicNum);             //ClinicNum pulled from appointment.
                try {
                    //Can return null, can throw exceptions
                    etrans270Request = x270Controller.RequestBenefits(clearinghouse, insPlan, insVerify.PatNum, carrier, insSub, out error);
                }
                catch (Exception ex) {
                    error = ex.Message;
                }
            }
            return(etrans270Request);
        }
Exemplo n.º 16
0
 private void PrintItem_Click()
 {
     //not currently accessible
     if (gridHistory.Rows.Count == 0)
     {
         MsgBox.Show(this, "There are no items to print.");
         return;
     }
     if (gridHistory.SelectedIndices.Length == 0)
     {
                         #if DEBUG
         gridHistory.SetSelected(0, true);               //saves you a click when testing
                         #else
         MsgBox.Show(this, "Please select at least one item first.");
         return;
                         #endif
     }
     //does not yet handle multiple selections
     Etrans etrans = Etranss.GetEtrans(PIn.PInt(tableHistory.Rows[gridHistory.SelectedIndices[0]]["EtransNum"].ToString()));
     //blah blah blah
     bool         assigned = false;                              //TODO: set to true in the case of assigned claims, whatever that means.
     FormCCDPrint FormP    = new FormCCDPrint(etrans, assigned); //Print the form.
     FormP.Print();
     //MessageBox.Show(etrans.MessageText);
 }
Exemplo n.º 17
0
 public FormEtrans835PickEob(List <string> listEobTranIds, string messageText835, Etrans etrans)
 {
     InitializeComponent();
     Lan.F(this);
     _listEobTranIds = listEobTranIds;
     _messageText835 = messageText835;
     _etrans         = etrans;
 }
Exemplo n.º 18
0
        ///<summary>Inserts one Etrans into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(Etrans etrans, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO etrans (";

            if (!useExistingPK && isRandomKeys)
            {
                etrans.EtransNum = ReplicationServers.GetKeyNoCache("etrans", "EtransNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "EtransNum,";
            }
            command += "DateTimeTrans,ClearingHouseNum,Etype,ClaimNum,OfficeSequenceNumber,CarrierTransCounter,CarrierTransCounter2,CarrierNum,CarrierNum2,PatNum,BatchNumber,AckCode,TransSetNum,Note,EtransMessageTextNum,AckEtransNum,PlanNum,InsSubNum,TranSetId835,CarrierNameRaw,PatientNameRaw,UserNum) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(etrans.EtransNum) + ",";
            }
            command +=
                DbHelper.Now() + ","
                + POut.Long(etrans.ClearingHouseNum) + ","
                + POut.Int((int)etrans.Etype) + ","
                + POut.Long(etrans.ClaimNum) + ","
                + POut.Int(etrans.OfficeSequenceNumber) + ","
                + POut.Int(etrans.CarrierTransCounter) + ","
                + POut.Int(etrans.CarrierTransCounter2) + ","
                + POut.Long(etrans.CarrierNum) + ","
                + POut.Long(etrans.CarrierNum2) + ","
                + POut.Long(etrans.PatNum) + ","
                + POut.Int(etrans.BatchNumber) + ","
                + "'" + POut.String(etrans.AckCode) + "',"
                + POut.Int(etrans.TransSetNum) + ","
                + DbHelper.ParamChar + "paramNote,"
                + POut.Long(etrans.EtransMessageTextNum) + ","
                + POut.Long(etrans.AckEtransNum) + ","
                + POut.Long(etrans.PlanNum) + ","
                + POut.Long(etrans.InsSubNum) + ","
                + "'" + POut.String(etrans.TranSetId835) + "',"
                + "'" + POut.String(etrans.CarrierNameRaw) + "',"
                + "'" + POut.String(etrans.PatientNameRaw) + "',"
                + POut.Long(etrans.UserNum) + ")";
            if (etrans.Note == null)
            {
                etrans.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(etrans.Note));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramNote);
            }
            else
            {
                etrans.EtransNum = Db.NonQ(command, true, "EtransNum", "etrans", paramNote);
            }
            return(etrans.EtransNum);
        }
Exemplo n.º 19
0
        ///<summary></summary>
        public static Etrans Insert835Etrans(string etransMessageText, DateTime dateTimeTrans)
        {
            Etrans etrans835 = Etranss.CreateEtrans(DateTime.Now, 0, etransMessageText, 0);       //Todo: T create class.

            etrans835.Etype = EtransType.ERA_835;
            Etranss.Insert(etrans835);
            etrans835.DateTimeTrans = dateTimeTrans;
            return(etrans835);
        }
Exemplo n.º 20
0
        public void SetupTest()
        {
            #region Create Patient and claim: Justin Smith
            Patient patJustinSmith = PatientT.CreatePatient(lName: "Smith", fName: "Justin");
            List <EraTestProcCodeData> listProcData = new List <EraTestProcCodeData>();
            listProcData.Add(new EraTestProcCodeData("D0120", ProcStat.TP, 43, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1110", ProcStat.TP, 110, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D0602", ProcStat.TP, 5, new DateTime(2017, 09, 26)));
            _claimPrimaryJustinSmith = EtransT.SetupEraClaim(patJustinSmith, listProcData, "P", "217308827", out List <InsuranceInfo> _listJustinSmithInsuranceInfo);
            #endregion
            #region Create Patient and claim: Jacob Jones
            Patient patJacobJones = PatientT.CreatePatient(lName: "Jones", fName: "Jacob");
            listProcData.Clear();
            listProcData.Add(new EraTestProcCodeData("D0120", ProcStat.TP, 43, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1110", ProcStat.TP, 110, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1206", ProcStat.TP, 68, new DateTime(2017, 09, 26)));
            _claimPrimaryJacobJones = EtransT.SetupEraClaim(patJacobJones, listProcData, "P", "217180995", out List <InsuranceInfo> _listJacobJonesInsuranceInfo);
            #endregion
            #region Create Patient and claim: Stephanie Mayer
            Patient patStephanieMayer = PatientT.CreatePatient(lName: "Mayer", fName: "Stephanie");
            listProcData.Clear();
            listProcData.Add(new EraTestProcCodeData("D0120", ProcStat.TP, 43, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1110", ProcStat.TP, 110, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D0602", ProcStat.TP, 5, new DateTime(2017, 09, 26)));
            listProcData.Add(new EraTestProcCodeData("D1206", ProcStat.TP, 68, new DateTime(2017, 09, 26)));
            _claimPrimaryStephanieMayer = EtransT.SetupEraClaim(patStephanieMayer, listProcData, "P", "217439125", out List <InsuranceInfo> _listStephanieMayerInsuranceInfo);
            #endregion
            //Create and insert etrans entry
            Etrans etrans835 = EtransT.Insert835Etrans(Properties.Resources.JustinSmithERA, new DateTime(2017, 09, 30));       //Spoof etrans imported 4 days after claim sent.
            List <ODTuple <Patient, long> > listPats = new List <ODTuple <Patient, long> >()
            {
                new ODTuple <Patient, long>(patJustinSmith, _claimPrimaryJustinSmith.ClaimNum),
                new ODTuple <Patient, long>(patJacobJones, _claimPrimaryJacobJones.ClaimNum),
                new ODTuple <Patient, long>(patStephanieMayer, _claimPrimaryStephanieMayer.ClaimNum)
            };
            _x835 = EtransT.Construct835(etrans835, Properties.Resources.JustinSmithERA, listPats, out _listEtrans835Attaches);
            foreach (Hx835_Claim eraClaim in _x835.ListClaimsPaid)
            {
                switch (eraClaim.PatientName.Fname.ToLower())
                {
                case "justin":
                    _eraJustinSmithClaim = eraClaim;
                    break;

                case "jacob":
                    _eraJacobJonesClaim = eraClaim;
                    break;

                case "stephanie":
                    _eraStephanieMayerClaim = eraClaim;
                    break;
                }
            }
        }
Exemplo n.º 21
0
        private void ShowRawMessage_Clicked(object sender, System.EventArgs e)
        {
            //accessed by right clicking on history
            if (gridHistory.SelectedIndices.Length != 1)
            {
                MsgBox.Show(this, "Please select exactly one item first.");
                return;
            }
            Etrans          et     = Etranss.GetEtrans(PIn.PInt(tableHistory.Rows[gridHistory.SelectedIndices[0]]["EtransNum"].ToString()));
            MsgBoxCopyPaste msgbox = new MsgBoxCopyPaste(et.MessageText);

            msgbox.ShowDialog();
        }
Exemplo n.º 22
0
 ///<summary>Inserts one Etrans into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(Etrans etrans)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(etrans, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             etrans.EtransNum = DbHelper.GetNextOracleKey("etrans", "EtransNum");                  //Cacheless method
         }
         return(InsertNoCache(etrans, true));
     }
 }
Exemplo n.º 23
0
 private void FormEtransEdit_Load(object sender, EventArgs e)
 {
     MessageText            = EtransMessageTexts.GetMessageText(EtransCur.EtransMessageTextNum);
     textMessageText.Text   = MessageText;
     textDateTimeTrans.Text = EtransCur.DateTimeTrans.ToString();
     textClaimNum.Text      = EtransCur.ClaimNum.ToString();
     textBatchNumber.Text   = EtransCur.BatchNumber.ToString();
     textTransSetNum.Text   = EtransCur.TransSetNum.ToString();
     textAckCode.Text       = EtransCur.AckCode;
     textNote.Text          = EtransCur.Note;
     if (EtransCur.Etype == EtransType.ClaimSent)
     {
         if (X12object.IsX12(MessageText))
         {
             X12object x12obj = new X12object(MessageText);
             if (x12obj.IsFormat4010())
             {
                 X837_4010 x837 = new X837_4010(MessageText);
                 checkAttachments.Checked = x837.AttachmentsWereSent(EtransCur.ClaimNum);                      //This function does not currently work, so the corresponding checkbox is hidden on the form as well.
             }
             else if (x12obj.IsFormat5010())
             {
                 X837_5010 x837 = new X837_5010(MessageText);
                 checkAttachments.Checked = x837.AttachmentsWereSent(EtransCur.ClaimNum);                      //This function does not currently work, so the corresponding checkbox is hidden on the form as well.
             }
         }
     }
     if (EtransCur.AckEtransNum > 0)
     {
         AckCur = Etranss.GetEtrans(EtransCur.AckEtransNum);
         if (AckCur != null)
         {
             textAckMessage.Text  = EtransMessageTexts.GetMessageText(AckCur.EtransMessageTextNum);
             textAckDateTime.Text = AckCur.DateTimeTrans.ToString();
             textAckNote.Text     = AckCur.Note;
         }
     }
     else
     {
         AckCur           = null;
         groupAck.Visible = false;
     }
     if (!CultureInfo.CurrentCulture.Name.EndsWith("CA"))             //Not Canadian.
     {
         butPrintAck.Visible = false;
     }
 }
Exemplo n.º 24
0
        ///<summary>Inserts one Etrans into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(Etrans etrans, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                etrans.EtransNum = ReplicationServers.GetKey("etrans", "EtransNum");
            }
            string command = "INSERT INTO etrans (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "EtransNum,";
            }
            command += "DateTimeTrans,ClearingHouseNum,Etype,ClaimNum,OfficeSequenceNumber,CarrierTransCounter,CarrierTransCounter2,CarrierNum,CarrierNum2,PatNum,BatchNumber,AckCode,TransSetNum,Note,EtransMessageTextNum,AckEtransNum,PlanNum,InsSubNum) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(etrans.EtransNum) + ",";
            }
            command +=
                DbHelper.Now() + ","
                + POut.Long(etrans.ClearingHouseNum) + ","
                + POut.Int((int)etrans.Etype) + ","
                + POut.Long(etrans.ClaimNum) + ","
                + POut.Int(etrans.OfficeSequenceNumber) + ","
                + POut.Int(etrans.CarrierTransCounter) + ","
                + POut.Int(etrans.CarrierTransCounter2) + ","
                + POut.Long(etrans.CarrierNum) + ","
                + POut.Long(etrans.CarrierNum2) + ","
                + POut.Long(etrans.PatNum) + ","
                + POut.Int(etrans.BatchNumber) + ","
                + "'" + POut.String(etrans.AckCode) + "',"
                + POut.Int(etrans.TransSetNum) + ","
                + "'" + POut.String(etrans.Note) + "',"
                + POut.Long(etrans.EtransMessageTextNum) + ","
                + POut.Long(etrans.AckEtransNum) + ","
                + POut.Long(etrans.PlanNum) + ","
                + POut.Long(etrans.InsSubNum) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                etrans.EtransNum = Db.NonQ(command, true);
            }
            return(etrans.EtransNum);
        }
Exemplo n.º 25
0
        private void FormEtrans270Edit_Load(object sender, EventArgs e)
        {
            MessageText    = EtransMessageTexts.GetMessageText(EtransCur.EtransMessageTextNum);
            MessageTextAck = "";
            //textMessageText.Text=MessageText;
            textNote.Text = EtransCur.Note;
            EtransAck271  = Etranss.GetEtrans(EtransCur.AckEtransNum);
            x271          = null;
            if (EtransAck271 != null)
            {
                MessageTextAck = EtransMessageTexts.GetMessageText(EtransAck271.EtransMessageTextNum);              //.Replace("~","~\r\n");
                if (EtransAck271.Etype == EtransType.BenefitResponse271)
                {
                    x271 = new X271(MessageTextAck);
                }
            }
            listDTP = new List <DTP271>();
            if (x271 != null)
            {
                listDTP = x271.GetListDtpSubscriber();
                textResponseGroupNum.Text = x271.GetGroupNum();
            }
            if (textCurrentGroupNum.Text != textResponseGroupNum.Text)
            {
                errorProviderGroupNum.SetError(textCurrentGroupNum, Lan.g(this, "Mismatched group number."));
            }
            radioBenefitSendsPat.Checked = (!_isConinsuranceInverted);
            radioBenefitSendsIns.Checked = (_isConinsuranceInverted);
            FillGridDates();
            CreateListOfBenefits();
            FillGrid();
            FillGridBen();
            if (IsInitialResponse)
            {
                SelectForImport();
            }
            long patNum = (EtransCur.PatNum == 0?_subPatNum:EtransCur.PatNum);        //Older 270/217s were always for the subscriber and have etrans.PatNum of 0.

            this.Text += ": " + Patients.GetNameLF(patNum);
            if (Clearinghouses.GetFirstOrDefault(x => x.ClearinghouseNum == EtransCur.ClearingHouseNum)?.CommBridge == EclaimsCommBridge.EDS &&
                EtransAck271 != null && EtransAck271.AckEtransNum != 0)
            {
                _htmlResponse    = EtransMessageTexts.GetMessageText(Etranss.GetEtrans(EtransAck271.AckEtransNum).EtransMessageTextNum);
                butPrint.Visible = true;
            }
        }
Exemplo n.º 26
0
        ///<summary>DateTimeTrans is always handled automatically here.  No need to set it in advance.</summary>
        private static void Insert(Etrans etrans)
        {
            if (PrefB.RandomKeys)
            {
                etrans.EtransNum = MiscData.GetKey("etrans", "EtransNum");
            }
            string command = "INSERT INTO etrans (";

            if (PrefB.RandomKeys)
            {
                command += "EtransNum,";
            }
            command += "DateTimeTrans,ClearinghouseNum,Etype,ClaimNum,OfficeSequenceNumber,CarrierTransCounter,"
                       + "CarrierTransCounter2,CarrierNum,CarrierNum2,PatNum,MessageText) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(etrans.EtransNum) + "', ";
            }
            if (FormChooseDatabase.DBtype == DatabaseType.Oracle)
            {
                command += POut.PDateT(MiscData.GetNowDateTime());
            }
            else              //Assume MySQL
            {
                command += "NOW()";
            }
            command += ", "           //"'"+POut.PDateT (etrans.DateTimeTrans)+"', "
                       + "'" + POut.PInt(etrans.ClearinghouseNum) + "', "
                       + "'" + POut.PInt((int)etrans.Etype) + "', "
                       + "'" + POut.PInt(etrans.ClaimNum) + "', "
                       + "'" + POut.PInt(etrans.OfficeSequenceNumber) + "', "
                       + "'" + POut.PInt(etrans.CarrierTransCounter) + "', "
                       + "'" + POut.PInt(etrans.CarrierTransCounter2) + "', "
                       + "'" + POut.PInt(etrans.CarrierNum) + "', "
                       + "'" + POut.PInt(etrans.CarrierNum2) + "', "
                       + "'" + POut.PInt(etrans.PatNum) + "', "
                       + "'" + POut.PString(etrans.MessageText) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                etrans.EtransNum = General.NonQ(command, true);
            }
        }
Exemplo n.º 27
0
        public static string Run(int scriptNum, string responseExpected, Claim claim)
        {
            string           retVal         = "";
            InsPlan          insPlan        = InsPlans.GetPlan(claim.PlanNum, null);
            InsSub           insSub         = InsSubs.GetOne(claim.InsSubNum);
            long             etransNum      = CanadianOutput.SendClaimReversal(claim, insPlan, insSub);
            Etrans           etrans         = Etranss.GetEtrans(etransNum);
            string           message        = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData       = new CCDFieldInputter(message);
            string           responseStatus = formData.GetValue("G05");

            if (responseStatus != responseExpected)
            {
                return("G05 should be " + responseExpected + "\r\n");
            }
            retVal += "Reversal #" + scriptNum.ToString() + " successful.\r\n";
            return(retVal);
        }
Exemplo n.º 28
0
        private void gridMain_DoubleClick(object sender, EventArgs e)
        {
            int index = gridMain.GetSelectedIndex();

            if (index == -1)           //Clicked in empty space.
            {
                return;
            }
            //Mimics FormClaimsSend.gridHistory_CellDoubleClick(...)
            Cursor = Cursors.WaitCursor;
            Etrans et = (Etrans)gridMain.Rows[index].Tag;

            //Sadly this is needed due to FormEtrans835Edit calling Etranss.Update .
            //See Etranss.RefreshHistory(...), this query does not select all etrans columns.
            //Mimics FormClaimsSend.gridHistory_CellDoubleClick(...)
            et = Etranss.GetEtrans(et.EtransNum);
            FormEtrans835Edit.ShowEra(et);
            Cursor = Cursors.Default;
        }
Exemplo n.º 29
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Etrans etrans = list[e.Row];

            if (etrans.Etype == EtransType.Eligibility_CA)
            {
                FormEtransEdit formETE = new FormEtransEdit();
                formETE.EtransCur = etrans;
                formETE.ShowDialog();
            }
            else
            {
                FormEtrans270Edit formE = new FormEtrans270Edit(PatPlanNum, PlanNum, SubNum);
                formE.EtransCur = etrans;
                formE.benList   = BenList;
                formE.ShowDialog();
            }
            FillGrid();
        }
Exemplo n.º 30
0
        ///<summary>Builds the X835 for given etrans835 and etransMessageText.
        ///Also attempts to create attaches for patients in listPatients using their first/last name and the claim num in their tuple entry.</summary>
        public static X835 Construct835(Etrans etrans835, string etransMessageText, List <ODTuple <Patient, long> > listPatients, out List <Etrans835Attach> listEtrans835Attaches)
        {
            listEtrans835Attaches = new List <Etrans835Attach>();
            //Construct the inital X835 so that we can find the ERA claim we are testing against, needed for attach information.
            X835 x835 = new X835(etrans835, etransMessageText, etrans835.TranSetId835);

            foreach (ODTuple <Patient, long> data in listPatients)
            {
                Patient pat      = data.Item1;
                long    claimNum = data.Item2;
                //Then using that ERA claim we will spoof the Etrans835Attach logic that would run when associating an OD claim to the ERA claim.
                Hx835_Claim eraClaim = x835.ListClaimsPaid.First(x => x.PatientName.Fname.ToLower() == pat.FName.ToLower() && x.PatientName.Lname.ToLower() == pat.LName.ToLower());
                //Spoof ERA claim attachement.
                Etrans835Attach attach = Insert835Attach(etrans835.EtransNum, claimNum, eraClaim.ClpSegmentIndex, etrans835.DateTimeTrans);
                listEtrans835Attaches.Add(attach);
            }
            //Finally we must reconstruct the X835 with the new spoofed attach.
            return(new X835(etrans835, etransMessageText, etrans835.TranSetId835, listEtrans835Attaches));
        }
Exemplo n.º 31
0
        public static string Run(int scriptNum, string responseExpected, string responseTypeExpected, Claim claim, bool showForms, int pageNumber, int lastPageNumber, double firstExamFee, double diagnosticPhaseFee)
        {
            string             retVal            = "";
            ClaimSendQueueItem queueItem         = Claims.GetQueueList(claim.ClaimNum, claim.ClinicNum, 0)[0];
            Clearinghouse      clearinghouseHq   = ClearinghouseL.GetClearinghouseHq(queueItem.ClearinghouseNum);
            Clearinghouse      clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);

            Eclaims.GetMissingData(clearinghouseClin, queueItem);           //,out warnings);
            if (queueItem.MissingData != "")
            {
                return("Cannot send predetermination until missing data is fixed:\r\n" + queueItem.MissingData + "\r\n");
            }
#if DEBUG
            Canadian.testNumber = scriptNum;
            claim.PreAuthString = "" + pageNumber + "," + lastPageNumber + "," + firstExamFee + "," + diagnosticPhaseFee;
#endif
            long             etransNum    = Canadian.SendClaim(clearinghouseClin, queueItem, showForms);
            Etrans           etrans       = Etranss.GetEtrans(etransNum);
            string           message      = EtransMessageTexts.GetMessageText(etrans.EtransMessageTextNum);
            CCDFieldInputter formData     = new CCDFieldInputter(message);
            string           responseType = formData.GetValue("A04");
            if (responseType != responseTypeExpected)
            {
                return("Form type is '" + responseType + "' but should be '" + responseTypeExpected + "'\r\n");
            }
            string responseStatus = formData.GetValue("G05");
            if (responseStatus != responseExpected)
            {
                return("G05 is '" + responseStatus + "' but should be '" + responseExpected + "'\r\n");
            }
            if (responseExpected == "R" && responseTypeExpected == "11")
            {
                //so far, only for #6.  We need some other way to test if successful transaction
                string errorMsgCount = formData.GetValue("G06");
                if (errorMsgCount == "00")
                {
                    return("Wrong message count.\r\n");
                }
            }
            retVal += "Predetermination #" + scriptNum + " page " + pageNumber + " of " + lastPageNumber + " successful.\r\n";
            return(retVal);
        }
Exemplo n.º 32
0
        ///<summary></summary>
        public static Etrans GetEtrans(int etransNum)
        {
            string    command = "SELECT * FROM etrans WHERE EtransNum=" + POut.PInt(etransNum);
            DataTable table   = General.GetTable(command);
            Etrans    etrans  = new Etrans();

            etrans.EtransNum            = PIn.PInt(table.Rows[0][0].ToString());
            etrans.DateTimeTrans        = PIn.PDateT(table.Rows[0][1].ToString());
            etrans.ClearinghouseNum     = PIn.PInt(table.Rows[0][2].ToString());
            etrans.Etype                = (EtransType)PIn.PInt(table.Rows[0][3].ToString());
            etrans.ClaimNum             = PIn.PInt(table.Rows[0][4].ToString());
            etrans.OfficeSequenceNumber = PIn.PInt(table.Rows[0][5].ToString());
            etrans.CarrierTransCounter  = PIn.PInt(table.Rows[0][6].ToString());
            etrans.CarrierTransCounter2 = PIn.PInt(table.Rows[0][7].ToString());
            etrans.CarrierNum           = PIn.PInt(table.Rows[0][8].ToString());
            etrans.CarrierNum2          = PIn.PInt(table.Rows[0][9].ToString());
            etrans.PatNum               = PIn.PInt(table.Rows[0][10].ToString());
            etrans.MessageText          = PIn.PString(table.Rows[0][11].ToString());
            return(etrans);
        }
Exemplo n.º 33
0
 ///<summary>Inserts one Etrans into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Etrans etrans,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         etrans.EtransNum=ReplicationServers.GetKey("etrans","EtransNum");
     }
     string command="INSERT INTO etrans (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="EtransNum,";
     }
     command+="DateTimeTrans,ClearingHouseNum,Etype,ClaimNum,OfficeSequenceNumber,CarrierTransCounter,CarrierTransCounter2,CarrierNum,CarrierNum2,PatNum,BatchNumber,AckCode,TransSetNum,Note,EtransMessageTextNum,AckEtransNum,PlanNum,InsSubNum) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(etrans.EtransNum)+",";
     }
     command+=
              DbHelper.Now()+","
         +    POut.Long  (etrans.ClearingHouseNum)+","
         +    POut.Int   ((int)etrans.Etype)+","
         +    POut.Long  (etrans.ClaimNum)+","
         +    POut.Int   (etrans.OfficeSequenceNumber)+","
         +    POut.Int   (etrans.CarrierTransCounter)+","
         +    POut.Int   (etrans.CarrierTransCounter2)+","
         +    POut.Long  (etrans.CarrierNum)+","
         +    POut.Long  (etrans.CarrierNum2)+","
         +    POut.Long  (etrans.PatNum)+","
         +    POut.Int   (etrans.BatchNumber)+","
         +"'"+POut.String(etrans.AckCode)+"',"
         +    POut.Int   (etrans.TransSetNum)+","
         +"'"+POut.String(etrans.Note)+"',"
         +    POut.Long  (etrans.EtransMessageTextNum)+","
         +    POut.Long  (etrans.AckEtransNum)+","
         +    POut.Long  (etrans.PlanNum)+","
         +    POut.Long  (etrans.InsSubNum)+")";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         etrans.EtransNum=Db.NonQ(command,true);
     }
     return etrans.EtransNum;
 }
Exemplo n.º 34
0
		///<summary>Updates one Etrans in the database.</summary>
		public static void Update(Etrans etrans){
			string command="UPDATE etrans SET "
				+"DateTimeTrans       =  "+POut.DateT (etrans.DateTimeTrans)+", "
				+"ClearingHouseNum    =  "+POut.Long  (etrans.ClearingHouseNum)+", "
				+"Etype               =  "+POut.Int   ((int)etrans.Etype)+", "
				+"ClaimNum            =  "+POut.Long  (etrans.ClaimNum)+", "
				+"OfficeSequenceNumber=  "+POut.Int   (etrans.OfficeSequenceNumber)+", "
				+"CarrierTransCounter =  "+POut.Int   (etrans.CarrierTransCounter)+", "
				+"CarrierTransCounter2=  "+POut.Int   (etrans.CarrierTransCounter2)+", "
				+"CarrierNum          =  "+POut.Long  (etrans.CarrierNum)+", "
				+"CarrierNum2         =  "+POut.Long  (etrans.CarrierNum2)+", "
				+"PatNum              =  "+POut.Long  (etrans.PatNum)+", "
				+"BatchNumber         =  "+POut.Int   (etrans.BatchNumber)+", "
				+"AckCode             = '"+POut.String(etrans.AckCode)+"', "
				+"TransSetNum         =  "+POut.Int   (etrans.TransSetNum)+", "
				+"Note                = '"+POut.String(etrans.Note)+"', "
				+"EtransMessageTextNum=  "+POut.Long  (etrans.EtransMessageTextNum)+", "
				+"AckEtransNum        =  "+POut.Long  (etrans.AckEtransNum)+", "
				+"PlanNum             =  "+POut.Long  (etrans.PlanNum)+", "
				+"InsSubNum           =  "+POut.Long  (etrans.InsSubNum)+", "
				+"TranSetId835        = '"+POut.String(etrans.TranSetId835)+"' "
				+"WHERE EtransNum = "+POut.Long(etrans.EtransNum);
			Db.NonQ(command);
		}
Exemplo n.º 35
0
		///<summary>Updates one Etrans in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
		public static bool Update(Etrans etrans,Etrans oldEtrans){
			string command="";
			if(etrans.DateTimeTrans != oldEtrans.DateTimeTrans) {
				if(command!=""){ command+=",";}
				command+="DateTimeTrans = "+POut.DateT(etrans.DateTimeTrans)+"";
			}
			if(etrans.ClearingHouseNum != oldEtrans.ClearingHouseNum) {
				if(command!=""){ command+=",";}
				command+="ClearingHouseNum = "+POut.Long(etrans.ClearingHouseNum)+"";
			}
			if(etrans.Etype != oldEtrans.Etype) {
				if(command!=""){ command+=",";}
				command+="Etype = "+POut.Int   ((int)etrans.Etype)+"";
			}
			if(etrans.ClaimNum != oldEtrans.ClaimNum) {
				if(command!=""){ command+=",";}
				command+="ClaimNum = "+POut.Long(etrans.ClaimNum)+"";
			}
			if(etrans.OfficeSequenceNumber != oldEtrans.OfficeSequenceNumber) {
				if(command!=""){ command+=",";}
				command+="OfficeSequenceNumber = "+POut.Int(etrans.OfficeSequenceNumber)+"";
			}
			if(etrans.CarrierTransCounter != oldEtrans.CarrierTransCounter) {
				if(command!=""){ command+=",";}
				command+="CarrierTransCounter = "+POut.Int(etrans.CarrierTransCounter)+"";
			}
			if(etrans.CarrierTransCounter2 != oldEtrans.CarrierTransCounter2) {
				if(command!=""){ command+=",";}
				command+="CarrierTransCounter2 = "+POut.Int(etrans.CarrierTransCounter2)+"";
			}
			if(etrans.CarrierNum != oldEtrans.CarrierNum) {
				if(command!=""){ command+=",";}
				command+="CarrierNum = "+POut.Long(etrans.CarrierNum)+"";
			}
			if(etrans.CarrierNum2 != oldEtrans.CarrierNum2) {
				if(command!=""){ command+=",";}
				command+="CarrierNum2 = "+POut.Long(etrans.CarrierNum2)+"";
			}
			if(etrans.PatNum != oldEtrans.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(etrans.PatNum)+"";
			}
			if(etrans.BatchNumber != oldEtrans.BatchNumber) {
				if(command!=""){ command+=",";}
				command+="BatchNumber = "+POut.Int(etrans.BatchNumber)+"";
			}
			if(etrans.AckCode != oldEtrans.AckCode) {
				if(command!=""){ command+=",";}
				command+="AckCode = '"+POut.String(etrans.AckCode)+"'";
			}
			if(etrans.TransSetNum != oldEtrans.TransSetNum) {
				if(command!=""){ command+=",";}
				command+="TransSetNum = "+POut.Int(etrans.TransSetNum)+"";
			}
			if(etrans.Note != oldEtrans.Note) {
				if(command!=""){ command+=",";}
				command+="Note = '"+POut.String(etrans.Note)+"'";
			}
			if(etrans.EtransMessageTextNum != oldEtrans.EtransMessageTextNum) {
				if(command!=""){ command+=",";}
				command+="EtransMessageTextNum = "+POut.Long(etrans.EtransMessageTextNum)+"";
			}
			if(etrans.AckEtransNum != oldEtrans.AckEtransNum) {
				if(command!=""){ command+=",";}
				command+="AckEtransNum = "+POut.Long(etrans.AckEtransNum)+"";
			}
			if(etrans.PlanNum != oldEtrans.PlanNum) {
				if(command!=""){ command+=",";}
				command+="PlanNum = "+POut.Long(etrans.PlanNum)+"";
			}
			if(etrans.InsSubNum != oldEtrans.InsSubNum) {
				if(command!=""){ command+=",";}
				command+="InsSubNum = "+POut.Long(etrans.InsSubNum)+"";
			}
			if(etrans.TranSetId835 != oldEtrans.TranSetId835) {
				if(command!=""){ command+=",";}
				command+="TranSetId835 = '"+POut.String(etrans.TranSetId835)+"'";
			}
			if(command==""){
				return false;
			}
			command="UPDATE etrans SET "+command
				+" WHERE EtransNum = "+POut.Long(etrans.EtransNum);
			Db.NonQ(command);
			return true;
		}