• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# model.Message类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Genetibase.NuGenHL7.model.Message的典型用法代码示例。如果您正苦于以下问题:C# Genetibase.NuGenHL7.model.Message类的具体用法?C# Genetibase.NuGenHL7.model.Message怎么用?C# Genetibase.NuGenHL7.model.Message使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Genetibase.NuGenHL7.model.Message类属于命名空间,在下文中一共展示了Genetibase.NuGenHL7.model.Message类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: NuGenMessagePointer

		/// <summary> Creates new GroupPointer </summary>
		public NuGenMessagePointer(NuGenPipeParser parser, Message message, NuGenEncodingCharacters encodingChars)
		{
			this.parser = parser;
			this.message = message;
			this.encodingChars = encodingChars;
			makeChildren();
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:NuGenMessagePointer.cs


示例2: validate

		/// <param name="message">a parsed message to validate (note that MSH-9-1 and MSH-9-2 must be valued)
		/// </param>
		/// <returns> true if the message is OK
		/// </returns>
		/// <throws>  HL7Exception if there is at least one error and this validator is set to fail on errors </throws>
		public virtual bool validate(Message message)
		{
			Terser t = new Terser(message);
			NuGenMessageRule[] rules = myContext.getMessageRules(message.Version, t.get_Renamed("MSH-9-1"), t.get_Renamed("MSH-9-2"));
			
			NuGenValidationException toThrow = null;
			bool result = true;
			for (int i = 0; i < rules.Length; i++)
			{
				NuGenValidationException[] ex = rules[i].test(message);
				for (int j = 0; j < ex.Length; j++)
				{
					result = false;
					if (failOnError && toThrow == null)
					{
						toThrow = ex[j];
					}
				}
			}
			
			if (toThrow != null)
			{
				throw new NuGenHL7Exception("Invalid message", toThrow);
			}
			
			return result;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:32,代码来源:NuGenMessageValidator.cs


示例3: fillDetails

		/// <summary> Fills in the details of an Application Reject message, including response and 
		/// error codes, and a text error message.  This is the method to override if you want
		/// to respond differently.  
		/// </summary>
		public virtual void  fillDetails(Message ack)
		{
			try
			{
				//populate MSA and ERR with generic error ... 
				Segment msa = (Segment) ack.get_Renamed("MSA");
				Terser.set_Renamed(msa, 1, 0, 1, 1, "AR");
				Terser.set_Renamed(msa, 3, 0, 1, 1, "No appropriate destination could be found to which this message could be routed.");
				//this is max length
				
				//populate ERR segment if it exists (may not depending on version)
				Structure s = ack.get_Renamed("ERR");
				if (s != null)
				{
					Segment err = (Segment) s;
					Terser.set_Renamed(err, 1, 0, 4, 1, "207");
					Terser.set_Renamed(err, 1, 0, 4, 2, "Application Internal Error");
					Terser.set_Renamed(err, 1, 0, 4, 3, "HL70357");
				}
			}
			catch (System.Exception e)
			{
				throw new NuGenApplicationException("Error trying to create Application Reject message: " + e.Message);
			}
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:29,代码来源:NuGenDefaultApplication.cs


示例4: getFields

		/// <param name="theMessage">a message from which to extract fields
		/// </param>
		/// <param name="theTerserPaths">a list of paths to desired fields, in the 
		/// form required by <code>Terser</code>.  
		/// </param>
		/// <returns> a Map from Terser paths to field values 
		/// </returns>
		public static System.Collections.IDictionary getFields(Message theMessage, System.Collections.IList theTerserPaths)
		{
			System.Collections.IDictionary fields = new System.Collections.Hashtable();
			Terser terser = new Terser(theMessage);
			for (int i = 0; i < theTerserPaths.Count; i++)
			{
				System.String path = (System.String) theTerserPaths[i];
				System.String fieldValue = terser.get_Renamed(path);
				fields[path] = fieldValue;
			}
			return fields;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:19,代码来源:NuGenMetadataExtractor.cs


示例5: processMessage

		/// <summary> Forwards the given message to any Applications that have been registered to
		/// accept messages of that type and trigger event.
		/// </summary>
		/// <throws>  ApplicationException if no such Applications are registered, or if </throws>
		/// <summary>      the underlying Application throws this exception during processing.
		/// </summary>
		public virtual Message processMessage(Message in_Renamed)
		{
			Message out_Renamed;
			try
			{
				NuGenApplication matchingApp = this.getMatchingApplication(in_Renamed);
				out_Renamed = matchingApp.processMessage(in_Renamed);
			}
			catch (NuGenHL7Exception e)
			{
				throw new NuGenApplicationException("Error internally routing message: " + e.ToString(), e);
			}
			return out_Renamed;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:20,代码来源:NuGenMessageTypeRouter.cs


示例6: canProcess

		/// <summary> Returns true if at least one application has been registered to accept this
		/// type of message.  Applications are registered using <code>registerApplication(...)</code>.
		/// </summary>
		public virtual bool canProcess(Message in_Renamed)
		{
			bool can = false;
			try
			{
				NuGenApplication matches = this.getMatchingApplication(in_Renamed);
				if (matches != null)
					can = true;
			}
			catch (NuGenHL7Exception)
			{
				can = false;
			}
			return can;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:18,代码来源:NuGenMessageTypeRouter.cs


示例7: processMessage

		/// <seealso cref="Genetibase.NuGenHL7.protocol.ReceivingApplication.processMessage(Genetibase.NuGenHL7.model.Message, java.util.Map)">
		/// </seealso>
		public virtual Message processMessage(Message theMessage, System.Collections.IDictionary theMetadata)
		{
			Message result = null;
			
			try
			{
				result = myApplication.processMessage(theMessage);
			}
			catch (ApplicationException e)
			{
				throw new NuGenReceivingApplicationException(e);
			}
			
			return result;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:17,代码来源:NuGenAppWrapper.cs


示例8: processMessage

		/// <summary> Creates and returns an acknowledgement -- the details are determined by fillDetails().</summary>
		public virtual Message processMessage(Message in_Renamed)
		{
			Message out_Renamed = null;
			try
			{
				//get default ACK
				out_Renamed = makeACK((Segment) in_Renamed.get_Renamed("MSH"));
				fillDetails(out_Renamed);
			}
			catch (System.Exception e)
			{
				throw new NuGenApplicationException("Couldn't create response message: " + e.Message);
			}
			return out_Renamed;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:16,代码来源:NuGenDefaultApplication.cs


示例9: checkParse

		/// <summary> Encodes the given message and compares it to the given string.  Any differences
		/// are noted in the file [hapi.home]/parse_check.txt.  Ignores extra field delimiters.
		/// </summary>
		public static void  checkParse(System.String originalMessageText, Message parsedMessage, Parser parser)
		{
			System.String newMessageText = parser.encode(parsedMessage);
			
			
			if (!originalMessageText.Equals(newMessageText))
			{
				//check each segment
				SupportClass.Tokenizer tok = new SupportClass.Tokenizer(originalMessageText, "\r");
				System.Collections.ArrayList one = new System.Collections.ArrayList();
				while (tok.HasMoreTokens())
				{
					System.String seg = tok.NextToken();
					if (seg.Length > 4)
						one.Add(seg);
				}
				tok = new SupportClass.Tokenizer(newMessageText, "\r");
				System.Collections.ArrayList two = new System.Collections.ArrayList();
				while (tok.HasMoreTokens())
				{
					System.String seg = tok.NextToken();
					if (seg.Length > 4)
						two.Add(stripExtraDelimiters(seg, seg[3]));
				}
				
				if (one.Count != two.Count)
				{
				}
				else
				{
					//check each segment
					for (int i = 0; i < one.Count; i++)
					{
						System.String origSeg = (System.String) one[i];
						System.String newSeg = (System.String) two[i];
						if (!origSeg.Equals(newSeg))
						{
						}
					}
				}
			}
			else
			{
			}
			
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:49,代码来源:NuGenParseChecker.cs


示例10: encodeDocument

		/// <summary> <p>Creates an XML Document that corresponds to the given Message object. </p>
		/// <p>If you are implementing this method, you should create an XML Document, and insert XML Elements
		/// into it that correspond to the groups and segments that belong to the message type that your subclass
		/// of XMLParser supports.  Then, for each segment in the message, call the method
		/// <code>encode(Segment segmentObject, Element segmentElement)</code> using the Element for
		/// that segment and the corresponding Segment object from the given Message.</p>
		/// </summary>
		public override System.Xml.XmlDocument encodeDocument(Message source)
		{
			System.String messageClassName = source.GetType().FullName;
			System.String messageName = messageClassName.Substring(messageClassName.LastIndexOf('.') + 1);
			System.Xml.XmlDocument doc = null;
			try
			{
				doc = new System.Xml.XmlDocument();
				System.Xml.XmlElement root = doc.CreateElement(messageName);
				doc.AppendChild(root);
			}
			catch (System.Exception e)
			{
				throw new NuGenHL7Exception("Can't create XML document - " + e.GetType().FullName, NuGenHL7Exception.APPLICATION_INTERNAL_ERROR, e);
			}
			encode(source, (System.Xml.XmlElement) doc.DocumentElement);
			return doc;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:25,代码来源:NuGenDefaultXMLParser.cs


示例11: AD

		/// <summary> Creates a AD.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public AD(Message message):base(message)
		{
			data = new Type[8];
			data[0] = new ST(message);
			data[1] = new ST(message);
			data[2] = new ST(message);
			data[3] = new ST(message);
			data[4] = new ST(message);
			data[5] = new ID(message, 399);
			data[6] = new ID(message, 190);
			data[7] = new ST(message);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:15,代码来源:AD.cs


示例12: DR

		/// <summary> Creates a DR.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public DR(Message message):base(message)
		{
			data = new Type[2];
			data[0] = new TS(message);
			data[1] = new TS(message);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:9,代码来源:DR.cs


示例13: WVS

		/// <summary> Creates a WVS.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public WVS(Message message):base(message)
		{
			data = new Type[2];
			data[0] = new ST(message);
			data[1] = new ST(message);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:9,代码来源:WVS.cs


示例14: TM

		/// <param name="theMessage">message to which this Type belongs
		/// </param>
		public TM(Message theMessage):base(theMessage)
		{
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:5,代码来源:TM.cs


示例15: TSComponentOne

		/// <param name="theMessage">message to which this Type belongs
		/// </param>
		public TSComponentOne(Message theMessage):base(theMessage)
		{
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:5,代码来源:TSComponentOne.cs


示例16: HD

		/// <summary> Creates a HD.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public HD(Message message):base(message)
		{
			data = new Type[3];
			data[0] = new IS(message, 300);
			data[1] = new ST(message);
			data[2] = new ID(message, 301);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:10,代码来源:HD.cs


示例17: VH

		/// <summary> Creates a VH.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public VH(Message message):base(message)
		{
			data = new Type[4];
			data[0] = new ID(message, 0);
			data[1] = new ID(message, 0);
			data[2] = new TM(message);
			data[3] = new TM(message);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:11,代码来源:VH.cs


示例18: CM_OSP

		/// <summary> Creates a CM_OSP.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public CM_OSP(Message message):base(message)
		{
			data = new Type[3];
			data[0] = new ID(message, 0);
			data[1] = new DT(message);
			data[2] = new DT(message);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:10,代码来源:CM_OSP.cs


示例19: FT

		/// <summary> Constructs an uninitialized FT.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public FT(Message message):base(message)
		{
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:6,代码来源:FT.cs


示例20: XAD

		/// <summary> Creates a XAD.</summary>
		/// <param name="message">the Message to which this Type belongs
		/// </param>
		public XAD(Message message):base(message)
		{
			data = new Type[14];
			data[0] = new SAD(message);
			data[1] = new ST(message);
			data[2] = new ST(message);
			data[3] = new ST(message);
			data[4] = new ST(message);
			data[5] = new ID(message, 399);
			data[6] = new ID(message, 190);
			data[7] = new ST(message);
			data[8] = new IS(message, 289);
			data[9] = new IS(message, 288);
			data[10] = new ID(message, 465);
			data[11] = new DR(message);
			data[12] = new TS(message);
			data[13] = new TS(message);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:21,代码来源:XAD.cs



注:本文中的Genetibase.NuGenHL7.model.Message类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# parser.NuGenModelClassFactory类代码示例发布时间:2022-05-24
下一篇:
C# GenericWriter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap