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 Pravin,

Thank you for your very detailed answer.

However, on investigation, I found that I didn't need any of this, as all the client and server configurations are stored in the HSSYS database, as are the access tokens, when they are created.

The %SYS namespace then contains a global mapping for OAuth2.* from the HSSYS database.

So, by mirroring the HSSYS database and setting the 'Customization namespace' to HSSYS in the OAuth2 server configuration, allows OAuth2 to continue to work after a failover.

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 am using my own custom Business Process which creates the HTTP Response.

I am also using a Business Services, rather than a Business Operation, like you, but I'm sure the principle will be much the same.

My Business Services uses the passthrough 'EnsLib.REST.GenericServices' business service class, which passes the HTTP Request to my custom process.

The Business Process then processes the request and creates the appropriate HTTP Response which is passed back to Business Service.

Hi Dmitriy,

I have been looking at OAuth2, but am struggling to get my head around it and wasn't sure has to use it within a Production and using Business Services and Operations.

Is this possible?

What is the recommend way to secure REST Business Services and Operations?

How does FHiR secure REST Business Services and Operations?

Sorry, a lot of questions!

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.