本文整理汇总了C#中MARC.AddResultDetail方法的典型用法代码示例。如果您正苦于以下问题:C# MARC.AddResultDetail方法的具体用法?C# MARC.AddResultDetail怎么用?C# MARC.AddResultDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MARC
的用法示例。
在下文中一共展示了MARC.AddResultDetail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public virtual object Parse(System.Xml.XmlReader s, System.Type useType, System.Type currentInteractionType, MARC.Everest.Formatters.XML.ITS1.XmlIts1FormatterParseResult resultContext) {
System.String nil = s.GetAttribute("nil", MARC.Everest.Formatters.XML.ITS1.XmlIts1Formatter.NS_XSI);
if(!System.String.IsNullOrEmpty(nil) && System.Convert.ToBoolean(nil)) return null;;
MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Agent instance = new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Agent();;
if(s.NodeType != System.Xml.XmlNodeType.Element) throw new System.InvalidOperationException(System.String.Format("Expected node type of Element, actual node type is '{0}'", s.NodeType));
if(s.GetAttribute("classCode") != null){ if(!"AGNT".Equals(s.GetAttribute("classCode"))) resultContext.AddResultDetail(new MARC.Everest.Connectors.FixedValueMisMatchedResultDetail(s.GetAttribute("classCode"), "AGNT", false, s.ToString())); instance.ClassCode = (MARC.Everest.DataTypes.CS<System.String>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("classCode"), typeof(MARC.Everest.DataTypes.CS<System.String>)); }
if(s.GetAttribute("nullFlavor") != null) instance.NullFlavor = (MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("nullFlavor"), typeof(MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>));
if(s.IsEmptyElement) return instance;
string sName = s.Name;
int sDepth = s.Depth;
s.Read();
while(!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Name == sName && s.Depth == sDepth)) {
string oldName = s.LocalName;
try { if(s.NodeType == System.Xml.XmlNodeType.Element) {
if(s.LocalName == "representedOrganization" ) {
object db1b9febfa2ff4d9c8a44c75c7799f8e1 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization), currentInteractionType, resultContext); instance.RepresentedOrganization = db1b9febfa2ff4d9c8a44c75c7799f8e1 is MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization ? db1b9febfa2ff4d9c8a44c75c7799f8e1 as MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization : (MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization)MARC.Everest.Connectors.Util.FromWireFormat(db1b9febfa2ff4d9c8a44c75c7799f8e1, typeof(MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization));
}
else if(s.LocalName == "realmCode" ) {
object d8a6a02dee5514777bfbbd1f6d49916f3 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>), currentInteractionType, resultContext); instance.RealmCode = d8a6a02dee5514777bfbbd1f6d49916f3 is MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>> ? d8a6a02dee5514777bfbbd1f6d49916f3 as MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>> : (MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>)MARC.Everest.Connectors.Util.FromWireFormat(d8a6a02dee5514777bfbbd1f6d49916f3, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>));
}
else if(s.LocalName == "typeId" ) {
object d1e93adf2ef0647dea657168fb827351e = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.II), currentInteractionType, resultContext); instance.TypeId = d1e93adf2ef0647dea657168fb827351e is MARC.Everest.DataTypes.II ? d1e93adf2ef0647dea657168fb827351e as MARC.Everest.DataTypes.II : (MARC.Everest.DataTypes.II)MARC.Everest.Connectors.Util.FromWireFormat(d1e93adf2ef0647dea657168fb827351e, typeof(MARC.Everest.DataTypes.II));
}
else if(s.LocalName == "templateId" ) {
object d6fcedf8ad81741bfb6425f42cbe2daf7 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>), currentInteractionType, resultContext); instance.TemplateId = d6fcedf8ad81741bfb6425f42cbe2daf7 is MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> ? d6fcedf8ad81741bfb6425f42cbe2daf7 as MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> : (MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>)MARC.Everest.Connectors.Util.FromWireFormat(d6fcedf8ad81741bfb6425f42cbe2daf7, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>));
}
else { resultContext.AddResultDetail(new MARC.Everest.Connectors.NotImplementedElementResultDetail(MARC.Everest.Connectors.ResultDetailType.Warning, s.LocalName, s.NamespaceURI, s.ToString(), null)); }
}
}
catch (System.Exception e) { resultContext.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, s.ToString(), e)); }
finally { if(oldName.Equals(s.LocalName)) s.Read(); } }
return instance;
}
示例2: Graph
public virtual MARC.Everest.Connectors.ResultCode Graph(System.Xml.XmlWriter s, object o, MARC.Everest.Interfaces.IGraphable context, MARC.Everest.Formatters.XML.ITS1.XmlIts1FormatterGraphResult resultContext) {
MARC.Everest.RMIM.UV.NE2008.COCT_MT090002UV01.AssignedEntity instance = o as MARC.Everest.RMIM.UV.NE2008.COCT_MT090002UV01.AssignedEntity;;
MARC.Everest.Connectors.ResultCode retVal = MARC.Everest.Connectors.ResultCode.Accepted;
if(o == null) throw new System.ArgumentNullException("o");
if(instance == null) throw new System.ArgumentException(System.String.Format("Could not cast type '{0}' to 'MARC.Everest.RMIM.UV.NE2008.COCT_MT090002UV01.AssignedEntity'!", o.GetType().FullName));
bool isInstanceNull = instance.NullFlavor != null;
bool isEntryPoint = s is MARC.Everest.Xml.XmlStateWriter && (s as MARC.Everest.Xml.XmlStateWriter).ElementStack.Count == 0 || s.WriteState == System.Xml.WriteState.Start; if(isEntryPoint) s.WriteStartElement("AssignedEntity", "urn:hl7-org:v3");
if(isEntryPoint) s.WriteAttributeString("xmlns", "xsi", null, MARC.Everest.Formatters.XML.ITS1.XmlIts1Formatter.NS_XSI);
if(instance.NullFlavor != null) this.Host.WriteNullFlavorUtil(s, instance.NullFlavor);
if(instance.ClassCode != null && !isInstanceNull) {
s.WriteAttributeString("classCode", MARC.Everest.Connectors.Util.ToWireFormat(instance.ClassCode));
}
if(instance.RealmCode != null && !isInstanceNull) {
if(!instance.RealmCode.IsEmpty)
retVal = Host.WriteElementUtil(s, "realmCode", (MARC.Everest.Interfaces.IGraphable)instance.RealmCode, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.TypeId != null && !isInstanceNull) {
retVal = Host.WriteElementUtil(s, "typeId", (MARC.Everest.Interfaces.IGraphable)instance.TypeId, typeof(MARC.Everest.DataTypes.II), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.TemplateId != null && !isInstanceNull) {
if(!instance.TemplateId.IsEmpty)
retVal = Host.WriteElementUtil(s, "templateId", (MARC.Everest.Interfaces.IGraphable)instance.TemplateId, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.Id != null && !isInstanceNull) {
if(!instance.Id.IsEmpty)
retVal = Host.WriteElementUtil(s, "id", (MARC.Everest.Interfaces.IGraphable)instance.Id, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.II>), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.Code == null && Host.CreateRequiredElements) { instance.Code = new MARC.Everest.DataTypes.CE<System.String>(); instance.Code.NullFlavor = MARC.Everest.DataTypes.NullFlavor.NoInformation; }
if(instance.Code != null && !isInstanceNull) {
if((host.Settings & MARC.Everest.Formatters.XML.ITS1.SettingsType.AllowSupplierDomainImposing) == MARC.Everest.Formatters.XML.ITS1.SettingsType.AllowSupplierDomainImposing && System.String.IsNullOrEmpty(instance.Code.CodeSystem) && instance.Code.NullFlavor == null) instance.Code.CodeSystem = "2.16.840.1.113883.5.111";
retVal = Host.WriteElementUtil(s, "code", (MARC.Everest.Interfaces.IGraphable)instance.Code, typeof(MARC.Everest.DataTypes.CE<System.String>), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.Addr != null && !isInstanceNull) {
if(!instance.Addr.IsEmpty)
retVal = Host.WriteElementUtil(s, "addr", (MARC.Everest.Interfaces.IGraphable)instance.Addr, typeof(MARC.Everest.DataTypes.BAG<MARC.Everest.DataTypes.AD>), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.AssignedPrincipalChoiceList != null && !isInstanceNull) {
if(instance.AssignedPrincipalChoiceList.GetType() == typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090103UV01.Person)) {
retVal = Host.WriteElementUtil(s, "assignedPerson", (MARC.Everest.Interfaces.IGraphable)instance.AssignedPrincipalChoiceList, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090103UV01.Person), context, resultContext);
}
else if(instance.AssignedPrincipalChoiceList.GetType() == typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090203UV01.Organization)) {
retVal = Host.WriteElementUtil(s, "assignedOrganization", (MARC.Everest.Interfaces.IGraphable)instance.AssignedPrincipalChoiceList, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090203UV01.Organization), context, resultContext);
}
else if(instance.AssignedPrincipalChoiceList.GetType() == typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090303UV01.Device)) {
retVal = Host.WriteElementUtil(s, "assignedDevice", (MARC.Everest.Interfaces.IGraphable)instance.AssignedPrincipalChoiceList, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT090303UV01.Device), context, resultContext);
}
else { resultContext.AddResultDetail(new MARC.Everest.Connectors.NotSupportedChoiceResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, System.String.Format("Type {0} is not a valid choice according to available choice elements", instance.AssignedPrincipalChoiceList.GetType()), s.ToString(), null)); }
}
if(instance.RepresentedOrganization != null && !isInstanceNull) {
retVal = Host.WriteElementUtil(s, "representedOrganization", (MARC.Everest.Interfaces.IGraphable)instance.RepresentedOrganization, typeof(MARC.Everest.RMIM.UV.NE2008.COCT_MT150002UV01.Organization), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(isEntryPoint) s.WriteEndElement();
return retVal;
}