示例#1
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            Check.Assert(reader.LocalName == "match", "local name must be 'match' rather than " + reader.LocalName);
            this.match = reader.ReadElementString("match", RmXmlSerializer.OpenEhrNamespace).ToCharArray()[0];
            reader.MoveToContent();

            if (reader.LocalName == "purpose")
            {
                this.purpose = new DvCodedText();
                this.purpose.ReadXml(reader);
            }

            Check.Assert(reader.LocalName == "target", "Expected localName is 'target' not " + reader.LocalName);
            this.target = new CodePhrase();
            this.target.ReadXml(reader);

            DesignByContract.Check.Assert(reader.NodeType == System.Xml.XmlNodeType.EndElement,
                                          "Expected endElement of TermMapping");
            reader.ReadEndElement();
            reader.MoveToContent();

            this.CheckInvariants();
        }
示例#2
0
        // CM: 15/02/08
        public DvState(DvCodedText value, bool isTerminal)
            : this()
        {
            this.Value = value;
            this.IsTerminal = isTerminal;

            this.CheckInvariants();
        }
示例#3
0
        public PartyRelated(string name, List<DvIdentifier> identifiers, DvCodedText relationship,
            PartyRef externalRef)
        {
            Check.Require(relationship != null, "relationship must not be null");

            this.relationship = relationship;

            SetBaseData(name, identifiers, externalRef);
        }
示例#4
0
        public TermMapping(char match, DvCodedText purpose, CodePhrase target)
            : this()
        {
            this.match = match;
            this.purpose = purpose;
            this.target = target;

            this.CheckInvariants();
        }
示例#5
0
        public TermMapping(char match, DvCodedText purpose, CodePhrase target)
            : this()
        {
            this.match   = match;
            this.purpose = purpose;
            this.target  = target;

            this.CheckInvariants();
        }
示例#6
0
        public Element(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid,
            Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit,
            DataValue value, DvCodedText nullFlavour)
            : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit)
        {
            this.value = value;
            this.nullFlavour = nullFlavour;

            SetAttributeDictionary();
            CheckInvariants();
        }
示例#7
0
        public override bool Equals(object obj)
        {
            DvCodedText codedText = obj as DvCodedText;

            if (codedText == null)
            {
                return(false);
            }

            if (!base.Equals(obj))
            {
                return(false);
            }

            return(this.DefiningCode.Equals(codedText.DefiningCode));
        }
示例#8
0
        public EventContext(DvDateTime startTime, DvDateTime endTime,
            DvCodedText setting, string location, PartyIdentified healthCareFacility,
            ItemStructure otherContext, Participation[] participations)
            : this()
        {
            Check.Require(startTime != null, "start_time must not be null");
            Check.Require(setting != null, "setting must not be null");

            this.startTime = startTime;
            this.endTime = endTime;
            this.setting = setting;
            this.location = location;
            this.healthCareFacility = healthCareFacility;
            this.otherContext = otherContext;
            if (this.otherContext != null)
                this.otherContext.Parent = this;
            if (participations != null)
                this.participations = new OpenEhr.AssumedTypes.List<Participation>(participations);

            SetAttributeDictionary();
            this.CheckInvariants();
        }
示例#9
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            if (reader.LocalName != "value")
                throw new InvalidXmlException("value", reader.LocalName);
            this.Value = new DvCodedText();
            this.Value.ReadXml(reader);

            if (reader.LocalName != "is_terminal")
                throw new InvalidXmlException("is_terminal", reader.LocalName);
            this.IsTerminal = reader.ReadElementContentAsBoolean("is_terminal", RmXmlSerializer.OpenEhrNamespace);
        }
示例#10
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            Check.Assert(reader.LocalName == "match", "local name must be 'match' rather than "+reader.LocalName);
            this.match = reader.ReadElementString("match", RmXmlSerializer.OpenEhrNamespace).ToCharArray()[0];
            reader.MoveToContent();

            if (reader.LocalName == "purpose")
            {
                this.purpose = new DvCodedText();
                this.purpose.ReadXml(reader);
            }

            Check.Assert(reader.LocalName == "target", "Expected localName is 'target' not "+reader.LocalName);
            this.target = new CodePhrase();
            this.target.ReadXml(reader);

            DesignByContract.Check.Assert(reader.NodeType == System.Xml.XmlNodeType.EndElement,
                "Expected endElement of TermMapping");
            reader.ReadEndElement();
            reader.MoveToContent();

            this.CheckInvariants();
        }
示例#11
0
        internal static bool ValidValueTermDef(DvCodedText dvCodedText, CAttribute cAttribute, ITerminologyService terminologyService)
        {
            string value = string.Empty;
            if (dvCodedText.DefiningCode.TerminologyId.Value == OpenEhrTerminologyIdentifiers.TerminologyIdOpenehr)

                value = OpenEhrTermDefTerm(dvCodedText.DefiningCode.CodeString, terminologyService);

            else if (dvCodedText.DefiningCode.TerminologyId.Value == "local")
                value = LocalTermDefText(dvCodedText.DefiningCode.CodeString, cAttribute);

            if (!string.IsNullOrEmpty(value)
                && !string.IsNullOrEmpty(dvCodedText.Value)
                && value != dvCodedText.Value)
            {
                return false;
            }
            if (!string.IsNullOrEmpty(value) && string.IsNullOrEmpty(dvCodedText.Value))
                dvCodedText.Value = value;

            return true;
        }