///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5ME_GDfPAID_1919_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5ME_GDfPAID_1919 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5ME_GDfPAID_1919_Array functionReturn = new FR_L5ME_GDfPAID_1919_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_Diagnosis_for_PerformedActionID", ex); } return(functionReturn); }
protected static FR_L5ME_GDfPAID_1919_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5ME_GDfPAID_1919 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5ME_GDfPAID_1919_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_EMR.Atomic.Retrieval.SQL.cls_Get_Diagnosis_for_PerformedActionID.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, "PerformedActionID", Parameter.PerformedActionID); List <L5ME_GDfPAID_1919_raw> results = new List <L5ME_GDfPAID_1919_raw>(); 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[] { "PotentialDiagnosis_Name_DictID", "HEC_Patient_DiagnosisID", "HEC_DIA_PotentialDiagnosisID", "ICD10_Code", "R_DiagnosedOnDate", "R_ScheduledExpiryDate", "R_IsActive", "R_IsConfirmed", "R_IsNegated", "R_IsAssumed", "R_DeactivatedOnDate", "HEC_ACT_PerformedAction_DiagnosisUpdateID" }); while (reader.Read()) { L5ME_GDfPAID_1919_raw resultItem = new L5ME_GDfPAID_1919_raw(); //0:Parameter PotentialDiagnosis_Name of type Dict resultItem.PotentialDiagnosis_Name = reader.GetDictionary(0); resultItem.PotentialDiagnosis_Name.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Name); //1:Parameter HEC_Patient_DiagnosisID of type Guid resultItem.HEC_Patient_DiagnosisID = reader.GetGuid(1); //2:Parameter HEC_DIA_PotentialDiagnosisID of type Guid resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(2); //3:Parameter ICD10_Code of type String resultItem.ICD10_Code = reader.GetString(3); //4:Parameter R_DiagnosedOnDate of type DateTime resultItem.R_DiagnosedOnDate = reader.GetDate(4); //5:Parameter R_ScheduledExpiryDate of type DateTime resultItem.R_ScheduledExpiryDate = reader.GetDate(5); //6:Parameter R_IsActive of type Boolean resultItem.R_IsActive = reader.GetBoolean(6); //7:Parameter R_IsConfirmed of type Boolean resultItem.R_IsConfirmed = reader.GetBoolean(7); //8:Parameter R_IsNegated of type Boolean resultItem.R_IsNegated = reader.GetBoolean(8); //9:Parameter R_IsAssumed of type Boolean resultItem.R_IsAssumed = reader.GetBoolean(9); //10:Parameter R_DeactivatedOnDate of type DateTime resultItem.R_DeactivatedOnDate = reader.GetDate(10); //11:Parameter HEC_ACT_PerformedAction_DiagnosisUpdateID of type Guid resultItem.HEC_ACT_PerformedAction_DiagnosisUpdateID = reader.GetGuid(11); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Diagnosis_for_PerformedActionID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5ME_GDfPAID_1919_raw.Convert(results).ToArray(); return(returnStatus); }