Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

## [1.0.1] - 2026-06-01

### Changed

- `client.search.semantic()` now calls the canonical path `GET /v1/search/semantic` instead of `GET /v1/concepts/semantic-search`. The legacy path remains a permanent server-side alias, so older SDK installations continue to work — no breaking change. The `User-Agent` and `__version__` are bumped to `1.0.1`.

### Fixed

- Corrected `sortBy` enum values across three options interfaces to match what the API actually accepts. TypeScript users were previously offered values that the server rejects with `validation_error`:
- `ListVocabulariesOptions.sortBy`: was `'name' | 'concept_count' | 'last_updated'`, now `'name' | 'priority' | 'updated'`.
- `VocabularyConceptsOptions.sortBy`: was `'name' | 'concept_count' | 'last_updated'`, now `'name' | 'concept_id' | 'concept_code'`.
- `BasicSearchOptions.sortBy`: was `'relevance' | 'name' | 'concept_count' | 'last_updated'`, now `'relevance' | 'name' | 'code' | 'date'`.

## [1.0.0] - 2026-05-31

### Added
Expand Down Expand Up @@ -63,7 +76,8 @@ client.fhir - resolve, resolveBatch, resolveCodeableConcept
Standalone: omophubFhirUrl, getApiKey, setApiKey, hasApiKey
```

<!-- Reference-style version links. Update when the v1.0.0 tag is cut. -->
[Unreleased]: https://github.com/OMOPHub/omophub-node/compare/v1.0.0...HEAD
<!-- Reference-style version links. -->
[Unreleased]: https://github.com/OMOPHub/omophub-node/compare/v1.0.1...HEAD
[1.0.1]: https://github.com/OMOPHub/omophub-node/releases/tag/v1.0.1
[1.0.0]: https://github.com/OMOPHub/omophub-node/releases/tag/v1.0.0

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@omophub/omophub-node",
"version": "1.0.0",
"version": "1.0.1",
"description": "Official OMOPHub Node.js / TypeScript SDK for the OHDSI medical vocabularies API - search, lookup, map, and navigate concepts across SNOMED, ICD10, RxNorm, LOINC, and more.",
"type": "module",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/normalize-search-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function normaliseBasicSearchData(raw: unknown): SearchResult {
}

/**
* Normalises `GET /concepts/semantic-search` into a flat
* Normalises `GET /search/semantic` into a flat
* `SemanticSearchResult[]` for the iter/all helpers. Handles both
* `{ results: [...] }` and bare-array forms.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/search/interfaces/basic-search-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export interface BasicSearchOptions extends PaginationOptions {
/** Minimum relevance score (0–1). */
minScore?: number;
exactMatch?: boolean;
sortBy?: 'relevance' | 'name' | 'concept_count' | 'last_updated';
sortBy?: 'relevance' | 'name' | 'code' | 'date';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This narrows a public exported union and introduces a backward-incompatible TypeScript API change. Keep old sortBy literals as aliases (at least temporarily) to avoid breaking consumers on upgrade.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/search/interfaces/basic-search-options.ts, line 14:

<comment>This narrows a public exported union and introduces a backward-incompatible TypeScript API change. Keep old `sortBy` literals as aliases (at least temporarily) to avoid breaking consumers on upgrade.</comment>

<file context>
@@ -11,6 +11,6 @@ export interface BasicSearchOptions extends PaginationOptions {
   minScore?: number;
   exactMatch?: boolean;
-  sortBy?: 'relevance' | 'name' | 'concept_count' | 'last_updated';
+  sortBy?: 'relevance' | 'name' | 'code' | 'date';
   sortOrder?: 'asc' | 'desc';
 }
</file context>
Suggested change
sortBy?: 'relevance' | 'name' | 'code' | 'date';
sortBy?:
| 'relevance'
| 'name'
| 'code'
| 'date'
| 'concept_count'
| 'last_updated';

sortOrder?: 'asc' | 'desc';
}
2 changes: 1 addition & 1 deletion src/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Search {
options: SemanticSearchOptions & GetOptions = {},
): Promise<OMOPHubResponse<SemanticSearchResultSet>> {
const { signal, headers, query: extraQuery, ...flags } = options;
const response = await this.client.get<unknown>('/concepts/semantic-search', {
const response = await this.client.get<unknown>('/search/semantic', {
signal,
headers,
query: { ...flags, ...extraQuery, query },
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* SDK version. Bumped in lockstep with package.json. Surfaced in the
* User-Agent header so server-side logs can attribute traffic to a release.
*/
export const __version__ = '0.0.1';
export const __version__ = '1.0.1';
2 changes: 1 addition & 1 deletion src/vocabularies/interfaces/list-vocabularies-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import type { PaginationOptions } from '../../common/interfaces/pagination.js';
export interface ListVocabulariesOptions extends PaginationOptions {
includeStats?: boolean;
includeInactive?: boolean;
sortBy?: 'name' | 'concept_count' | 'last_updated';
sortBy?: 'name' | 'priority' | 'updated';
sortOrder?: 'asc' | 'desc';
}
2 changes: 1 addition & 1 deletion src/vocabularies/interfaces/vocabulary-concepts-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export interface VocabularyConceptsOptions extends PaginationOptions {
includeInvalid?: boolean;
includeRelationships?: boolean;
includeSynonyms?: boolean;
sortBy?: 'name' | 'concept_count' | 'last_updated';
sortBy?: 'name' | 'concept_id' | 'concept_code';
sortOrder?: 'asc' | 'desc';
}
4 changes: 2 additions & 2 deletions test/search/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe('client.search.autocomplete', () => {
});

describe('client.search.semantic', () => {
test('hits GET /concepts/semantic-search with snake-cased query', async () => {
test('hits GET /search/semantic with snake-cased query', async () => {
const fetchMock = createMockFetch();
enqueueSuccess(fetchMock, { results: [], search_metadata: {} });
const client = new OMOPHub('oh_test', { fetch: fetchMock });
Expand All @@ -228,7 +228,7 @@ describe('client.search.semantic', () => {
pageSize: 20,
});
const { url } = lastCall(fetchMock);
expect(url).toContain('/concepts/semantic-search');
expect(url).toContain('/search/semantic');
expect(url).toContain('query=high+blood+sugar');
expect(url).toContain('vocabulary_ids=SNOMED');
expect(url).toContain('standard_concept=S');
Expand Down
Loading