///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5ME_GPIfPID_1338 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5ME_GPIfPID_1338 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5ME_GPIfPID_1338 functionReturn = new FR_L5ME_GPIfPID_1338(); 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_PatientInfos_for_PatientID", ex); } return(functionReturn); }
protected static FR_L5ME_GPIfPID_1338 Execute(DbConnection Connection, DbTransaction Transaction, P_L5ME_GPIfPID_1338 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5ME_GPIfPID_1338(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MyHealthClub_EMR.Atomic.Retrieval.SQL.cls_PatientInfos_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 <L5ME_GPIfPID_1338_raw> results = new List <L5ME_GPIfPID_1338_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[] { "CMN_PER_PersonInfoID", "FirstName", "LastName", "PrimaryEmail", "BirthDate", "HEC_PatientID", "CMN_BPT_BusinessParticipant_RefID", "Creation_Timestamp", "IsDeleted", "Tenant_RefID", "Gender", "DefaultLanguage_RefID", "Modification_TimestampBP", "Modification_TimestampPatient", "Modification_TimestampPersoInfo", "Modification_TimestampCommunicationContact", "Modification_TimestampContactType", "CMN_PER_CommunicationContactID", "Contact_Type", "Content", "IsDefaultForContactType" }); while (reader.Read()) { L5ME_GPIfPID_1338_raw resultItem = new L5ME_GPIfPID_1338_raw(); //0:Parameter CMN_PER_PersonInfoID of type Guid resultItem.CMN_PER_PersonInfoID = reader.GetGuid(0); //1:Parameter FirstName of type String resultItem.FirstName = reader.GetString(1); //2:Parameter LastName of type String resultItem.LastName = reader.GetString(2); //3:Parameter PrimaryEmail of type String resultItem.PrimaryEmail = reader.GetString(3); //4:Parameter BirthDate of type DateTime resultItem.BirthDate = reader.GetDate(4); //5:Parameter HEC_PatientID of type Guid resultItem.HEC_PatientID = reader.GetGuid(5); //6:Parameter CMN_BPT_BusinessParticipant_RefID of type Guid resultItem.CMN_BPT_BusinessParticipant_RefID = reader.GetGuid(6); //7:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(7); //8:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(8); //9:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(9); //10:Parameter Gender of type int resultItem.Gender = reader.GetInteger(10); //11:Parameter DefaultLanguage_RefID of type Guid resultItem.DefaultLanguage_RefID = reader.GetGuid(11); //12:Parameter Modification_TimestampBP of type DateTime resultItem.Modification_TimestampBP = reader.GetDate(12); //13:Parameter Modification_TimestampPatient of type DateTime resultItem.Modification_TimestampPatient = reader.GetDate(13); //14:Parameter Modification_TimestampPersoInfo of type DateTime resultItem.Modification_TimestampPersoInfo = reader.GetDate(14); //15:Parameter Modification_TimestampCommunicationContact of type DateTime resultItem.Modification_TimestampCommunicationContact = reader.GetDate(15); //16:Parameter Modification_TimestampContactType of type DateTime resultItem.Modification_TimestampContactType = reader.GetDate(16); //17:Parameter CMN_PER_CommunicationContactID of type Guid resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(17); //18:Parameter Contact_Type of type Guid resultItem.Contact_Type = reader.GetGuid(18); //19:Parameter Content of type String resultItem.Content = reader.GetString(19); //20:Parameter IsDefaultForContactType of type bool resultItem.IsDefaultForContactType = reader.GetBoolean(20); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_PatientInfos_for_PatientID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5ME_GPIfPID_1338_raw.Convert(results).FirstOrDefault(); return(returnStatus); }