· Jan 19, 2022

Error while updating FHIR CapabilityStatement Resource via FHIR Console Setup


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:

/// 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

Discussion (2)2
Log in or sign up to continue