protected static FR_L5DG_GADfP_0950_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DG_GADfP_0950 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DG_GADfP_0950_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Lucentis_Diagnosis.Atomic.Retrieval.SQL.cls_Get_AllDiagnosis_for_PatientID.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, "PatientID", Parameter.PatientID); List <L5DG_GADfP_0950> results = new List <L5DG_GADfP_0950>(); 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[] { "HEC_Patient_DiagnosisID", "HEC_DIA_PotentialDiagnosisID", "ICD10_Code", "PotentialDiagnosis_Name_DictID", "HEC_DIA_Diagnosis_StateID", "DiagnosisState_Abbreviation", "DiagnosisState_Name_DictID", "HEC_DIA_Diagnosis_LocalizationID", "DiagnosisLocalization_Name_DictID", "CreationDate", "DiagnosedOnDate", "DoctorFirstName", "DoctorLastName", "HEC_DoctorID" }); while (reader.Read()) { L5DG_GADfP_0950 resultItem = new L5DG_GADfP_0950(); //0:Parameter HEC_Patient_DiagnosisID of type Guid resultItem.HEC_Patient_DiagnosisID = reader.GetGuid(0); //1:Parameter HEC_DIA_PotentialDiagnosisID of type Guid resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(1); //2:Parameter ICD10_Code of type String resultItem.ICD10_Code = reader.GetString(2); //3:Parameter PotentialDiagnosis_Name_DictID of type Dict resultItem.PotentialDiagnosis_Name_DictID = reader.GetDictionary(3); resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Name_DictID); //4:Parameter HEC_DIA_Diagnosis_StateID of type Guid resultItem.HEC_DIA_Diagnosis_StateID = reader.GetGuid(4); //5:Parameter DiagnosisState_Abbreviation of type String resultItem.DiagnosisState_Abbreviation = reader.GetString(5); //6:Parameter DiagnosisState_Name of type Dict resultItem.DiagnosisState_Name = reader.GetDictionary(6); resultItem.DiagnosisState_Name.SourceTable = "hec_dia_diagnosis_states"; loader.Append(resultItem.DiagnosisState_Name); //7:Parameter HEC_DIA_Diagnosis_LocalizationID of type Guid resultItem.HEC_DIA_Diagnosis_LocalizationID = reader.GetGuid(7); //8:Parameter DiagnosisLocalization_Name of type Dict resultItem.DiagnosisLocalization_Name = reader.GetDictionary(8); resultItem.DiagnosisLocalization_Name.SourceTable = "hec_dia_diagnosis_localizations"; loader.Append(resultItem.DiagnosisLocalization_Name); //9:Parameter CreationDate of type DateTime resultItem.CreationDate = reader.GetDate(9); //10:Parameter DiagnosedOnDate of type DateTime resultItem.DiagnosedOnDate = reader.GetDate(10); //11:Parameter DoctorFirstName of type String resultItem.DoctorFirstName = reader.GetString(11); //12:Parameter DoctorLastName of type String resultItem.DoctorLastName = reader.GetString(12); //13:Parameter HEC_DoctorID of type Guid resultItem.HEC_DoctorID = reader.GetGuid(13); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw ex; } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L5DG_GADfP_0950_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5DG_GADfP_0950 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5DG_GADfP_0950_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DG_GADfP_0950 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5DG_GADfP_0950_Array functionReturn = new FR_L5DG_GADfP_0950_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 ex; } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5DG_GADfP_0950_Array Invoke(string ConnectionString, P_L5DG_GADfP_0950 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }