Beispiel #1
0
        protected static FR_L6PA_GMSPfID_1538 Execute(DbConnection Connection, DbTransaction Transaction, P_L6PA_GMSPfID_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L6PA_GMSPfID_1538();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL6_MS_Patient.Atomic.Retrieval.SQL.cls_Get_MS_Patients_For_ID.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, "HEC_PatientID", Parameter.HEC_PatientID);



            List <L6PA_GMSPfID_1538_raw> results = new List <L6PA_GMSPfID_1538_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[] { "USR_AccountID", "USR_Device_AccountCodeID", "AccountCode_Value", "Salutation_General", "FirstName", "LastName", "PrimaryEmail", "HealthInsurance_Number", "PatientComment", "HasFulfilledParticipationPolicyRequirements", "CMN_PER_PersonInfoID", "CMN_BPT_BusinessParticipantID", "HEC_Patient_HealthInsurancesID", "HEC_PatientID", "HEC_STU_Study_ParticipatingPatientID", "Participation_DateOfSigning", "Participation_Comment", "Content", "CMN_PER_CommunicationContactID", "Contact_Type", "Street_Number", "Street_Name", "City_Name", "City_PostalCode", "Province_Name", "SequenceNumber", "IsPrimary", "CMN_AddressID", "AssignmentID" });
                while (reader.Read())
                {
                    L6PA_GMSPfID_1538_raw resultItem = new L6PA_GMSPfID_1538_raw();
                    //0:Parameter USR_AccountID of type Guid
                    resultItem.USR_AccountID = reader.GetGuid(0);
                    //1:Parameter USR_Device_AccountCodeID of type Guid
                    resultItem.USR_Device_AccountCodeID = reader.GetGuid(1);
                    //2:Parameter AccountCode_Value of type string
                    resultItem.AccountCode_Value = reader.GetString(2);
                    //3:Parameter Salutation_General of type string
                    resultItem.Salutation_General = reader.GetString(3);
                    //4:Parameter FirstName of type string
                    resultItem.FirstName = reader.GetString(4);
                    //5:Parameter LastName of type string
                    resultItem.LastName = reader.GetString(5);
                    //6:Parameter PrimaryEmail of type string
                    resultItem.PrimaryEmail = reader.GetString(6);
                    //7:Parameter HealthInsurance_Number of type string
                    resultItem.HealthInsurance_Number = reader.GetString(7);
                    //8:Parameter PatientComment of type string
                    resultItem.PatientComment = reader.GetString(8);
                    //9:Parameter HasFulfilledParticipationPolicyRequirements of type bool
                    resultItem.HasFulfilledParticipationPolicyRequirements = reader.GetBoolean(9);
                    //10:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(10);
                    //11:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(11);
                    //12:Parameter HEC_Patient_HealthInsurancesID of type Guid
                    resultItem.HEC_Patient_HealthInsurancesID = reader.GetGuid(12);
                    //13:Parameter HEC_PatientID of type Guid
                    resultItem.HEC_PatientID = reader.GetGuid(13);
                    //14:Parameter HEC_STU_Study_ParticipatingPatientID of type Guid
                    resultItem.HEC_STU_Study_ParticipatingPatientID = reader.GetGuid(14);
                    //15:Parameter Participation_DateOfSigning of type DateTime
                    resultItem.Participation_DateOfSigning = reader.GetDate(15);
                    //16:Parameter Participation_Comment of type string
                    resultItem.Participation_Comment = reader.GetString(16);
                    //17:Parameter Content of type String
                    resultItem.Content = reader.GetString(17);
                    //18:Parameter CMN_PER_CommunicationContactID of type Guid
                    resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(18);
                    //19:Parameter Contact_Type of type Guid
                    resultItem.Contact_Type = reader.GetGuid(19);
                    //20:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(20);
                    //21:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(21);
                    //22:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(22);
                    //23:Parameter City_PostalCode of type String
                    resultItem.City_PostalCode = reader.GetString(23);
                    //24:Parameter Province_Name of type String
                    resultItem.Province_Name = reader.GetString(24);
                    //25:Parameter SequenceNumber of type int
                    resultItem.SequenceNumber = reader.GetInteger(25);
                    //26:Parameter IsPrimary of type bool
                    resultItem.IsPrimary = reader.GetBoolean(26);
                    //27:Parameter CMN_AddressID of type Guid
                    resultItem.CMN_AddressID = reader.GetGuid(27);
                    //28:Parameter AssignmentID of type Guid
                    resultItem.AssignmentID = reader.GetGuid(28);

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

            returnStatus.Result = L6PA_GMSPfID_1538_raw.Convert(results).FirstOrDefault();

            return(returnStatus);
        }
Beispiel #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_L6PA_GMSPfID_1538 Invoke(DbConnection Connection, DbTransaction Transaction, P_L6PA_GMSPfID_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Beispiel #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6PA_GMSPfID_1538 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6PA_GMSPfID_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6PA_GMSPfID_1538 functionReturn = new FR_L6PA_GMSPfID_1538();

            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_MS_Patients_For_ID", ex);
            }
            return(functionReturn);
        }
Beispiel #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L6PA_GMSPfID_1538 Invoke(string ConnectionString, P_L6PA_GMSPfID_1538 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }