Your apology is humbly accepted. Thank you very much.

Sai Kumar Munikuntla.



________________________________
From: Chris Selwyn <[email protected]>
To: Sai Kumar Munikuntla <[email protected]>
Cc: [email protected]
Sent: Tue, December 8, 2009 11:21:17 AM
Subject: Re: [HAPI-devel] How can I add a XCN (Pathologist) data to OBR in 
OML_O21?

My apologies... It should have read...

           OML_O21 oml = new OML_O21();
           OML_O21_ORDER order = oml.getORDER_GENERAL().getORDER();
           OML_O21_OBSERVATION_REQUEST obsreq = order.getOBSERVATION_REQUEST();
           OBR obr = obsreq.getOBR();
           XCN pathologist = 
obr.getOrderingProvider(obr.getOrderingProvider().length);
           pathologist.getIDNumber().setValue("12345");
           pathologist.getFamilyName().getSurname().setValue("Munikuntla");
           pathologist.getGivenName().setValue("Sai Kumar");

I thought that the repetition count started at 1, but it doesn't... it
starts at 0.

Chris

Sai Kumar Munikuntla wrote: 
Hi Chris,
>
>That doesn't seem to work. I got an exception. As I said earlier, it has an 
>empty array XCN[].
>
>ca.uhn.hl7v2.HL7Exception: Can't get repetition 1 from field 16 - there are 
>currently only 0 reps.
>at ca.uhn.hl7v2.model.AbstractSegment.getField(AbstractSegment.java:122)
>at ca.uhn.hl7v2.model.v24.segment.OBR.getOrderingProvider(OBR.java:426)
>at 
>com.biogen.coreinformatics.lims.ventana.MessageBuilder.buildOBR(MessageBuilder.java:142)
>at 
>com.biogen.coreinformatics.lims.ventana.MessageBuilder.createOML_O21Message(MessageBuilder.java:34)
>at 
>com.biogen.coreinformatics.lims.ventana.MessageSender.sendAndReceive(MessageSender.java:28)
>at 
>com.biogen.coreinformatics.lims.ventana.MessageSender.main(MessageSender.java:63)
>
>In AbstractSegment it is checking for Out of Range
>
>//check if out of range ... 
>        if (rep > arr.length)
>            throw new HL7Exception(
>                "Can't get repetition "
>                    + rep
>                    + " from field "
>                    + number
>                    + " - there are currently only "
>                    + arr.length
>                    + " reps.",
>                HL7Exception.APPLICATION_INTERNAL_ERROR);
>
>
>Thanks & Regards,
>Sai Kumar Munikuntla.
>
>
>
>----- Original Message ----
>From: Chris Selwyn <[email protected]>
>To: Sai Kumar Munikuntla <[email protected]>
>Cc: [email protected]
>Sent: Mon, December 7, 2009 7:53:56 PM
>Subject: Re: [HAPI-devel] How can I add a XCN (Pathologist) data to OBR in 
>OML_O21?
>
>Try this...
>
>           OML_O21 oml = new OML_O21();
>           OML_O21_ORDER order = oml.getORDER_GENERAL().getORDER();
>           OML_O21_OBSERVATION_REQUEST obsreq = order.getOBSERVATION_REQUEST();
>           OBR obr = obsreq.getOBR();
>           XCN pathologist = 
> obr.getOrderingProvider(obr.getOrderingProvider().length + 1);
>           pathologist.getIDNumber().setValue("12345");
>           pathologist.getFamilyName().getSurname().setValue("Munikuntla");
>           pathologist.getGivenName().setValue("Sai Kumar");
>
>Chris
>
>Sai Kumar Munikuntla wrote:
>  
>Hi All,
>>
>>How can I add a XCN (Pathologist) data to OBR?
>>
>>I tried the following.
>>
>>OML_O21 oml = new OML_O21();
>>OML_O21_ORDER order = oml.getORDER_GENERAL().getORDER();
>>OML_O21_OBSERVATION_REQUEST obr = order.getOBSERVATION_REQUEST();
>>
>>XCN[] pathologistArr = obrSegment.getOrderingProvider();
>>
>>if (null == pathologistArr
>>|| (null != pathologistArr && pathologistArr.length == 0)) {
>>pathologistArr = new XCN[1];
>>// if I don't do this it is throwing a IndexOutOfBoundsException as the XCN 
>>array returned earlier is a null or an empty array
>>}
>>XCN pathologist = new XCN(null);
>>pathologist.getIDNumber().setValue("12345");
>>pathologist.getFamilyName().getSurname().setValue("Munikuntla");
>>pathologist.getGivenName().setValue("Sai Kumar");
>>pathologistArr[0] = pathologist;
>>// this doesn't add the pathologist data to the OBR
>>
>>
>>Thanks & Regards,
>>Sai Kumar Munikuntla.
>>
>>
>>     
>>------------------------------------------------------------------------------
>>Join us December 9, 2009 for the Red Hat Virtual Experience,
>>a free event focused on virtualization and cloud computing. Attend in-depth 
>>sessions from your desk. Your couch. Anywhere.
>>http://p.sf.net/sfu/redhat-sfdev2dev
>>_______________________________________________
>>Hl7api-devel mailing list
>>[email protected] 
>>https://lists.sourceforge.net/lists/listinfo/hl7api-devel 
>>    
> 
>  


      
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to