Exemple #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6TR_GTaRDfT_1156 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6TR_GTaRDfT_1156 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6TR_GTaRDfT_1156 functionReturn = new FR_L6TR_GTaRDfT_1156();

            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_Treatment_and_RelevantDiagnosis_for_TreatmentID", ex);
            }
            return(functionReturn);
        }
Exemple #2
0
        protected static FR_L6TR_GTaRDfT_1156 Execute(DbConnection Connection, DbTransaction Transaction, P_L6TR_GTaRDfT_1156 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L6TR_GTaRDfT_1156();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL6_Lucenits_Treatments.Atomic.Retrieval.SQL.cls_Get_Treatment_and_RelevantDiagnosis_for_TreatmentID.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, "TreatmentID", Parameter.TreatmentID);



            List <L6TR_GTaRDfT_1156_raw> results = new List <L6TR_GTaRDfT_1156_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[] { "HEC_Patient_TreatmentID", "TreatmentPractice_RefID", "IsTreatmentPerformed", "IfTreatmentPerformed_ByDoctor_RefID", "IfTreatmentPerformed_Date", "IsTreatmentFollowup", "IfTreatmentFollowup_FromTreatment_RefID", "IsScheduled", "IfSheduled_Date", "IsTreatmentBilled", "IfTreatmentBilled_Date", "Treatment_Comment", "IsTreatmentOfLeftEye", "IsTreatmentOfRightEye", "HEC_Patient_Treatment_RelevantDiagnosisID", "HEC_DIA_Diagnosis_StateID", "HEC_DIA_Diagnosis_LocalizationID", "HEC_DIA_PotentialDiagnosisID", "Doctor_RefID", "DiagnosisLocalization_Name_DictID", "ICD10_Code", "DiagnosisState_Name_DictID", "DiagnosisState_Abbreviation", "DoctorFirstName", "DoctorLastName", "Creation_Date", "DiagnosedOnDate", "PotentialDiagnosis_Name_DictID", "CMN_PRO_ProductID", "Product_Number", "Quantity", "Product_Name_DictID", "TransmitionCode" });
                while (reader.Read())
                {
                    L6TR_GTaRDfT_1156_raw resultItem = new L6TR_GTaRDfT_1156_raw();
                    //0:Parameter HEC_Patient_TreatmentID of type Guid
                    resultItem.HEC_Patient_TreatmentID = reader.GetGuid(0);
                    //1:Parameter TreatmentPractice_RefID of type Guid
                    resultItem.TreatmentPractice_RefID = reader.GetGuid(1);
                    //2:Parameter IsTreatmentPerformed of type bool
                    resultItem.IsTreatmentPerformed = reader.GetBoolean(2);
                    //3:Parameter IfTreatmentPerformed_ByDoctor_RefID of type Guid
                    resultItem.IfTreatmentPerformed_ByDoctor_RefID = reader.GetGuid(3);
                    //4:Parameter IfTreatmentPerformed_Date of type DateTime
                    resultItem.IfTreatmentPerformed_Date = reader.GetDate(4);
                    //5:Parameter IsTreatmentFollowup of type bool
                    resultItem.IsTreatmentFollowup = reader.GetBoolean(5);
                    //6:Parameter IfTreatmentFollowup_FromTreatment_RefID of type Guid
                    resultItem.IfTreatmentFollowup_FromTreatment_RefID = reader.GetGuid(6);
                    //7:Parameter IsScheduled of type bool
                    resultItem.IsScheduled = reader.GetBoolean(7);
                    //8:Parameter IfSheduled_Date of type DateTime
                    resultItem.IfSheduled_Date = reader.GetDate(8);
                    //9:Parameter IsTreatmentBilled of type bool
                    resultItem.IsTreatmentBilled = reader.GetBoolean(9);
                    //10:Parameter IfTreatmentBilled_Date of type DateTime
                    resultItem.IfTreatmentBilled_Date = reader.GetDate(10);
                    //11:Parameter Treatment_Comment of type String
                    resultItem.Treatment_Comment = reader.GetString(11);
                    //12:Parameter IsTreatmentOfLeftEye of type bool
                    resultItem.IsTreatmentOfLeftEye = reader.GetBoolean(12);
                    //13:Parameter IsTreatmentOfRightEye of type bool
                    resultItem.IsTreatmentOfRightEye = reader.GetBoolean(13);
                    //14:Parameter HEC_Patient_Treatment_RelevantDiagnosisID of type Guid
                    resultItem.HEC_Patient_Treatment_RelevantDiagnosisID = reader.GetGuid(14);
                    //15:Parameter HEC_DIA_Diagnosis_StateID of type Guid
                    resultItem.HEC_DIA_Diagnosis_StateID = reader.GetGuid(15);
                    //16:Parameter HEC_DIA_Diagnosis_LocalizationID of type Guid
                    resultItem.HEC_DIA_Diagnosis_LocalizationID = reader.GetGuid(16);
                    //17:Parameter HEC_DIA_PotentialDiagnosisID of type Guid
                    resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(17);
                    //18:Parameter Doctor_RefID of type Guid
                    resultItem.Doctor_RefID = reader.GetGuid(18);
                    //19:Parameter DiagnosisLocalization_Name of type Dict
                    resultItem.DiagnosisLocalization_Name             = reader.GetDictionary(19);
                    resultItem.DiagnosisLocalization_Name.SourceTable = "hec_dia_diagnosis_localizations";
                    loader.Append(resultItem.DiagnosisLocalization_Name);
                    //20:Parameter ICD10_Code of type String
                    resultItem.ICD10_Code = reader.GetString(20);
                    //21:Parameter DiagnosisState_Name of type Dict
                    resultItem.DiagnosisState_Name             = reader.GetDictionary(21);
                    resultItem.DiagnosisState_Name.SourceTable = "hec_dia_diagnosis_states";
                    loader.Append(resultItem.DiagnosisState_Name);
                    //22:Parameter DiagnosisState_Abbreviation of type String
                    resultItem.DiagnosisState_Abbreviation = reader.GetString(22);
                    //23:Parameter DoctorFirstName of type String
                    resultItem.DoctorFirstName = reader.GetString(23);
                    //24:Parameter DoctorLastName of type String
                    resultItem.DoctorLastName = reader.GetString(24);
                    //25:Parameter Creation_Date of type DateTime
                    resultItem.Creation_Date = reader.GetDate(25);
                    //26:Parameter DiagnosedOnDate of type DateTime
                    resultItem.DiagnosedOnDate = reader.GetDate(26);
                    //27:Parameter PotentialDiagnosis_Name_DictID of type Dict
                    resultItem.PotentialDiagnosis_Name_DictID             = reader.GetDictionary(27);
                    resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnoses";
                    loader.Append(resultItem.PotentialDiagnosis_Name_DictID);
                    //28:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(28);
                    //29:Parameter Product_Number of type string
                    resultItem.Product_Number = reader.GetString(29);
                    //30:Parameter Quantity of type double
                    resultItem.Quantity = reader.GetDouble(30);
                    //31:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(31);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);
                    //32:Parameter TransmitionCode of type int
                    resultItem.TransmitionCode = reader.GetInteger(32);

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

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

            return(returnStatus);
        }