Example #1
0
        protected static FR_L5PA_GPfPIDaAHIC_1113 Execute(DbConnection Connection, DbTransaction Transaction, P_L5PA_GPfPIDaAHIC_1113 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5PA_GPfPIDaAHIC_1113();
            returnValue.Result         = new L5PA_GPfPIDaAHIC_1113();
            returnValue.Result.Patient = new L5PA_GPfPID_1413();
            List <L5PA_GAHICfP_1137> healthCompanies = new List <L5PA_GAHICfP_1137>();
            returnValue.Result.HealthInsurance_Company = healthCompanies.ToArray();

            P_L5PA_GPfPID_1413 param = new P_L5PA_GPfPID_1413();
            param.PatientID = Parameter.PatientID;
            L5PA_GPfPID_1413 patient = new L5PA_GPfPID_1413();
            patient = cls_Get_Patient_for_PatientID.Invoke(Connection, Transaction, param, securityTicket).Result;


            returnValue.Result.Patient = patient;

            List <L5PA_GAHICfP_1137> HealthInsuranceCompanies = new List <L5PA_GAHICfP_1137>();

            HealthInsuranceCompanies = cls_Get_AllHealthInsuranceCompanies_for_Patient.Invoke(Connection, Transaction, securityTicket).Result.ToList();

            returnValue.Result.HealthInsurance_Company = HealthInsuranceCompanies.ToArray();

            return(returnValue);

            #endregion UserCode
        }
        protected static FR_L5PA_GPfPID_1413 Execute(DbConnection Connection, DbTransaction Transaction, P_L5PA_GPfPID_1413 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5PA_GPfPID_1413();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Lucentis_Patient.Complex.Retrieval.SQL.cls_Get_Patient_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 <L5PA_GPfPID_1413> results = new List <L5PA_GPfPID_1413>();
            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_PatientID", "FirstName", "LastName", "Birthdate", "HEC_MedicalPractices_RefID", "HealthInsurance_Number", "HealthInsurance_State_RefID", "CompanyName", "InsuranceStateCode", "Gender", "HEC_HealthInsurance_CompanyID" });
                while (reader.Read())
                {
                    L5PA_GPfPID_1413 resultItem = new L5PA_GPfPID_1413();
                    //0:Parameter HEC_PatientID of type Guid
                    resultItem.HEC_PatientID = 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 Birthdate of type DateTime
                    resultItem.Birthdate = reader.GetDate(3);
                    //4:Parameter HEC_MedicalPractices_RefID of type Guid
                    resultItem.HEC_MedicalPractices_RefID = reader.GetGuid(4);
                    //5:Parameter HealthInsurance_Number of type String
                    resultItem.HealthInsurance_Number = reader.GetString(5);
                    //6:Parameter HealthInsurance_State_RefID of type Guid
                    resultItem.HealthInsurance_State_RefID = reader.GetGuid(6);
                    //7:Parameter CompanyName of type String
                    resultItem.CompanyName = reader.GetString(7);
                    //8:Parameter InsuranceStateCode of type String
                    resultItem.InsuranceStateCode = reader.GetString(8);
                    //9:Parameter Gender of type int
                    resultItem.Gender = reader.GetInteger(9);
                    //10:Parameter HEC_HealthInsurance_CompanyID of type Guid
                    resultItem.HEC_HealthInsurance_CompanyID = reader.GetGuid(10);

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

            returnStatus.Result = results.FirstOrDefault();
            return(returnStatus);
        }