Exemple #1
0
        /// <summary>
        /// Set of language-dependent paths extracted from archetype. Paths obey the same syntax as
        /// physical_paths, but with node_ids replaced by their meanings from the ontology.
        /// </summary>
        /// <param name="aLanguage">language</param>
        /// <returns></returns>
        public Set <String> LogicalPaths(string aLanguage)
        {
            Check.Require(this.ArchetypeId != null, string.Format(CommonStrings.XMustNotBeNull, "ArchetypeId"));
            Check.Require(this.ArchetypeId.Value != null, string.Format(CommonStrings.XMustNotBeNull, "ArchetypeId.Value"));

            Check.Require(this.Ontology.HasLanguage(aLanguage), string.Format(
                              AmValidationStrings.OntologyMustContainLanguageY, this.ArchetypeId.Value, aLanguage));

            if (this.logicalPaths == null)
            {
                AssumedTypes.Set <string> physicalPath = this.PhysicalPaths();
                System.Collections.Generic.List <string> logicalPathList = new System.Collections.Generic.List <string>();
                foreach (string aPath in physicalPath)
                {
                    if (aPath == "/")
                    {
                        logicalPathList.Add(aPath);
                    }
                    else
                    {
                        string logicalPath = ToLogicalPath(aLanguage, aPath);
                        logicalPathList.Add(logicalPath);
                    }
                }

                this.logicalPaths = new Set <string>(logicalPathList);
            }

            DesignByContract.Check.Ensure(this.logicalPaths != null && !this.logicalPaths.IsEmpty(),
                                          "logicalPaths must not be null or empty.");

            return(this.logicalPaths);
        }
Exemple #2
0
 public ArchetypeSlot(string rmTypeName, string nodeId, AssumedTypes.Interval<int> occurrences,
   CAttribute parent, AssumedTypes.Set<Assertion.Assertion> includes, 
     AssumedTypes.Set<Assertion.Assertion> excludes): base(rmTypeName, nodeId, occurrences, parent)
 {
     this.Includes = includes;
     this.Excludes = excludes;
 }
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            base.ReadXmlBase(reader);

            // read for the attributes in this local class
            Check.Assert(reader.LocalName == "uid", "Expected LocalName as uid rather than " + reader.LocalName);
            this.uid = new OpenEhr.RM.Support.Identification.ObjectVersionId();
            this.uid.ReadXml(reader);

            if (reader.LocalName == "data")
            {
                string dataType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

                OpenEhr.RM.Common.Archetyped.Impl.Locatable locatableData =
                    OpenEhr.RM.Common.Archetyped.Impl.Locatable.GetLocatableObjectByType(dataType);
                locatableData.ReadXml(reader);
                this.data = locatableData as T;
            }

            if (reader.LocalName == "preceding_version_uid")
            {
                this.precedingVersionUid = new OpenEhr.RM.Support.Identification.ObjectVersionId();
                this.precedingVersionUid.ReadXml(reader);
            }

            if (reader.LocalName == "other_input_version_uids")
            {
                this.otherInputVersionUids = new AssumedTypes.Set <ObjectVersionId>();
                do
                {
                    ObjectVersionId objectVersionId = new ObjectVersionId();
                    objectVersionId.ReadXml(reader);

                    this.otherInputVersionUids.Add(objectVersionId);
                } while (reader.LocalName == "other_input_version_uids");
            }

            if (reader.LocalName == "attestations")
            {
                this.attestations = new OpenEhr.AssumedTypes.List <OpenEhr.RM.Common.Generic.Attestation>();
                do
                {
                    Generic.Attestation a = new OpenEhr.RM.Common.Generic.Attestation();
                    a.ReadXml(reader);

                    this.attestations.Add(a);
                } while (reader.LocalName == "attestations");
            }

            Check.Assert(reader.LocalName == "lifecycle_state",
                         "Expected LocalName is lifecycle_state not " + reader.LocalName);
            this.lifecycleState = new OpenEhr.RM.DataTypes.Text.DvCodedText();
            this.lifecycleState.ReadXml(reader);
        }
Exemple #4
0
        /// <summary>
        /// Set of language-independent paths extracted from archetype. Paths obey Xpath-like syntax
        /// and are formed from alternations of C_OBJECT.node_id and C_ATTRIBUTE.rm_attribute_name values.
        /// </summary>
        /// <returns></returns>
        public AssumedTypes.Set <string> PhysicalPaths()
        {
            Check.Require(this.Definition != null, string.Format(CommonStrings.XMustNotBeNull, "Definition"));

            if (this.physicalPaths == null)
            {
                this.physicalPaths = new Set <string>(this.Definition.PhysicalPaths);
            }

            Check.Ensure(this.physicalPaths != null, "this.physicalPath must not be null.");

            return(this.physicalPaths);
        }
 public CComplexObject(string rmTypeName, string nodeId, AssumedTypes.Interval <int> occurrences,
                       CAttribute parent, object assumedValue, AssumedTypes.Set <CAttribute> attributes)
     : base(rmTypeName, nodeId, occurrences, parent, assumedValue)
 {
     this.Attributes = attributes;
 }
Exemple #6
0
 /// <summary>
 /// Return the row whose first n columns have names equal to the values in 'Keys'
 /// </summary>
 /// <param name="keys"></param>
 /// <returns></returns>
 public Cluster RowWithKey(AssumedTypes.Set <string> keys)
 {
     throw new NotImplementedException();
 }
Exemple #7
0
        /// <summary>
        /// True if there is a row whose first n columns have the names in keys
        /// </summary>
        /// <param name="keys"></param>
        /// <returns></returns>

        public bool HasRowWithKey(AssumedTypes.Set <string> keys)
        {
            throw new NotImplementedException("HasRowWithKey function has not been implemented.");
        }
Exemple #8
0
        /// <summary>
        /// Set of language-independent paths extracted from archetype. Paths obey Xpath-like syntax
        /// and are formed from alternations of C_OBJECT.node_id and C_ATTRIBUTE.rm_attribute_name values.
        /// </summary>
        /// <returns></returns>
        public AssumedTypes.Set<string> PhysicalPaths()
        {
            Check.Require(this.Definition != null, string.Format(CommonStrings.XMustNotBeNull, "Definition"));

            if (this.physicalPaths == null)
            {
                this.physicalPaths = new Set<string>(this.Definition.PhysicalPaths);
            }

            Check.Ensure(this.physicalPaths != null, "this.physicalPath must not be null.");

            return this.physicalPaths;
        }