Question
Martin Staudigel · Jan 11

Validating HS.FHIRServer.Interop.Request

Hello community,

I'm trying to validate a HS.FHIRServer.Interop.Request received from an HS.FHIRServer.Interop.Service, which looks more or less like this example

It is quite intuitive to gain access to basic properties like

$$$TRACE("Request Method: " _ pRequest.Request.RequestMethod)

But when I try to get access to the AdditionalInfoItems (especially the 'ClientAddr' element) simplicity is over.

As $$$TRACE("Request contains " _ pRequest.Request.AdditionalInfo.Count() _ " Info items.") results in printout of a correct number of elements, a for loop

for tCount=1:1:pRequest.Request.AdditionalInfo.Count() {
  set tItem = pRequest.Request.AdditionalInfo.GetAt(tCount)
  $$$TRACE("Current info item: " _ tItem)
}

just prints empty Strings. As AddtionalInfoItem only extends %Library.String (https://docs.intersystems.com/irisforhealthlatest/csp/documatic/%25CSP.D...) I am somewhat at a loss as to how to get access to both key an value of the object.

I would be very grateful for a hint.

Regards,

Martin

Product version: IRIS 2021.1
$ZV: IRIS for UNIX (SUSE Linux Enterprise Server for x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:48:27 EDT
0
0 103
Discussion (2)1
Log in or sign up to continue

Request.AdditionalInfo is defined as an array of AdditionalInfoItem, so the methods for working with that array are documented under ArrayOfObjects.

For an array, GetAt expects a key rather than a numeric index. For example GetAt("ClientAddr") should work.

Hello Marc,

thank's a lot! I had hoped and suspected that it must be a small thing.

Regards,

Martin