Skip to content

Use new webapi to store concept sets#2560

Open
khairul-syazwan wants to merge 14 commits into
developfrom
khairul-syazwan/analyze-2440
Open

Use new webapi to store concept sets#2560
khairul-syazwan wants to merge 14 commits into
developfrom
khairul-syazwan/analyze-2440

Conversation

@khairul-syazwan

Copy link
Copy Markdown
Collaborator

#2440

Merge Checklist

Please cross check this list if additions / modifications needs to be done on top of your core changes and tick them off. Reviewer can as well glance through and help the developer if something is missed out.

  • Automated Tests (Jasmine integration tests, Unit tests, and/or Performance tests)
  • Updated Manual tests / Demo Config
  • Documentation (Application guide, Admin guide, Markdown, Readme and/or Wiki)
  • Verified that local development environment is working with latest changes (integrated with latest develop branch)
  • following best practices in code review doc

Copilot AI review requested due to automatic review settings May 22, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates concept set persistence in the d2e-webapi facade to use OHDSI WebAPI concept set endpoints, while keeping legacy terminology-svc concept sets readable but effectively read-only in the UI.

Changes:

  • Added a WebAPI-backed concept set API client and updated the concept set service to merge legacy + WebAPI concept sets using an encoded ID namespace.
  • Updated UI concept set/terminology flows to respect hasWriteAccess (read-only legacy) and to display “Legacy/WebAPI” badges plus a legacy read-only banner.
  • Added unit tests for the new facade ID encoding/mapping and UI action rendering.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
plugins/ui/apps/concept-sets/tsconfig.json Limits main TS include set (vite config handled via node tsconfig reference).
plugins/ui/apps/concept-sets/src/webcomponents/registerWebComponents.ts Adjusts JSX intrinsic element typing via React module augmentation.
plugins/ui/apps/concept-sets/src/types/terminology.ts Adds source field to concept set types.
plugins/ui/apps/concept-sets/src/Terminology/utils/types.ts Extends concept set types with access flags and source.
plugins/ui/apps/concept-sets/src/Terminology/utils/d2eWebapiMappers.ts Maps access flags and source from facade responses.
plugins/ui/apps/concept-sets/src/Terminology/Terminology.tsx Enforces read-only behavior for legacy sets and surfaces legacy warning.
plugins/ui/apps/concept-sets/src/context/state/translation-state.ts Adds i18n strings for Legacy/WebAPI labels/tooltips and legacy read-only text.
plugins/ui/apps/concept-sets/src/ConceptSets/ConceptSetsTable.tsx Uses hasWriteAccess for actions; adds Legacy/WebAPI chips.
plugins/ui/apps/concept-sets/src/ConceptSets/ConceptSetsTable.test.tsx Adds tests for read-only vs writable actions and chips.
plugins/ui/apps/concept-sets/src/ConceptSets/ConceptSets.tsx Stops passing userName to table (access now based on flags).
plugins/ui/apps/concept-sets/src/ConceptSets/ConceptSetDeleteDialog.tsx Removes unused React default import.
plugins/ui/apps/concept-sets/src/axios/request.ts Tightens AbortSignal typing for request dedup wrapper.
plugins/ui/apps/concept-sets/src/axios/public-webapi-proxy.ts Marks unused pagination params with underscores.
plugins/functions/d2e-webapi/src/services/conceptset.service.ts Switches CRUD to WebAPI, merges lists, encodes WebAPI IDs, legacy becomes read-only.
plugins/functions/d2e-webapi/src/services/conceptset.service.test.ts Adds tests for encoding/mapping/read-only assertions.
plugins/functions/d2e-webapi/src/routes/conceptset.ts Returns 403 for legacy mutation attempts with a structured error.
plugins/functions/d2e-webapi/src/errors/ConceptSetErrors.ts Adds LegacyConceptSetReadOnlyError.
plugins/functions/d2e-webapi/src/dto/conceptset.ts Adds required source to concept set response DTO.
plugins/functions/d2e-webapi/src/api/WebApiConceptSetAPI.ts New fetch-based WebAPI concept set client with SERVICE_ROUTES base URL.

},
]}
isLoading={false}
userName="owner"
Comment on lines +603 to +610
setConceptSetSource(conceptSet.source || null);
setConceptSetShared(conceptSet.shared);
setIsUserConceptSet(conceptSet.createdBy === userName);
setIsUserConceptSet(!!conceptSet.hasWriteAccess);
setErrorMsg(
conceptSet.hasWriteAccess
? ""
: LEGACY_CONCEPT_SET_READ_ONLY_MESSAGE
);
Comment on lines +130 to 132
const usage = await getConceptSetUsage(token, datasetId, resolvedConceptSetId);

if (usage.inUse) {
);
const [terminologyConceptSets, webApiConceptSets] = await Promise.all([
terminologySvcApi.getConceptSets(datasetId),
webApiConceptSetApi.getConceptSets().catch(() => []),
Comment on lines +67 to +74
const getWebApiBaseUrl = () => {
try {
const parsed = JSON.parse(Deno.env.get("SERVICE_ROUTES") ?? "{}");
return parsed.webapi ?? DEFAULT_WEBAPI_URL;
} catch {
return DEFAULT_WEBAPI_URL;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants