public Instruction(DvText name, string archetypeNodeId, UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, CodePhrase language, CodePhrase encoding, PartyProxy subject, PartyProxy proider, Participation[] otherParticipations, ObjectRef workflowId, ItemStructure protocol, ObjectRef guidelineId, DvText narrative, DvDateTime expiryTime, Activity[] activities, DvParsable wfDefinition) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, language, encoding, subject, proider, otherParticipations, workflowId, protocol, guidelineId) { Check.Require(narrative != null, "narrative must not be null"); this.narrative = narrative; this.expiryTime = expiryTime; if (activities != null) { this.activities = RmFactory.LocatableList<Activity>(this, activities); } this.wfDefinition = wfDefinition; SetAttributeDictionary(); CheckInvariants(); }
protected override void ReadXmlBase(System.Xml.XmlReader reader) { base.ReadXmlBase(reader); DesignByContract.Check.Assert(reader.LocalName == "narrative", "Expected LocalName is 'narrative', but it is " + reader.LocalName); string narrativeType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace); if (narrativeType != null) this.narrative = new OpenEhr.RM.DataTypes.Text.DvCodedText(); else this.narrative = new OpenEhr.RM.DataTypes.Text.DvText(); this.narrative.ReadXml(reader); if (reader.LocalName == "expiry_time") { this.expiryTime = new OpenEhr.RM.DataTypes.Quantity.DateTime.DvDateTime(); this.expiryTime.ReadXml(reader); } if (reader.LocalName == "wf_definition") { this.wfDefinition = new OpenEhr.RM.DataTypes.Encapsulated.DvParsable(); this.wfDefinition.ReadXml(reader); } if (reader.LocalName == "activities") { AssumedTypes.Impl.LocatableList<Activity> activities = new OpenEhr.AssumedTypes.Impl.LocatableList<Activity>(); do { Activity activity = new Activity(); activity.ReadXml(reader); activity.Parent = this; activities.Add(activity); } while (reader.LocalName == "activities" && reader.NodeType == System.Xml.XmlNodeType.Element); this.activities = activities; } }