Terser problem with subcomponents

View: New views
4 Messages — Rating Filter:   Alert me  

Terser problem with subcomponents

by Johnny2R :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm having problems getting a value I need using a Terser. Here's the PID segment of a test message:

PID|1||0123456^^^H^HOSP~4567891252^^^NH^NHS||TEST SYSTEMS^TEST PATIENT^^^||19400101|F|||Hinde House^Bethel Street^Norwich^Great Yarmouth and Gorleston, Norfolk^NR2 1NR||01603 016030|||2||||||||||||||N

I want to retrieve the value of the second subcomponent of field 3, component 5 (4567891252 in the example). The following correctly gives me 'HOSP', the first subcomponent:

terser.get("/.PID-3-5-1")

But terser.get("/.PID-3-5-2"), which should return '4567891252', returns null. Have I misunderstood something? This is with HAPI 0.5.1.

Re: Terser problem with subcomponents

by Johnny2R :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, not a terser problem, an idiocy problem on my part. I was mistaking the repetition separator for a subcomponent separator...

Re: Terser problem with subcomponents

by nksharma0624 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do you mean..I thought your syntax for Terser was correct?

-----Original Message-----
From: Johnny2R [mailto:grails@...]
Sent: Monday, August 03, 2009 12:49 PM
To: hl7api-devel@...
Subject: Re: [HAPI-devel] Terser problem with subcomponents


Sorry, not a terser problem, an idiocy problem on my part. I was
mistaking
the repetition separator for a subcomponent separator...

--
View this message in context:
http://www.nabble.com/Terser-problem-with-subcomponents-tp24795762p24796
097.html
Sent from the hl7api-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------
------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and
focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@...
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@...
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Re: Terser problem with subcomponents

by Johnny2R :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

nksharma0624 wrote:
How do you mean..I thought your syntax for Terser was correct?
The syntax would have been correct if they really had been subcomponents (and had ~, the tilde, been the subcomponent separator). But I was completely misreading the field, which is really just a repeating field with the tilde being the repetition separator. It all made a lot more sense once I realized my mistake.