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