OCL's FHIR Service currently resolves canonical URLs and relative references using internal logic. OCL provides a standardized $resolveReference operation that handles version-aware resolution of canonical URLs (e.g. https://loinc.org) and OCL relative URLs (e.g. /orgs/Regenstrief/sources/LOINC/) to a specific repository versions.
Problem Statement
Use of $resolveReference addresses these challenges:
- Multi-tenancy conflicts: Multiple organizations may publish content using the same canonical URLs but in different OCL namespaces
- Version ambiguity: Resolving to "latest" version vs. specific versions may not be handled consistently across FHIR operations
- Maintenance burden: Custom resolution logic scattered across different endpoints/services rather than centralized
- Future-proofing: As OCL evolves, it needs a needs a single source of truth across the entire OCL stack
Proposed Solution
Refactor the FHIR service to use OCL's $resolveReference operation for resolving all repository references before performing FHIR operations.
MVP requirements:
- Replace inline resolution logic in the FHIR service with calls to
$resolveReference
- Applies to all FHIR CRUDS requests, operations ($lookup, $validate-code, $translate, etc.), and any other endpoint that resolves terminology references
- Handle version resolution
- No version specified --> use $resolveReference to resolve to latest
- Implicit namespace context
- OCL infers namespace from request context when not explicit -- this should work fine for the MVP even if there are multiple uses of a canonical URL defined in OCL, but we need to test and confirm that there are no gaps
Acceptance Criteria
Resources
Documentation: https://docs.openconceptlab.org/en/latest/oclapi/apireference/resolveReference.html
Additional work post-MVP
- Both canonical URLs and OCL relative URLs are supported by the FHIR service and resolve correctly
- Explicit namespace context: Support request-level control of namespace and pass namespace to $resolveReference for multi-tenant resolution
OCL's FHIR Service currently resolves canonical URLs and relative references using internal logic. OCL provides a standardized
$resolveReferenceoperation that handles version-aware resolution of canonical URLs (e.g.https://loinc.org) and OCL relative URLs (e.g./orgs/Regenstrief/sources/LOINC/) to a specific repository versions.Problem Statement
Use of
$resolveReferenceaddresses these challenges:Proposed Solution
Refactor the FHIR service to use OCL's
$resolveReferenceoperation for resolving all repository references before performing FHIR operations.MVP requirements:
$resolveReferenceAcceptance Criteria
Resources
Documentation: https://docs.openconceptlab.org/en/latest/oclapi/apireference/resolveReference.html
Additional work post-MVP