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

            FR_L6TR_GTaRD_2039_Array functionReturn = new FR_L6TR_GTaRD_2039_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_Treatment_and_RelevantDiagnosis_for_BillInfo", ex);
            }
            return(functionReturn);
        }
Esempio n. 2
0
        protected static FR_L6TR_GTaRD_2039_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6TR_GTaRD_2039 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L6TR_GTaRD_2039_Array();

            DbCommand command = Connection.CreateCommand();

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

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "toDate", Parameter.toDate);



            List <L6TR_GTaRD_2039_raw> results = new List <L6TR_GTaRD_2039_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[] { "IsTreatmentDeleted", "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_RefID", "IfSheduled_ForDoctor_RefID", "BIL_BillPositionID", "BillPosition_ProductNumber", "PositionNumber", "External_PositionCode", "External_PositionType", "External_PositionReferenceField", "PositionValue_IncludingTax", "PositionValue_BeforeTax", "BIL_BillPosition_TransmitionStatusID", "TransmitionCode", "PrimaryComment", "SecondaryComment", "Creation_Timestamp", "TransmittedOnDate", "HEC_Patient_Treatment_RelevantDiagnosisID", "HEC_DIA_Diagnosis_StateID", "HEC_DIA_PotentialDiagnosisID", "Doctor_RefID", "ICD10_Code", "DiagnosisState_Name_DictID", "DiagnosisState_Abbreviation", "Creation_Date", "DiagnosedOnDate", "PotentialDiagnosis_Name_DictID", "CMN_PRO_ProductID", "Product_Number", "Quantity", "Product_Name_DictID" });
                while (reader.Read())
                {
                    L6TR_GTaRD_2039_raw resultItem = new L6TR_GTaRD_2039_raw();
                    //0:Parameter IsTreatmentDeleted of type bool
                    resultItem.IsTreatmentDeleted = reader.GetBoolean(0);
                    //1:Parameter HEC_Patient_TreatmentID of type Guid
                    resultItem.HEC_Patient_TreatmentID = reader.GetGuid(1);
                    //2:Parameter TreatmentPractice_RefID of type Guid
                    resultItem.TreatmentPractice_RefID = reader.GetGuid(2);
                    //3:Parameter IsTreatmentPerformed of type bool
                    resultItem.IsTreatmentPerformed = reader.GetBoolean(3);
                    //4:Parameter IfTreatmentPerformed_ByDoctor_RefID of type Guid
                    resultItem.IfTreatmentPerformed_ByDoctor_RefID = reader.GetGuid(4);
                    //5:Parameter IfTreatmentPerformed_Date of type DateTime
                    resultItem.IfTreatmentPerformed_Date = reader.GetDate(5);
                    //6:Parameter IsTreatmentFollowup of type bool
                    resultItem.IsTreatmentFollowup = reader.GetBoolean(6);
                    //7:Parameter IfTreatmentFollowup_FromTreatment_RefID of type Guid
                    resultItem.IfTreatmentFollowup_FromTreatment_RefID = reader.GetGuid(7);
                    //8:Parameter IsScheduled of type bool
                    resultItem.IsScheduled = reader.GetBoolean(8);
                    //9:Parameter IfSheduled_Date of type DateTime
                    resultItem.IfSheduled_Date = reader.GetDate(9);
                    //10:Parameter IsTreatmentBilled of type bool
                    resultItem.IsTreatmentBilled = reader.GetBoolean(10);
                    //11:Parameter IfTreatmentBilled_Date of type DateTime
                    resultItem.IfTreatmentBilled_Date = reader.GetDate(11);
                    //12:Parameter Treatment_Comment of type String
                    resultItem.Treatment_Comment = reader.GetString(12);
                    //13:Parameter IsTreatmentOfLeftEye of type bool
                    resultItem.IsTreatmentOfLeftEye = reader.GetBoolean(13);
                    //14:Parameter IsTreatmentOfRightEye of type bool
                    resultItem.IsTreatmentOfRightEye = reader.GetBoolean(14);
                    //15:Parameter HEC_Patient_RefID of type Guid
                    resultItem.HEC_Patient_RefID = reader.GetGuid(15);
                    //16:Parameter IfSheduled_ForDoctor_RefID of type Guid
                    resultItem.IfSheduled_ForDoctor_RefID = reader.GetGuid(16);
                    //17:Parameter BIL_BillPositionID of type Guid
                    resultItem.BIL_BillPositionID = reader.GetGuid(17);
                    //18:Parameter BillPosition_ProductNumber of type string
                    resultItem.BillPosition_ProductNumber = reader.GetString(18);
                    //19:Parameter PositionNumber of type string
                    resultItem.PositionNumber = reader.GetString(19);
                    //20:Parameter External_PositionCode of type string
                    resultItem.External_PositionCode = reader.GetString(20);
                    //21:Parameter External_PositionType of type string
                    resultItem.External_PositionType = reader.GetString(21);
                    //22:Parameter External_PositionReferenceField of type string
                    resultItem.External_PositionReferenceField = reader.GetString(22);
                    //23:Parameter PositionValue_IncludingTax of type double
                    resultItem.PositionValue_IncludingTax = reader.GetDouble(23);
                    //24:Parameter PositionValue_BeforeTax of type double
                    resultItem.PositionValue_BeforeTax = reader.GetDouble(24);
                    //25:Parameter BIL_BillPosition_TransmitionStatusID of type Guid
                    resultItem.BIL_BillPosition_TransmitionStatusID = reader.GetGuid(25);
                    //26:Parameter TransmitionCode of type int
                    resultItem.TransmitionCode = reader.GetInteger(26);
                    //27:Parameter PrimaryComment of type string
                    resultItem.PrimaryComment = reader.GetString(27);
                    //28:Parameter SecondaryComment of type string
                    resultItem.SecondaryComment = reader.GetString(28);
                    //29:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(29);
                    //30:Parameter TransmittedOnDate of type DateTime
                    resultItem.TransmittedOnDate = reader.GetDate(30);
                    //31:Parameter HEC_Patient_Treatment_RelevantDiagnosisID of type Guid
                    resultItem.HEC_Patient_Treatment_RelevantDiagnosisID = reader.GetGuid(31);
                    //32:Parameter HEC_DIA_Diagnosis_StateID of type Guid
                    resultItem.HEC_DIA_Diagnosis_StateID = reader.GetGuid(32);
                    //33:Parameter HEC_DIA_PotentialDiagnosisID of type Guid
                    resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(33);
                    //34:Parameter Doctor_RefID of type Guid
                    resultItem.Doctor_RefID = reader.GetGuid(34);
                    //35:Parameter ICD10_Code of type String
                    resultItem.ICD10_Code = reader.GetString(35);
                    //36:Parameter DiagnosisState_Name of type Dict
                    resultItem.DiagnosisState_Name             = reader.GetDictionary(36);
                    resultItem.DiagnosisState_Name.SourceTable = "hec_dia_diagnosis_states";
                    loader.Append(resultItem.DiagnosisState_Name);
                    //37:Parameter DiagnosisState_Abbreviation of type String
                    resultItem.DiagnosisState_Abbreviation = reader.GetString(37);
                    //38:Parameter Creation_Date of type DateTime
                    resultItem.Creation_Date = reader.GetDate(38);
                    //39:Parameter DiagnosedOnDate of type DateTime
                    resultItem.DiagnosedOnDate = reader.GetDate(39);
                    //40:Parameter PotentialDiagnosis_Name_DictID of type Dict
                    resultItem.PotentialDiagnosis_Name_DictID             = reader.GetDictionary(40);
                    resultItem.PotentialDiagnosis_Name_DictID.SourceTable = "hec_dia_potentialdiagnoses";
                    loader.Append(resultItem.PotentialDiagnosis_Name_DictID);
                    //41:Parameter CMN_PRO_ProductID of type Guid
                    resultItem.CMN_PRO_ProductID = reader.GetGuid(41);
                    //42:Parameter Product_Number of type string
                    resultItem.Product_Number = reader.GetString(42);
                    //43:Parameter Quantity of type double
                    resultItem.Quantity = reader.GetDouble(43);
                    //44:Parameter Product_Name of type Dict
                    resultItem.Product_Name             = reader.GetDictionary(44);
                    resultItem.Product_Name.SourceTable = "cmn_pro_products";
                    loader.Append(resultItem.Product_Name);

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

            returnStatus.Result = L6TR_GTaRD_2039_raw.Convert(results).ToArray();
            return(returnStatus);
        }