Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
feat: add getCapabilities method to Search interface (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
carvantes authored Jan 12, 2021
1 parent beb6f57 commit b274566
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ export interface SearchFilter {
logicalOperator: 'AND' | 'OR';
}

export interface SearchCapabilityStatement {
[resourceType: string]: SearchCapabilities;
}

export interface SearchCapabilities {
searchParam: {
name: string;
definition?: string;
type: string;
documentation?: string;
}[];
searchInclude: string[];
searchRevInclude: string[];
}

export interface Search {
/**
* Searches a specific Resource Type based on some filter criteria
Expand All @@ -53,4 +68,9 @@ export interface Search {
* Searches all Resource Types based on some filter criteria
*/
globalSearch(request: GlobalSearchRequest): Promise<SearchResponse>;
/**
* Retrieve a subset of the CapabilityStatement with the search-related fields for all resources
* See https://www.hl7.org/fhir/capabilitystatement.html
*/
getCapabilities(): Promise<SearchCapabilityStatement>;
}
5 changes: 4 additions & 1 deletion src/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

/* eslint-disable @typescript-eslint/no-unused-vars */
import { Search } from './search';
import { Search, SearchCapabilityStatement } from './search';
import { History } from './history';
import { AccessBulkDataJobRequest, Authorization, GetSearchFilterBasedOnIdentityRequest } from './authorization';
import { Persistence } from './persistence';
Expand All @@ -23,6 +23,9 @@ export module stubs {
};

export const search: Search = {
async getCapabilities(): Promise<SearchCapabilityStatement> {
throw new Error('Method not implemented.');
},
typeSearch(request) {
throw new Error('Method not implemented.');
},
Expand Down

0 comments on commit b274566

Please sign in to comment.