protected static FR_L2PP_GaPPT_1449_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L2PP_GaPPT_1449_Array();
            //Put your code here
            #region Get Languages

            P_L2LN_GALFTID_1530 param = new P_L2LN_GALFTID_1530();
            param.Tenant_RefID = securityTicket.TenantID;
            var DBLanguages = cls_Get_All_Languages_ForTenantID.Invoke(Connection, Transaction, param, securityTicket).Result;

            var languages = DBLanguages.Select(i => new ISOLanguage()
            {
                ISO = i.ISO_639_1, LanguageID = i.CMN_LanguageID
            }).ToList();

            #endregion

            Assembly      asm      = Assembly.GetExecutingAssembly();
            XmlDocument   resource = new XmlDocument();
            XmlTextReader reader   = new XmlTextReader(asm.GetManifestResourceStream(DMPatientParameterTypes.ResourceFilePath));
            resource.Load(reader);

            var predefinedPatientParameterTypes = DMPatientParameterTypes.Get_PredefinedPatientParameterTypes(Connection, Transaction, securityTicket);

            var globalPropertyMatchingIDs = predefinedPatientParameterTypes.Select(i => i.GlobalPropertyMatchingID).ToList();

            var globalMatching2Dict = DBCommonsReader.Instance.GetDictObjectsFromResourceFile(globalPropertyMatchingIDs, resource,
                                                                                              ORM_HEC_Patient_ParameterType.TableName, languages);

            returnValue.Result = predefinedPatientParameterTypes.Select(item =>
                                                                        new L2PP_GaPPT_1449 {
                GlobalPropertyMatchingID = item.GlobalPropertyMatchingID, PatientParameter_TypeName = globalMatching2Dict[item.GlobalPropertyMatchingID]
            }).ToArray();

            return(returnValue);

            #endregion UserCode
        }
        protected static FR_L2PP_GaPP_1554_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L2PP_GaPP_1554_Array();
            //Put your code here
            var parameterTypes = DMPatientParameterTypes.Get_PredefinedPatientParameterTypes(Connection, Transaction, securityTicket);
            List <L2PP_GaPP_1554> patParameters = new List <L2PP_GaPP_1554>();


            P_L2LN_GALFTID_1530 param = new P_L2LN_GALFTID_1530();
            param.Tenant_RefID = securityTicket.TenantID;
            var DBLanguages = cls_Get_All_Languages_ForTenantID.Invoke(Connection, Transaction, param, securityTicket).Result;

            var languages = DBLanguages.Select(i => new ISOLanguage()
            {
                ISO = i.ISO_639_1, LanguageID = i.CMN_LanguageID
            }).ToList();
            Assembly      asm      = Assembly.GetExecutingAssembly();
            XmlDocument   resource = new XmlDocument();
            var           xmlpath  = asm.GetManifestResourceStream(DMPatientParameterTypes.ResourceFilePath);
            XmlTextReader reader   = new XmlTextReader(xmlpath);
            resource.Load(reader);

            var predefinedPatientParameterTypes = DMPatientParameterTypes.Get_PredefinedPatientParameterTypes(Connection, Transaction, securityTicket);

            var globalPropertyMatchingIDs = predefinedPatientParameterTypes.Select(i => i.GlobalPropertyMatchingID).ToList();

            var globalMatching2Dict = DBCommonsReader.Instance.GetDictObjectsFromResourceFile(globalPropertyMatchingIDs, resource,
                                                                                              ORM_HEC_Patient_Parameter.TableName, languages);

            foreach (var item in parameterTypes)
            {
                var patientParameter = ORM_HEC_Patient_Parameter.Query.Search(Connection, Transaction, new ORM_HEC_Patient_Parameter.Query()
                {
                    Tenant_RefID             = securityTicket.TenantID,
                    IsDeleted                = false,
                    GlobalPropertyMatchingID = item.GlobalPropertyMatchingID
                });
                if (patientParameter != null && patientParameter.Count != 0)
                {
                    L2PP_GaPP_1554 patParameter = new L2PP_GaPP_1554();
                    patParameter.GlobalPropertyMatchingID = item.GlobalPropertyMatchingID;
                    patParameter.PatientParameter_ID      = patientParameter.Single().HEC_Patient_ParameterID;
                    patParameters.Add(patParameter);
                }
                else
                {
                    ORM_HEC_Patient_Parameter newPatparameter = new ORM_HEC_Patient_Parameter();
                    newPatparameter.IsVitalParameter         = true;
                    newPatparameter.ParameterType_RefID      = DMPatientParameterTypes.Get_PatientParameterTypes_for_GlobalPropertyMatchingID(Connection, Transaction, item.GlobalPropertyMatchingID, securityTicket);
                    newPatparameter.Tenant_RefID             = securityTicket.TenantID;
                    newPatparameter.PatientParameterITL      = Guid.NewGuid().ToString();
                    newPatparameter.GlobalPropertyMatchingID = item.GlobalPropertyMatchingID;
                    newPatparameter.IsString       = true;
                    newPatparameter.Parameter_Name = globalMatching2Dict[item.GlobalPropertyMatchingID];
                    newPatparameter.Save(Connection, Transaction);

                    L2PP_GaPP_1554 patParameter = new L2PP_GaPP_1554();
                    patParameter.GlobalPropertyMatchingID = item.GlobalPropertyMatchingID;
                    patParameter.PatientParameter_ID      = newPatparameter.HEC_Patient_ParameterID;
                    patParameters.Add(patParameter);
                }
            }
            returnValue.Result = patParameters.ToArray();
            return(returnValue);

            #endregion UserCode
        }