public void AddPatientProfile(int p_CarePlanTemplate_OID, int p_patientProfile_OID)
        {
            MoSIoTGenNHibernate.EN.MosIoT.CarePlanTemplateEN carePlanTemplateEN = null;
            try
            {
                SessionInitializeTransaction();
                carePlanTemplateEN = (CarePlanTemplateEN)session.Load(typeof(CarePlanTemplateEN), p_CarePlanTemplate_OID);
                carePlanTemplateEN.PatientProfile = (MoSIoTGenNHibernate.EN.MosIoT.PatientProfileEN)session.Load(typeof(MoSIoTGenNHibernate.EN.MosIoT.PatientProfileEN), p_patientProfile_OID);



                session.Update(carePlanTemplateEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is MoSIoTGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in CarePlanTemplateCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
        public void AddCondition(int p_CarePlanTemplate_OID, System.Collections.Generic.IList <int> p_addressConditions_OIDs)
        {
            MoSIoTGenNHibernate.EN.MosIoT.CarePlanTemplateEN carePlanTemplateEN = null;
            try
            {
                SessionInitializeTransaction();
                carePlanTemplateEN = (CarePlanTemplateEN)session.Load(typeof(CarePlanTemplateEN), p_CarePlanTemplate_OID);
                MoSIoTGenNHibernate.EN.MosIoT.ConditionEN addressConditionsENAux = null;
                if (carePlanTemplateEN.AddressConditions == null)
                {
                    carePlanTemplateEN.AddressConditions = new System.Collections.Generic.List <MoSIoTGenNHibernate.EN.MosIoT.ConditionEN>();
                }

                foreach (int item in p_addressConditions_OIDs)
                {
                    addressConditionsENAux = new MoSIoTGenNHibernate.EN.MosIoT.ConditionEN();
                    addressConditionsENAux = (MoSIoTGenNHibernate.EN.MosIoT.ConditionEN)session.Load(typeof(MoSIoTGenNHibernate.EN.MosIoT.ConditionEN), item);
                    addressConditionsENAux.CarePlanTemplate.Add(carePlanTemplateEN);

                    carePlanTemplateEN.AddressConditions.Add(addressConditionsENAux);
                }


                session.Update(carePlanTemplateEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is MoSIoTGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new MoSIoTGenNHibernate.Exceptions.DataLayerException("Error in CarePlanTemplateCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
示例#3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            CarePlanTemplateEN t = obj as CarePlanTemplateEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
 public CarePlanTemplateEN(CarePlanTemplateEN carePlanTemplate)
 {
     this.init(Id, carePlanTemplate.CareActivity, carePlanTemplate.PatientProfile, carePlanTemplate.Status, carePlanTemplate.Intent, carePlanTemplate.Title, carePlanTemplate.Modified, carePlanTemplate.Goals, carePlanTemplate.AddressConditions, carePlanTemplate.DurationDays, carePlanTemplate.Name, carePlanTemplate.Description, carePlanTemplate.Comunication);
 }