示例#1
0
        public void AssignConditionCode(int p_Condition_OID, int p_conditionCode_OID)
        {
            ChroniGenNHibernate.EN.Chroni.ConditionEN conditionEN = null;
            try
            {
                SessionInitializeTransaction();
                conditionEN = (ConditionEN)session.Load(typeof(ConditionEN), p_Condition_OID);
                conditionEN.ConditionCode = (ChroniGenNHibernate.EN.Chroni.ConditionCodeEN)session.Load(typeof(ChroniGenNHibernate.EN.Chroni.ConditionCodeEN), p_conditionCode_OID);

                conditionEN.ConditionCode.Condition.Add(conditionEN);



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

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


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

            if (t == null)
            {
                return(false);
            }
            if (Identifier.Equals(t.Identifier))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        public void UnassignConditionCode(int p_Condition_OID, int p_conditionCode_OID)
        {
            try
            {
                SessionInitializeTransaction();
                ChroniGenNHibernate.EN.Chroni.ConditionEN conditionEN = null;
                conditionEN = (ConditionEN)session.Load(typeof(ConditionEN), p_Condition_OID);

                if (conditionEN.ConditionCode.Identifier == p_conditionCode_OID)
                {
                    conditionEN.ConditionCode = null;
                }
                else
                {
                    throw new ModelException("The identifier " + p_conditionCode_OID + " in p_conditionCode_OID you are trying to unrelationer, doesn't exist in ConditionEN");
                }

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

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


            finally
            {
                SessionClose();
            }
        }
示例#4
0
        public int New_(ChroniGenNHibernate.Enumerated.Chroni.EncounterStatusEnum p_status, ChroniGenNHibernate.Enumerated.Chroni.EncounterTypeEnum p_type, ChroniGenNHibernate.Enumerated.Chroni.EncounterPriorityEnum p_priority, Nullable <DateTime> p_startDate, Nullable <DateTime> p_endDate, string p_reason, string p_serviceProvider, int p_patient, System.Collections.Generic.IList <int> p_practitioner, ChroniGenNHibernate.EN.Chroni.ConditionEN p_condition, int p_slot, string p_note)
        {
            EncounterEN encounterEN = null;
            int         oid;

            //Initialized EncounterEN
            encounterEN        = new EncounterEN();
            encounterEN.Status = p_status;

            encounterEN.Type = p_type;

            encounterEN.Priority = p_priority;

            encounterEN.StartDate = p_startDate;

            encounterEN.EndDate = p_endDate;

            encounterEN.Reason = p_reason;

            encounterEN.ServiceProvider = p_serviceProvider;


            if (p_patient != -1)
            {
                // El argumento p_patient -> Property patient es oid = false
                // Lista de oids identifier
                encounterEN.Patient            = new ChroniGenNHibernate.EN.Chroni.PatientEN();
                encounterEN.Patient.Identifier = p_patient;
            }


            encounterEN.Practitioner = new System.Collections.Generic.List <ChroniGenNHibernate.EN.Chroni.PractitionerEN>();
            if (p_practitioner != null)
            {
                foreach (int item in p_practitioner)
                {
                    ChroniGenNHibernate.EN.Chroni.PractitionerEN en = new ChroniGenNHibernate.EN.Chroni.PractitionerEN();
                    en.Identifier = item;
                    encounterEN.Practitioner.Add(en);
                }
            }

            else
            {
                encounterEN.Practitioner = new System.Collections.Generic.List <ChroniGenNHibernate.EN.Chroni.PractitionerEN>();
            }

            encounterEN.Condition = p_condition;


            if (p_slot != -1)
            {
                // El argumento p_slot -> Property slot es oid = false
                // Lista de oids identifier
                encounterEN.Slot            = new ChroniGenNHibernate.EN.Chroni.SlotEN();
                encounterEN.Slot.Identifier = p_slot;
            }

            encounterEN.Note = p_note;

            //Call to EncounterCAD

            oid = _IEncounterCAD.New_(encounterEN);
            return(oid);
        }
示例#5
0
 public ConditionEN(ConditionEN condition)
 {
     this.init(Identifier, condition.Encounter, condition.ConditionCode, condition.Category, condition.ClinicalStatus, condition.Severity, condition.Onset, condition.Abatement, condition.Note);
 }