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

            FR_L6EX_GCPD_1353 functionReturn = new FR_L6EX_GCPD_1353();

            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_Curent_Patient_data", ex);
            }
            return(functionReturn);
        }
Beispiel #2
0
        protected static FR_L6EX_GCPD_1353 Execute(DbConnection Connection, DbTransaction Transaction, P_L6EX_GCPD_1353 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6EX_GCPD_1353();
            returnValue.Result = new L6EX_GCPD_1353();
            List <L6EX_GCPD_1353_current_diagnosis>  diagnoseList   = new List <L6EX_GCPD_1353_current_diagnosis>();
            List <L6EX_GCPD_1353_current_medication> medicationList = new List <L6EX_GCPD_1353_current_medication>();
            returnValue.Result.current_diagnosis  = diagnoseList.ToArray();
            returnValue.Result.current_medication = medicationList.ToArray();

            var curentPatientDiagnoses = cls_Get_Curent_Patient_Diagnoses.Invoke(Connection, Transaction, new P_L5EX_GCPM_1150 {
                PatientID = Parameter.PatientID
            }, securityTicket).Result.ToList();
            var curentPatientMedications = cls_Get_Current_Patient_Medications.Invoke(Connection, Transaction, new P_L5EX_GCPM_1331 {
                PatientID = Parameter.PatientID
            }, securityTicket).Result.ToList();
            var curentPatientSubstances = cls_Get_Curent_Patient_Substances.Invoke(Connection, Transaction, new P_L5EX_GCPS_1354 {
                PatientID = Parameter.PatientID
            }, securityTicket).Result.ToList();

            var _providerFactory = ProviderFactory.Instance;
            var documentProvider = _providerFactory.CreateDocumentServiceProvider();

            foreach (var item in curentPatientDiagnoses)
            {
                L6EX_GCPD_1353_current_diagnosis diagnose = new L6EX_GCPD_1353_current_diagnosis();
                diagnose.date       = item.diagnosed_on.ToShortDateString();
                diagnose.doctor     = item.doctor;
                diagnose.id         = item.HEC_ACT_PerformedAction_DiagnosisUpdateID.ToString();
                diagnose.icd10      = item.ICD10_Code;
                diagnose.name       = item.PotentialDiagnosis_Name.Contents[0].Content;
                diagnose.doctor_url = (item.ProfileImage_Document_RefID == Guid.Empty) ? "../Images/icons/no_avatar.png" :documentProvider.GenerateImageThumbnailLink(item.ProfileImage_Document_RefID, securityTicket.SessionTicket, false, 40);
                diagnoseList.Add(diagnose);
            }

            foreach (var item in curentPatientMedications)
            {
                L6EX_GCPD_1353_current_medication medication = new L6EX_GCPD_1353_current_medication();
                medication.medication_id  = item.HEC_Patient_MedicationID.ToString();
                medication.medication     = item.Product_Name.Contents[0].Content + " " + item.PackageContent_Amount + " " + item.ISOCode + " " + item.DosageForm_Name.Contents[0].Content;
                medication.added_date     = item.R_DateOfAdding.ToShortDateString();
                medication.use_until_date = item.R_ActiveUntill.ToShortDateString();
                medicationList.Add(medication);
            }

            foreach (var item in curentPatientSubstances)
            {
                L6EX_GCPD_1353_current_medication medication = new L6EX_GCPD_1353_current_medication();
                medication.medication_id  = item.HEC_Patient_MedicationID.ToString();
                medication.medication     = item.GlobalPropertyMatchingID + " " + item.R_DosageText + " " + item.R_IfSubstance_Strength;
                medication.added_date     = item.R_DateOfAdding.ToShortDateString();
                medication.use_until_date = item.R_ActiveUntill.ToShortDateString();
                medicationList.Add(medication);
            }
            P_L5PA_GPDDfPID_1358 patientInfoparam = new P_L5PA_GPDDfPID_1358();
            patientInfoparam.PatientID = Parameter.PatientID;
            var patientInfo = cls_Get_PatientDetailData_for_PatientID.Invoke(Connection, Transaction, patientInfoparam, securityTicket).Result;
            L6EX_GCPD_1353_patient_info patientdata = new L6EX_GCPD_1353_patient_info();
            patientdata.Patient_name              = patientInfo.FirstName + " " + patientInfo.LastName;
            patientdata.Patient_birthday          = patientInfo.BirthDate;
            returnValue.Result.patient_info       = patientdata;
            returnValue.Result.current_diagnosis  = diagnoseList.ToArray();
            returnValue.Result.current_medication = medicationList.ToArray();
            return(returnValue);

            #endregion UserCode
        }