You can map a subscript of Ens.LookupTable, rather than map all of Ens.LoopTable, to restrict the mapping to only the lookup table you want to map.

Simply set the 'Global Subscripts to be Mapped' setting, in the Global Mapping, to the lookup table you want to map, enclosed in brackets and double quotes, e.g.: ("TableA").
Repeat this for each table you want to map.

Hope this helps.

Neil

Hi Marcus,

Sometimes it easier not copy all the addresses across in the first place, so that the target addresses field is empty when you start the 'for each' loop, but if you have copied all the addresses across then I would clear all the target addresses out, before your 'for each' loop.

So the code would be something like:

<assign value='' property='target.{PatientAddress}' action='clear' />
<foreach property='source.{PatientAddress()}' key='k1' >
<if condition='source.{PatientAddress(k1).addresstype}="H"' >
<true>
<assign value='source.{PatientAddress(k1)}' property='target.{PatientAddress(1)}' action='set' />
<assign value='"HOME"' property='target.{PatientAddress(1).addresstype}' action='set' />
</true>
</if>
</foreach>

Hop this helps.

Regards

Neil

Hi McLean,

Thank you for your reply, very useful.

With regards to failover and the necessary OAuth2 components this was my biggest concern as I had assumed these components where store in the %SYS database, which isn't mirrored.

However, you saying that they are stored in the HealthShare database made me think and I can now see that they there is a global mapping for the HSSYS database, which can, I'm sure, be mirrored.

I have gone through a lot of documentation, but is there any particular links, that relate to this specific area that you could pass on?

Thanks again.

Neil

Hi Mike,

I have been having the same problem and could only ever return a 200 or 500 status code from my REST Business Service, so I was very disheartened to see your post that WRC said you have to CSP layer to get round this.

However, not one to give up easily, I believe I have found a solution:

I am using the EnsLib.REST.GenericServices business service class which uses the EnsLib.HTTP.InboundAdapter  adaptor class.

It appears that the EnsLib.HTTP.InboundAdapter class uses the second and remaining pieces, separated by " ", of the StatusLine header value for the returned status code.

Therefore, in my Business Process code, that returns  EnsLib.HTTP.GenericMessage back to the Business Service, I used the following lines, in the appropriate places of my code:

Set tHttpResponse = ##class(%Net.HttpResponse).%New()

Set tHttpResponse.StatusLine = "HTTP/1.1 404 Not Known"

Set response = ##class(EnsLib.HTTP.GenericMessage).%New(tResponseStream,,tHttpResponse)

Do response.HTTPHeaders.SetAt("HTTP/1.1 400 Bad Request","STATUSLINE")

Do response.HTTPHeaders.SetAt(tHttpResponse.StatusLine,"STATUSLINE")

Hope this helps.