Question
Kari Vatjus-Anttila · Jan 19

Error while updating FHIR CapabilityStatement Resource via FHIR Console Setup

Hello,

I have been tinkering with FHIR recently and tried to update the FHIR servers Capability Statement after I made some changes. I updated an OAuth2.Issuer Service Registry entrys URL and needed to update the metadata which the FHIR server sends to the client so they can get the updated URL for the authorization server we use.

However, when I run the Console Setup tool with

do ##class(HS.FHIRServer.ConsoleSetup).Setup()

I get an error while the update is happening that %ZHS.HC.OAuth2.Utils class cannot be found. I wonder why this happens. I cannot find any information about that class online so I was wondering whether this is a bug or an user error of some sort? Could you please give me some tips if I'm doing something wrong with this? I've attached a screenshot of the tool and the error it produced. Also, a code snippet from HS.FHIRServer.Utils class where the error occurs.

I was following the instructions found from here: https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI...

/// API<br>

/// GetOAuthMetadataByServiceName derives an endpoint URL from the specified Service

/// Registry entry, then gets the OAuth 2.0 authorization server metadata at that

/// issuer URL. It then returns the metadata as a %DynamicObject.

ClassMethod GetOAuthServerMetaByService(pServiceName As %String) As %DynamicObject

{
    Set dynObj = $$$NewJSONObject
    // Blank or invalid pServiceName returns blank object variable.
    Set oauthServiceEntry = ##class(HS.Registry.Service.Abstract).EndPointForNameType(pServiceName, "HTTP")

    If $IsObject(oauthServiceEntry) {
        // There is a Service Registry Entry for the OAuth issuer endpoint

        // The error happens here!
        Set dynObj = ##class(%ZHS.HC.OAuth2.Utils).GetServerMetadataByIssuer(oauthServiceEntry.EndPoint, oauthServiceEntry.SSLConfig)
    }

    Return dynObj

}
0
0 69
Discussion (2)2
Log in or sign up to continue

Hi Kari, can you please check the preview 2021.2 (docker pull containers.intersystems.com/intersystems/irishealth:2021.2.0.617.0)? This contains the %ZHS.HC.OAuth2.Utils.

Hi,

Thanks for the response. I upgraded the container to 2021.2.0.617.0, and it seems the FHIR metadata gets populated with the security related data correctly now.

Thank you very much for the input and have a good day!

Kari Vatjus-Anttila