public static IMConditionDTOA Convert(EntityAttributesEN en, NHibernate.ISession session = null)
        {
            IMConditionDTOA    dto = null;
            IMConditionRESTCAD iMConditionRESTCAD = null;
            IMConditionCEN     iMConditionCEN     = null;
            IMConditionCP      iMConditionCP      = null;

            if (en != null)
            {
                dto = new IMConditionDTOA();
                iMConditionRESTCAD = new IMConditionRESTCAD(session);
                iMConditionCEN     = new IMConditionCEN(iMConditionRESTCAD);
                iMConditionCP      = new IMConditionCP(session);


                IMConditionEN enHijo = iMConditionRESTCAD.ReadOIDDefault(en.Id);



                //
                // Attributes

                dto.Id = en.Id;

                dto.Name = en.Name;


                dto.Description = en.Description;


                //
                // TravesalLink

                /* Rol: IMCondition o--> Condition */
                dto.ValueCondition = ConditionAssembler.Convert((ConditionEN)enHijo.Condition, session);


                //
                // Service
            }

            return(dto);
        }
        public static PatientProfileDTOA Convert(PatientProfileEN en, NHibernate.ISession session = null)
        {
            PatientProfileDTOA    dto = null;
            PatientProfileRESTCAD patientProfileRESTCAD = null;
            PatientProfileCEN     patientProfileCEN     = null;
            PatientProfileCP      patientProfileCP      = null;

            if (en != null)
            {
                dto = new PatientProfileDTOA();
                patientProfileRESTCAD = new PatientProfileRESTCAD(session);
                patientProfileCEN     = new PatientProfileCEN(patientProfileRESTCAD);
                patientProfileCP      = new PatientProfileCP(session);



                //
                // Attributes

                dto.Id = en.Id;

                dto.PreferredLanguage = en.PreferredLanguage;


                dto.Region = en.Region;


                dto.HazardAvoidance = en.HazardAvoidance;


                dto.Name = en.Name;


                dto.Description = en.Description;


                //
                // TravesalLink

                /* Rol: PatientProfile o--> Condition */
                dto.Diseases = null;
                List <ConditionEN> Diseases = patientProfileRESTCAD.Diseases(en.Id).ToList();
                if (Diseases != null)
                {
                    dto.Diseases = new List <ConditionDTOA>();
                    foreach (ConditionEN entry in Diseases)
                    {
                        dto.Diseases.Add(ConditionAssembler.Convert(entry, session));
                    }
                }

                /* Rol: PatientProfile o--> Disability */
                dto.Disabilities = null;
                List <DisabilityEN> Disabilities = patientProfileRESTCAD.Disabilities(en.Id).ToList();
                if (Disabilities != null)
                {
                    dto.Disabilities = new List <DisabilityDTOA>();
                    foreach (DisabilityEN entry in Disabilities)
                    {
                        dto.Disabilities.Add(DisabilityAssembler.Convert(entry, session));
                    }
                }


                //
                // Service
            }

            return(dto);
        }