/// <summary>
        /// Update the specified observation
        /// </summary>
        public override Core.Model.Acts.CodedObservation ObsoleteInternal(DataContext context, Core.Model.Acts.CodedObservation data)
        {
            if (data.Value != null)
            {
                data.Value = data.Value?.EnsureExists(context) as Concept;
            }
            data.ValueKey = data.Value?.Key ?? data.ValueKey;
            var obsData = this.m_observationPersistence.ObsoleteInternal(context, data);

            context.Insert(new DbCodedObservation()
            {
                ParentKey = obsData.VersionKey.Value,
                Value     = data.ValueKey
            });
            return(data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Insert the observation
        /// </summary>
        public override Core.Model.Acts.CodedObservation InsertInternal(DataContext context, Core.Model.Acts.CodedObservation data)
        {
            if (data.Value != null)
            {
                data.Value = data.Value?.EnsureExists(context) as Concept;
            }
            data.ValueKey = data.Value?.Key ?? data.ValueKey;

            context.Insert(new DbCodedObservation()
            {
                ParentKey = data.VersionKey.Value,
                Value     = data.ValueKey
            });

            return(data);
        }