- Log in to post comments
Hey Gigi.
In the past I have had to create a custom HL7 HTTP Operation that heavily relies on the code used by the built in Operation. Doing so comes with some risk risk, but in my use case it was required (the response could only be read using %Parser.ParseIOStream and not %Parser.ParseFramedIOStream). My change was effectively a copy of the SendMessage Method, with a single line changed.
In your case, I think you will want to do similar, but instead I think the following will need to be your approach:
- Create a new Operation that copies EnsLib.HL7.Operation.HTTPOperation.
- Add in a new Method that follows the format of what the bot has shared for the Method "AuthorizeMe", but tweaked to reference the client setup for OAuth2
- At the start of the existing Method "SendMessage", as a line at the start that calls the "AuthorizeMe" Method. Something like:
- $$$QuitOnError(..AuthorizeMe())
- Add a new line prior to the line that makes the HTTP Request which adds in the authorisation header. Something like:
- Set tSC = tHttpRequest.SetHeader("Authorization","Bearer "_AccessToken)
This should hopefully add in the OAuth2 bearer token to the Http request as you need.
You will still need to configure your instance to be able to generate the OAuth token to be able to then make use of this.
If this is your first time working with OAuth2 in IRIS, I would start with making sure you are able to set this up and generate a token. Once configured within the management portal, you can try testing this by manually running the calls being made in the "AuthorizeMe" method and seeing if you get a valid token back (or add it to an adhoc classmethod so you can call that on each test instead of needing to manually run the required lines).
- Log in to post comments
Hi Mark.
Do you mean that you're trying to have a drop down in the "table" field when using your custom lookup function?
If so, I don't think this is possible as the logic for this seems to be buried in a system zen page that is explicitly looking out for both the "Lookup" and "Exists" function by name to give this behaviour.
- Log in to post comments
Once you have this setup working, I would say that you could add in a slight improvement and make it so that the Client is a configurable item for the Operation and not hard coded.