export function convertScopeToSmartScope()

in src/smartScopeHelper.ts [19:32]


export function convertScopeToSmartScope(scope: string): ClinicalSmartScope {
    const matchClinicalScope = scope.match(FHIR_SCOPE_REGEX);
    if (matchClinicalScope) {
        const { scopeType, scopeResourceType, accessType } = matchClinicalScope.groups!;

        return {
            scopeType: <ScopeType>scopeType,
            resourceType: scopeResourceType,
            accessType: <AccessModifier>accessType,
        };
    }

    throw new Error('Not a SmartScope');
}