public static PatientDTOA Convert(EntityEN en, NHibernate.ISession session = null)
        {
            PatientDTOA    dto            = null;
            PatientRESTCAD patientRESTCAD = null;
            PatientCEN     patientCEN     = null;
            PatientCP      patientCP      = null;

            if (en != null)
            {
                dto            = new PatientDTOA();
                patientRESTCAD = new PatientRESTCAD(session);
                patientCEN     = new PatientCEN(patientRESTCAD);
                patientCP      = new PatientCP(session);


                PatientEN enHijo = patientRESTCAD.ReadOIDDefault(en.Id);



                //
                // Attributes

                dto.Id = en.Id;

                dto.Name = en.Name;


                dto.Description = en.Description;


                //
                // TravesalLink

                /* Rol: Patient o--> PatientProfile */
                dto.PatientProfile = PatientProfileAssembler.Convert((PatientProfileEN)enHijo.PatientProfile, session);

                /* Rol: Patient o--> User */
                dto.UserData = UserAssembler.Convert((UserEN)enHijo.UserPatient, session);


                //
                // Service
            }

            return(dto);
        }
        public static RelatedPersonDTOA Convert(EntityEN en, NHibernate.ISession session = null)
        {
            RelatedPersonDTOA    dto = null;
            RelatedPersonRESTCAD relatedPersonRESTCAD = null;
            RelatedPersonCEN     relatedPersonCEN     = null;
            RelatedPersonCP      relatedPersonCP      = null;

            if (en != null)
            {
                dto = new RelatedPersonDTOA();
                relatedPersonRESTCAD = new RelatedPersonRESTCAD(session);
                relatedPersonCEN     = new RelatedPersonCEN(relatedPersonRESTCAD);
                relatedPersonCP      = new RelatedPersonCP(session);


                RelatedPersonEN enHijo = relatedPersonRESTCAD.ReadOIDDefault(en.Id);



                //
                // Attributes

                dto.Id = en.Id;

                dto.Name = en.Name;


                dto.Description = en.Description;


                //
                // TravesalLink

                /* Rol: RelatedPerson o--> User */
                dto.RpData = UserAssembler.Convert((UserEN)enHijo.UserRelatedPerson, session);


                //
                // Service
            }

            return(dto);
        }
예제 #3
0
        public static PractitionerDTOA Convert(EntityEN en, NHibernate.ISession session = null)
        {
            PractitionerDTOA    dto = null;
            PractitionerRESTCAD practitionerRESTCAD = null;
            PractitionerCEN     practitionerCEN     = null;
            PractitionerCP      practitionerCP      = null;

            if (en != null)
            {
                dto = new PractitionerDTOA();
                practitionerRESTCAD = new PractitionerRESTCAD(session);
                practitionerCEN     = new PractitionerCEN(practitionerRESTCAD);
                practitionerCP      = new PractitionerCP(session);


                PractitionerEN enHijo = practitionerRESTCAD.ReadOIDDefault(en.Id);



                //
                // Attributes

                dto.Id = en.Id;

                dto.Name = en.Name;


                dto.Description = en.Description;


                //
                // TravesalLink

                /* Rol: Practitioner o--> User */
                dto.PractitionerData = UserAssembler.Convert((UserEN)enHijo.UserPractitioner, session);


                //
                // Service
            }

            return(dto);
        }