Mike Yackanich · Jan 11, 2021 go to post

Thanks! Yes indeed - a question vs announcement - not sure how that got changed (?). But thanks - I think that's my issue - I have a stream vs an object as 1st parameter.

Thanks again!

Mike Yackanich · Jan 15, 2021 go to post

Thanks for the feedback Don. I ended up calling WRC and was informed that a Business Service alone does not allow control of the HTTP response status code other than either 200 or 500. A CSP layer is apparently needed in order to expose %request.Status.

Mike Yackanich · Feb 1, 2021 go to post

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.

Mike Yackanich · Feb 1, 2021 go to post

Hi Neil,

I'm attempting to introduce a Business Process to see if I can modify the HTTP response code there, but I wanted to ask what class you were using for the Business Process. Did you use EnsLib.MsgRouter.RoutingEngine?

Mike Yackanich · Apr 17, 2021 go to post

Genius! That was it - I added trailing "/" and the bundle posted and the patient resource was created.

THANKS!!!

Mike Yackanich · Apr 17, 2021 go to post

Hi Nigel,

Thanks for your thorough response. Even though adding the trailing slash to the BaseURL in fact worked, I also attempted your suggestion of changing the $.entry.request.url from "Patient" to "/Patient" - but that did not work.

I learned a lot from your response, though, and it is much appreciated!

Mike Yackanich · Apr 18, 2021 go to post

Ha! I accidentally accepted my initial response instead of Francois's. Thanks for pointing that out!

Mike Yackanich · May 14, 2021 go to post

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 ];

Mike Yackanich · May 30, 2021 go to post

Thanks Chris! I just took a look and I can use those classes for a custom export/import.

Mike Yackanich · Jul 26, 2021 go to post

Hi Muhammad,

Not sure exactly what you mean by "add this service automatically", but if you didn't want to manually add to the production, you can use Ens.Director to programmatically add a Business Service to a production.

Hope this helps.

Mike Yackanich · Jul 26, 2021 go to post

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."

Mike Yackanich · Jul 26, 2021 go to post

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.