コード例 #1
0
        protected static FR_CAS_GCFR_0910_Array Execute(DbConnection Connection, DbTransaction Transaction, P_CAS_GCFR_0910 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_CAS_GCFR_0910_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "MMDocConnectDBMethods.Case.Atomic.Retrieval.SQL.cls_Get_Cases_For_Report.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Status", Parameter.Status);



            List <CAS_GCFR_0910> results = new List <CAS_GCFR_0910>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "Patient_LastName", "Patient_FirstName", "Patient_BirthDate", "Patient_Gender", "CaseNumber", "IM_PotentialDiagnosisLocalization_Code", "IM_PotentialDiagnosis_Name", "IM_PotentialDiagnosis_Code", "IM_PotentialDiagnosisState_Name", "IM_PotentialDiagnosisCatalog_Name", "TreatmentSubmitBPName", "TreatmentPracticeName", "AfterCaseSubmitMedicalPractice", "AfterCaseSubmitResponsibleBPNAme", "Patient_RefID", "PotentialDiagnosis_RefID", "AfterCareDoctor", "SurgeryDoctor", "CaseID", "StatusID", "TreatmentCaseSubmitActionID", "afterCaseSubmitActionID", "LocalizationID", "LocalizationImID", "DiganoseImID", "Code", "Catalog_Name_DictID", "PotentialDiagnosis_Name_DictID", "CodeForType", "TreatmentDate", "AfterCareDate", "BillingCode", "StatusNumber", "PositionNumber", "IsTreatmentP", "IsAftercareP", "TreatmentPerformedDiganoseID", "AftercasePerformedDiagnoseID", "TreatmentDiagnoseUpdateIM", "AftercareDiagnoseUpdateIM", "TreatmentLocalizationID", "AftercareLocalizationID", "TreatmentLocalizationCode", "AftercareLocalizationCode", "AftercaseLocalizationIDIM", "TreatmentLocalizationIDIM", "IsPatientFeeWaived", "orderId", "orderStatusCode", "isLabelOnly", "SendInvoiceToPractice", "NumberForPayment", "DrugID", "CodeName", "IsTreatmentID", "IsAftercareID", "TreatmentPracticeID", "AftercarePracticeID", "PatientHIP", "InsuranceID", "GposID", "BillPositionID", "CaseCreationDate" });
                while (reader.Read())
                {
                    CAS_GCFR_0910 resultItem = new CAS_GCFR_0910();
                    //0:Parameter Patient_LastName of type String
                    resultItem.Patient_LastName = reader.GetString(0);
                    //1:Parameter Patient_FirstName of type String
                    resultItem.Patient_FirstName = reader.GetString(1);
                    //2:Parameter Patient_BirthDate of type DateTime
                    resultItem.Patient_BirthDate = reader.GetDate(2);
                    //3:Parameter Patient_Gender of type Double
                    resultItem.Patient_Gender = reader.GetDouble(3);
                    //4:Parameter CaseNumber of type String
                    resultItem.CaseNumber = reader.GetString(4);
                    //5:Parameter IM_PotentialDiagnosisLocalization_Code of type String
                    resultItem.IM_PotentialDiagnosisLocalization_Code = reader.GetString(5);
                    //6:Parameter IM_PotentialDiagnosis_Name of type String
                    resultItem.IM_PotentialDiagnosis_Name = reader.GetString(6);
                    //7:Parameter IM_PotentialDiagnosis_Code of type String
                    resultItem.IM_PotentialDiagnosis_Code = reader.GetString(7);
                    //8:Parameter IM_PotentialDiagnosisState_Name of type String
                    resultItem.IM_PotentialDiagnosisState_Name = reader.GetString(8);
                    //9:Parameter IM_PotentialDiagnosisCatalog_Name of type String
                    resultItem.IM_PotentialDiagnosisCatalog_Name = reader.GetString(9);
                    //10:Parameter TreatmentSubmitBPName of type String
                    resultItem.TreatmentSubmitBPName = reader.GetString(10);
                    //11:Parameter TreatmentPracticeName of type String
                    resultItem.TreatmentPracticeName = reader.GetString(11);
                    //12:Parameter AfterCaseSubmitMedicalPractice of type String
                    resultItem.AfterCaseSubmitMedicalPractice = reader.GetString(12);
                    //13:Parameter AfterCaseSubmitResponsibleBPNAme of type String
                    resultItem.AfterCaseSubmitResponsibleBPNAme = reader.GetString(13);
                    //14:Parameter Patient_RefID of type Guid
                    resultItem.Patient_RefID = reader.GetGuid(14);
                    //15:Parameter PotentialDiagnosis_RefID of type Guid
                    resultItem.PotentialDiagnosis_RefID = reader.GetGuid(15);
                    //16:Parameter AfterCareDoctor of type Guid
                    resultItem.AfterCareDoctor = reader.GetGuid(16);
                    //17:Parameter SurgeryDoctor of type Guid
                    resultItem.SurgeryDoctor = reader.GetGuid(17);
                    //18:Parameter CaseID of type Guid
                    resultItem.CaseID = reader.GetGuid(18);
                    //19:Parameter StatusID of type Guid
                    resultItem.StatusID = reader.GetGuid(19);
                    //20:Parameter TreatmentCaseSubmitActionID of type Guid
                    resultItem.TreatmentCaseSubmitActionID = reader.GetGuid(20);
                    //21:Parameter afterCaseSubmitActionID of type Guid
                    resultItem.afterCaseSubmitActionID = reader.GetGuid(21);
                    //22:Parameter LocalizationID of type Guid
                    resultItem.LocalizationID = reader.GetGuid(22);
                    //23:Parameter LocalizationImID of type Guid
                    resultItem.LocalizationImID = reader.GetGuid(23);
                    //24:Parameter DiganoseImID of type Guid
                    resultItem.DiganoseImID = reader.GetGuid(24);
                    //25:Parameter Code of type String
                    resultItem.Code = reader.GetString(25);
                    //26:Parameter Catalog_Name_DictID of type Dict
                    resultItem.Catalog_Name_DictID             = reader.GetDictionary(26);
                    resultItem.Catalog_Name_DictID.SourceTable = "hec_dia_potentialdiagnosis_catalogs";
                    loader.Append(resultItem.Catalog_Name_DictID);
                    //27:Parameter PotentialDiagnosis_Name_DictID of type Dict
                    resultItem.PotentialDiagnosis_Name_DictID             = reader.GetDictionary(27);
                    resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnosis_catalogs";
                    loader.Append(resultItem.PotentialDiagnosis_Name_DictID);
                    //28:Parameter CodeForType of type String
                    resultItem.CodeForType = reader.GetString(28);
                    //29:Parameter TreatmentDate of type DateTime
                    resultItem.TreatmentDate = reader.GetDate(29);
                    //30:Parameter AfterCareDate of type DateTime
                    resultItem.AfterCareDate = reader.GetDate(30);
                    //31:Parameter BillingCode of type String
                    resultItem.BillingCode = reader.GetString(31);
                    //32:Parameter StatusNumber of type String
                    resultItem.StatusNumber = reader.GetString(32);
                    //33:Parameter PositionNumber of type String
                    resultItem.PositionNumber = reader.GetString(33);
                    //34:Parameter IsTreatmentP of type bool
                    resultItem.IsTreatmentP = reader.GetBoolean(34);
                    //35:Parameter IsAftercareP of type bool
                    resultItem.IsAftercareP = reader.GetBoolean(35);
                    //36:Parameter TreatmentPerformedDiganoseID of type Guid
                    resultItem.TreatmentPerformedDiganoseID = reader.GetGuid(36);
                    //37:Parameter AftercasePerformedDiagnoseID of type Guid
                    resultItem.AftercasePerformedDiagnoseID = reader.GetGuid(37);
                    //38:Parameter TreatmentDiagnoseUpdateIM of type Guid
                    resultItem.TreatmentDiagnoseUpdateIM = reader.GetGuid(38);
                    //39:Parameter AftercareDiagnoseUpdateIM of type Guid
                    resultItem.AftercareDiagnoseUpdateIM = reader.GetGuid(39);
                    //40:Parameter TreatmentLocalizationID of type Guid
                    resultItem.TreatmentLocalizationID = reader.GetGuid(40);
                    //41:Parameter AftercareLocalizationID of type Guid
                    resultItem.AftercareLocalizationID = reader.GetGuid(41);
                    //42:Parameter TreatmentLocalizationCode of type String
                    resultItem.TreatmentLocalizationCode = reader.GetString(42);
                    //43:Parameter AftercareLocalizationCode of type String
                    resultItem.AftercareLocalizationCode = reader.GetString(43);
                    //44:Parameter AftercaseLocalizationIDIM of type Guid
                    resultItem.AftercaseLocalizationIDIM = reader.GetGuid(44);
                    //45:Parameter TreatmentLocalizationIDIM of type Guid
                    resultItem.TreatmentLocalizationIDIM = reader.GetGuid(45);
                    //46:Parameter IsPatientFeeWaived of type Boolean
                    resultItem.IsPatientFeeWaived = reader.GetBoolean(46);
                    //47:Parameter orderId of type Guid
                    resultItem.orderId = reader.GetGuid(47);
                    //48:Parameter orderStatusCode of type string
                    resultItem.orderStatusCode = reader.GetString(48);
                    //49:Parameter isLabelOnly of type Boolean
                    resultItem.isLabelOnly = reader.GetBoolean(49);
                    //50:Parameter SendInvoiceToPractice of type Boolean
                    resultItem.SendInvoiceToPractice = reader.GetBoolean(50);
                    //51:Parameter NumberForPayment of type int
                    resultItem.NumberForPayment = reader.GetInteger(51);
                    //52:Parameter DrugID of type Guid
                    resultItem.DrugID = reader.GetGuid(52);
                    //53:Parameter CodeName of type String
                    resultItem.CodeName = reader.GetString(53);
                    //54:Parameter IsTreatmentID of type Guid
                    resultItem.IsTreatmentID = reader.GetGuid(54);
                    //55:Parameter IsAftercareID of type Guid
                    resultItem.IsAftercareID = reader.GetGuid(55);
                    //56:Parameter TreatmentPracticeID of type Guid
                    resultItem.TreatmentPracticeID = reader.GetGuid(56);
                    //57:Parameter AftercarePracticeID of type Guid
                    resultItem.AftercarePracticeID = reader.GetGuid(57);
                    //58:Parameter PatientHIP of type String
                    resultItem.PatientHIP = reader.GetString(58);
                    //59:Parameter InsuranceID of type String
                    resultItem.InsuranceID = reader.GetString(59);
                    //60:Parameter GposID of type Guid
                    resultItem.GposID = reader.GetGuid(60);
                    //61:Parameter BillPositionID of type Guid
                    resultItem.BillPositionID = reader.GetGuid(61);
                    //62:Parameter CaseCreationDate of type DateTime
                    resultItem.CaseCreationDate = reader.GetDate(62);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_Cases_For_Report", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
コード例 #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_CAS_GCFR_0910_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_CAS_GCFR_0910 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
コード例 #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_CAS_GCFR_0910_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_CAS_GCFR_0910 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_CAS_GCFR_0910_Array functionReturn = new FR_CAS_GCFR_0910_Array();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, Parameter, securityTicket);

                #region Cleanup Connection/Transaction
                //Commit the transaction
                if (cleanupTransaction == true)
                {
                    Transaction.Commit();
                }
                //Close the connection
                if (cleanupConnection == true)
                {
                    Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

                try
                {
                    if (cleanupConnection == true && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                catch { }

                throw new Exception("Exception occured in method cls_Get_Cases_For_Report", ex);
            }
            return(functionReturn);
        }
コード例 #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_CAS_GCFR_0910_Array Invoke(string ConnectionString, P_CAS_GCFR_0910 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }