in src/smartAuthorizationHelper.ts [29:37]
export function getFhirResource(resourceValue: string, defaultHostname: string): FhirResource {
const match = resourceValue.match(FHIR_RESOURCE_REGEX);
if (match) {
const { resourceType, id } = match.groups!;
const hostname = match.groups!.hostname ?? defaultHostname;
return { hostname, resourceType, id };
}
throw new UnauthorizedError('Resource is in the incorrect format');
}