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 6655687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:33:02+00:00 2026-05-26T01:33:02+00:00

I am having trouble reading the ORC-2 field from ORM^O01 order message. I am

  • 0

I am having trouble reading the ORC-2 field from ORM^O01 order message. I am using HapiStructures-v23-1.2.jar to read but this method(getFillerOrdersNumber()) is returning null value

    MSH|^~\\&|recAPP|20010|BIBB|HCL|20110923192607||ORM^O01|11D900220|D|2.3|1\r
    PID|1|11D900220|11D900220||TEST^FOURTYONE||19980808|M|||\r
    ZRQ|1|11D900220||CHARTMAXX TESTING ACCOUNT 2|||||||||||||||||Y\r

    ORC|NW|11D900220||||||||||66662^NOT INDICATED^X^^^^^^^^^^U|||||||||CHARTMAXX   
    TESTING ACCOUNT 2|^695 S.BROADWAY^DENVER^CO^80209\r

    OBR|1|11D900220||66^BHL, 9P21 GENOTYPE^L|NORMAL||20110920001800|
    ||NOTAVAILABLE|N||Y|||66662^NOT INDICATED^X^^^^^^^^^^U\r

I want to parse this message and read the ORC-2 field and save it in the database

    public static string getOrderNumber(){
         Message hapiMsg = null;
         Parser p = new GenericParser();
         p.setValidationContext(null);
         try {
            hapiMsg = p.parse(hl7Message);
         } catch (Exception e) {
            Logger.error(e);
         }

             Terser terser = new Terser(hapiMsg);
         try {
            ORM_O01 getOrc = (ORM_O01)hapiMsg;
            ORC orc = new ORC(getOrc, null);
            String fn= orc.getFillerOrderNumber().toString();
         }catch(Exception e){
            logger.error(e);
         }
         return fn;
    }

I read in some posts that I have to ladder through to reach the ORC OBR and NTE segments. can someone help me how to do this with a piece of code. Thanks in advance

  • 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-26T01:33:02+00:00Added an answer on May 26, 2026 at 1:33 am

    Based on this code:

    ORM_O01 getOrc = (ORM_O01)hapiMsg;
    ORC orc = new ORC(getOrc, null);
    String fn= orc.getFillerOrderNumber().toString();
    

    It looks like you are creating a new ORC rather than pulling out the existing one from the message. I unfortunately can’t provide the exact code as I’m only familiar with HL7, not HAPI.

    EDIT: It looks like you may be able to do ORC orc = getOrc.getORDER().getORC();

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

Sidebar

Related Questions

I'm having trouble reading a chunked response when using a StreamReader to read the
I'm having trouble reading output from dr racket. By default it displays lists using
Im having trouble reading from a CSV file final String DELIMITER = ,; Scanner
I'm having some trouble reading data from a file into a vector of Orders.
I'm having trouble reading properties from JSON within NodeJS. Feels like an obvious mistake
I seem to be having trouble reading preferences from my AppWidgetProvider class. My code
I'm having trouble on reading my inbox in gmail using Oauth 2.0. I'm using
I'm having some trouble reading files with Indy from a site that has WordPress
I'm having trouble reading the JSON data from a venues search. Here is my
I am having trouble reading serial data from ARM LPC2378 microcontroller. Will I have

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.