Example #1
0
        public static GoalEN Convert(GoalDTO dto)
        {
            GoalEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new GoalEN();



                    if (dto.CarePlan_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICarePlanTemplateCAD carePlanTemplateCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CarePlanTemplateCAD();

                        newinstance.CarePlan = carePlanTemplateCAD.ReadOIDDefault(dto.CarePlan_oid);
                    }
                    newinstance.Id       = dto.Id;
                    newinstance.Priority = dto.Priority;

                    if (dto.Targets != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ITargetCAD targetCAD = new MoSIoTGenNHibernate.CAD.MosIoT.TargetCAD();

                        newinstance.Targets = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.TargetEN>();
                        foreach (TargetDTO entry in dto.Targets)
                        {
                            newinstance.Targets.Add(TargetAssemblerDTO.Convert(entry));
                        }
                    }
                    newinstance.Status = dto.Status;
                    if (dto.Condition_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IConditionCAD conditionCAD = new MoSIoTGenNHibernate.CAD.MosIoT.ConditionCAD();

                        newinstance.Condition = conditionCAD.ReadOIDDefault(dto.Condition_oid);
                    }
                    newinstance.Description = dto.Description;
                    newinstance.Category    = dto.Category;
                    newinstance.OutcomeCode = dto.OutcomeCode;
                    newinstance.Name        = dto.Name;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
        public static DisabilityEN Convert(DisabilityDTO dto)
        {
            DisabilityEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new DisabilityEN();



                    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.Name     = dto.Name;
                    newinstance.Type     = dto.Type;
                    newinstance.Severity = dto.Severity;
                    if (dto.Origin_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IConditionCAD conditionCAD = new MoSIoTGenNHibernate.CAD.MosIoT.ConditionCAD();

                        newinstance.Origin = conditionCAD.ReadOIDDefault(dto.Origin_oid);
                    }
                    if (dto.AccessMode_oid != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IAccessModeCAD accessModeCAD = new MoSIoTGenNHibernate.CAD.MosIoT.AccessModeCAD();

                        newinstance.AccessMode = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.AccessModeEN>();
                        foreach (int entry in dto.AccessMode_oid)
                        {
                            newinstance.AccessMode.Add(accessModeCAD.ReadOIDDefault(entry));
                        }
                    }
                    newinstance.Description = dto.Description;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }
        public static IMConditionEN Convert(IMConditionDTO dto)
        {
            IMConditionEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new IMConditionEN();



                    if (dto.Condition_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IConditionCAD conditionCAD = new MoSIoTGenNHibernate.CAD.MosIoT.ConditionCAD();

                        newinstance.Condition = conditionCAD.ReadOIDDefault(dto.Condition_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);
        }
Example #4
0
        public static CarePlanTemplateEN Convert(CarePlanTemplateDTO dto)
        {
            CarePlanTemplateEN newinstance = null;

            try
            {
                if (dto != null)
                {
                    newinstance = new CarePlanTemplateEN();



                    if (dto.CareActivity != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.ICareActivityCAD careActivityCAD = new MoSIoTGenNHibernate.CAD.MosIoT.CareActivityCAD();

                        newinstance.CareActivity = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.CareActivityEN>();
                        foreach (CareActivityDTO entry in dto.CareActivity)
                        {
                            newinstance.CareActivity.Add(CareActivityAssemblerDTO.Convert(entry));
                        }
                    }
                    if (dto.PatientProfile_oid != -1)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IPatientProfileCAD patientProfileCAD = new MoSIoTGenNHibernate.CAD.MosIoT.PatientProfileCAD();

                        newinstance.PatientProfile = patientProfileCAD.ReadOIDDefault(dto.PatientProfile_oid);
                    }
                    newinstance.Status   = dto.Status;
                    newinstance.Intent   = dto.Intent;
                    newinstance.Title    = dto.Title;
                    newinstance.Modified = dto.Modified;

                    if (dto.Goals != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IGoalCAD goalCAD = new MoSIoTGenNHibernate.CAD.MosIoT.GoalCAD();

                        newinstance.Goals = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.GoalEN>();
                        foreach (GoalDTO entry in dto.Goals)
                        {
                            newinstance.Goals.Add(GoalAssemblerDTO.Convert(entry));
                        }
                    }
                    if (dto.AddressConditions_oid != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IConditionCAD conditionCAD = new MoSIoTGenNHibernate.CAD.MosIoT.ConditionCAD();

                        newinstance.AddressConditions = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.ConditionEN>();
                        foreach (int entry in dto.AddressConditions_oid)
                        {
                            newinstance.AddressConditions.Add(conditionCAD.ReadOIDDefault(entry));
                        }
                    }
                    newinstance.Id           = dto.Id;
                    newinstance.DurationDays = dto.DurationDays;
                    newinstance.Name         = dto.Name;
                    newinstance.Description  = dto.Description;

                    if (dto.Comunication != null)
                    {
                        MoSIoTGenNHibernate.CAD.MosIoT.IComunicationCAD comunicationCAD = new MoSIoTGenNHibernate.CAD.MosIoT.ComunicationCAD();

                        newinstance.Comunication = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.ComunicationEN>();
                        foreach (ComunicationDTO entry in dto.Comunication)
                        {
                            newinstance.Comunication.Add(ComunicationAssemblerDTO.Convert(entry));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(newinstance);
        }