MessageStructureToMessage Method

Summary
Parses a MessageStructure and creates a Message object with the results. Returns this object.
Syntax
C#
C++/CLI
public MessageStructureConverter MessageStructureToMessage( 
   MessageStructure msgstruct, 
   Options op 
) 
public: 
MessageStructureConverter^ MessageStructureToMessage(  
   MessageStructure^ msgstruct, 
   Options^ op 
)  

Parameters

msgstruct
The MessageStructure to parse.

op
Parsing Options for this MessageStructure.

Return Value

Returns this object.

Example

This example shows how to read a pipe message.

C#
using Leadtools; 
using LeadtoolsExamples.Common; 
using Leadtools.Medical.HL7; 
using Leadtools.Medical.HL7.V2x.Models; 
using Leadtools.Medical.HL7.V2x.Listener; 
using Leadtools.Medical.HL7.V2x.Sender; 
using Leadtools.Medical.HL7.V26.Messages; 
 
public static IHL7MessageItem ParsePipeMessage(string pipe) 
{ 
   PipeMessageConverter pmc = new PipeMessageConverter(); 
   MessageStructure ms = pmc.PipeMessageToMessageStructure(pipe); 
   MessageStructureConverter msc = new MessageStructureConverter(); 
 
   Exception exParse = null; 
   try 
   { 
      IHL7MessageItem msg = msc.MessageStructureToMessage(ms, new MessageStructureConverter.Options() { Parse_RepeatableParentGroupFirst = true, Forgive_IncompleteMessage = true }).Message; 
      return msg; 
   } 
   catch (Exception e) 
   { 
      exParse = e; 
   } 
 
   try 
   { 
      IHL7MessageItem msg = msc.MessageStructureToMessage(ms, new MessageStructureConverter.Options() { Parse_RepeatableParentGroupFirst = false, Forgive_IncompleteMessage = true }).Message; 
      return msg; 
   } 
   catch 
   { 
      throw exParse; 
   } 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Medical.HL7 Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.