@oystehr/sdk 4.3.11 → 4.3.12

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.
Files changed (76) hide show
  1. package/dist/cjs/index.min.cjs +1 -1
  2. package/dist/cjs/index.min.cjs.map +1 -1
  3. package/dist/cjs/resources/classes/erx.cjs +8 -0
  4. package/dist/cjs/resources/classes/erx.cjs.map +1 -1
  5. package/dist/cjs/resources/classes/erx.d.ts +7 -1
  6. package/dist/cjs/resources/classes/fhir.cjs +31 -0
  7. package/dist/cjs/resources/classes/fhir.cjs.map +1 -1
  8. package/dist/cjs/resources/classes/fhir.d.ts +31 -0
  9. package/dist/cjs/resources/classes/rcm.cjs +9 -0
  10. package/dist/cjs/resources/classes/rcm.cjs.map +1 -1
  11. package/dist/cjs/resources/classes/rcm.d.ts +8 -1
  12. package/dist/cjs/resources/classes/terminology.cjs +9 -0
  13. package/dist/cjs/resources/classes/terminology.cjs.map +1 -1
  14. package/dist/cjs/resources/classes/terminology.d.ts +8 -1
  15. package/dist/cjs/resources/classes/z3.cjs +9 -0
  16. package/dist/cjs/resources/classes/z3.cjs.map +1 -1
  17. package/dist/cjs/resources/classes/z3.d.ts +8 -1
  18. package/dist/cjs/resources/types/ErxGetMedicationHistoryResponse.d.ts +1 -1
  19. package/dist/cjs/resources/types/ErxGetPharmacyParams.d.ts +3 -0
  20. package/dist/cjs/resources/types/ErxGetPharmacyResponse.d.ts +16 -0
  21. package/dist/cjs/resources/types/ErxSearchPharmaciesResponse.d.ts +2 -2
  22. package/dist/cjs/resources/types/LabOrderSubmitParams.d.ts +4 -0
  23. package/dist/cjs/resources/types/RcmProcessEraParams.d.ts +6 -0
  24. package/dist/cjs/resources/types/RcmProcessEraResponse.d.ts +5 -0
  25. package/dist/cjs/resources/types/TerminologySearchIcd10Params.d.ts +9 -0
  26. package/dist/cjs/resources/types/TerminologySearchIcd10Response.d.ts +27 -0
  27. package/dist/cjs/resources/types/Z3EmptyBucketParams.d.ts +3 -0
  28. package/dist/cjs/resources/types/Z3EmptyBucketResponse.d.ts +9 -0
  29. package/dist/cjs/resources/types/index.d.ts +8 -0
  30. package/dist/esm/index.min.js +1 -1
  31. package/dist/esm/index.min.js.map +1 -1
  32. package/dist/esm/resources/classes/erx.d.ts +7 -1
  33. package/dist/esm/resources/classes/erx.js +8 -0
  34. package/dist/esm/resources/classes/erx.js.map +1 -1
  35. package/dist/esm/resources/classes/fhir.d.ts +31 -0
  36. package/dist/esm/resources/classes/fhir.js +31 -0
  37. package/dist/esm/resources/classes/fhir.js.map +1 -1
  38. package/dist/esm/resources/classes/rcm.d.ts +8 -1
  39. package/dist/esm/resources/classes/rcm.js +9 -0
  40. package/dist/esm/resources/classes/rcm.js.map +1 -1
  41. package/dist/esm/resources/classes/terminology.d.ts +8 -1
  42. package/dist/esm/resources/classes/terminology.js +9 -0
  43. package/dist/esm/resources/classes/terminology.js.map +1 -1
  44. package/dist/esm/resources/classes/z3.d.ts +8 -1
  45. package/dist/esm/resources/classes/z3.js +9 -0
  46. package/dist/esm/resources/classes/z3.js.map +1 -1
  47. package/dist/esm/resources/types/ErxGetMedicationHistoryResponse.d.ts +1 -1
  48. package/dist/esm/resources/types/ErxGetPharmacyParams.d.ts +3 -0
  49. package/dist/esm/resources/types/ErxGetPharmacyResponse.d.ts +16 -0
  50. package/dist/esm/resources/types/ErxSearchPharmaciesResponse.d.ts +2 -2
  51. package/dist/esm/resources/types/LabOrderSubmitParams.d.ts +4 -0
  52. package/dist/esm/resources/types/RcmProcessEraParams.d.ts +6 -0
  53. package/dist/esm/resources/types/RcmProcessEraResponse.d.ts +5 -0
  54. package/dist/esm/resources/types/TerminologySearchIcd10Params.d.ts +9 -0
  55. package/dist/esm/resources/types/TerminologySearchIcd10Response.d.ts +27 -0
  56. package/dist/esm/resources/types/Z3EmptyBucketParams.d.ts +3 -0
  57. package/dist/esm/resources/types/Z3EmptyBucketResponse.d.ts +9 -0
  58. package/dist/esm/resources/types/index.d.ts +8 -0
  59. package/package.json +1 -1
  60. package/src/resources/classes/erx.ts +10 -0
  61. package/src/resources/classes/fhir.ts +31 -0
  62. package/src/resources/classes/rcm.ts +11 -0
  63. package/src/resources/classes/terminology.ts +14 -0
  64. package/src/resources/classes/z3.ts +11 -0
  65. package/src/resources/types/ErxGetMedicationHistoryResponse.ts +1 -1
  66. package/src/resources/types/ErxGetPharmacyParams.ts +5 -0
  67. package/src/resources/types/ErxGetPharmacyResponse.ts +18 -0
  68. package/src/resources/types/ErxSearchPharmaciesResponse.ts +2 -2
  69. package/src/resources/types/LabOrderSubmitParams.ts +4 -0
  70. package/src/resources/types/RcmProcessEraParams.ts +8 -0
  71. package/src/resources/types/RcmProcessEraResponse.ts +7 -0
  72. package/src/resources/types/TerminologySearchIcd10Params.ts +11 -0
  73. package/src/resources/types/TerminologySearchIcd10Response.ts +29 -0
  74. package/src/resources/types/Z3EmptyBucketParams.ts +5 -0
  75. package/src/resources/types/Z3EmptyBucketResponse.ts +11 -0
  76. package/src/resources/types/index.ts +8 -0
@@ -32,9 +32,40 @@ export class Fhir extends SDKResource {
32
32
  update = ext.update;
33
33
  patch = ext.patch;
34
34
  delete = ext.delete;
35
+ /**
36
+ * Fetches the status of an async job. If the job is still in progress, returns an object with status 202. If the job is completed, returns the job result with status 200. If the job has failed, returns an object with status 500 and an OperationOutcome resource describing the failure. If the job has expired, returns an object with status 410.
37
+ * @param this The SDKResource context (this is an extension method and should be called with the SDKResource instance as the context, e.g. `sdkResource.getAsyncJob(jobId)`)
38
+ * @param jobId The ID of the async job to fetch
39
+ * @param request Optional OystehrClientRequest for authentication and headers
40
+ * @returns A Promise that resolves to the FhirAsyncJobStatus
41
+ */
35
42
  getAsyncJob = ext.getAsyncJob;
43
+ /**
44
+ * Waits for an async job to complete by polling its status until it reaches a terminal state (success, failure, or expiration) or the specified timeout is reached. Returns the final job status. Throws if the job fails, expires, or does not complete within the timeout.
45
+ * @param this The SDKResource context (this is an extension method and should be called with the SDKResource instance as the context, e.g. `sdkResource.waitForAsyncJob(jobId)`)
46
+ * @param jobId The ID of the async job to wait for
47
+ * @param options Optional FhirAsyncWaitOptions to configure polling behavior
48
+ * @param request Optional OystehrClientRequest for authentication and headers
49
+ * @returns A Promise that resolves to the final FhirAsyncJobStatus
50
+ */
36
51
  waitForAsyncJob = ext.waitForAsyncJob;
52
+ /**
53
+ * Waits for an async job to complete and retrieves the bulk output manifest and files. Throws if the job fails, expires, or does not complete within the specified timeout.
54
+ * @param this The SDKResource context (this is an extension method and should be called with the SDKResource instance as the context, e.g. `sdkResource.waitForAsyncBulkOutput(jobId)`)
55
+ * @param jobId The ID of the async job to wait for
56
+ * @param options Optional FhirAsyncWaitOptions to configure polling behavior
57
+ * @param request Optional OystehrClientRequest for authentication and headers
58
+ * @returns A Promise that resolves to a FhirAsyncBulkOutputResult containing the bulk output manifest and files
59
+ */
37
60
  waitForAsyncBulkOutput = ext.waitForAsyncBulkOutput;
61
+ /**
62
+ * Wrapper around waitForAsyncBulkOutput that transforms the retrieved bulk output files into a single Bundle resource containing all the output resources as entries. This is a convenience method for use cases where you want to work with the bulk output as a Bundle, but it may not be efficient for large outputs due to the overhead of downloading and parsing all files and constructing the Bundle in memory.
63
+ * Can be slow due to downloading and parsing potentially large NDJSON files, so use only if you need the full output as a Bundle resource. For more efficient processing of large bulk outputs, use waitForAsyncBulkOutput directly.
64
+ * @param jobId the ID of the async job to wait for
65
+ * @param options optional FhirAsyncWaitOptions to configure polling behavior
66
+ * @param request optional OystehrClientRequest for authentication and headers
67
+ * @returns a Promise that resolves to a Bundle containing all resources from the bulk output
68
+ */
38
69
  waitForAsyncBulkBundle = ext.waitForAsyncBulkBundle;
39
70
  cancelAsyncJob = ext.cancelAsyncJob;
40
71
  history = ext.history;
@@ -8,6 +8,8 @@ import {
8
8
  RcmGetPayerResponse,
9
9
  RcmListPayersParams,
10
10
  RcmListPayersResponse,
11
+ RcmProcessEraParams,
12
+ RcmProcessEraResponse,
11
13
  RcmSetClaimStatusParams,
12
14
  RcmSetClaimStatusResponse,
13
15
  RcmSubmitClaimParams,
@@ -100,4 +102,13 @@ export class Rcm extends SDKResource {
100
102
  getPayer(params: RcmGetPayerParams, request?: OystehrClientRequest): Promise<RcmGetPayerResponse> {
101
103
  return this.request('/payer/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);
102
104
  }
105
+ /**
106
+ * Allows to manually process EDI835.
107
+ *
108
+ * Access Policy Action: `RCM:ProcessEra`
109
+ * Access Policy Resource: `RCM:Era`
110
+ */
111
+ processEra(params: RcmProcessEraParams, request?: OystehrClientRequest): Promise<RcmProcessEraResponse> {
112
+ return this.request('/process-era', 'post', this.#baseUrlThunk.bind(this))(params, request);
113
+ }
103
114
  }
@@ -6,6 +6,8 @@ import {
6
6
  TerminologySearchCptResponse,
7
7
  TerminologySearchHcpcsParams,
8
8
  TerminologySearchHcpcsResponse,
9
+ TerminologySearchIcd10Params,
10
+ TerminologySearchIcd10Response,
9
11
  } from '../..';
10
12
  import { SDKResource } from '../../client/client';
11
13
  import { OystehrConfig } from '../../config';
@@ -38,4 +40,16 @@ export class Terminology extends SDKResource {
38
40
  ): Promise<TerminologySearchHcpcsResponse> {
39
41
  return this.request('/hcpcs/search', 'get', this.#baseUrlThunk.bind(this))(params, request);
40
42
  }
43
+ /**
44
+ * Search ICD-10-CM (International Classification of Diseases, 10th Revision, Clinical Modification) diagnosis codes by code or description. Only billable (leaf-node) codes are returned, including codes expanded with their required seventh character. Supports exact matches, prefix searches, and full-text search with BM25 ranking.
45
+ *
46
+ * Access Policy Action: `Terminology:SearchCodes`
47
+ * Access Policy Resource: `Terminology:Code:*`
48
+ */
49
+ searchIcd10(
50
+ params: TerminologySearchIcd10Params,
51
+ request?: OystehrClientRequest
52
+ ): Promise<TerminologySearchIcd10Response> {
53
+ return this.request('/icd10/search', 'get', this.#baseUrlThunk.bind(this))(params, request);
54
+ }
41
55
  }
@@ -6,6 +6,8 @@ import {
6
6
  Z3CreateBucketResponse,
7
7
  Z3DeleteBucketParams,
8
8
  Z3DeleteObjectParams,
9
+ Z3EmptyBucketParams,
10
+ Z3EmptyBucketResponse,
9
11
  Z3GetPresignedUrlParams,
10
12
  Z3GetPresignedUrlResponse,
11
13
  Z3ListBucketsResponse,
@@ -67,6 +69,15 @@ export class Z3 extends SDKResource {
67
69
  deleteBucket(params: Z3DeleteBucketParams, request?: OystehrClientRequest): Promise<void> {
68
70
  return this.request('/z3/{bucketName}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
69
71
  }
72
+ /**
73
+ * Recursively delete all Z3 Objects in the Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
74
+ *
75
+ * Access Policy Action: `Z3:EmptyBucket`
76
+ * Access Policy Resource: `Z3:BucketName`
77
+ */
78
+ emptyBucket(params: Z3EmptyBucketParams, request?: OystehrClientRequest): Promise<Z3EmptyBucketResponse> {
79
+ return this.request('/z3/{bucketName}/objects', 'delete', this.#baseUrlThunk.bind(this))(params, request);
80
+ }
70
81
  /**
71
82
  * List all Z3 Objects at the provided path in the Bucket with the provided name [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
72
83
  *
@@ -38,7 +38,7 @@ export type ErxGetMedicationHistoryResponse = {
38
38
  schedule: number | null;
39
39
  directions: string | null;
40
40
  substitutionsAllowed: boolean;
41
- writtenDate: string;
41
+ writtenDate: string | null;
42
42
  effectiveDate: string | null;
43
43
  lastFillDate: string | null;
44
44
  expirationDate: string | null;
@@ -0,0 +1,5 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ export interface ErxGetPharmacyParams {
4
+ pharmacyId: string;
5
+ }
@@ -0,0 +1,18 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ /**
4
+ * Success
5
+ */
6
+ export interface ErxGetPharmacyResponse {
7
+ id: number;
8
+ name: string;
9
+ address1: string;
10
+ address2: string | null;
11
+ city: string;
12
+ state: string;
13
+ zipCode: string;
14
+ phone: string;
15
+ fax: string | null;
16
+ specialties: string[];
17
+ ncpdpId: string;
18
+ }
@@ -8,12 +8,12 @@ export interface ErxSearchPharmaciesResponse {
8
8
  id: number;
9
9
  name: string;
10
10
  address1: string;
11
- address2?: string;
11
+ address2: string | null;
12
12
  city: string;
13
13
  state: string;
14
14
  zipCode: string;
15
15
  phone: string;
16
- fax?: string;
16
+ fax: string | null;
17
17
  specialties: string[];
18
18
  ncpdpId: string;
19
19
  }[];
@@ -14,4 +14,8 @@ export interface LabOrderSubmitParams {
14
14
  * A client-provided string used to identify all tests in an order. See [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/#client-provided-order-number/) for more details.
15
15
  */
16
16
  orderNumber?: string;
17
+ /**
18
+ * Flag to indicate which patient ID to transmit on the lab order. Defaults to false, instead using the Patient resource's UUID. If set to true but no friendly ID is found, throws a 400 error. See [Friendly Patient ID](https://docs.oystehr.com/oystehr/services/fhir/friendly-patient-id/) for more information on the friendly ID. See [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/#friendly-patient-id-in-lab-orders/) for more information on submitting using the friendly ID.
19
+ */
20
+ useFriendlyPatientId?: boolean;
17
21
  }
@@ -0,0 +1,8 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ export interface RcmProcessEraParams {
4
+ /**
5
+ * EDI835 X12 string representing ERA
6
+ */
7
+ edi835: string;
8
+ }
@@ -0,0 +1,7 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ import { Bundle } from 'fhir/r4b';
4
+ /**
5
+ * Bundle with FHIR transaction output with resources created after procesing ERA.
6
+ */
7
+ export type RcmProcessEraResponse = Bundle;
@@ -0,0 +1,11 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ export interface TerminologySearchIcd10Params {
4
+ query: string;
5
+ searchType?: 'code' | 'description' | 'all';
6
+ limit?: number;
7
+ cursor?: string;
8
+ strictMatch?: boolean;
9
+ includeSynonyms?: boolean;
10
+ specialty?: 'urgent-care'[];
11
+ }
@@ -0,0 +1,29 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ /**
4
+ * ICD-10-CM code search results
5
+ */
6
+ export interface TerminologySearchIcd10Response {
7
+ /**
8
+ * Array of ICD-10-CM codes matching the search.
9
+ */
10
+ codes: {
11
+ /**
12
+ * ICD-10-CM code.
13
+ */
14
+ code: string;
15
+ /**
16
+ * Human-readable description of the ICD-10-CM code.
17
+ */
18
+ display: string;
19
+ }[];
20
+ /**
21
+ * Pagination metadata.
22
+ */
23
+ metadata: {
24
+ /**
25
+ * Cursor for the next page of results. Null if no more results.
26
+ */
27
+ nextCursor: string | null;
28
+ };
29
+ }
@@ -0,0 +1,5 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ export interface Z3EmptyBucketParams {
4
+ bucketName: string;
5
+ }
@@ -0,0 +1,11 @@
1
+ // AUTOGENERATED -- DO NOT EDIT
2
+
3
+ /**
4
+ * Z3 Bucket was emptied successfully.
5
+ */
6
+ export interface Z3EmptyBucketResponse {
7
+ /**
8
+ * The number of Z3 Objects deleted from the bucket.
9
+ */
10
+ deletedCount: number;
11
+ }
@@ -123,6 +123,8 @@ export * from './Z3ListBucketsResponse';
123
123
  export * from './Z3CreateBucketParams';
124
124
  export * from './Z3CreateBucketResponse';
125
125
  export * from './Z3DeleteBucketParams';
126
+ export * from './Z3EmptyBucketParams';
127
+ export * from './Z3EmptyBucketResponse';
126
128
  export * from './Z3ListObjectsParams';
127
129
  export * from './Z3ListObjectsResponse';
128
130
  export * from './Z3GetPresignedUrlParams';
@@ -165,6 +167,8 @@ export * from './ErxCancelPrescriptionParams';
165
167
  export * from './ErxSyncPatientParams';
166
168
  export * from './ErxSearchPharmaciesParams';
167
169
  export * from './ErxSearchPharmaciesResponse';
170
+ export * from './ErxGetPharmacyParams';
171
+ export * from './ErxGetPharmacyResponse';
168
172
  export * from './ErxConnectPractitionerParams';
169
173
  export * from './ErxConnectPractitionerResponse';
170
174
  export * from './ErxCheckPractitionerEnrollmentParams';
@@ -175,6 +179,8 @@ export * from './TerminologySearchCptParams';
175
179
  export * from './TerminologySearchCptResponse';
176
180
  export * from './TerminologySearchHcpcsParams';
177
181
  export * from './TerminologySearchHcpcsResponse';
182
+ export * from './TerminologySearchIcd10Params';
183
+ export * from './TerminologySearchIcd10Response';
178
184
  export * from './ZambdaSchedule';
179
185
  export * from './ZambdaFunction';
180
186
  export * from './ZambdaExecuteResult';
@@ -210,3 +216,5 @@ export * from './RcmListPayersParams';
210
216
  export * from './RcmListPayersResponse';
211
217
  export * from './RcmGetPayerParams';
212
218
  export * from './RcmGetPayerResponse';
219
+ export * from './RcmProcessEraParams';
220
+ export * from './RcmProcessEraResponse';