Hi,

I actually figured out the problem. Since my code was trying to work on some of 
the fields (by mistake my logic had that) - I was getting into those kinds of 
return types which are already defined within the first 18 fields of DG1 
segment. Now after fixing that - it works good - thanks for your time and help!

Regards
Rana

-----Original Message-----
From: christian ohr [mailto:christian....@icw.de] 
Sent: Monday, February 06, 2012 7:01 AM
To: hl7api-devel@lists.sourceforge.net
Subject: Re: [HAPI-devel] PR1 and DG1 segment Field augmentation


Can you provide an example message and a piece of code or a unit test that 
demonstrates this?
What HAPI version are you using?

Christian


rroy wrote:
> 
> Thanks for your solution.
> 
> Yes it worked for PR1 but for DG1 we are not getting object of type 
> Varies. Say if I am  getting a object of type 
> ca.uhn.hl7v2.model.v23.datatype.NM then I am getting type cast 
> exception like " ca.uhn.hl7v2.model.v23.datatype.NM cannot be cast to 
> ca.uhn.hl7v2.model.Varies". Any help on this kind of cases?
> 
> Thanks
> Rana
> -----Original Message-----
> From: christian ohr [mailto:christian....@icw.de]
> Sent: Thursday, February 02, 2012 2:41 AM
> To: hl7api-devel@lists.sourceforge.net
> Subject: Re: [HAPI-devel] PR1 and DG1 segment Field augmentation
> 
> 
> If you don't want to access your additional fields "by name", you can 
> just parse your messages as usual. The PR1/DG1 segment classes should 
> append anonymous and untyped fields of type ca.uhn.hl7v2.model.Varies, 
> containing GenericPrimitives or GenericComposites, which in return 
> contain the values, and you can use the generic API (dg1.get(50), 
> terser.get('DG1-50'), etc.) to access them.
> 
> If you want to be more specific (access fields by name, validation 
> etc.) you have the option to define custom segments and custom 
> messages that exactly reflect your message semantics. See e.g.
> http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CustomModelCl
> asses.html
> for an example.
> 
> regards
> Christian
> 
> 
> rroy wrote:
>> 
>> Hi,
>> 
>> Is there a way that I can extend/augment the field numbers in PR1 and
>> DG1 segments based on my requirement? Say I have currently the 
>> limitation as
>> 22 is the max field for PR1 – but if required can I extend it to use 
>> 50th field for the segment. I would really appreciate your help on 
>> this regard.
>> 
>> Thanks
>> Rana
>> 
>> 
> 
> --
> View this message in context:
> http://old.nabble.com/PR1-and-DG1-segment-Field-augmentation-tp3324456
> 7p33249347.html Sent from the hl7api-devel mailing list archive at 
> Nabble.com.
> 
> 
> ----------------------------------------------------------------------
> -------- Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft 
> developers is just $99.99! Visual Studio, SharePoint, SQL - plus 
> HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you 
> subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
> ----------------------------------------------------------------------
> -------- Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft 
> developers is just $99.99! Visual Studio, SharePoint, SQL - plus 
> HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you 
> subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
> 
> 

--
View this message in context: 
http://old.nabble.com/PR1-and-DG1-segment-Field-augmentation-tp33244567p33272021.html
Sent from the hl7api-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to