Exemplo n.º 1
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            try
            {
                TQ.__send_eof = chkSendEOF.Checked;

                if ((cbDelimitedTestRecord.Checked || cbTaggedTestRecord.Checked) && txtFileName.Text.Length > 0)
                {
                    List <KeyValuePair <string, string> > __key_data = new List <KeyValuePair <string, string> >();
                    var __output = new motFormattedFileOutput();

                    if (!Directory.Exists("C:/Records"))
                    {
                        Directory.CreateDirectory("C:/Records");
                    }

                    if (cbDelimitedTestRecord.Checked)
                    {
                        __key_data.Add(new KeyValuePair <string, string>("TableType", "T" + __action.ToUpper().Substring(0, 1)));
                    }

                    __key_data.Add(new KeyValuePair <string, string>("RxSys_LocID", txtRxSys_LocID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DoseScheduleName", txtDoseScheduleName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DoseTimesQtys", txtDoseTimesQtys.Text));

                    if (cbDelimitedTestRecord.Checked)
                    {
                        byte[] __record = __output.WriteDelimitedFile(@"C:\Records\" + txtFileName.Text, __key_data);

                        if (cbSendDelimitedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }

                    if (cbTaggedTestRecord.Checked)
                    {
                        if (cbDelimitedTestRecord.Checked)
                        {
                            __key_data.RemoveAt(0);
                        }

                        string __record = __output.WriteTaggedFile(@"C:\Records\" + txtFileName.Text, __key_data, "TimesQtys", __action);

                        if (cbSendTaggedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }
                }
                else
                {
                    TQ.RxSys_LocID      = txtRxSys_LocID.Text;
                    TQ.DoseScheduleName = txtDoseScheduleName.Text;
                    TQ.DoseTimesQtys    = txtDoseTimesQtys.Text;

                    __execute.__update_event_ui("Time and Quantities field assignment complete ...");

                    try
                    {
                        TQ.Write(__execute.__p);
                    }
                    catch (Exception ex)
                    {
                        __execute.__update_error_ui(string.Format("Time and Quantities record write error: {0}", ex.Message));
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                __execute.__update_error_ui(string.Format("Time and Quantities record error: {0}", ex.Message));
                return;
            }

            __execute.__update_event_ui("Time and Quantities write record complete ...");
        }
Exemplo n.º 2
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            try
            {
                Drug.__send_eof = chkSendEOF.Checked;

                if ((cbDelimitedTestRecord.Checked || cbTaggedTestRecord.Checked) && txtFileName.Text.Length > 0)
                {
                    List <KeyValuePair <string, string> > __key_data = new List <KeyValuePair <string, string> >();
                    var __output = new motFormattedFileOutput();

                    if (!Directory.Exists("C:/Records"))
                    {
                        Directory.CreateDirectory("C:/Records");
                    }

                    if (cbDelimitedTestRecord.Checked)
                    {
                        __key_data.Add(new KeyValuePair <string, string>("TableType", "D" + __action.ToUpper().Substring(0, 1)));
                    }

                    __key_data.Add(new KeyValuePair <string, string>("RxSys_DrugID", txtRxSys_DrugID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("LabelCode", txtLblCode.Text));
                    __key_data.Add(new KeyValuePair <string, string>("ProductCode", txtProdCode.Text));
                    __key_data.Add(new KeyValuePair <string, string>("TradeName", txtTradename.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Strength", txtStrength.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Unit", txtUnit.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxOTC", txtRxOtc.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DoseForm", txtDoseForm.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Route", txtRoute.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DrugSchedule", txtDrugSchedule.Text));
                    __key_data.Add(new KeyValuePair <string, string>("VisualDescription", txtVisualDescription.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DrugName", txtDrugName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("ShortName", txtShortName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("NDCNum", txtNDCNum.Text));
                    __key_data.Add(new KeyValuePair <string, string>("SizeFactor", txtSizeFactor.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Template", txtTemplate.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DefaultIsolate", txtDefaultIsolate.Text));
                    __key_data.Add(new KeyValuePair <string, string>("ConsultMsg", txtConsultMsg.Text));
                    __key_data.Add(new KeyValuePair <string, string>("GenericFor", txtGenericFor.Text));

                    if (cbDelimitedTestRecord.Checked)
                    {
                        byte[] __record = __output.WriteDelimitedFile(@"C:\Records\" + txtFileName.Text, __key_data);

                        if (cbSendDelimitedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }

                    if (cbTaggedTestRecord.Checked)
                    {
                        if (cbDelimitedTestRecord.Checked)
                        {
                            __key_data.RemoveAt(0);
                        }

                        string __record = __output.WriteTaggedFile(@"C:\Records\" + txtFileName.Text, __key_data, "Drug", __action);

                        if (cbSendTaggedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }
                }
                else
                {
                    Drug.RxSys_DrugID = txtRxSys_DrugID.Text;
                    Drug.LabelCode    = txtLblCode.Text;
                    Drug.ProductCode  = txtProdCode.Text;
                    Drug.TradeName    = txtTradename.Text;
                    //Drug.Strength = Convert.ToInt32(txtStrength.Text);
                    Drug.Strength          = txtStrength.Text;
                    Drug.Unit              = txtUnit.Text;
                    Drug.RxOTC             = txtRxOtc.Text;
                    Drug.DoseForm          = txtDoseForm.Text;
                    Drug.Route             = txtRoute.Text;
                    Drug.DrugSchedule      = Convert.ToInt32(txtDrugSchedule.Text);
                    Drug.VisualDescription = txtVisualDescription.Text;
                    Drug.DrugName          = txtDrugName.Text;
                    Drug.ShortName         = txtShortName.Text;
                    Drug.NDCNum            = txtNDCNum.Text;
                    Drug.SizeFactor        = Convert.ToInt32(txtSizeFactor.Text);
                    Drug.Template          = txtTemplate.Text;
                    Drug.DefaultIsolate    = Convert.ToInt32(txtDefaultIsolate.Text);
                    Drug.ConsultMsg        = txtConsultMsg.Text;
                    Drug.GenericFor        = txtGenericFor.Text;

                    __execute.__update_event_ui("Drug field assignment complete ...");

                    try
                    {
                        Drug.Write(__execute.__p);
                    }
                    catch (Exception ex)
                    {
                        __execute.__update_error_ui(string.Format("Drug record write error: {0}", ex.Message));
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                __execute.__update_error_ui(string.Format("Drug record error: {0}", ex.Message));
                return;
            }

            __execute.__update_event_ui("Drug write record complete ...");
        }
Exemplo n.º 3
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            try
            {
                Loc.__send_eof = chkSendEOF.Checked;

                if ((cbDelimitedTestRecord.Checked || cbTaggedTestRecord.Checked) && txtFileName.Text.Length > 0)
                {
                    List <KeyValuePair <string, string> > __key_data = new List <KeyValuePair <string, string> >();
                    var __output = new motFormattedFileOutput();

                    if (!Directory.Exists("C:/Records"))
                    {
                        Directory.CreateDirectory("C:/Records");
                    }

                    if (cbDelimitedTestRecord.Checked)
                    {
                        __key_data.Add(new KeyValuePair <string, string>("TableType", "L" + __action.ToUpper().Substring(0, 1)));
                        //__key_data.Add(new KeyValuePair<string, string>("Action", __action.ToUpper().Substring(0, 1)));
                    }
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_StoreID", txtRxSys_StoreID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("LocName", txtLocName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Address1", txtAddress1.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Address2", txtAddress2.Text));
                    __key_data.Add(new KeyValuePair <string, string>("City", txtCity.Text));
                    __key_data.Add(new KeyValuePair <string, string>("State", txtState.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Zip", txtZip.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Phone", txtPhone.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Comments", txtComment.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_StoreID", txtRxSys_LocID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("CycleDays", txtCycleDays.Text));
                    __key_data.Add(new KeyValuePair <string, string>("CycleType", txtCycleType.Text));

                    if (cbDelimitedTestRecord.Checked)
                    {
                        byte[] __record = __output.WriteDelimitedFile(@"C:\Records\" + txtFileName.Text, __key_data);

                        if (cbSendDelimitedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }

                    if (cbTaggedTestRecord.Checked)
                    {
                        if (cbDelimitedTestRecord.Checked)
                        {
                            __key_data.RemoveAt(0);
                        }

                        string __record = __output.WriteTaggedFile(@"C:\Records\" + txtFileName.Text, __key_data, "Location", __action);

                        if (cbSendTaggedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }
                }
                else
                {
                    Loc.RxSys_StoreID = txtRxSys_StoreID.Text;
                    Loc.RxSys_LocID   = txtRxSys_LocID.Text;
                    Loc.LocationName  = txtLocName.Text;
                    Loc.Address1      = txtAddress1.Text;
                    Loc.Address2      = txtAddress2.Text;
                    Loc.City          = txtCity.Text;
                    Loc.State         = txtState.Text;
                    Loc.Zip           = txtZip.Text;
                    Loc.Phone         = txtPhone.Text;
                    Loc.Comments      = txtComment.Text;
                    Loc.CycleDays     = txtCycleDays.Text.Length > 0 ? Convert.ToInt32(txtCycleDays.Text) : 0;
                    Loc.CycleType     = txtCycleType.Text.Length > 0 ? Convert.ToInt32(txtCycleType.Text) : 0;

                    __execute.__update_event_ui("Location field assignment complete ...");

                    try
                    {
                        Loc.Write(__execute.__p);
                    }
                    catch (Exception ex)
                    {
                        __execute.__update_error_ui(string.Format("Location record write error: {0}", ex.Message));
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                __execute.__update_error_ui(string.Format("Location record field assignment error: {0}", ex.Message));
                return;
            }

            __execute.__update_event_ui("Location write record complete ...");
        }
Exemplo n.º 4
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            try
            {
                Patient.__send_eof = chkSendEOF.Checked;

                if ((cbDelimitedTestRecord.Checked || cbTaggedTestRecord.Checked) && txtFileName.Text.Length > 0)
                {
                    List <KeyValuePair <string, string> > __key_data = new List <KeyValuePair <string, string> >();
                    var __output = new motFormattedFileOutput();

                    if (!Directory.Exists("C:/Records"))
                    {
                        Directory.CreateDirectory("C:/Records");
                    }

                    if (cbDelimitedTestRecord.Checked)
                    {
                        __key_data.Add(new KeyValuePair <string, string>("TableType", "A" + __action.ToUpper().Substring(0, 1)));
                    }

                    __key_data.Add(new KeyValuePair <string, string>("RxSys_PatID", txtRxSys_PatID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("LastName", txtLastName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("FirstName", txtFirstName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("MiddleInitial", txtMiddleInitial.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Address1", txtAddress1.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Address2", txtAddress2.Text));
                    __key_data.Add(new KeyValuePair <string, string>("City", txtCity.Text));
                    __key_data.Add(new KeyValuePair <string, string>("State", txtState.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Zip", txtZip.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Phone1", txtPhone1.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Phone2", txtPhone2.Text));
                    __key_data.Add(new KeyValuePair <string, string>("WorkPhone", txtWorkPhone.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_LocID", txtRxSys_LocID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Room", txtRoom.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Comments", txtComments.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Gender", txtGender.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Status", txtStatus.Text));
                    __key_data.Add(new KeyValuePair <string, string>("CycleDate", txtCycleDate.Text));
                    __key_data.Add(new KeyValuePair <string, string>("CycleDays", txtCycleDays.Text));
                    __key_data.Add(new KeyValuePair <string, string>("CycleType", txtCycleType.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Status", txtStatus.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_LastDoc", txtRxSys_LastDoc.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_PrimaryDoc", txtRxSys_PrimaryDoc.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_AltDoc", txtRxSys_AltDoc.Text));
                    __key_data.Add(new KeyValuePair <string, string>("SSN", txtSSN.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Allergies", txtAllergies.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Diet", txtDiet.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DxNotes", txtDxNote.Text));
                    __key_data.Add(new KeyValuePair <string, string>("TreatmentNotes", txtTreatmentNotes.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DOB", txtDOB.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Height", txtHeight.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Weight", txtWeight.Text));
                    __key_data.Add(new KeyValuePair <string, string>("ResponsibleName", txtResponsibleName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("InsName", txtInsName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("InsPNo", txtInsPNo.Text));
                    __key_data.Add(new KeyValuePair <string, string>("AltInsName", txtAltInsName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("AltInsPNo", txtAltInsPNo.Text));
                    __key_data.Add(new KeyValuePair <string, string>("MCareNum", txtMCareNum.Text));
                    __key_data.Add(new KeyValuePair <string, string>("MCaidNum", txtMCaidNum.Text));
                    __key_data.Add(new KeyValuePair <string, string>("AdmitDate", txtAdmitDate.Text));
                    __key_data.Add(new KeyValuePair <string, string>("ChartOnly", txtChartOnly.Text));

                    if (cbDelimitedTestRecord.Checked)
                    {
                        byte[] __record = __output.WriteDelimitedFile(@"C:\Records\" + txtFileName.Text, __key_data);

                        if (cbSendDelimitedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }

                    if (cbTaggedTestRecord.Checked)
                    {
                        if (cbDelimitedTestRecord.Checked)
                        {
                            __key_data.RemoveAt(0);
                        }

                        string __record = __output.WriteTaggedFile(@"C:\Records\" + txtFileName.Text, __key_data, "Patient", __action);

                        if (cbSendTaggedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }
                }
                else
                {
                    Patient.setField("Action", __action);

                    // Assign all the values and write
                    Patient.RxSys_PatID   = txtRxSys_PatID.Text;
                    Patient.LastName      = txtLastName.Text;
                    Patient.MiddleInitial = txtMiddleInitial.Text;
                    Patient.FirstName     = txtFirstName.Text;
                    Patient.Address1      = txtAddress1.Text;
                    Patient.Address2      = txtAddress2.Text;
                    Patient.City          = txtCity.Text;
                    Patient.PostalCode    = txtZip.Text;
                    Patient.Phone1        = txtPhone1.Text;
                    Patient.Phone2        = txtPhone2.Text;
                    Patient.WorkPhone     = txtWorkPhone.Text;
                    Patient.Room          = txtRoom.Text;

                    Patient.Comments        = txtComments.Text;
                    Patient.Allergies       = txtAllergies.Text;
                    Patient.Diet            = txtDiet.Text;
                    Patient.DxNotes         = txtDxNote.Text;
                    Patient.TreatmentNotes  = txtTreatmentNotes.Text;
                    Patient.ResponisbleName = txtResponsibleName.Text;

                    Patient.DOB    = txtDOB.Text;
                    Patient.Height = Convert.ToInt32(txtHeight.Text);
                    Patient.Weight = Convert.ToInt32(txtWeight.Text);

                    Patient.InsName     = txtInsName.Text;
                    Patient.AltInsName  = txtAltInsName.Text;
                    Patient.InsPNo      = txtAltInsName.Text;
                    Patient.AltInsPNo   = txtAltInsPNo.Text;
                    Patient.MedicareNum = txtMCareNum.Text;
                    Patient.MedicaidNum = txtMCaidNum.Text;

                    Patient.CycleDate = txtCycleDate.Text;
                    Patient.CycleDays = Convert.ToInt32(txtCycleDays.Text);
                    Patient.CycleType = Convert.ToInt32(txtCycleType.Text);

                    Patient.Status = Convert.ToInt32(txtStatus.Text);
                    Patient.SSN    = txtSSN.Text;

                    Patient.AdmitDate = txtAdmitDate.Text;
                    Patient.ChartOnly = txtChartOnly.Text;
                    Patient.Gender    = txtGender.Text;

                    Patient.RxSys_PatID      = txtRxSys_PatID.Text;
                    Patient.RxSys_LocID      = txtRxSys_LocID.Text;
                    Patient.RxSys_PrimaryDoc = txtRxSys_PrimaryDoc.Text;
                    Patient.RxSys_LastDoc    = txtRxSys_LastDoc.Text;
                    Patient.RxSys_AltDoc     = txtRxSys_AltDoc.Text;

                    __execute.__update_event_ui("Patient field assignment complete ...");

                    try
                    {
                        Patient.Write(__execute.__p);
                    }
                    catch (Exception ex)
                    {
                        __execute.__update_error_ui(string.Format("Patient record write error: {0}", ex.Message));
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                __execute.__update_error_ui(string.Format("Patient record field assignment error: {0}", ex.Message));
                return;
            }

            __execute.__update_event_ui("Patient write record complete ...");
        }
Exemplo n.º 5
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            try
            {
                Scrip.__send_eof = chkSendEOF.Checked;

                if ((cbDelimitedTestRecord.Checked || cbTaggedTestRecord.Checked) && txtFileName.Text.Length > 0)
                {
                    List <KeyValuePair <string, string> > __key_data = new List <KeyValuePair <string, string> >();
                    var __output = new motFormattedFileOutput();

                    if (!Directory.Exists("C:/Records"))
                    {
                        Directory.CreateDirectory("C:/Records");
                    }

                    if (cbDelimitedTestRecord.Checked)
                    {
                        __key_data.Add(new KeyValuePair <string, string>("TableType", "R" + __action.ToUpper().Substring(0, 1)));
                    }

                    __key_data.Add(new KeyValuePair <string, string>("RxSys_PatID", txtRxSys_PatID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_RxNum", txtRxNum.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_DocID", txtRxSys_DocID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Sig", txtSig.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxStartDate", txtRxStartDate.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxStopDate", txtRxStopDate.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DoseScheduleName", txtDoseScheduleName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Comments", txtComments.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Refills", txtRefills.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_NewRxNum", txtRxSys_NewRxNum.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Isolate", txtIsolate.Text));
                    __key_data.Add(new KeyValuePair <string, string>("MDoMStart", txtMDOMStart.Text));
                    __key_data.Add(new KeyValuePair <string, string>("MDoMEnd", txtMDOMStop.Text));
                    __key_data.Add(new KeyValuePair <string, string>("QtyPerDose", txtQtyPerDose.Text));
                    __key_data.Add(new KeyValuePair <string, string>("QtyDispensed", txtQtyDispensed.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxType", txtRxType.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Status", txtStatus.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DoW", txtDOW.Text));
                    __key_data.Add(new KeyValuePair <string, string>("SpecialDoses", txtSpecialDoses.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DoseTimesQtys", txtDoseTimesQtys.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_DrugID", txtDrug_ID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DiscontinueDate", txtDiscontinueDate.Text));

                    if (cbDelimitedTestRecord.Checked)
                    {
                        byte[] __record = __output.WriteDelimitedFile(@"C:\Records\" + txtFileName.Text, __key_data);

                        if (cbSendDelimitedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }

                    if (cbTaggedTestRecord.Checked)
                    {
                        if (cbDelimitedTestRecord.Checked)
                        {
                            __key_data.RemoveAt(0);
                        }

                        __key_data.Add(new KeyValuePair <string, string>("ChartOnly", txtChartOnly.Text));
                        __key_data.Add(new KeyValuePair <string, string>("AnchorDate", txtAnchorDate.Text));

                        string __record = __output.WriteTaggedFile(@"C:\Records\" + txtFileName.Text, __key_data, "Rx", __action);

                        if (cbSendTaggedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }
                }
                else
                {
                    Scrip.setField("Action", __action);

                    // Assign all the values and write
                    Scrip.RxSys_PatID  = txtRxSys_PatID.Text;
                    Scrip.RxSys_RxNum  = txtRxNum.Text;
                    Scrip.RxSys_DrugID = txtDrug_ID.Text;
                    Scrip.RxSys_DocID  = txtRxSys_DocID.Text;
                    Scrip.Sig          = txtSig.Text;
                    Scrip.Comments     = txtComments.Text;

                    Scrip.MDOMStart    = txtMDOMStart.Text;
                    Scrip.QtyPerDose   = txtQtyPerDose.Text;
                    Scrip.QtyDispensed = txtQtyDispensed.Text;

                    Scrip.Status = txtStatus.Text;
                    Scrip.DoW    = txtDOW.Text;

                    Scrip.RxStartDate     = txtRxStartDate.Text;
                    Scrip.RxStopDate      = txtRxStopDate.Text;
                    Scrip.DiscontinueDate = txtDiscontinueDate.Text;

                    Scrip.DoseScheduleName = txtDoseScheduleName.Text;
                    Scrip.Isolate          = txtIsolate.Text;

                    Scrip.SpecialDoses  = txtSpecialDoses.Text;
                    Scrip.DoseTimesQtys = txtDoseTimesQtys.Text;

                    Scrip.ChartOnly  = txtChartOnly.Text;
                    Scrip.Refills    = txtRefills.Text;
                    Scrip.RxType     = txtRxType.Text;
                    Scrip.AnchorDate = txtAnchorDate.Text;

                    __execute.__update_event_ui("Prescription field assignment complete ...");

                    try
                    {
                        Scrip.Write(__execute.__p);
                    }
                    catch (Exception ex)
                    {
                        __execute.__update_error_ui(string.Format("Prescription record write error: {0}", ex.Message));
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                __execute.__update_error_ui(string.Format("Prescription record error: {0}", ex.Message));
                return;
            }

            __execute.__update_event_ui("Prescription write record complete ...");
        }
Exemplo n.º 6
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            try
            {
                Doc.__send_eof = chkSendEOF.Checked;

                if ((cbDelimitedTestRecord.Checked || cbTaggedTestRecord.Checked) && txtFileName.Text.Length > 0)
                {
                    List <KeyValuePair <string, string> > __key_data = new List <KeyValuePair <string, string> >();
                    var __output = new motFormattedFileOutput();

                    if (!Directory.Exists("C:/Records"))
                    {
                        Directory.CreateDirectory("C:/Records");
                    }

                    if (cbDelimitedTestRecord.Checked)
                    {
                        __key_data.Add(new KeyValuePair <string, string>("TableType", "P" + __action.ToUpper().Substring(0, 1)));
                    }

                    __key_data.Add(new KeyValuePair <string, string>("LastName", txtLastName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("FirstName", txtFirstName.Text));
                    __key_data.Add(new KeyValuePair <string, string>("MiddleInitial", txtMiddleInitial.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Address1", txtAddress1.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Address2", txtAddress2.Text));
                    __key_data.Add(new KeyValuePair <string, string>("City", txtCity.Text));
                    __key_data.Add(new KeyValuePair <string, string>("State", txtState.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Zip", txtZip.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Phone", txtPhone.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Comments", txtComments.Text));
                    __key_data.Add(new KeyValuePair <string, string>("DEA_ID", txtDEA_ID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("TPID", txtTPID.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Speciality", txtSpecialty.Text));
                    __key_data.Add(new KeyValuePair <string, string>("Fax", txtFax.Text));
                    __key_data.Add(new KeyValuePair <string, string>("PagerInfo", txtPagerInfo.Text));
                    __key_data.Add(new KeyValuePair <string, string>("RxSys_DocID", txtRxSys_DocID.Text));

                    if (cbDelimitedTestRecord.Checked)
                    {
                        byte[] __record = __output.WriteDelimitedFile(@"C:\Records\" + txtFileName.Text, __key_data);

                        if (cbSendDelimitedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }

                    if (cbTaggedTestRecord.Checked)
                    {
                        if (cbDelimitedTestRecord.Checked)
                        {
                            __key_data.RemoveAt(0);
                        }

                        string __record = __output.WriteTaggedFile(@"C:\Records\" + txtFileName.Text, __key_data, "Prescriber", __action);

                        if (cbSendTaggedRecord.Checked)
                        {
                            __execute.__p.write(__record);
                        }
                    }
                }
                else
                {
                    Doc.RxSys_DocID   = txtRxSys_DocID.Text;
                    Doc.LastName      = txtLastName.Text;
                    Doc.FirstName     = txtFirstName.Text;
                    Doc.MiddleInitial = txtMiddleInitial.Text;
                    Doc.Address1      = txtAddress1.Text;
                    Doc.Address2      = txtAddress2.Text;
                    Doc.City          = txtCity.Text;
                    Doc.State         = txtState.Text;
                    Doc.PostalCode    = txtZip.Text;
                    Doc.Phone         = txtPhone.Text;
                    Doc.Comments      = txtComments.Text;
                    Doc.DEA_ID        = txtDEA_ID.Text;
                    Doc.TPID          = txtTPID.Text;
                    Doc.Specialty     = txtSpecialty.Text.Length > 0 ? Convert.ToInt32(txtSpecialty.Text) : 0;
                    Doc.Fax           = txtFax.Text;
                    Doc.PagerInfo     = txtPagerInfo.Text;

                    __execute.__update_event_ui("Prescriber field assignment complete ...");

                    try
                    {
                        Doc.Write(__execute.__p);
                    }
                    catch (Exception ex)
                    {
                        __execute.__update_error_ui(string.Format("Prescriber record write error: {0}", ex.Message));
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                __execute.__update_error_ui(string.Format("Prescriber record field assignment error: {0}", ex.Message));
                return;
            }

            __execute.__update_event_ui("Prescriber write record complete ...");
        }