Exemplo n.º 1
0
        protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L5EX_SVfEID_1440 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Guid();
            //Put your code here
            var examination = ORM_HEC_ACT_PerformedAction.Query.Search(Connection, Transaction, new ORM_HEC_ACT_PerformedAction.Query()
            {
                HEC_ACT_PerformedActionID = Parameter.ExaminationID,
                Tenant_RefID = securityTicket.TenantID,
                IsDeleted    = false
            }).Single();

            var patientID            = examination.Patient_RefID;
            var allPatientParameters = cls_Get_all_PatientParameters_for_Tenant.Invoke(Connection, Transaction, securityTicket).Result.ToList();

            if (Parameter.HeartRate != null)
            {
                if (Parameter.HeartRate.Frequency != null)
                {
                    saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.HeartRate.Frequency, "myhealtclub.gpapp.pulse-frequency", allPatientParameters, securityTicket);
                }
                if (Parameter.HeartRate.Rhythm != null)
                {
                    saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.HeartRate.Rhythm, "myhealtclub.gpapp.pulse-rhytm", allPatientParameters, securityTicket);
                }
                if (Parameter.HeartRate.Volume != null)
                {
                    saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.HeartRate.Volume, "myhealtclub.gpapp.pulse-volume", allPatientParameters, securityTicket);
                }
            }
            if (Parameter.BloodPressure != null)
            {
                if (Parameter.BloodPressure.Systolic != null)
                {
                    saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.BloodPressure.Systolic, "myhealtclub.gpapp.preasure-sys", allPatientParameters, securityTicket);
                }
                if (Parameter.BloodPressure.Diastolic != null)
                {
                    saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.BloodPressure.Diastolic, "myhealtclub.gpapp.preasure-dia", allPatientParameters, securityTicket);
                }
            }
            if (Parameter.BMI != null)
            {
                if (Parameter.BMI.Height != null)
                {
                    saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.BMI.Height, "myhealtclub.gpapp.bmi-height", allPatientParameters, securityTicket);
                }
                if (Parameter.BMI.Weight != null)
                {
                    saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.BMI.Weight, "myhealtclub.gpapp.bmi-weight", allPatientParameters, securityTicket);
                }
            }
            if (Parameter.BodyTemperature != null)
            {
                saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.BodyTemperature, "myhealtclub.gpapp.body-temp", allPatientParameters, securityTicket);
            }
            if (Parameter.Oxygen_saturation != null)
            {
                saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.Oxygen_saturation, "myhealtclub.gpapp.oxygen-saturation", allPatientParameters, securityTicket);
            }
            if (Parameter.Respiration != null)
            {
                saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, Parameter.Respiration, "myhealtclub.gpapp.respiration", allPatientParameters, securityTicket);
            }

            foreach (var custom in Parameter.CustomVitals)
            {
                saveNewParameterValue(Connection, Transaction, patientID, Parameter.ExaminationID, custom.Value, custom.PatientParameter_RefID.ToString(), allPatientParameters, securityTicket);
            }

            return(returnValue);

            #endregion UserCode
        }
Exemplo n.º 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_Guid Invoke(DbConnection Connection, DbTransaction Transaction, P_L5EX_SVfEID_1440 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Exemplo n.º 3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_Guid Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5EX_SVfEID_1440 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_Guid functionReturn = new FR_Guid();

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