Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:05:55+00:00 2026-05-27T16:05:55+00:00

In NHapi, how can we parse a message if we don’t know what messageType

  • 0

In NHapi, how can we parse a message if we don’t know what messageType (MSH#9) it is?

var parser = new NHapi.Base.Parser.PipeParser();

IMessage parsedMessage = parser.Parse(SampleMessage);

parsedMessage is a NHapi.Base.Model.GenericMessage.V25 at runtime and I can’t seem to read in the MSH header to read the MessageType field and then re-parse(?) the message as that message type.

I’m frustrated by the lack of documentation and examples. Perhaps I’m very far off base. I am very new to HL7, but I thought I was doing well understanding the HL7 spec until I tried using NHapi.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:05:56+00:00Added an answer on May 27, 2026 at 4:05 pm

    parsedMessage.GetStructureName() will give you the message type and trigger event. parser.Encode(parsedMessage) will give you the message back in pipe-delimited format.

    The following code shows how to get the message type and also how to get the original message in pipe format.

    public static String ParseMessage(String message)
    {
        var parser = new NHapi.Base.Parser.PipeParser();
        var parsedMessage = parser.Parse(message);
    
        //Get the message type and trigger event
        var msgType = parsedMessage.GetStructureName();
    
        //Get the message in raw, pipe-delimited format
        var pipeDelimitedMessage = parser.Encode(parsedMessage);
    
        return pipeDelimitedMessage;
    }
    

    Some good starter code can be found at the hapi examples site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a module which is transmitting but I don't know whether the
From what I gather, Google Chrome can run browser plugins written using NPAPI .
Here http://gplflash.sourceforge.net/gplflash2_blog/npapi.html Given code is switch(var) { case NPPVpluginNameString: *val = Example Plug-In; break;
Can anybody show me simple working example using Qt(export DLL plugin file) and make
I'm writing an NPAPI plugin. In C++ code, I can't create a JS object
I am considering using NHapi in some HL7 related projects. Usually when I decide
I am trying to call the internal Windows NT API function NtOpenProcess. I know
I know its possible to integrate NPAPI plugins with QtWebKit as its been supported
I have a html page that opens a new window and loads a basic
I would like to know if there is any functionality in the Gecko SDK/NPAPI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.