Actually - I pointed you to Ens.Director, but that only lets you dynamically control a production (and temporarily create a business host).

But if you take a look at the OnWizardCompletion method within EnsPortal.Dialog.ProductionAddService, and AddNewItem method of EnsPortal.Dialog.ProductionAddHost I think you'll find a sample of the code that you would need.

Just to bring closure to this, I opened a WRC, and ISC has acknowledged that it is currently not possible to add an HTTP Header within HS.FHIRServer.Interop.HTTPOperation. Snippet of ISC feedback is below:

"I do not see a built in way to get the desired functionality. From what I can tell, the headers get set in the MakeRequest argument of the HS.FHIRServer.RestClient.HTTP. This field accepts a headers argument of a multidimensional array (header("abc")=123). This method is invoked by the MakeRequestAndInvoke method of HS.FHIRServer.RestClient.Base, which HS.FHIRServer.RestClient.HTTP extends. MakeRequestAndInvoke appears to be the method that we call based upon most if not all requests to finally create the HTTP Request and send it (httpClient.Batch, httpClient.History, httpClient.VRead, etc.). The problem is that the callers (httpClient.Batch, etc.) are called without a way to specify headers for MakeRequestAndInvoke. MakeRequest in HS.FHIRServer.RestClient.HTTP is where the request is finally created and headers are added. MakeRequestAndInvoke is usually a stripped down method that does some error checking and then calls MakeRequest() And Invoke().

Development has reviewed this issue and has added it to their development plan. Once it has a target version date, I will let you know so that you may know around when the change will been added to our product."

Hi Marc,

Thanks for the feedback. Would that have the same effect as the following - which I have already tested?

do ..HttpClient.%HttpRequest.SetHeader("x-api-key", ApiKeyToUse)

When I attempt this I get "ObjectScript error: PRIVATE PROPERTY" because within HS.FHIRServer.RestClient.HTTP the HttpRequest object is defined as:

Property %HttpRequest As %Net.HttpRequest [ Private ];

Hi Neil,

My code was pretty much identical to what you shared above, except for the following:

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

I added that, but it didn't change anything.

The only other difference is that I am doing all of this in the Business Operation in that I only have and Business Service and Business Operation (no Business Process). Not sure if that would make a difference, but I'm going to put in a Business Operation and apply these changes and see if that works.

Thanks again for the investigation and idea - I'll let you know if inserting a Business Process and the related code works for me.