@oystehr/sdk 4.3.4 → 4.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/cjs/index.min.cjs.map +1 -1
- package/dist/cjs/resources/classes/fhir-ext.cjs +4 -0
- package/dist/cjs/resources/classes/fhir-ext.cjs.map +1 -1
- package/dist/cjs/resources/classes/fhir-ext.d.ts +2 -1
- package/dist/cjs/resources/classes/fhir.cjs +1 -0
- package/dist/cjs/resources/classes/fhir.cjs.map +1 -1
- package/dist/cjs/resources/classes/fhir.d.ts +1 -0
- package/dist/cjs/resources/types/TelemedCreateMeetingParams.d.ts +4 -0
- package/dist/cjs/resources/types/fhir.d.ts +3 -0
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/resources/classes/fhir-ext.d.ts +2 -1
- package/dist/esm/resources/classes/fhir-ext.js +4 -1
- package/dist/esm/resources/classes/fhir-ext.js.map +1 -1
- package/dist/esm/resources/classes/fhir.d.ts +1 -0
- package/dist/esm/resources/classes/fhir.js +2 -1
- package/dist/esm/resources/classes/fhir.js.map +1 -1
- package/dist/esm/resources/types/TelemedCreateMeetingParams.d.ts +4 -0
- package/dist/esm/resources/types/fhir.d.ts +3 -0
- package/package.json +1 -1
- package/src/resources/classes/fhir-ext.ts +9 -0
- package/src/resources/classes/fhir.ts +1 -0
- package/src/resources/types/TelemedCreateMeetingParams.ts +4 -0
- package/src/resources/types/fhir.ts +4 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address as AddressR4B, HumanName as HumanNameR4B } from 'fhir/r4b';
|
|
2
2
|
import { Address as AddressR5, HumanName as HumanNameR5 } from 'fhir/r5';
|
|
3
|
-
import { BatchBundle, BatchInput, Bundle, FhirCreateParams, FhirDeleteParams, FhirGetParams, FhirHistoryGetParams, FhirHistorySearchParams, FhirPatchParams, FhirResource, FhirResourceReturnValue, FhirSearchParams, FhirUpdateParams, TransactionBundle } from '../..';
|
|
3
|
+
import { BatchBundle, BatchInput, Bundle, FhirCreateParams, FhirDeleteParams, FhirGetParams, FhirHistoryGetParams, FhirHistorySearchParams, FhirPatchParams, FhirResource, FhirResourceReturnValue, FhirSearchParams, FhirUpdateParams, GenerateFriendlyPatientIdParams, TransactionBundle } from '../..';
|
|
4
4
|
import { FhirFetcherResponse, OystehrClientRequest, SDKResource } from '../../client/client';
|
|
5
5
|
/**
|
|
6
6
|
* Optional parameter that can be passed to the client methods. It allows
|
|
@@ -35,6 +35,7 @@ export declare function history<T extends FhirResource>(this: SDKResource, { res
|
|
|
35
35
|
export declare function history<T extends FhirResource>(this: SDKResource, { resourceType, id, count, offset }: FhirHistorySearchParams<T>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<Bundle<T>>>;
|
|
36
36
|
export declare function batch<BundleContentType extends FhirResource>(this: SDKResource, input: BatchInput<BundleContentType>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<BatchBundle<BundleContentType>>>;
|
|
37
37
|
export declare function transaction<BundleContentType extends FhirResource>(this: SDKResource, input: BatchInput<BundleContentType>, request?: OystehrClientRequest): Promise<FhirFetcherResponse<TransactionBundle<BundleContentType>>>;
|
|
38
|
+
export declare function generateFriendlyPatientId(this: SDKResource, { id }: GenerateFriendlyPatientIdParams, request?: OystehrClientRequest): Promise<FhirFetcherResponse<FhirResource>>;
|
|
38
39
|
export declare function formatAddress(address: AddressR4B | AddressR5, options?: {
|
|
39
40
|
all?: boolean;
|
|
40
41
|
use?: boolean;
|
|
@@ -474,6 +474,9 @@ async function transaction(input, request) {
|
|
|
474
474
|
};
|
|
475
475
|
return bundle;
|
|
476
476
|
}
|
|
477
|
+
async function generateFriendlyPatientId({ id }, request) {
|
|
478
|
+
return this.fhirRequest(`/Patient/${id}/$generate-friendly-patient-id`, 'POST')({}, request);
|
|
479
|
+
}
|
|
477
480
|
function formatAddress(address, options) {
|
|
478
481
|
const builder = [];
|
|
479
482
|
if (address.line) {
|
|
@@ -517,5 +520,5 @@ function formatHumanName(name, options) {
|
|
|
517
520
|
return builder.join(' ').trim();
|
|
518
521
|
}
|
|
519
522
|
|
|
520
|
-
export { batch, create, del as delete, formatAddress, formatHumanName, get, history, patch, search, transaction, update };
|
|
523
|
+
export { batch, create, del as delete, formatAddress, formatHumanName, generateFriendlyPatientId, get, history, patch, search, transaction, update };
|
|
521
524
|
//# sourceMappingURL=fhir-ext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fhir-ext.js","sources":["../../../../src/resources/classes/fhir-ext.ts"],"sourcesContent":["import type { Operation } from 'fast-json-patch';\nimport { Address as AddressR4B, HumanName as HumanNameR4B } from 'fhir/r4b';\nimport { Address as AddressR5, HumanName as HumanNameR5 } from 'fhir/r5';\nimport {\n BatchBundle,\n BatchInput,\n BatchInputRequest,\n Binary,\n Bundle,\n BundleEntry,\n Coding,\n FhirBundle,\n FhirCreateParams,\n FhirDeleteParams,\n FhirGetParams,\n FhirHistoryGetParams,\n FhirHistorySearchParams,\n FhirPatchParams,\n FhirResource,\n FhirResourceReturnValue,\n FhirSearchParams,\n FhirUpdateParams,\n OperationOutcome,\n Resource,\n SearchParam,\n TransactionBundle,\n} from '../..';\nimport { addParamsToSearch, FhirFetcherResponse, OystehrClientRequest, SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\nimport { OystehrFHIRError, OystehrSdkError } from '../../errors';\n\n// Code adapted from https://github.com/sindresorhus/uint8array-extras\nconst MAX_BLOCK_SIZE = 65_535;\nfunction stringToBase64(input: string): string {\n const data: Uint8Array<ArrayBuffer> = new globalThis.TextEncoder().encode(input);\n let base64 = '';\n\n for (let index = 0; index < data.length; index += MAX_BLOCK_SIZE) {\n const chunk = data.subarray(index, index + MAX_BLOCK_SIZE);\n // Required as `btoa` and `atob` don't properly support Unicode: https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem\n base64 += globalThis.btoa(String.fromCodePoint.apply(undefined, chunk as unknown as number[]));\n }\n return base64;\n}\n\nfunction base64ToString(input: string): string {\n const binaryString = globalThis.atob(input);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return new globalThis.TextDecoder().decode(bytes);\n}\n\n// ─── Tag-mode helpers ────────────────────────────────────────────────────────\n\n/** Converts a Coding to the FHIR _tag parameter value format \"system|code\". */\nfunction codingToTagValue(coding: Coding): string {\n return coding.system ? `${coding.system}|${coding.code ?? ''}` : coding.code ?? '';\n}\n\n/** Returns true if two Codings match on system (treating absent as empty string) and code. */\nfunction codingMatches(a: Coding, b: Coding): boolean {\n return (a.system ?? '') === (b.system ?? '') && (a.code ?? '') === (b.code ?? '');\n}\n\n/**\n * Appends _tag (tag-workspace mode) or _tag:not (ignore-tags mode) search\n * params to an existing SearchParam array and returns the new array.\n */\nfunction applyTagSearchParams(config: OystehrConfig, params: SearchParam[] | undefined): SearchParam[] {\n const out: SearchParam[] = params ? [...params] : [];\n if (config.workspaceTag) {\n out.push({ name: '_tag', value: codingToTagValue(config.workspaceTag) });\n } else if (config.ignoreTags?.length) {\n for (const tag of config.ignoreTags) {\n out.push({ name: '_tag:not', value: codingToTagValue(tag) });\n }\n }\n return out;\n}\n\n/**\n * In ignore-tags mode: throws OystehrSdkError if the resource carries any ignored tag.\n * In tag-workspace mode: injects the workspace tag into resource.meta.tag if not already present.\n * Returns the (possibly cloned) resource.\n */\nfunction applyTagToResource<T extends FhirResource>(config: OystehrConfig, resource: T): T {\n const resourceLike = resource as unknown as Resource;\n\n if (config.ignoreTags?.length) {\n const resourceTags = (resourceLike.meta?.tag ?? []) as Coding[];\n for (const ignored of config.ignoreTags) {\n if (resourceTags.some((t) => codingMatches(t, ignored))) {\n throw new OystehrSdkError({\n message: `Resource has an ignored tag (system: \"${ignored.system ?? ''}\", code: \"${\n ignored.code ?? ''\n }\") and cannot be mutated in ignoreTags mode`,\n code: 400,\n });\n }\n }\n return resource;\n }\n\n if (config.workspaceTag) {\n const tag = config.workspaceTag;\n const existingTags = (resourceLike.meta?.tag ?? []) as Coding[];\n if (!existingTags.some((t) => codingMatches(t, tag))) {\n return {\n ...resource,\n meta: {\n ...resourceLike.meta,\n tag: [...existingTags, tag],\n },\n } as T;\n }\n }\n\n return resource;\n}\n\n/**\n * In ignore-tags mode: throws OystehrSdkError if any operation value resembles an ignored tag.\n * In tag-workspace mode: guards against removal or loss of the workspace tag:\n * - add/replace of the tag array: ensures workspace tag is present in the value\n * - add/replace of meta: ensures workspace tag is present in meta.tag\n * - remove of /meta/tag or /meta: keeps the remove and appends an operation to restore the workspace tag\n * - add of a single tag (path ends in /-): left unchanged (workspace tag already on the resource)\n */\nfunction applyTagToPatchOperations(config: OystehrConfig, operations: Operation[]): Operation[] {\n if (config.ignoreTags?.length) {\n for (const op of operations) {\n if (op.op === 'add' || op.op === 'replace' || op.op === 'test') {\n const opValue: unknown = op.value;\n if (opValue !== null && opValue !== undefined && typeof opValue === 'object') {\n const v = opValue as Coding;\n if (v.code !== undefined) {\n for (const ignored of config.ignoreTags) {\n if (codingMatches(v, ignored)) {\n throw new OystehrSdkError({\n message: `Patch operation contains an ignored tag (system: \"${ignored.system ?? ''}\", code: \"${\n ignored.code ?? ''\n }\") and cannot be applied in ignoreTags mode`,\n code: 400,\n });\n }\n }\n }\n }\n }\n }\n return operations;\n }\n\n if (config.workspaceTag) {\n const tag = config.workspaceTag;\n return operations.reduce<Operation[]>((result, op) => {\n // remove /meta/tag — restore workspace tag afterwards\n if (op.op === 'remove' && op.path === '/meta/tag') {\n result.push(op);\n result.push({ op: 'add' as const, path: '/meta/tag', value: [tag] });\n return result;\n }\n\n // remove /meta — restore workspace tag afterwards\n if (op.op === 'remove' && op.path === '/meta') {\n result.push(op);\n result.push({ op: 'add' as const, path: '/meta', value: { tag: [tag] } });\n return result;\n }\n\n // add/replace the entire tag array — ensure workspace tag is present\n if ((op.op === 'add' || op.op === 'replace') && op.path === '/meta/tag') {\n const tags: Coding[] = Array.isArray(op.value) ? (op.value as Coding[]) : [];\n if (!tags.some((t) => codingMatches(t, tag))) {\n result.push({ ...op, value: [...tags, tag] });\n } else {\n result.push(op);\n }\n return result;\n }\n\n // add/replace the entire meta object — ensure workspace tag is present in meta.tag\n if ((op.op === 'add' || op.op === 'replace') && op.path === '/meta') {\n const metaValue: { tag?: Coding[] } =\n op.value != null && typeof op.value === 'object' ? (op.value as { tag?: Coding[] }) : {};\n const tags = metaValue.tag ?? [];\n if (!tags.some((t) => codingMatches(t, tag))) {\n result.push({ ...op, value: { ...metaValue, tag: [...tags, tag] } });\n } else {\n result.push(op);\n }\n return result;\n }\n\n // All other operations (including add /meta/tag/- for individual tags) pass through unchanged.\n // Workspace tag is assumed already present on the resource from create/update.\n result.push(op);\n return result;\n }, []);\n }\n\n return operations;\n}\n\n/**\n * Throws OystehrFHIRError (404) if the retrieved resource violates the tag configuration:\n * - workspaceTag mode: resource must carry the workspace tag\n * - ignoreTags mode: resource must not carry any ignored tag\n */\nfunction assertRetrievedResource(config: OystehrConfig, resource: FhirResource): void {\n const resourceLike = resource as unknown as Resource;\n const resourceTags = (resourceLike.meta?.tag ?? []) as Coding[];\n\n if (config.workspaceTag) {\n const tag = config.workspaceTag;\n if (!resourceTags.some((t) => codingMatches(t, tag))) {\n throw new OystehrFHIRError({\n error: {\n resourceType: 'OperationOutcome',\n id: 'not-found',\n issue: [{ severity: 'error', code: 'not-found', details: { text: 'Not found' } }],\n },\n code: 404,\n });\n }\n return;\n }\n\n if (config.ignoreTags?.length) {\n for (const ignored of config.ignoreTags) {\n if (resourceTags.some((t) => codingMatches(t, ignored))) {\n throw new OystehrFHIRError({\n error: {\n resourceType: 'OperationOutcome',\n id: 'not-found',\n issue: [{ severity: 'error', code: 'not-found', details: { text: 'Not found' } }],\n },\n code: 404,\n });\n }\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Optional parameter that can be passed to the client methods. It allows\n * overriding the access token or project ID, and setting various headers,\n * such as 'Content-Type'. Also support enabling optimistic locking.\n */\nexport interface OystehrFHIRUpdateClientRequest extends OystehrClientRequest {\n /**\n * Enable optimistic locking for the request. If set to a version ID, the request will\n * include the 'If-Match' header with that value in the FHIR optimistic-locking format.\n * If the resource has been updated since the version provided, the request\n * will fail with a 412 Precondition Failed error.\n */\n optimisticLockingVersionId?: string;\n}\n\n/**\n * Performs a FHIR search and returns the results as a Bundle resource\n *\n * @param options FHIR resource type and FHIR search parameters\n * @param request optional OystehrClientRequest object\n * @returns FHIR Bundle resource\n */\nexport async function search<T extends FhirResource>(\n this: SDKResource,\n params: FhirSearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>> {\n const { resourceType } = params;\n const taggedParams = applyTagSearchParams(this.config, params.params);\n let paramMap: Record<string, (string | number)[]> | undefined;\n if (taggedParams.length) {\n paramMap = taggedParams.reduce((acc, param) => {\n if (!acc[param.name]) {\n acc[param.name] = [];\n }\n acc[param.name].push(param.value);\n return acc;\n }, {} as Record<string, (string | number)[]>);\n }\n const requestBundle = await this.fhirRequest<FhirBundle<T>>(`/${resourceType}/_search`, 'POST')(paramMap, {\n ...request,\n contentType: 'application/x-www-form-urlencoded',\n });\n const bundle: Bundle<T> = {\n ...requestBundle,\n entry: requestBundle.entry as Array<BundleEntry<T>> | undefined,\n unbundle: function (this: { entry?: Array<BundleEntry<T>> | undefined }) {\n return (\n this.entry?.map((entry) => entry.resource).filter((resource): resource is T => resource !== undefined) ?? []\n );\n },\n };\n return bundle;\n}\n\nexport async function create<T extends FhirResource>(\n this: SDKResource,\n params: FhirCreateParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const tagged = applyTagToResource(this.config, params);\n const { resourceType } = tagged;\n return this.fhirRequest(`/${resourceType}`, 'POST')(tagged as unknown as Record<string, unknown>, request);\n}\n\nexport async function get<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const result = await this.fhirRequest<FhirResourceReturnValue<T>>(`/${resourceType}/${id}`, 'GET')({}, request);\n assertRetrievedResource(this.config, result);\n return result;\n}\n\nexport async function update<T extends FhirResource>(\n this: SDKResource,\n params: FhirUpdateParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const tagged = applyTagToResource(this.config, params);\n const { id, resourceType } = tagged;\n return this.fhirRequest(`/${resourceType}/${id}`, 'PUT')(tagged as unknown as Record<string, unknown>, {\n ...request,\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nexport async function patch<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, operations }: FhirPatchParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const taggedOperations = applyTagToPatchOperations(this.config, operations);\n return this.fhirRequest(`/${resourceType}/${id}`, 'PATCH')(taggedOperations, {\n ...request,\n contentType: 'application/json-patch+json',\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nasync function del<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirDeleteParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n return this.fhirRequest(`/${resourceType}/${id}`, 'DELETE')({}, request);\n}\nexport { del as delete };\n\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirHistorySearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, versionId }: FhirHistoryGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, count, offset }: FhirHistorySearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n {\n resourceType,\n id,\n versionId,\n count,\n offset,\n }: { resourceType: string; id: string; versionId?: string; count?: number; offset?: number },\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>> | FhirFetcherResponse<T>> {\n if (versionId) {\n return this.fhirRequest(`/${resourceType}/${id}/_history/${versionId}`, 'GET')({}, request);\n }\n if (count) {\n return this.fhirRequest(\n `/${resourceType}/${id}/_history?_total=accurate&_count=${count}\n ${offset ? `&_offset=${offset}` : ''}`,\n 'GET'\n )({}, request);\n }\n return this.fhirRequest(`/${resourceType}/${id}/_history?_total=accurate`, 'GET')({}, request);\n}\n\n/**\n * Returns true when a batch GET/HEAD URL is a search (e.g. \"Patient\" or \"Patient?name=foo\")\n * rather than a direct retrieval (e.g. \"Patient/abc-123\").\n * A retrieval URL has a path segment after the resource type that is not a FHIR operation\n * (operations start with \"_\", e.g. \"_search\" or \"_history\").\n */\nfunction isBatchSearchUrl(url: string): boolean {\n const path = url.split('?')[0];\n const segments = path.split('/').filter(Boolean);\n // Only one segment → bare resource type, always a search\n if (segments.length <= 1) return true;\n // Two or more segments: second segment is an ID if it doesn't start with '_'\n return segments[1].startsWith('_');\n}\n\n/** Returns true when a batch POST URL targets a `_search` endpoint (e.g. \"Patient/_search\"). */\nfunction isBatchSearchPostUrl(url: string): boolean {\n return url.split('?')[0].endsWith('/_search');\n}\n\nfunction batchInputRequestToBundleEntryItem<T extends FhirResource>(\n request: BatchInputRequest<T>,\n config: OystehrConfig\n): BundleEntry<T | Binary<T>> {\n const { method } = request;\n let url = request.url;\n\n // Inject tag search params into search request URLs before URL encoding.\n // GET/HEAD: only for search URLs (not retrievals like Patient/<id>).\n // POST: only for _search endpoints (not creates).\n if (\n ((method === 'GET' || method === 'HEAD') && isBatchSearchUrl(url)) ||\n (method === 'POST' && isBatchSearchPostUrl(url))\n ) {\n if (config.workspaceTag) {\n url += (url.includes('?') ? '&' : '?') + `_tag=${codingToTagValue(config.workspaceTag)}`;\n }\n if (config.ignoreTags?.length) {\n for (const tag of config.ignoreTags) {\n url += (url.includes('?') ? '&' : '?') + `_tag:not=${codingToTagValue(tag)}`;\n }\n }\n }\n\n const baseRequest = {\n request: {\n method,\n url,\n },\n };\n\n // Escape query string parameters in entry.request.url\n if (url.split('?').length > 1) {\n const [resource, query] = url.split('?');\n const params = query\n .split('&')\n .map((param) => {\n const [name, value] = param.split('=');\n return { name, value };\n })\n .reduce((acc, { name, value }) => {\n if (!name) {\n return acc;\n }\n if (!acc[name]) {\n acc[name] = [];\n }\n acc[name].push(value);\n return acc;\n }, {} as Record<string, string[]>);\n const search = new URLSearchParams();\n addParamsToSearch(params, search);\n baseRequest.request.url = `${resource}?${search.toString()}`;\n }\n\n // GET, DELETE, and HEAD require no further parameters\n if (['GET', 'DELETE', 'HEAD'].includes(method)) {\n return baseRequest as BundleEntry<T>;\n }\n\n // PUT updates require a full resource\n if (method === 'PUT') {\n const resource = applyTagToResource(config, request.resource);\n return {\n request: {\n ...baseRequest.request,\n ifMatch: request.ifMatch,\n },\n resource: resource as T,\n } as BundleEntry<T>;\n }\n\n // PATCH can be Binary resource or JSON patch\n if (method === 'PATCH') {\n if ('resource' in request) {\n // Binary patch — decode operations, apply tag transforms, re-encode\n let patchResource = request.resource;\n const binaryData = patchResource.data;\n if (binaryData) {\n const operations = JSON.parse(base64ToString(binaryData)) as Operation[];\n const taggedOperations = applyTagToPatchOperations(config, operations);\n patchResource = { ...patchResource, data: stringToBase64(JSON.stringify(taggedOperations)) } as Binary<T>;\n }\n return {\n request: {\n ...baseRequest.request,\n ifMatch: request.ifMatch,\n },\n resource: patchResource,\n } as BundleEntry<Binary<T>>;\n }\n const operations = applyTagToPatchOperations(config, request.operations);\n const data = stringToBase64(JSON.stringify(operations));\n return {\n ...baseRequest,\n resource: {\n resourceType: 'Binary',\n contentType: 'application/json-patch+json',\n data,\n },\n } as BundleEntry<Binary<T>>;\n }\n\n // POST _search — no resource body; tag params were already injected into the URL above\n if (method === 'POST' && isBatchSearchPostUrl(url)) {\n return baseRequest as BundleEntry<T>;\n }\n\n // POST creates require a full resource\n if (method === 'POST' && 'resource' in request) {\n const resource = applyTagToResource(config, request.resource);\n const { fullUrl } = request;\n return {\n ...baseRequest,\n resource: resource as T,\n fullUrl,\n } as BundleEntry<T>;\n }\n\n // // Add ifMatch for the entries that support it\n // if ('ifMatch' in request) {\n // baseRequest.request = {\n // ...baseRequest.request,\n // ifMatch: request.ifMatch,\n // };\n // }\n\n throw new Error('Unrecognized method');\n}\n\nexport async function batch<BundleContentType extends FhirResource>(\n this: SDKResource,\n input: BatchInput<BundleContentType>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<BatchBundle<BundleContentType>>> {\n const resp = await this.fhirRequest('/', 'POST')(\n {\n resourceType: 'Bundle',\n type: 'batch',\n entry: input.requests.map((req) => batchInputRequestToBundleEntryItem(req, this.config)),\n },\n request\n );\n // Validate each GET/HEAD retrieval entry against the tag config.\n // Violations are replaced with a synthetic 404 OperationOutcome entry; batch entries are independent.\n const rawEntries = resp.entry as Array<BundleEntry<BundleContentType>> | undefined;\n const processedEntries: Array<BundleEntry<BundleContentType>> | undefined =\n this.config.workspaceTag || this.config.ignoreTags?.length\n ? rawEntries?.map((entry, i) => {\n const req = input.requests[i];\n if (!req || !entry?.resource) return entry;\n if ((req.method === 'GET' || req.method === 'HEAD') && !isBatchSearchUrl(req.url)) {\n try {\n assertRetrievedResource(this.config, entry.resource);\n } catch (err) {\n if (!(err instanceof OystehrFHIRError)) throw err;\n return {\n request: entry.request,\n response: { status: '404', outcome: err.cause },\n } as unknown as BundleEntry<BundleContentType>;\n }\n }\n return entry;\n })\n : rawEntries;\n const bundle: BatchBundle<BundleContentType> = {\n ...resp,\n entry: processedEntries,\n unbundle: function (this: { entry?: Array<BundleEntry<BundleContentType>> | undefined }) {\n return (\n this.entry\n ?.map((entry) => entry.resource)\n .filter((resource): resource is BundleContentType => resource !== undefined) ?? []\n );\n },\n errors: function (this: { entry?: Array<BundleEntry<BundleContentType>> | undefined }) {\n return this.entry\n ?.filter((entry) => entry.response?.status?.startsWith('4') || entry.response?.status?.startsWith('5'))\n .map((entry) => entry.response?.outcome)\n .filter((outcome): outcome is OperationOutcome => outcome !== undefined);\n },\n };\n return bundle;\n}\n\nexport async function transaction<BundleContentType extends FhirResource>(\n this: SDKResource,\n input: BatchInput<BundleContentType>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<TransactionBundle<BundleContentType>>> {\n const resp = await this.fhirRequest('/', 'POST')(\n {\n resourceType: 'Bundle',\n type: 'transaction',\n entry: input.requests.map((req) => batchInputRequestToBundleEntryItem(req, this.config)),\n },\n request\n );\n // Validate each GET/HEAD retrieval entry against the tag config.\n // A violation throws OystehrFHIRError(404) — transactions are all-or-nothing.\n if (this.config.workspaceTag || this.config.ignoreTags?.length) {\n (resp.entry as Array<BundleEntry<BundleContentType>> | undefined)?.forEach((entry, i) => {\n const req = input.requests[i];\n if (!req || !entry?.resource) return;\n if ((req.method === 'GET' || req.method === 'HEAD') && !isBatchSearchUrl(req.url)) {\n assertRetrievedResource(this.config, entry.resource);\n }\n });\n }\n const bundle: TransactionBundle<BundleContentType> = {\n ...resp,\n entry: resp.entry as Array<BundleEntry<BundleContentType>> | undefined,\n unbundle: function (this: { entry?: Array<BundleEntry<BundleContentType>> | undefined }) {\n return (\n this.entry\n ?.map((entry) => entry.resource)\n .filter((resource): resource is BundleContentType => resource !== undefined) ?? []\n );\n },\n };\n return bundle;\n}\n\nexport function formatAddress(\n address: AddressR4B | AddressR5,\n options?: { all?: boolean; use?: boolean; lineSeparator?: string }\n): string {\n const builder = [];\n\n if (address.line) {\n builder.push(...address.line);\n }\n\n if (address.city || address.state || address.postalCode) {\n const cityStateZip = [];\n if (address.city) {\n cityStateZip.push(address.city);\n }\n if (address.state) {\n cityStateZip.push(address.state);\n }\n if (address.postalCode) {\n cityStateZip.push(address.postalCode);\n }\n builder.push(cityStateZip.join(', '));\n }\n\n if (address.use && (options?.all || options?.use)) {\n builder.push('[' + address.use + ']');\n }\n\n return builder.join(options?.lineSeparator || ', ').trim();\n}\n\nexport function formatHumanName(\n name: HumanNameR4B | HumanNameR5,\n options?: {\n all?: boolean;\n prefix?: boolean;\n suffix?: boolean;\n use?: boolean;\n }\n): string {\n const builder = [];\n\n if (name.prefix && options?.prefix !== false) {\n builder.push(...name.prefix);\n }\n\n if (name.given) {\n builder.push(...name.given);\n }\n\n if (name.family) {\n builder.push(name.family);\n }\n\n if (name.suffix && options?.suffix !== false) {\n builder.push(...name.suffix);\n }\n\n if (name.use && (options?.all || options?.use)) {\n builder.push('[' + name.use + ']');\n }\n\n return builder.join(' ').trim();\n}\n"],"names":[],"mappings":";;;AA+BA;AACA,MAAM,cAAc,GAAG,MAAM;AAC7B,SAAS,cAAc,CAAC,KAAa,EAAA;AACnC,IAAA,MAAM,IAAI,GAA4B,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IAChF,IAAI,MAAM,GAAG,EAAE;AAEf,IAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,cAAc,EAAE;AAChE,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CAAC;;AAE1D,QAAA,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,EAAE,KAA4B,CAAC,CAAC;IAChG;AACA,IAAA,OAAO,MAAM;AACf;AAEA,SAAS,cAAc,CAAC,KAAa,EAAA;IACnC,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3C,MAAM,KAAK,GAAG,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IAAI,CAAC,GAAG,KAAK,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,GAAG,CAAC,EAAE;QAC9C,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACpC;IAEA,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;AACjC;;;;"}
|
|
1
|
+
{"version":3,"file":"fhir-ext.js","sources":["../../../../src/resources/classes/fhir-ext.ts"],"sourcesContent":["import type { Operation } from 'fast-json-patch';\nimport { Address as AddressR4B, HumanName as HumanNameR4B } from 'fhir/r4b';\nimport { Address as AddressR5, HumanName as HumanNameR5 } from 'fhir/r5';\nimport {\n BatchBundle,\n BatchInput,\n BatchInputRequest,\n Binary,\n Bundle,\n BundleEntry,\n Coding,\n FhirBundle,\n FhirCreateParams,\n FhirDeleteParams,\n FhirGetParams,\n FhirHistoryGetParams,\n FhirHistorySearchParams,\n FhirPatchParams,\n FhirResource,\n FhirResourceReturnValue,\n FhirSearchParams,\n FhirUpdateParams,\n GenerateFriendlyPatientIdParams,\n OperationOutcome,\n Resource,\n SearchParam,\n TransactionBundle,\n} from '../..';\nimport { addParamsToSearch, FhirFetcherResponse, OystehrClientRequest, SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\nimport { OystehrFHIRError, OystehrSdkError } from '../../errors';\n\n// Code adapted from https://github.com/sindresorhus/uint8array-extras\nconst MAX_BLOCK_SIZE = 65_535;\nfunction stringToBase64(input: string): string {\n const data: Uint8Array<ArrayBuffer> = new globalThis.TextEncoder().encode(input);\n let base64 = '';\n\n for (let index = 0; index < data.length; index += MAX_BLOCK_SIZE) {\n const chunk = data.subarray(index, index + MAX_BLOCK_SIZE);\n // Required as `btoa` and `atob` don't properly support Unicode: https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem\n base64 += globalThis.btoa(String.fromCodePoint.apply(undefined, chunk as unknown as number[]));\n }\n return base64;\n}\n\nfunction base64ToString(input: string): string {\n const binaryString = globalThis.atob(input);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return new globalThis.TextDecoder().decode(bytes);\n}\n\n// ─── Tag-mode helpers ────────────────────────────────────────────────────────\n\n/** Converts a Coding to the FHIR _tag parameter value format \"system|code\". */\nfunction codingToTagValue(coding: Coding): string {\n return coding.system ? `${coding.system}|${coding.code ?? ''}` : coding.code ?? '';\n}\n\n/** Returns true if two Codings match on system (treating absent as empty string) and code. */\nfunction codingMatches(a: Coding, b: Coding): boolean {\n return (a.system ?? '') === (b.system ?? '') && (a.code ?? '') === (b.code ?? '');\n}\n\n/**\n * Appends _tag (tag-workspace mode) or _tag:not (ignore-tags mode) search\n * params to an existing SearchParam array and returns the new array.\n */\nfunction applyTagSearchParams(config: OystehrConfig, params: SearchParam[] | undefined): SearchParam[] {\n const out: SearchParam[] = params ? [...params] : [];\n if (config.workspaceTag) {\n out.push({ name: '_tag', value: codingToTagValue(config.workspaceTag) });\n } else if (config.ignoreTags?.length) {\n for (const tag of config.ignoreTags) {\n out.push({ name: '_tag:not', value: codingToTagValue(tag) });\n }\n }\n return out;\n}\n\n/**\n * In ignore-tags mode: throws OystehrSdkError if the resource carries any ignored tag.\n * In tag-workspace mode: injects the workspace tag into resource.meta.tag if not already present.\n * Returns the (possibly cloned) resource.\n */\nfunction applyTagToResource<T extends FhirResource>(config: OystehrConfig, resource: T): T {\n const resourceLike = resource as unknown as Resource;\n\n if (config.ignoreTags?.length) {\n const resourceTags = (resourceLike.meta?.tag ?? []) as Coding[];\n for (const ignored of config.ignoreTags) {\n if (resourceTags.some((t) => codingMatches(t, ignored))) {\n throw new OystehrSdkError({\n message: `Resource has an ignored tag (system: \"${ignored.system ?? ''}\", code: \"${\n ignored.code ?? ''\n }\") and cannot be mutated in ignoreTags mode`,\n code: 400,\n });\n }\n }\n return resource;\n }\n\n if (config.workspaceTag) {\n const tag = config.workspaceTag;\n const existingTags = (resourceLike.meta?.tag ?? []) as Coding[];\n if (!existingTags.some((t) => codingMatches(t, tag))) {\n return {\n ...resource,\n meta: {\n ...resourceLike.meta,\n tag: [...existingTags, tag],\n },\n } as T;\n }\n }\n\n return resource;\n}\n\n/**\n * In ignore-tags mode: throws OystehrSdkError if any operation value resembles an ignored tag.\n * In tag-workspace mode: guards against removal or loss of the workspace tag:\n * - add/replace of the tag array: ensures workspace tag is present in the value\n * - add/replace of meta: ensures workspace tag is present in meta.tag\n * - remove of /meta/tag or /meta: keeps the remove and appends an operation to restore the workspace tag\n * - add of a single tag (path ends in /-): left unchanged (workspace tag already on the resource)\n */\nfunction applyTagToPatchOperations(config: OystehrConfig, operations: Operation[]): Operation[] {\n if (config.ignoreTags?.length) {\n for (const op of operations) {\n if (op.op === 'add' || op.op === 'replace' || op.op === 'test') {\n const opValue: unknown = op.value;\n if (opValue !== null && opValue !== undefined && typeof opValue === 'object') {\n const v = opValue as Coding;\n if (v.code !== undefined) {\n for (const ignored of config.ignoreTags) {\n if (codingMatches(v, ignored)) {\n throw new OystehrSdkError({\n message: `Patch operation contains an ignored tag (system: \"${ignored.system ?? ''}\", code: \"${\n ignored.code ?? ''\n }\") and cannot be applied in ignoreTags mode`,\n code: 400,\n });\n }\n }\n }\n }\n }\n }\n return operations;\n }\n\n if (config.workspaceTag) {\n const tag = config.workspaceTag;\n return operations.reduce<Operation[]>((result, op) => {\n // remove /meta/tag — restore workspace tag afterwards\n if (op.op === 'remove' && op.path === '/meta/tag') {\n result.push(op);\n result.push({ op: 'add' as const, path: '/meta/tag', value: [tag] });\n return result;\n }\n\n // remove /meta — restore workspace tag afterwards\n if (op.op === 'remove' && op.path === '/meta') {\n result.push(op);\n result.push({ op: 'add' as const, path: '/meta', value: { tag: [tag] } });\n return result;\n }\n\n // add/replace the entire tag array — ensure workspace tag is present\n if ((op.op === 'add' || op.op === 'replace') && op.path === '/meta/tag') {\n const tags: Coding[] = Array.isArray(op.value) ? (op.value as Coding[]) : [];\n if (!tags.some((t) => codingMatches(t, tag))) {\n result.push({ ...op, value: [...tags, tag] });\n } else {\n result.push(op);\n }\n return result;\n }\n\n // add/replace the entire meta object — ensure workspace tag is present in meta.tag\n if ((op.op === 'add' || op.op === 'replace') && op.path === '/meta') {\n const metaValue: { tag?: Coding[] } =\n op.value != null && typeof op.value === 'object' ? (op.value as { tag?: Coding[] }) : {};\n const tags = metaValue.tag ?? [];\n if (!tags.some((t) => codingMatches(t, tag))) {\n result.push({ ...op, value: { ...metaValue, tag: [...tags, tag] } });\n } else {\n result.push(op);\n }\n return result;\n }\n\n // All other operations (including add /meta/tag/- for individual tags) pass through unchanged.\n // Workspace tag is assumed already present on the resource from create/update.\n result.push(op);\n return result;\n }, []);\n }\n\n return operations;\n}\n\n/**\n * Throws OystehrFHIRError (404) if the retrieved resource violates the tag configuration:\n * - workspaceTag mode: resource must carry the workspace tag\n * - ignoreTags mode: resource must not carry any ignored tag\n */\nfunction assertRetrievedResource(config: OystehrConfig, resource: FhirResource): void {\n const resourceLike = resource as unknown as Resource;\n const resourceTags = (resourceLike.meta?.tag ?? []) as Coding[];\n\n if (config.workspaceTag) {\n const tag = config.workspaceTag;\n if (!resourceTags.some((t) => codingMatches(t, tag))) {\n throw new OystehrFHIRError({\n error: {\n resourceType: 'OperationOutcome',\n id: 'not-found',\n issue: [{ severity: 'error', code: 'not-found', details: { text: 'Not found' } }],\n },\n code: 404,\n });\n }\n return;\n }\n\n if (config.ignoreTags?.length) {\n for (const ignored of config.ignoreTags) {\n if (resourceTags.some((t) => codingMatches(t, ignored))) {\n throw new OystehrFHIRError({\n error: {\n resourceType: 'OperationOutcome',\n id: 'not-found',\n issue: [{ severity: 'error', code: 'not-found', details: { text: 'Not found' } }],\n },\n code: 404,\n });\n }\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Optional parameter that can be passed to the client methods. It allows\n * overriding the access token or project ID, and setting various headers,\n * such as 'Content-Type'. Also support enabling optimistic locking.\n */\nexport interface OystehrFHIRUpdateClientRequest extends OystehrClientRequest {\n /**\n * Enable optimistic locking for the request. If set to a version ID, the request will\n * include the 'If-Match' header with that value in the FHIR optimistic-locking format.\n * If the resource has been updated since the version provided, the request\n * will fail with a 412 Precondition Failed error.\n */\n optimisticLockingVersionId?: string;\n}\n\n/**\n * Performs a FHIR search and returns the results as a Bundle resource\n *\n * @param options FHIR resource type and FHIR search parameters\n * @param request optional OystehrClientRequest object\n * @returns FHIR Bundle resource\n */\nexport async function search<T extends FhirResource>(\n this: SDKResource,\n params: FhirSearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>> {\n const { resourceType } = params;\n const taggedParams = applyTagSearchParams(this.config, params.params);\n let paramMap: Record<string, (string | number)[]> | undefined;\n if (taggedParams.length) {\n paramMap = taggedParams.reduce((acc, param) => {\n if (!acc[param.name]) {\n acc[param.name] = [];\n }\n acc[param.name].push(param.value);\n return acc;\n }, {} as Record<string, (string | number)[]>);\n }\n const requestBundle = await this.fhirRequest<FhirBundle<T>>(`/${resourceType}/_search`, 'POST')(paramMap, {\n ...request,\n contentType: 'application/x-www-form-urlencoded',\n });\n const bundle: Bundle<T> = {\n ...requestBundle,\n entry: requestBundle.entry as Array<BundleEntry<T>> | undefined,\n unbundle: function (this: { entry?: Array<BundleEntry<T>> | undefined }) {\n return (\n this.entry?.map((entry) => entry.resource).filter((resource): resource is T => resource !== undefined) ?? []\n );\n },\n };\n return bundle;\n}\n\nexport async function create<T extends FhirResource>(\n this: SDKResource,\n params: FhirCreateParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const tagged = applyTagToResource(this.config, params);\n const { resourceType } = tagged;\n return this.fhirRequest(`/${resourceType}`, 'POST')(tagged as unknown as Record<string, unknown>, request);\n}\n\nexport async function get<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const result = await this.fhirRequest<FhirResourceReturnValue<T>>(`/${resourceType}/${id}`, 'GET')({}, request);\n assertRetrievedResource(this.config, result);\n return result;\n}\n\nexport async function update<T extends FhirResource>(\n this: SDKResource,\n params: FhirUpdateParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const tagged = applyTagToResource(this.config, params);\n const { id, resourceType } = tagged;\n return this.fhirRequest(`/${resourceType}/${id}`, 'PUT')(tagged as unknown as Record<string, unknown>, {\n ...request,\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nexport async function patch<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, operations }: FhirPatchParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n const taggedOperations = applyTagToPatchOperations(this.config, operations);\n return this.fhirRequest(`/${resourceType}/${id}`, 'PATCH')(taggedOperations, {\n ...request,\n contentType: 'application/json-patch+json',\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nasync function del<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirDeleteParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<FhirResourceReturnValue<T>>> {\n return this.fhirRequest(`/${resourceType}/${id}`, 'DELETE')({}, request);\n}\nexport { del as delete };\n\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirHistorySearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, versionId }: FhirHistoryGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, count, offset }: FhirHistorySearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n {\n resourceType,\n id,\n versionId,\n count,\n offset,\n }: { resourceType: string; id: string; versionId?: string; count?: number; offset?: number },\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>> | FhirFetcherResponse<T>> {\n if (versionId) {\n return this.fhirRequest(`/${resourceType}/${id}/_history/${versionId}`, 'GET')({}, request);\n }\n if (count) {\n return this.fhirRequest(\n `/${resourceType}/${id}/_history?_total=accurate&_count=${count}\n ${offset ? `&_offset=${offset}` : ''}`,\n 'GET'\n )({}, request);\n }\n return this.fhirRequest(`/${resourceType}/${id}/_history?_total=accurate`, 'GET')({}, request);\n}\n\n/**\n * Returns true when a batch GET/HEAD URL is a search (e.g. \"Patient\" or \"Patient?name=foo\")\n * rather than a direct retrieval (e.g. \"Patient/abc-123\").\n * A retrieval URL has a path segment after the resource type that is not a FHIR operation\n * (operations start with \"_\", e.g. \"_search\" or \"_history\").\n */\nfunction isBatchSearchUrl(url: string): boolean {\n const path = url.split('?')[0];\n const segments = path.split('/').filter(Boolean);\n // Only one segment → bare resource type, always a search\n if (segments.length <= 1) return true;\n // Two or more segments: second segment is an ID if it doesn't start with '_'\n return segments[1].startsWith('_');\n}\n\n/** Returns true when a batch POST URL targets a `_search` endpoint (e.g. \"Patient/_search\"). */\nfunction isBatchSearchPostUrl(url: string): boolean {\n return url.split('?')[0].endsWith('/_search');\n}\n\nfunction batchInputRequestToBundleEntryItem<T extends FhirResource>(\n request: BatchInputRequest<T>,\n config: OystehrConfig\n): BundleEntry<T | Binary<T>> {\n const { method } = request;\n let url = request.url;\n\n // Inject tag search params into search request URLs before URL encoding.\n // GET/HEAD: only for search URLs (not retrievals like Patient/<id>).\n // POST: only for _search endpoints (not creates).\n if (\n ((method === 'GET' || method === 'HEAD') && isBatchSearchUrl(url)) ||\n (method === 'POST' && isBatchSearchPostUrl(url))\n ) {\n if (config.workspaceTag) {\n url += (url.includes('?') ? '&' : '?') + `_tag=${codingToTagValue(config.workspaceTag)}`;\n }\n if (config.ignoreTags?.length) {\n for (const tag of config.ignoreTags) {\n url += (url.includes('?') ? '&' : '?') + `_tag:not=${codingToTagValue(tag)}`;\n }\n }\n }\n\n const baseRequest = {\n request: {\n method,\n url,\n },\n };\n\n // Escape query string parameters in entry.request.url\n if (url.split('?').length > 1) {\n const [resource, query] = url.split('?');\n const params = query\n .split('&')\n .map((param) => {\n const [name, value] = param.split('=');\n return { name, value };\n })\n .reduce((acc, { name, value }) => {\n if (!name) {\n return acc;\n }\n if (!acc[name]) {\n acc[name] = [];\n }\n acc[name].push(value);\n return acc;\n }, {} as Record<string, string[]>);\n const search = new URLSearchParams();\n addParamsToSearch(params, search);\n baseRequest.request.url = `${resource}?${search.toString()}`;\n }\n\n // GET, DELETE, and HEAD require no further parameters\n if (['GET', 'DELETE', 'HEAD'].includes(method)) {\n return baseRequest as BundleEntry<T>;\n }\n\n // PUT updates require a full resource\n if (method === 'PUT') {\n const resource = applyTagToResource(config, request.resource);\n return {\n request: {\n ...baseRequest.request,\n ifMatch: request.ifMatch,\n },\n resource: resource as T,\n } as BundleEntry<T>;\n }\n\n // PATCH can be Binary resource or JSON patch\n if (method === 'PATCH') {\n if ('resource' in request) {\n // Binary patch — decode operations, apply tag transforms, re-encode\n let patchResource = request.resource;\n const binaryData = patchResource.data;\n if (binaryData) {\n const operations = JSON.parse(base64ToString(binaryData)) as Operation[];\n const taggedOperations = applyTagToPatchOperations(config, operations);\n patchResource = { ...patchResource, data: stringToBase64(JSON.stringify(taggedOperations)) } as Binary<T>;\n }\n return {\n request: {\n ...baseRequest.request,\n ifMatch: request.ifMatch,\n },\n resource: patchResource,\n } as BundleEntry<Binary<T>>;\n }\n const operations = applyTagToPatchOperations(config, request.operations);\n const data = stringToBase64(JSON.stringify(operations));\n return {\n ...baseRequest,\n resource: {\n resourceType: 'Binary',\n contentType: 'application/json-patch+json',\n data,\n },\n } as BundleEntry<Binary<T>>;\n }\n\n // POST _search — no resource body; tag params were already injected into the URL above\n if (method === 'POST' && isBatchSearchPostUrl(url)) {\n return baseRequest as BundleEntry<T>;\n }\n\n // POST creates require a full resource\n if (method === 'POST' && 'resource' in request) {\n const resource = applyTagToResource(config, request.resource);\n const { fullUrl } = request;\n return {\n ...baseRequest,\n resource: resource as T,\n fullUrl,\n } as BundleEntry<T>;\n }\n\n // // Add ifMatch for the entries that support it\n // if ('ifMatch' in request) {\n // baseRequest.request = {\n // ...baseRequest.request,\n // ifMatch: request.ifMatch,\n // };\n // }\n\n throw new Error('Unrecognized method');\n}\n\nexport async function batch<BundleContentType extends FhirResource>(\n this: SDKResource,\n input: BatchInput<BundleContentType>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<BatchBundle<BundleContentType>>> {\n const resp = await this.fhirRequest('/', 'POST')(\n {\n resourceType: 'Bundle',\n type: 'batch',\n entry: input.requests.map((req) => batchInputRequestToBundleEntryItem(req, this.config)),\n },\n request\n );\n // Validate each GET/HEAD retrieval entry against the tag config.\n // Violations are replaced with a synthetic 404 OperationOutcome entry; batch entries are independent.\n const rawEntries = resp.entry as Array<BundleEntry<BundleContentType>> | undefined;\n const processedEntries: Array<BundleEntry<BundleContentType>> | undefined =\n this.config.workspaceTag || this.config.ignoreTags?.length\n ? rawEntries?.map((entry, i) => {\n const req = input.requests[i];\n if (!req || !entry?.resource) return entry;\n if ((req.method === 'GET' || req.method === 'HEAD') && !isBatchSearchUrl(req.url)) {\n try {\n assertRetrievedResource(this.config, entry.resource);\n } catch (err) {\n if (!(err instanceof OystehrFHIRError)) throw err;\n return {\n request: entry.request,\n response: { status: '404', outcome: err.cause },\n } as unknown as BundleEntry<BundleContentType>;\n }\n }\n return entry;\n })\n : rawEntries;\n const bundle: BatchBundle<BundleContentType> = {\n ...resp,\n entry: processedEntries,\n unbundle: function (this: { entry?: Array<BundleEntry<BundleContentType>> | undefined }) {\n return (\n this.entry\n ?.map((entry) => entry.resource)\n .filter((resource): resource is BundleContentType => resource !== undefined) ?? []\n );\n },\n errors: function (this: { entry?: Array<BundleEntry<BundleContentType>> | undefined }) {\n return this.entry\n ?.filter((entry) => entry.response?.status?.startsWith('4') || entry.response?.status?.startsWith('5'))\n .map((entry) => entry.response?.outcome)\n .filter((outcome): outcome is OperationOutcome => outcome !== undefined);\n },\n };\n return bundle;\n}\n\nexport async function transaction<BundleContentType extends FhirResource>(\n this: SDKResource,\n input: BatchInput<BundleContentType>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<TransactionBundle<BundleContentType>>> {\n const resp = await this.fhirRequest('/', 'POST')(\n {\n resourceType: 'Bundle',\n type: 'transaction',\n entry: input.requests.map((req) => batchInputRequestToBundleEntryItem(req, this.config)),\n },\n request\n );\n // Validate each GET/HEAD retrieval entry against the tag config.\n // A violation throws OystehrFHIRError(404) — transactions are all-or-nothing.\n if (this.config.workspaceTag || this.config.ignoreTags?.length) {\n (resp.entry as Array<BundleEntry<BundleContentType>> | undefined)?.forEach((entry, i) => {\n const req = input.requests[i];\n if (!req || !entry?.resource) return;\n if ((req.method === 'GET' || req.method === 'HEAD') && !isBatchSearchUrl(req.url)) {\n assertRetrievedResource(this.config, entry.resource);\n }\n });\n }\n const bundle: TransactionBundle<BundleContentType> = {\n ...resp,\n entry: resp.entry as Array<BundleEntry<BundleContentType>> | undefined,\n unbundle: function (this: { entry?: Array<BundleEntry<BundleContentType>> | undefined }) {\n return (\n this.entry\n ?.map((entry) => entry.resource)\n .filter((resource): resource is BundleContentType => resource !== undefined) ?? []\n );\n },\n };\n return bundle;\n}\n\nexport async function generateFriendlyPatientId(\n this: SDKResource,\n { id }: GenerateFriendlyPatientIdParams,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<FhirResource>> {\n return this.fhirRequest(`/Patient/${id}/$generate-friendly-patient-id`, 'POST')({}, request);\n}\n\nexport function formatAddress(\n address: AddressR4B | AddressR5,\n options?: { all?: boolean; use?: boolean; lineSeparator?: string }\n): string {\n const builder = [];\n\n if (address.line) {\n builder.push(...address.line);\n }\n\n if (address.city || address.state || address.postalCode) {\n const cityStateZip = [];\n if (address.city) {\n cityStateZip.push(address.city);\n }\n if (address.state) {\n cityStateZip.push(address.state);\n }\n if (address.postalCode) {\n cityStateZip.push(address.postalCode);\n }\n builder.push(cityStateZip.join(', '));\n }\n\n if (address.use && (options?.all || options?.use)) {\n builder.push('[' + address.use + ']');\n }\n\n return builder.join(options?.lineSeparator || ', ').trim();\n}\n\nexport function formatHumanName(\n name: HumanNameR4B | HumanNameR5,\n options?: {\n all?: boolean;\n prefix?: boolean;\n suffix?: boolean;\n use?: boolean;\n }\n): string {\n const builder = [];\n\n if (name.prefix && options?.prefix !== false) {\n builder.push(...name.prefix);\n }\n\n if (name.given) {\n builder.push(...name.given);\n }\n\n if (name.family) {\n builder.push(name.family);\n }\n\n if (name.suffix && options?.suffix !== false) {\n builder.push(...name.suffix);\n }\n\n if (name.use && (options?.all || options?.use)) {\n builder.push('[' + name.use + ']');\n }\n\n return builder.join(' ').trim();\n}\n"],"names":[],"mappings":";;;AAgCA;AACA,MAAM,cAAc,GAAG,MAAM;AAC7B,SAAS,cAAc,CAAC,KAAa,EAAA;AACnC,IAAA,MAAM,IAAI,GAA4B,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IAChF,IAAI,MAAM,GAAG,EAAE;AAEf,IAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,cAAc,EAAE;AAChE,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CAAC;;AAE1D,QAAA,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,EAAE,KAA4B,CAAC,CAAC;IAChG;AACA,IAAA,OAAO,MA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AAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;IAC7B;AAEA,IAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACf,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC3B;IAEA,IAAI,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,MAAM,KAAK,KAAK,EAAE;QAC5C,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9B;AAEA,IAAA,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,GAAG,CAAC,EAAE;QAC9C,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACpC;IAEA,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;AACjC;;;;"}
|
|
@@ -19,6 +19,7 @@ export declare class Fhir extends SDKResource {
|
|
|
19
19
|
history: typeof ext.history;
|
|
20
20
|
batch: typeof ext.batch;
|
|
21
21
|
transaction: typeof ext.transaction;
|
|
22
|
+
generateFriendlyPatientId: typeof ext.generateFriendlyPatientId;
|
|
22
23
|
formatAddress: typeof ext.formatAddress;
|
|
23
24
|
formatHumanName: typeof ext.formatHumanName;
|
|
24
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SDKResource } from '../../client/client.js';
|
|
2
|
-
import { search, create, get, update, patch, delete as del, history, batch, transaction, formatAddress, formatHumanName } from './fhir-ext.js';
|
|
2
|
+
import { search, create, get, update, patch, delete as del, history, batch, transaction, generateFriendlyPatientId, formatAddress, formatHumanName } from './fhir-ext.js';
|
|
3
3
|
|
|
4
4
|
// AUTOGENERATED -- DO NOT EDIT
|
|
5
5
|
class Fhir extends SDKResource {
|
|
@@ -24,6 +24,7 @@ class Fhir extends SDKResource {
|
|
|
24
24
|
history = history;
|
|
25
25
|
batch = batch;
|
|
26
26
|
transaction = transaction;
|
|
27
|
+
generateFriendlyPatientId = generateFriendlyPatientId;
|
|
27
28
|
formatAddress = formatAddress;
|
|
28
29
|
formatHumanName = formatHumanName;
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fhir.js","sources":["../../../../src/resources/classes/fhir.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\nimport * as ext from './fhir-ext';\n\nexport class Fhir extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['fhirApiUrl'] ?? 'https://fhir-api.zapehr.com';\n }\n /**\n * Performs a FHIR search and returns the results as a Bundle resource\n * @param options FHIR resource type and FHIR search parameters\n * @param request optional OystehrClientRequest object\n * @returns FHIR Bundle resource\n */\n search = ext.search;\n create = ext.create;\n get = ext.get;\n update = ext.update;\n patch = ext.patch;\n delete = ext.delete;\n history = ext.history;\n batch = ext.batch;\n transaction = ext.transaction;\n formatAddress = ext.formatAddress;\n formatHumanName = ext.formatHumanName;\n}\n"],"names":["ext.search","ext.create","ext.get","ext.update","ext.patch","ext.delete","ext.history","ext.batch","ext.transaction","ext.formatAddress","ext.formatHumanName"],"mappings":";;;AAAA;AAMM,MAAO,IAAK,SAAQ,WAAW,CAAA;AACnC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC;IACf;IACA,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,YAAY,CAAC,IAAI,6BAA6B;IAC9E;AACA;;;;;AAKG;AACH,IAAA,MAAM,GAAGA,MAAU;AACnB,IAAA,MAAM,GAAGC,MAAU;AACnB,IAAA,GAAG,GAAGC,GAAO;AACb,IAAA,MAAM,GAAGC,MAAU;AACnB,IAAA,KAAK,GAAGC,KAAS;AACjB,IAAA,MAAM,GAAGC,GAAU;AACnB,IAAA,OAAO,GAAGC,OAAW;AACrB,IAAA,KAAK,GAAGC,KAAS;AACjB,IAAA,WAAW,GAAGC,WAAe;AAC7B,IAAA,aAAa,GAAGC,aAAiB;AACjC,IAAA,eAAe,GAAGC,eAAmB;AACtC;;;;"}
|
|
1
|
+
{"version":3,"file":"fhir.js","sources":["../../../../src/resources/classes/fhir.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\nimport * as ext from './fhir-ext';\n\nexport class Fhir extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['fhirApiUrl'] ?? 'https://fhir-api.zapehr.com';\n }\n /**\n * Performs a FHIR search and returns the results as a Bundle resource\n * @param options FHIR resource type and FHIR search parameters\n * @param request optional OystehrClientRequest object\n * @returns FHIR Bundle resource\n */\n search = ext.search;\n create = ext.create;\n get = ext.get;\n update = ext.update;\n patch = ext.patch;\n delete = ext.delete;\n history = ext.history;\n batch = ext.batch;\n transaction = ext.transaction;\n generateFriendlyPatientId = ext.generateFriendlyPatientId;\n formatAddress = ext.formatAddress;\n formatHumanName = ext.formatHumanName;\n}\n"],"names":["ext.search","ext.create","ext.get","ext.update","ext.patch","ext.delete","ext.history","ext.batch","ext.transaction","ext.generateFriendlyPatientId","ext.formatAddress","ext.formatHumanName"],"mappings":";;;AAAA;AAMM,MAAO,IAAK,SAAQ,WAAW,CAAA;AACnC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC;IACf;IACA,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,YAAY,CAAC,IAAI,6BAA6B;IAC9E;AACA;;;;;AAKG;AACH,IAAA,MAAM,GAAGA,MAAU;AACnB,IAAA,MAAM,GAAGC,MAAU;AACnB,IAAA,GAAG,GAAGC,GAAO;AACb,IAAA,MAAM,GAAGC,MAAU;AACnB,IAAA,KAAK,GAAGC,KAAS;AACjB,IAAA,MAAM,GAAGC,GAAU;AACnB,IAAA,OAAO,GAAGC,OAAW;AACrB,IAAA,KAAK,GAAGC,KAAS;AACjB,IAAA,WAAW,GAAGC,WAAe;AAC7B,IAAA,yBAAyB,GAAGC,yBAA6B;AACzD,IAAA,aAAa,GAAGC,aAAiB;AACjC,IAAA,eAAe,GAAGC,eAAmB;AACtC;;;;"}
|
|
@@ -4,4 +4,8 @@ export interface TelemedCreateMeetingParams {
|
|
|
4
4
|
* Well formed Encounter with the https://extensions.fhir.oystehr.com/encounter-other-participants extension specified optionally.
|
|
5
5
|
*/
|
|
6
6
|
encounter: Encounter;
|
|
7
|
+
/**
|
|
8
|
+
* If true, audio from the meeting will be recorded and stored as an MP4 file in Z3. Defaults to false.
|
|
9
|
+
*/
|
|
10
|
+
recordAudio?: boolean;
|
|
7
11
|
}
|
|
@@ -58,6 +58,9 @@ export interface FhirDeleteParams<T extends FhirResource> {
|
|
|
58
58
|
resourceType: T['resourceType'];
|
|
59
59
|
id: string;
|
|
60
60
|
}
|
|
61
|
+
export interface GenerateFriendlyPatientIdParams {
|
|
62
|
+
id: string;
|
|
63
|
+
}
|
|
61
64
|
export interface FhirHistorySearchParams<T extends FhirResource> {
|
|
62
65
|
resourceType: T['resourceType'];
|
|
63
66
|
id: string;
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
FhirResourceReturnValue,
|
|
21
21
|
FhirSearchParams,
|
|
22
22
|
FhirUpdateParams,
|
|
23
|
+
GenerateFriendlyPatientIdParams,
|
|
23
24
|
OperationOutcome,
|
|
24
25
|
Resource,
|
|
25
26
|
SearchParam,
|
|
@@ -638,6 +639,14 @@ export async function transaction<BundleContentType extends FhirResource>(
|
|
|
638
639
|
return bundle;
|
|
639
640
|
}
|
|
640
641
|
|
|
642
|
+
export async function generateFriendlyPatientId(
|
|
643
|
+
this: SDKResource,
|
|
644
|
+
{ id }: GenerateFriendlyPatientIdParams,
|
|
645
|
+
request?: OystehrClientRequest
|
|
646
|
+
): Promise<FhirFetcherResponse<FhirResource>> {
|
|
647
|
+
return this.fhirRequest(`/Patient/${id}/$generate-friendly-patient-id`, 'POST')({}, request);
|
|
648
|
+
}
|
|
649
|
+
|
|
641
650
|
export function formatAddress(
|
|
642
651
|
address: AddressR4B | AddressR5,
|
|
643
652
|
options?: { all?: boolean; use?: boolean; lineSeparator?: string }
|
|
@@ -26,6 +26,7 @@ export class Fhir extends SDKResource {
|
|
|
26
26
|
history = ext.history;
|
|
27
27
|
batch = ext.batch;
|
|
28
28
|
transaction = ext.transaction;
|
|
29
|
+
generateFriendlyPatientId = ext.generateFriendlyPatientId;
|
|
29
30
|
formatAddress = ext.formatAddress;
|
|
30
31
|
formatHumanName = ext.formatHumanName;
|
|
31
32
|
}
|
|
@@ -7,4 +7,8 @@ export interface TelemedCreateMeetingParams {
|
|
|
7
7
|
* Well formed Encounter with the https://extensions.fhir.oystehr.com/encounter-other-participants extension specified optionally.
|
|
8
8
|
*/
|
|
9
9
|
encounter: Encounter;
|
|
10
|
+
/**
|
|
11
|
+
* If true, audio from the meeting will be recorded and stored as an MP4 file in Z3. Defaults to false.
|
|
12
|
+
*/
|
|
13
|
+
recordAudio?: boolean;
|
|
10
14
|
}
|
|
@@ -84,6 +84,10 @@ export interface FhirDeleteParams<T extends FhirResource> {
|
|
|
84
84
|
id: string;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
export interface GenerateFriendlyPatientIdParams {
|
|
88
|
+
id: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
87
91
|
export interface FhirHistorySearchParams<T extends FhirResource> {
|
|
88
92
|
resourceType: T['resourceType'];
|
|
89
93
|
id: string;
|