public static PatientProfileEN Convert(PatientProfileDTO dto) { PatientProfileEN newinstance = null; try { if (dto != null) { newinstance = new PatientProfileEN(); if (dto.AccessMode != null) { MoSIoTGenNHibernate.CAD.MosIoT.IAccessModeCAD accessModeCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AccessModeCAD(); newinstance.AccessMode = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AccessModeEN>(); foreach (AccessModeDTO entry in dto.AccessMode) { newinstance.AccessMode.Add(AccessModeAssemblerDTO.Convert(entry)); } } newinstance.PreferredLanguage = dto.PreferredLanguage; newinstance.Region = dto.Region; newinstance.HazardAvoidance = dto.HazardAvoidance; if (dto.Disability != null) { MoSIoTGenNHibernate.CAD.MosIoT.IDisabilityCAD disabilityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.DisabilityCAD(); newinstance.Disability = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.DisabilityEN>(); foreach (DisabilityDTO entry in dto.Disability) { newinstance.Disability.Add(DisabilityAssemblerDTO.Convert(entry)); } } newinstance.Id = dto.Id; if (dto.Diseases != null) { MoSIoTGenNHibernate.CAD.MosIoT.IConditionCAD conditionCAD = new MoSIoTGenNHibernate.CAD.MosIoT.ConditionCAD(); newinstance.Diseases = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.ConditionEN>(); foreach (ConditionDTO entry in dto.Diseases) { newinstance.Diseases.Add(ConditionAssemblerDTO.Convert(entry)); } } newinstance.Name = dto.Name; newinstance.Description = dto.Description; } } catch (Exception ex) { throw ex; } return(newinstance); }
public static ConditionEN Convert(ConditionDTO dto) { ConditionEN newinstance = null; try { if (dto != null) { newinstance = new ConditionEN(); if (dto.PatientProfile_oid != -1) { MoSIoTGenNHibernate.CAD.MosIoT.IPatientProfileCAD patientProfileCAD = new MoSIoTGenNHibernate.CAD.MosIoT.PatientProfileCAD(); newinstance.PatientProfile = patientProfileCAD.ReadOIDDefault(dto.PatientProfile_oid); } newinstance.Id = dto.Id; newinstance.Description = dto.Description; if (dto.Disabilities_oid != null) { MoSIoTGenNHibernate.CAD.MosIoT.IDisabilityCAD disabilityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.DisabilityCAD(); newinstance.Disabilities = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.DisabilityEN>(); foreach (int entry in dto.Disabilities_oid) { newinstance.Disabilities.Add(disabilityCAD.ReadOIDDefault(entry)); } } newinstance.ClinicalStatus = dto.ClinicalStatus; newinstance.Disease = dto.Disease; if (dto.Goal_oid != null) { MoSIoTGenNHibernate.CAD.MosIoT.IGoalCAD goalCAD = new MoSIoTGenNHibernate.CAD.MosIoT.GoalCAD(); newinstance.Goal = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.GoalEN>(); foreach (int entry in dto.Goal_oid) { newinstance.Goal.Add(goalCAD.ReadOIDDefault(entry)); } } newinstance.Name = dto.Name; } } catch (Exception ex) { throw ex; } return(newinstance); }
public static AccessModeEN Convert(AccessModeDTO dto) { AccessModeEN newinstance = null; try { if (dto != null) { newinstance = new AccessModeEN(); if (dto.Patient_oid != -1) { MoSIoTGenNHibernate.CAD.MosIoT.IPatientProfileCAD patientProfileCAD = new MoSIoTGenNHibernate.CAD.MosIoT.PatientProfileCAD(); newinstance.Patient = patientProfileCAD.ReadOIDDefault(dto.Patient_oid); } newinstance.Id = dto.Id; newinstance.TypeAccessMode = dto.TypeAccessMode; if (dto.AdaptationDetailRequired != null) { MoSIoTGenNHibernate.CAD.MosIoT.IAdaptationDetailRequiredCAD adaptationDetailRequiredCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AdaptationDetailRequiredCAD(); newinstance.AdaptationDetailRequired = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AdaptationDetailRequiredEN>(); foreach (AdaptationDetailRequiredDTO entry in dto.AdaptationDetailRequired) { newinstance.AdaptationDetailRequired.Add(AdaptationDetailRequiredAssemblerDTO.Convert(entry)); } } if (dto.DeviceTemplate_oid != null) { MoSIoTGenNHibernate.CAD.MosIoT.IDeviceTemplateCAD deviceTemplateCAD = new MoSIoTGenNHibernate.CAD.MosIoT.DeviceTemplateCAD(); newinstance.DeviceTemplate = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.DeviceTemplateEN>(); foreach (int entry in dto.DeviceTemplate_oid) { newinstance.DeviceTemplate.Add(deviceTemplateCAD.ReadOIDDefault(entry)); } } newinstance.Description = dto.Description; if (dto.AdaptationTypeRequired != null) { MoSIoTGenNHibernate.CAD.MosIoT.IAdaptationTypeRequiredCAD adaptationTypeRequiredCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AdaptationTypeRequiredCAD(); newinstance.AdaptationTypeRequired = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AdaptationTypeRequiredEN>(); foreach (AdaptationTypeRequiredDTO entry in dto.AdaptationTypeRequired) { newinstance.AdaptationTypeRequired.Add(AdaptationTypeRequiredAssemblerDTO.Convert(entry)); } } if (dto.AdaptationRequest != null) { MoSIoTGenNHibernate.CAD.MosIoT.IAdaptationRequestCAD adaptationRequestCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AdaptationRequestCAD(); newinstance.AdaptationRequest = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AdaptationRequestEN>(); foreach (AdaptationRequestDTO entry in dto.AdaptationRequest) { newinstance.AdaptationRequest.Add(AdaptationRequestAssemblerDTO.Convert(entry)); } } if (dto.Disability_oid != -1) { MoSIoTGenNHibernate.CAD.MosIoT.IDisabilityCAD disabilityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.DisabilityCAD(); newinstance.Disability = disabilityCAD.ReadOIDDefault(dto.Disability_oid); } newinstance.Name = dto.Name; } } catch (Exception ex) { throw ex; } return(newinstance); }
public static IMDisabilityEN Convert(IMDisabilityDTO dto) { IMDisabilityEN newinstance = null; try { if (dto != null) { newinstance = new IMDisabilityEN(); if (dto.Disability_oid != -1) { MoSIoTGenNHibernate.CAD.MosIoT.IDisabilityCAD disabilityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.DisabilityCAD(); newinstance.Disability = disabilityCAD.ReadOIDDefault(dto.Disability_oid); } newinstance.Id = dto.Id; newinstance.Name = dto.Name; newinstance.Type = dto.Type; newinstance.IsOID = dto.IsOID; if (dto.TargetAssociation_oid != null) { MoSIoTGenNHibernate.CAD.MosIoT.IAssociationCAD associationCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AssociationCAD(); newinstance.TargetAssociation = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AssociationEN>(); foreach (int entry in dto.TargetAssociation_oid) { newinstance.TargetAssociation.Add(associationCAD.ReadOIDDefault(entry)); } } if (dto.OriginAsociation_oid != null) { MoSIoTGenNHibernate.CAD.MosIoT.IAssociationCAD associationCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AssociationCAD(); newinstance.OriginAsociation = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AssociationEN>(); foreach (int entry in dto.OriginAsociation_oid) { newinstance.OriginAsociation.Add(associationCAD.ReadOIDDefault(entry)); } } newinstance.AssociationType = dto.AssociationType; newinstance.IsWritable = dto.IsWritable; newinstance.Description = dto.Description; if (dto.Entity_oid != -1) { MoSIoTGenNHibernate.CAD.MosIoT.IEntityCAD entityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.EntityCAD(); newinstance.Entity = entityCAD.ReadOIDDefault(dto.Entity_oid); } if (dto.Trigger_oid != null) { MoSIoTGenNHibernate.CAD.MosIoT.IRecipeTriggerCAD recipeTriggerCAD = new MoSIoTGenNHibernate.CAD.MosIoT.RecipeTriggerCAD(); newinstance.Trigger = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.RecipeTriggerEN>(); foreach (int entry in dto.Trigger_oid) { newinstance.Trigger.Add(recipeTriggerCAD.ReadOIDDefault(entry)); } } if (dto.Register_oid != null) { MoSIoTGenNHibernate.CAD.MosIoT.IRegisterCAD registerCAD = new MoSIoTGenNHibernate.CAD.MosIoT.RegisterCAD(); newinstance.Register = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.RegisterEN>(); foreach (int entry in dto.Register_oid) { newinstance.Register.Add(registerCAD.ReadOIDDefault(entry)); } } newinstance.Value = dto.Value; } } catch (Exception ex) { throw ex; } return(newinstance); }