コード例 #1
0
        Archetyped GetArchetypeDetails(string archetypeId)
        {
            //var aId = new ArchetypeId("openEHR-EHR-COMPOSITION.report-result.v1");
            var    aId       = new ArchetypeId(archetypeId);
            var    tId       = new TemplateId("bitalino_monitor.en.v1");
            string rmVersion = "1.0.1";

            Archetyped details = new Archetyped(aId, rmVersion, tId);

            return(details);
        }
コード例 #2
0
        internal protected override void ReadXml(System.Xml.XmlReader reader)
        {
            if (reader.NodeType == System.Xml.XmlNodeType.None)
            {
                reader.MoveToContent();
            }

            string archetypeNodeId = reader.GetAttribute("archetype_node_id");

            Check.Require(ArchetypeId.IsValid(archetypeNodeId),
                          "Composition archetype node Id must be an archetype ID");
            base.ReadXml(reader);
        }
コード例 #3
0
ファイル: Archetype.cs プロジェクト: panky2sharma/OpenEHR
        public Archetype(ArchetypeId archetypeId, string concept, CComplexObject definition,
                         ArchetypeOntology ontology, CodePhrase originalLanguage, RevisionHistory revisionHistory,
                         bool isControlled)
            : base(originalLanguage, revisionHistory, isControlled)
        {
            Check.Require(archetypeId != null, string.Format(CommonStrings.XMustNotBeNull, "archetypeId"));
            Check.Require(!string.IsNullOrEmpty(concept) != null, string.Format(CommonStrings.XMustNotBeNullOrEmpty, "concept"));
            Check.Require(definition != null, string.Format(CommonStrings.XMustNotBeNull, "definition"));
            Check.Require(ontology != null, string.Format(CommonStrings.XMustNotBeNull, "ontology"));

            this.archetypeId = archetypeId;
            this.definition  = definition;
            this.ontology    = ontology;
        }
コード例 #4
0
        public EhrStatus(ArchetypeId archetypeId, DvText name, ObjectVersionId uid, PartySelf subject,
                         bool isQueryable, bool isModifiable, ItemStructure otherDetails)
        {
            if (uid != null)
            {
                this.Uid = uid;
            }

            this.subject = subject;

            this.isQueryable    = isQueryable;
            this.isQueryableSet = true;

            this.isModifiable    = isModifiable;
            this.isModifiableSet = true;

            this.otherDetails = otherDetails;

            base.SetBaseData(archetypeId.Value, name);
        }
コード例 #5
0
        public void ValueShouldBeSetCorrectly()
        {
            const string referenceModelOriginator      = "openEHR";
            const string referenceModelName            = "composition";
            const string referenceModelEntity          = "OBSERVATION";
            const string qualifiedReferenceModelEntity = referenceModelOriginator + "-" + referenceModelName + "-" + referenceModelEntity;
            const string conceptName    = "biochemistry_result";
            const string specialisation = "cholesterol";
            const string domainConcept  = conceptName + "-" + specialisation;
            const string versionId      = "v1";
            const string value          = qualifiedReferenceModelEntity + "." + domainConcept + "." + versionId;
            var          id1            = new ArchetypeId(value);

            Assert.AreEqual(value, id1.Value);
            Assert.AreEqual(qualifiedReferenceModelEntity, id1.QualifiedReferenceModelEntity);
            Assert.AreEqual(referenceModelOriginator, id1.ReferenceModelOriginator);
            Assert.AreEqual(referenceModelName, id1.ReferenceModelName);
            Assert.AreEqual(referenceModelEntity, id1.ReferenceModelEntity);
            Assert.AreEqual(domainConcept, id1.DomainConcept);
            Assert.AreEqual(specialisation, id1.Specialisation);
            Assert.AreEqual(versionId, "v" + id1.VersionId);
            Assert.AreEqual(value, id1.ToString());
        }
コード例 #6
0
        void ReadCArchetypeRoot(XmlReader reader, CArchetypeRoot node)
        {
            ReadCComplexObject(reader, node);

            ArchetypeId archetypeId = new ArchetypeId();

            archetypeId.ReadXml(reader);
            node.ArchetypeId = archetypeId;

            if (reader.LocalName == "template_id")
            {
                TemplateId templateId = new TemplateId();
                templateId.ReadXml(reader);
                node.TemplateId = templateId;
            }

            if (reader.LocalName == "default_values")
            {
                throw new NotImplementedException(CommonStrings.DefaultsSerialisationNotImplemented);
            }

            if (reader.LocalName == "term_definitions")
            {
                System.Collections.Generic.Dictionary <string, AM.Archetype.Ontology.ArchetypeTerm> termDefimitionItemDic
                    = new System.Collections.Generic.Dictionary <string, AM.Archetype.Ontology.ArchetypeTerm>();

                while (reader.LocalName == "term_definitions")
                {
                    AM.Archetype.Ontology.ArchetypeTerm archetypeTerm = new AM.Archetype.Ontology.ArchetypeTerm();
                    amSerializer.ReadArchetypeTerm(reader, archetypeTerm);

                    termDefimitionItemDic.Add(archetypeTerm.Code, archetypeTerm);
                }
                node.TermDefinitions
                    = new Hash <AM.Archetype.Ontology.ArchetypeTerm, string>(termDefimitionItemDic);
            }

            if (reader.LocalName == "term_bindings")
            {
                if (reader.IsEmptyElement)
                {
                    reader.Skip();
                    reader.MoveToContent();
                }
                else
                {
                    System.Collections.Generic.Dictionary <string, Hash <CodePhrase, string> > termBindingDic =
                        new System.Collections.Generic.Dictionary <string, Hash <CodePhrase, string> >();
                    do
                    {
                        System.Collections.Generic.Dictionary <string, CodePhrase> termBindingItemDic
                            = new System.Collections.Generic.Dictionary <string, CodePhrase>();

                        string terminologyString = reader.GetAttribute("terminology");
                        DesignByContract.Check.Assert(!string.IsNullOrEmpty(terminologyString), "terminologyString must not be null or empty.");

                        reader.ReadStartElement();
                        reader.MoveToContent();

                        while (reader.LocalName == "items")
                        {
                            string hashId = reader.GetAttribute("code");

                            reader.ReadStartElement();
                            reader.MoveToContent();

                            CodePhrase codePhrase = new CodePhrase();
                            codePhrase.ReadXml(reader);

                            reader.ReadEndElement();
                            reader.MoveToContent();

                            termBindingItemDic.Add(hashId, codePhrase);
                        }

                        reader.ReadEndElement();
                        reader.MoveToContent();

                        DesignByContract.Check.Assert(termBindingItemDic.Count > 0, "termBindingItemDic must not be empty.");

                        Hash <CodePhrase, string> termBindingItemHash
                            = new Hash <CodePhrase, string>(termBindingItemDic);

                        termBindingDic.Add(terminologyString, termBindingItemHash);
                    } while (reader.LocalName == "term_bindings");

                    DesignByContract.Check.Assert(termBindingDic.Count > 0, "termBindingDic must not be empty.");

                    node.TermBindings = new Hash <Hash <CodePhrase, string>, string>(termBindingDic);
                }
            }

            Check.Assert(reader.NodeType == System.Xml.XmlNodeType.EndElement, "Expected endElement of CArchetypeRoot");

            reader.ReadEndElement();
            reader.MoveToContent();
        }