phenoml 7.1.0 → 9.0.0

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 (74) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +7 -3
  3. package/dist/cjs/api/resources/fhirProvider/client/Client.js +7 -3
  4. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.ts +6 -13
  5. package/dist/cjs/api/resources/fhirProvider/client/requests/index.d.ts +0 -1
  6. package/dist/cjs/api/resources/fhirProvider/types/AuthMethod.d.ts +2 -1
  7. package/dist/cjs/api/resources/fhirProvider/types/AuthMethod.js +2 -1
  8. package/dist/cjs/api/resources/fhirProvider/types/ClientSecretAuth.d.ts +10 -0
  9. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderAddAuthConfigRequest.d.ts +22 -0
  10. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderAddAuthConfigRequest.js +3 -0
  11. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderCreateRequestAuth.d.ts +22 -0
  12. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderCreateRequestAuth.js +3 -0
  13. package/dist/cjs/api/resources/fhirProvider/types/GoogleHealthcareAuth.d.ts +4 -0
  14. package/dist/cjs/api/resources/fhirProvider/types/GoogleHealthcareAuth.js +3 -0
  15. package/dist/cjs/api/resources/fhirProvider/types/JwtAuth.d.ts +10 -0
  16. package/dist/cjs/api/resources/fhirProvider/types/JwtAuth.js +3 -0
  17. package/dist/cjs/api/resources/fhirProvider/types/NoAuth.d.ts +1 -0
  18. package/dist/cjs/api/resources/fhirProvider/types/NoAuth.js +3 -0
  19. package/dist/cjs/api/resources/fhirProvider/types/OnBehalfOfAuth.d.ts +10 -0
  20. package/dist/cjs/api/resources/fhirProvider/types/OnBehalfOfAuth.js +3 -0
  21. package/dist/cjs/api/resources/fhirProvider/types/Role.d.ts +19 -4
  22. package/dist/cjs/api/resources/fhirProvider/types/Role.js +19 -4
  23. package/dist/cjs/api/resources/fhirProvider/types/TokenPassthroughAuth.d.ts +1 -0
  24. package/dist/cjs/api/resources/fhirProvider/types/TokenPassthroughAuth.js +3 -0
  25. package/dist/cjs/api/resources/fhirProvider/types/index.d.ts +8 -0
  26. package/dist/cjs/api/resources/fhirProvider/types/index.js +8 -0
  27. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateRequest.d.ts +1 -0
  28. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateRequest.js +1 -0
  29. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +2 -10
  30. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.js +0 -9
  31. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.ts +1 -0
  32. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.js +1 -0
  33. package/dist/cjs/version.d.ts +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/esm/Client.mjs +2 -2
  36. package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +7 -3
  37. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +7 -3
  38. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.mts +6 -13
  39. package/dist/esm/api/resources/fhirProvider/client/requests/index.d.mts +0 -1
  40. package/dist/esm/api/resources/fhirProvider/types/AuthMethod.d.mts +2 -1
  41. package/dist/esm/api/resources/fhirProvider/types/AuthMethod.mjs +2 -1
  42. package/dist/esm/api/resources/fhirProvider/types/ClientSecretAuth.d.mts +10 -0
  43. package/dist/esm/api/resources/fhirProvider/types/FhirProviderAddAuthConfigRequest.d.mts +22 -0
  44. package/dist/esm/api/resources/fhirProvider/types/FhirProviderAddAuthConfigRequest.mjs +2 -0
  45. package/dist/esm/api/resources/fhirProvider/types/FhirProviderCreateRequestAuth.d.mts +22 -0
  46. package/dist/esm/api/resources/fhirProvider/types/FhirProviderCreateRequestAuth.mjs +2 -0
  47. package/dist/esm/api/resources/fhirProvider/types/GoogleHealthcareAuth.d.mts +4 -0
  48. package/dist/esm/api/resources/fhirProvider/types/GoogleHealthcareAuth.mjs +2 -0
  49. package/dist/esm/api/resources/fhirProvider/types/JwtAuth.d.mts +10 -0
  50. package/dist/esm/api/resources/fhirProvider/types/JwtAuth.mjs +2 -0
  51. package/dist/esm/api/resources/fhirProvider/types/NoAuth.d.mts +1 -0
  52. package/dist/esm/api/resources/fhirProvider/types/NoAuth.mjs +2 -0
  53. package/dist/esm/api/resources/fhirProvider/types/OnBehalfOfAuth.d.mts +10 -0
  54. package/dist/esm/api/resources/fhirProvider/types/OnBehalfOfAuth.mjs +2 -0
  55. package/dist/esm/api/resources/fhirProvider/types/Role.d.mts +19 -4
  56. package/dist/esm/api/resources/fhirProvider/types/Role.mjs +19 -4
  57. package/dist/esm/api/resources/fhirProvider/types/TokenPassthroughAuth.d.mts +1 -0
  58. package/dist/esm/api/resources/fhirProvider/types/TokenPassthroughAuth.mjs +2 -0
  59. package/dist/esm/api/resources/fhirProvider/types/index.d.mts +8 -0
  60. package/dist/esm/api/resources/fhirProvider/types/index.mjs +8 -0
  61. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateRequest.d.mts +1 -0
  62. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateRequest.mjs +1 -0
  63. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +2 -10
  64. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.mjs +1 -8
  65. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.mts +1 -0
  66. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.mjs +1 -0
  67. package/dist/esm/version.d.mts +1 -1
  68. package/dist/esm/version.mjs +1 -1
  69. package/package.json +1 -1
  70. package/reference.md +8 -4
  71. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderAddAuthConfigRequest.d.ts +0 -20
  72. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderAddAuthConfigRequest.d.mts +0 -20
  73. /package/dist/cjs/api/resources/fhirProvider/{client/requests/FhirProviderAddAuthConfigRequest.js → types/ClientSecretAuth.js} +0 -0
  74. /package/dist/esm/api/resources/fhirProvider/{client/requests/FhirProviderAddAuthConfigRequest.mjs → types/ClientSecretAuth.mjs} +0 -0
@@ -52,8 +52,8 @@ class phenomlClient {
52
52
  this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
53
53
  "X-Fern-Language": "JavaScript",
54
54
  "X-Fern-SDK-Name": "phenoml",
55
- "X-Fern-SDK-Version": "7.1.0",
56
- "User-Agent": "phenoml/7.1.0",
55
+ "X-Fern-SDK-Version": "9.0.0",
56
+ "User-Agent": "phenoml/9.0.0",
57
57
  "X-Fern-Runtime": core.RUNTIME.type,
58
58
  "X-Fern-Runtime-Version": core.RUNTIME.version,
59
59
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -27,8 +27,11 @@ export declare class FhirProvider {
27
27
  * await client.fhirProvider.create({
28
28
  * name: "Epic Sandbox",
29
29
  * provider: "athenahealth",
30
- * auth_method: "client_secret",
31
- * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
30
+ * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
31
+ * auth: {
32
+ * auth_method: "jwt",
33
+ * client_id: "your-client-id"
34
+ * }
32
35
  * })
33
36
  */
34
37
  create(request: phenoml.fhirProvider.FhirProviderCreateRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
@@ -103,7 +106,8 @@ export declare class FhirProvider {
103
106
  *
104
107
  * @example
105
108
  * await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
106
- * auth_method: "client_secret"
109
+ * auth_method: "jwt",
110
+ * client_id: "your-client-id"
107
111
  * })
108
112
  */
109
113
  addAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderAddAuthConfigRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
@@ -70,8 +70,11 @@ class FhirProvider {
70
70
  * await client.fhirProvider.create({
71
71
  * name: "Epic Sandbox",
72
72
  * provider: "athenahealth",
73
- * auth_method: "client_secret",
74
- * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
73
+ * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
74
+ * auth: {
75
+ * auth_method: "jwt",
76
+ * client_id: "your-client-id"
77
+ * }
75
78
  * })
76
79
  */
77
80
  create(request, requestOptions) {
@@ -371,7 +374,8 @@ class FhirProvider {
371
374
  *
372
375
  * @example
373
376
  * await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
374
- * auth_method: "client_secret"
377
+ * auth_method: "jwt",
378
+ * client_id: "your-client-id"
375
379
  * })
376
380
  */
377
381
  addAuthConfig(fhir_provider_id, request, requestOptions) {
@@ -4,8 +4,11 @@ import type * as phenoml from "../../../../index.js";
4
4
  * {
5
5
  * name: "Epic Sandbox",
6
6
  * provider: "athenahealth",
7
- * auth_method: "client_secret",
8
- * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
7
+ * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
8
+ * auth: {
9
+ * auth_method: "jwt",
10
+ * client_id: "your-client-id"
11
+ * }
9
12
  * }
10
13
  */
11
14
  export interface FhirProviderCreateRequest {
@@ -14,17 +17,7 @@ export interface FhirProviderCreateRequest {
14
17
  /** Optional description of the FHIR provider */
15
18
  description?: string;
16
19
  provider: phenoml.fhirProvider.Provider;
17
- auth_method: phenoml.fhirProvider.AuthMethod;
18
20
  /** Base URL of the FHIR server */
19
21
  base_url: string;
20
- /** OAuth client ID (required for jwt, client_secret, and on_behalf_of auth methods) */
21
- client_id?: string;
22
- /** OAuth client secret (required for client_secret and on_behalf_of auth methods) */
23
- client_secret?: string;
24
- service_account_key?: phenoml.fhirProvider.ServiceAccountKey;
25
- /** Expiry time for JWT credentials (only applicable for JWT auth method). If omitted, a default expiry is used. */
26
- credential_expiry?: string;
27
- role?: phenoml.fhirProvider.Role;
28
- /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. Only applicable to `client_secret`, `jwt`, and `on_behalf_of` auth methods; specifying scopes for other auth methods will return an error. Make sure the scopes you specify are appropriate for the auth config and provider you are using. */
29
- scopes?: string;
22
+ auth: phenoml.fhirProvider.FhirProviderCreateRequestAuth;
30
23
  }
@@ -1,4 +1,3 @@
1
- export type { FhirProviderAddAuthConfigRequest } from "./FhirProviderAddAuthConfigRequest.js";
2
1
  export type { FhirProviderCreateRequest } from "./FhirProviderCreateRequest.js";
3
2
  export type { FhirProviderRemoveAuthConfigRequest } from "./FhirProviderRemoveAuthConfigRequest.js";
4
3
  export type { FhirProviderSetActiveAuthConfigRequest } from "./FhirProviderSetActiveAuthConfigRequest.js";
@@ -5,7 +5,8 @@
5
5
  * **Scope behavior by auth method:**
6
6
  * - `client_secret`, `jwt`, `on_behalf_of`: Scopes are included in the OAuth token request.
7
7
  * They can be configured using the `role` or `scopes` field. If neither is specified, provider-specific
8
- * default scopes derived from a default role are used.
8
+ * default scopes derived from a default role are used. Roles grant access across all FHIR resource
9
+ * types, but the exact scope format varies by EHR — see the `Role` schema for details.
9
10
  * - `google_healthcare`: Uses a fixed Google Cloud Healthcare scope. Specifying `role` or `scopes` will
10
11
  * return an error.
11
12
  * - `token_passthrough`: The caller provides their own bearer token via the X-Phenoml-Fhir-Provider header
@@ -9,7 +9,8 @@ exports.AuthMethod = void 0;
9
9
  * **Scope behavior by auth method:**
10
10
  * - `client_secret`, `jwt`, `on_behalf_of`: Scopes are included in the OAuth token request.
11
11
  * They can be configured using the `role` or `scopes` field. If neither is specified, provider-specific
12
- * default scopes derived from a default role are used.
12
+ * default scopes derived from a default role are used. Roles grant access across all FHIR resource
13
+ * types, but the exact scope format varies by EHR — see the `Role` schema for details.
13
14
  * - `google_healthcare`: Uses a fixed Google Cloud Healthcare scope. Specifying `role` or `scopes` will
14
15
  * return an error.
15
16
  * - `token_passthrough`: The caller provides their own bearer token via the X-Phenoml-Fhir-Provider header
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.js";
2
+ export interface ClientSecretAuth {
3
+ /** OAuth client ID */
4
+ client_id: string;
5
+ /** OAuth client secret */
6
+ client_secret: string;
7
+ role?: phenoml.fhirProvider.Role;
8
+ /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. */
9
+ scopes?: string;
10
+ }
@@ -0,0 +1,22 @@
1
+ import type * as phenoml from "../../../index.js";
2
+ export type FhirProviderAddAuthConfigRequest = phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.Jwt | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.ClientSecret | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.OnBehalfOf | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.GoogleHealthcare | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.TokenPassthrough | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.None;
3
+ export declare namespace FhirProviderAddAuthConfigRequest {
4
+ interface Jwt extends phenoml.fhirProvider.JwtAuth {
5
+ auth_method: "jwt";
6
+ }
7
+ interface ClientSecret extends phenoml.fhirProvider.ClientSecretAuth {
8
+ auth_method: "client_secret";
9
+ }
10
+ interface OnBehalfOf extends phenoml.fhirProvider.OnBehalfOfAuth {
11
+ auth_method: "on_behalf_of";
12
+ }
13
+ interface GoogleHealthcare extends phenoml.fhirProvider.GoogleHealthcareAuth {
14
+ auth_method: "google_healthcare";
15
+ }
16
+ interface TokenPassthrough extends phenoml.fhirProvider.TokenPassthroughAuth {
17
+ auth_method: "token_passthrough";
18
+ }
19
+ interface None extends phenoml.fhirProvider.NoAuth {
20
+ auth_method: "none";
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import type * as phenoml from "../../../index.js";
2
+ export type FhirProviderCreateRequestAuth = phenoml.fhirProvider.FhirProviderCreateRequestAuth.Jwt | phenoml.fhirProvider.FhirProviderCreateRequestAuth.ClientSecret | phenoml.fhirProvider.FhirProviderCreateRequestAuth.OnBehalfOf | phenoml.fhirProvider.FhirProviderCreateRequestAuth.GoogleHealthcare | phenoml.fhirProvider.FhirProviderCreateRequestAuth.TokenPassthrough | phenoml.fhirProvider.FhirProviderCreateRequestAuth.None;
3
+ export declare namespace FhirProviderCreateRequestAuth {
4
+ interface Jwt extends phenoml.fhirProvider.JwtAuth {
5
+ auth_method: "jwt";
6
+ }
7
+ interface ClientSecret extends phenoml.fhirProvider.ClientSecretAuth {
8
+ auth_method: "client_secret";
9
+ }
10
+ interface OnBehalfOf extends phenoml.fhirProvider.OnBehalfOfAuth {
11
+ auth_method: "on_behalf_of";
12
+ }
13
+ interface GoogleHealthcare extends phenoml.fhirProvider.GoogleHealthcareAuth {
14
+ auth_method: "google_healthcare";
15
+ }
16
+ interface TokenPassthrough extends phenoml.fhirProvider.TokenPassthroughAuth {
17
+ auth_method: "token_passthrough";
18
+ }
19
+ interface None extends phenoml.fhirProvider.NoAuth {
20
+ auth_method: "none";
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as phenoml from "../../../index.js";
2
+ export interface GoogleHealthcareAuth {
3
+ service_account_key: phenoml.fhirProvider.ServiceAccountKey;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.js";
2
+ export interface JwtAuth {
3
+ /** OAuth client ID */
4
+ client_id: string;
5
+ /** Expiry time for JWT credentials. If omitted, a default expiry is used. */
6
+ credential_expiry?: string;
7
+ role?: phenoml.fhirProvider.Role;
8
+ /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. */
9
+ scopes?: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type NoAuth = {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.js";
2
+ export interface OnBehalfOfAuth {
3
+ /** OAuth client ID */
4
+ client_id: string;
5
+ /** OAuth client secret */
6
+ client_secret: string;
7
+ role?: phenoml.fhirProvider.Role;
8
+ /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. */
9
+ scopes?: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,14 +3,29 @@
3
3
  * Cannot be specified together with `scopes`. Only applicable to
4
4
  * `client_secret`, `jwt`, and `on_behalf_of` auth methods.
5
5
  *
6
- * The server resolves each role to the appropriate scopes for the provider:
7
- * - `admin`: Full CRUD access (create, read, update, delete, search)
8
- * - `read`: Read and search access only
9
- * - `write`: Create, update, and delete access (no read)
6
+ * Roles apply across **all FHIR resource types** (e.g., Patient, Observation,
7
+ * Condition, etc.) they are not limited to a single resource. The server
8
+ * resolves each role to the appropriate system-level scopes for the provider:
9
+ * - `admin`: Full CRUD access (create, read, update, delete, search) on all resources
10
+ * - `read`: Read and search access on all resources
11
+ * - `write`: Create, update, and delete access on all resources (no read)
12
+ *
13
+ * **The exact scopes generated depend on the provider**, because each EHR uses a
14
+ * different SMART on FHIR version or scope format:
15
+ * - **Epic**: SMART v2 scopes (e.g., `system/*.cruds` for admin)
16
+ * - **Cerner**: Cerner-specific SMART v2 scopes with per-resource grants for the
17
+ * subset of resources Cerner supports
18
+ * - **Athenahealth**: USCDI SMART v2 scopes with explicit per-resource grants
19
+ * (e.g., `system/Patient.rs`, `system/Observation.rs`, etc.)
20
+ * - **Elation**: SMART v1 scopes (e.g., `system/*.read` for read)
21
+ * - **Medplum, Phenostore**: SMART v2 scopes
10
22
  *
11
23
  * If neither `role` nor `scopes` is specified, the provider-specific default
12
24
  * role is used (typically `read`; `admin` for Medplum/sandbox).
13
25
  *
26
+ * If the generated scopes don't match what your EHR expects, use the `scopes`
27
+ * field to specify exact scopes instead.
28
+ *
14
29
  * Canvas does not support system-level roles — use `scopes` directly.
15
30
  * Google Healthcare, HAPI, and `none`/`token_passthrough` auth methods
16
31
  * do not use scopes at all.
@@ -7,14 +7,29 @@ exports.Role = void 0;
7
7
  * Cannot be specified together with `scopes`. Only applicable to
8
8
  * `client_secret`, `jwt`, and `on_behalf_of` auth methods.
9
9
  *
10
- * The server resolves each role to the appropriate scopes for the provider:
11
- * - `admin`: Full CRUD access (create, read, update, delete, search)
12
- * - `read`: Read and search access only
13
- * - `write`: Create, update, and delete access (no read)
10
+ * Roles apply across **all FHIR resource types** (e.g., Patient, Observation,
11
+ * Condition, etc.) they are not limited to a single resource. The server
12
+ * resolves each role to the appropriate system-level scopes for the provider:
13
+ * - `admin`: Full CRUD access (create, read, update, delete, search) on all resources
14
+ * - `read`: Read and search access on all resources
15
+ * - `write`: Create, update, and delete access on all resources (no read)
16
+ *
17
+ * **The exact scopes generated depend on the provider**, because each EHR uses a
18
+ * different SMART on FHIR version or scope format:
19
+ * - **Epic**: SMART v2 scopes (e.g., `system/*.cruds` for admin)
20
+ * - **Cerner**: Cerner-specific SMART v2 scopes with per-resource grants for the
21
+ * subset of resources Cerner supports
22
+ * - **Athenahealth**: USCDI SMART v2 scopes with explicit per-resource grants
23
+ * (e.g., `system/Patient.rs`, `system/Observation.rs`, etc.)
24
+ * - **Elation**: SMART v1 scopes (e.g., `system/*.read` for read)
25
+ * - **Medplum, Phenostore**: SMART v2 scopes
14
26
  *
15
27
  * If neither `role` nor `scopes` is specified, the provider-specific default
16
28
  * role is used (typically `read`; `admin` for Medplum/sandbox).
17
29
  *
30
+ * If the generated scopes don't match what your EHR expects, use the `scopes`
31
+ * field to specify exact scopes instead.
32
+ *
18
33
  * Canvas does not support system-level roles — use `scopes` directly.
19
34
  * Google Healthcare, HAPI, and `none`/`token_passthrough` auth methods
20
35
  * do not use scopes at all.
@@ -0,0 +1 @@
1
+ export type TokenPassthroughAuth = {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,8 @@
1
1
  export * from "./AuthMethod.js";
2
+ export * from "./ClientSecretAuth.js";
3
+ export * from "./FhirProviderAddAuthConfigRequest.js";
2
4
  export * from "./FhirProviderAuthConfig.js";
5
+ export * from "./FhirProviderCreateRequestAuth.js";
3
6
  export * from "./FhirProviderDeleteResponse.js";
4
7
  export * from "./FhirProviderListResponse.js";
5
8
  export * from "./FhirProviderRemoveAuthConfigResponse.js";
@@ -7,9 +10,14 @@ export * from "./FhirProviderResponse.js";
7
10
  export * from "./FhirProviderSandboxInfo.js";
8
11
  export * from "./FhirProviderTemplate.js";
9
12
  export * from "./FhirQueryResponse.js";
13
+ export * from "./GoogleHealthcareAuth.js";
10
14
  export * from "./JsonWebKey.js";
15
+ export * from "./JwtAuth.js";
16
+ export * from "./NoAuth.js";
17
+ export * from "./OnBehalfOfAuth.js";
11
18
  export * from "./Provider.js";
12
19
  export * from "./Role.js";
13
20
  export * from "./ServiceAccountKey.js";
14
21
  export * from "./ServiceAccountMetadata.js";
15
22
  export * from "./SmartConfiguration.js";
23
+ export * from "./TokenPassthroughAuth.js";
@@ -15,7 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./AuthMethod.js"), exports);
18
+ __exportStar(require("./ClientSecretAuth.js"), exports);
19
+ __exportStar(require("./FhirProviderAddAuthConfigRequest.js"), exports);
18
20
  __exportStar(require("./FhirProviderAuthConfig.js"), exports);
21
+ __exportStar(require("./FhirProviderCreateRequestAuth.js"), exports);
19
22
  __exportStar(require("./FhirProviderDeleteResponse.js"), exports);
20
23
  __exportStar(require("./FhirProviderListResponse.js"), exports);
21
24
  __exportStar(require("./FhirProviderRemoveAuthConfigResponse.js"), exports);
@@ -23,9 +26,14 @@ __exportStar(require("./FhirProviderResponse.js"), exports);
23
26
  __exportStar(require("./FhirProviderSandboxInfo.js"), exports);
24
27
  __exportStar(require("./FhirProviderTemplate.js"), exports);
25
28
  __exportStar(require("./FhirQueryResponse.js"), exports);
29
+ __exportStar(require("./GoogleHealthcareAuth.js"), exports);
26
30
  __exportStar(require("./JsonWebKey.js"), exports);
31
+ __exportStar(require("./JwtAuth.js"), exports);
32
+ __exportStar(require("./NoAuth.js"), exports);
33
+ __exportStar(require("./OnBehalfOfAuth.js"), exports);
27
34
  __exportStar(require("./Provider.js"), exports);
28
35
  __exportStar(require("./Role.js"), exports);
29
36
  __exportStar(require("./ServiceAccountKey.js"), exports);
30
37
  __exportStar(require("./ServiceAccountMetadata.js"), exports);
31
38
  __exportStar(require("./SmartConfiguration.js"), exports);
39
+ __exportStar(require("./TokenPassthroughAuth.js"), exports);
@@ -31,6 +31,7 @@ export declare namespace CreateRequest {
31
31
  readonly Procedure: "procedure";
32
32
  readonly Questionnaire: "questionnaire";
33
33
  readonly Questionnaireresponse: "questionnaireresponse";
34
+ readonly Servicerequest: "servicerequest";
34
35
  readonly SimpleObservation: "simple-observation";
35
36
  readonly VitalSigns: "vital-signs";
36
37
  };
@@ -20,6 +20,7 @@ var CreateRequest;
20
20
  Procedure: "procedure",
21
21
  Questionnaire: "questionnaire",
22
22
  Questionnaireresponse: "questionnaireresponse",
23
+ Servicerequest: "servicerequest",
23
24
  SimpleObservation: "simple-observation",
24
25
  VitalSigns: "vital-signs",
25
26
  };
@@ -9,8 +9,8 @@
9
9
  export interface DocumentRequest {
10
10
  /** FHIR version to use */
11
11
  version: string;
12
- /** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
13
- resource: DocumentRequest.Resource;
12
+ /** Type of FHIR resource to create. Accepts any FHIR resource type or US Core profile name. */
13
+ resource: string;
14
14
  /**
15
15
  * Base64 encoded file content.
16
16
  * Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
@@ -18,11 +18,3 @@ export interface DocumentRequest {
18
18
  */
19
19
  content: string;
20
20
  }
21
- export declare namespace DocumentRequest {
22
- /** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
23
- const Resource: {
24
- readonly Questionnaire: "questionnaire";
25
- readonly Questionnaireresponse: "questionnaireresponse";
26
- };
27
- type Resource = (typeof Resource)[keyof typeof Resource];
28
- }
@@ -1,12 +1,3 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.DocumentRequest = void 0;
5
- var DocumentRequest;
6
- (function (DocumentRequest) {
7
- /** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
8
- DocumentRequest.Resource = {
9
- Questionnaire: "questionnaire",
10
- Questionnaireresponse: "questionnaireresponse",
11
- };
12
- })(DocumentRequest || (exports.DocumentRequest = DocumentRequest = {}));
@@ -42,6 +42,7 @@ export declare namespace Lang2FhirAndCreateRequest {
42
42
  readonly Procedure: "procedure";
43
43
  readonly Questionnaire: "questionnaire";
44
44
  readonly Questionnaireresponse: "questionnaireresponse";
45
+ readonly Servicerequest: "servicerequest";
45
46
  readonly SimpleObservation: "simple-observation";
46
47
  readonly VitalSigns: "vital-signs";
47
48
  };
@@ -20,6 +20,7 @@ var Lang2FhirAndCreateRequest;
20
20
  Procedure: "procedure",
21
21
  Questionnaire: "questionnaire",
22
22
  Questionnaireresponse: "questionnaireresponse",
23
+ Servicerequest: "servicerequest",
23
24
  SimpleObservation: "simple-observation",
24
25
  VitalSigns: "vital-signs",
25
26
  };
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "7.1.0";
1
+ export declare const SDK_VERSION = "9.0.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "7.1.0";
4
+ exports.SDK_VERSION = "9.0.0";
@@ -16,8 +16,8 @@ export class phenomlClient {
16
16
  this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
17
17
  "X-Fern-Language": "JavaScript",
18
18
  "X-Fern-SDK-Name": "phenoml",
19
- "X-Fern-SDK-Version": "7.1.0",
20
- "User-Agent": "phenoml/7.1.0",
19
+ "X-Fern-SDK-Version": "9.0.0",
20
+ "User-Agent": "phenoml/9.0.0",
21
21
  "X-Fern-Runtime": core.RUNTIME.type,
22
22
  "X-Fern-Runtime-Version": core.RUNTIME.version,
23
23
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -27,8 +27,11 @@ export declare class FhirProvider {
27
27
  * await client.fhirProvider.create({
28
28
  * name: "Epic Sandbox",
29
29
  * provider: "athenahealth",
30
- * auth_method: "client_secret",
31
- * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
30
+ * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
31
+ * auth: {
32
+ * auth_method: "jwt",
33
+ * client_id: "your-client-id"
34
+ * }
32
35
  * })
33
36
  */
34
37
  create(request: phenoml.fhirProvider.FhirProviderCreateRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
@@ -103,7 +106,8 @@ export declare class FhirProvider {
103
106
  *
104
107
  * @example
105
108
  * await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
106
- * auth_method: "client_secret"
109
+ * auth_method: "jwt",
110
+ * client_id: "your-client-id"
107
111
  * })
108
112
  */
109
113
  addAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderAddAuthConfigRequest, requestOptions?: FhirProvider.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
@@ -34,8 +34,11 @@ export class FhirProvider {
34
34
  * await client.fhirProvider.create({
35
35
  * name: "Epic Sandbox",
36
36
  * provider: "athenahealth",
37
- * auth_method: "client_secret",
38
- * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
37
+ * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
38
+ * auth: {
39
+ * auth_method: "jwt",
40
+ * client_id: "your-client-id"
41
+ * }
39
42
  * })
40
43
  */
41
44
  create(request, requestOptions) {
@@ -335,7 +338,8 @@ export class FhirProvider {
335
338
  *
336
339
  * @example
337
340
  * await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
338
- * auth_method: "client_secret"
341
+ * auth_method: "jwt",
342
+ * client_id: "your-client-id"
339
343
  * })
340
344
  */
341
345
  addAuthConfig(fhir_provider_id, request, requestOptions) {
@@ -4,8 +4,11 @@ import type * as phenoml from "../../../../index.mjs";
4
4
  * {
5
5
  * name: "Epic Sandbox",
6
6
  * provider: "athenahealth",
7
- * auth_method: "client_secret",
8
- * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
7
+ * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
8
+ * auth: {
9
+ * auth_method: "jwt",
10
+ * client_id: "your-client-id"
11
+ * }
9
12
  * }
10
13
  */
11
14
  export interface FhirProviderCreateRequest {
@@ -14,17 +17,7 @@ export interface FhirProviderCreateRequest {
14
17
  /** Optional description of the FHIR provider */
15
18
  description?: string;
16
19
  provider: phenoml.fhirProvider.Provider;
17
- auth_method: phenoml.fhirProvider.AuthMethod;
18
20
  /** Base URL of the FHIR server */
19
21
  base_url: string;
20
- /** OAuth client ID (required for jwt, client_secret, and on_behalf_of auth methods) */
21
- client_id?: string;
22
- /** OAuth client secret (required for client_secret and on_behalf_of auth methods) */
23
- client_secret?: string;
24
- service_account_key?: phenoml.fhirProvider.ServiceAccountKey;
25
- /** Expiry time for JWT credentials (only applicable for JWT auth method). If omitted, a default expiry is used. */
26
- credential_expiry?: string;
27
- role?: phenoml.fhirProvider.Role;
28
- /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. Only applicable to `client_secret`, `jwt`, and `on_behalf_of` auth methods; specifying scopes for other auth methods will return an error. Make sure the scopes you specify are appropriate for the auth config and provider you are using. */
29
- scopes?: string;
22
+ auth: phenoml.fhirProvider.FhirProviderCreateRequestAuth;
30
23
  }
@@ -1,4 +1,3 @@
1
- export type { FhirProviderAddAuthConfigRequest } from "./FhirProviderAddAuthConfigRequest.mjs";
2
1
  export type { FhirProviderCreateRequest } from "./FhirProviderCreateRequest.mjs";
3
2
  export type { FhirProviderRemoveAuthConfigRequest } from "./FhirProviderRemoveAuthConfigRequest.mjs";
4
3
  export type { FhirProviderSetActiveAuthConfigRequest } from "./FhirProviderSetActiveAuthConfigRequest.mjs";
@@ -5,7 +5,8 @@
5
5
  * **Scope behavior by auth method:**
6
6
  * - `client_secret`, `jwt`, `on_behalf_of`: Scopes are included in the OAuth token request.
7
7
  * They can be configured using the `role` or `scopes` field. If neither is specified, provider-specific
8
- * default scopes derived from a default role are used.
8
+ * default scopes derived from a default role are used. Roles grant access across all FHIR resource
9
+ * types, but the exact scope format varies by EHR — see the `Role` schema for details.
9
10
  * - `google_healthcare`: Uses a fixed Google Cloud Healthcare scope. Specifying `role` or `scopes` will
10
11
  * return an error.
11
12
  * - `token_passthrough`: The caller provides their own bearer token via the X-Phenoml-Fhir-Provider header
@@ -6,7 +6,8 @@
6
6
  * **Scope behavior by auth method:**
7
7
  * - `client_secret`, `jwt`, `on_behalf_of`: Scopes are included in the OAuth token request.
8
8
  * They can be configured using the `role` or `scopes` field. If neither is specified, provider-specific
9
- * default scopes derived from a default role are used.
9
+ * default scopes derived from a default role are used. Roles grant access across all FHIR resource
10
+ * types, but the exact scope format varies by EHR — see the `Role` schema for details.
10
11
  * - `google_healthcare`: Uses a fixed Google Cloud Healthcare scope. Specifying `role` or `scopes` will
11
12
  * return an error.
12
13
  * - `token_passthrough`: The caller provides their own bearer token via the X-Phenoml-Fhir-Provider header
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export interface ClientSecretAuth {
3
+ /** OAuth client ID */
4
+ client_id: string;
5
+ /** OAuth client secret */
6
+ client_secret: string;
7
+ role?: phenoml.fhirProvider.Role;
8
+ /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. */
9
+ scopes?: string;
10
+ }
@@ -0,0 +1,22 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export type FhirProviderAddAuthConfigRequest = phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.Jwt | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.ClientSecret | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.OnBehalfOf | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.GoogleHealthcare | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.TokenPassthrough | phenoml.fhirProvider.FhirProviderAddAuthConfigRequest.None;
3
+ export declare namespace FhirProviderAddAuthConfigRequest {
4
+ interface Jwt extends phenoml.fhirProvider.JwtAuth {
5
+ auth_method: "jwt";
6
+ }
7
+ interface ClientSecret extends phenoml.fhirProvider.ClientSecretAuth {
8
+ auth_method: "client_secret";
9
+ }
10
+ interface OnBehalfOf extends phenoml.fhirProvider.OnBehalfOfAuth {
11
+ auth_method: "on_behalf_of";
12
+ }
13
+ interface GoogleHealthcare extends phenoml.fhirProvider.GoogleHealthcareAuth {
14
+ auth_method: "google_healthcare";
15
+ }
16
+ interface TokenPassthrough extends phenoml.fhirProvider.TokenPassthroughAuth {
17
+ auth_method: "token_passthrough";
18
+ }
19
+ interface None extends phenoml.fhirProvider.NoAuth {
20
+ auth_method: "none";
21
+ }
22
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,22 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export type FhirProviderCreateRequestAuth = phenoml.fhirProvider.FhirProviderCreateRequestAuth.Jwt | phenoml.fhirProvider.FhirProviderCreateRequestAuth.ClientSecret | phenoml.fhirProvider.FhirProviderCreateRequestAuth.OnBehalfOf | phenoml.fhirProvider.FhirProviderCreateRequestAuth.GoogleHealthcare | phenoml.fhirProvider.FhirProviderCreateRequestAuth.TokenPassthrough | phenoml.fhirProvider.FhirProviderCreateRequestAuth.None;
3
+ export declare namespace FhirProviderCreateRequestAuth {
4
+ interface Jwt extends phenoml.fhirProvider.JwtAuth {
5
+ auth_method: "jwt";
6
+ }
7
+ interface ClientSecret extends phenoml.fhirProvider.ClientSecretAuth {
8
+ auth_method: "client_secret";
9
+ }
10
+ interface OnBehalfOf extends phenoml.fhirProvider.OnBehalfOfAuth {
11
+ auth_method: "on_behalf_of";
12
+ }
13
+ interface GoogleHealthcare extends phenoml.fhirProvider.GoogleHealthcareAuth {
14
+ auth_method: "google_healthcare";
15
+ }
16
+ interface TokenPassthrough extends phenoml.fhirProvider.TokenPassthroughAuth {
17
+ auth_method: "token_passthrough";
18
+ }
19
+ interface None extends phenoml.fhirProvider.NoAuth {
20
+ auth_method: "none";
21
+ }
22
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export interface GoogleHealthcareAuth {
3
+ service_account_key: phenoml.fhirProvider.ServiceAccountKey;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export interface JwtAuth {
3
+ /** OAuth client ID */
4
+ client_id: string;
5
+ /** Expiry time for JWT credentials. If omitted, a default expiry is used. */
6
+ credential_expiry?: string;
7
+ role?: phenoml.fhirProvider.Role;
8
+ /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. */
9
+ scopes?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type NoAuth = {};
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export interface OnBehalfOfAuth {
3
+ /** OAuth client ID */
4
+ client_id: string;
5
+ /** OAuth client secret */
6
+ client_secret: string;
7
+ role?: phenoml.fhirProvider.Role;
8
+ /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. */
9
+ scopes?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -3,14 +3,29 @@
3
3
  * Cannot be specified together with `scopes`. Only applicable to
4
4
  * `client_secret`, `jwt`, and `on_behalf_of` auth methods.
5
5
  *
6
- * The server resolves each role to the appropriate scopes for the provider:
7
- * - `admin`: Full CRUD access (create, read, update, delete, search)
8
- * - `read`: Read and search access only
9
- * - `write`: Create, update, and delete access (no read)
6
+ * Roles apply across **all FHIR resource types** (e.g., Patient, Observation,
7
+ * Condition, etc.) they are not limited to a single resource. The server
8
+ * resolves each role to the appropriate system-level scopes for the provider:
9
+ * - `admin`: Full CRUD access (create, read, update, delete, search) on all resources
10
+ * - `read`: Read and search access on all resources
11
+ * - `write`: Create, update, and delete access on all resources (no read)
12
+ *
13
+ * **The exact scopes generated depend on the provider**, because each EHR uses a
14
+ * different SMART on FHIR version or scope format:
15
+ * - **Epic**: SMART v2 scopes (e.g., `system/*.cruds` for admin)
16
+ * - **Cerner**: Cerner-specific SMART v2 scopes with per-resource grants for the
17
+ * subset of resources Cerner supports
18
+ * - **Athenahealth**: USCDI SMART v2 scopes with explicit per-resource grants
19
+ * (e.g., `system/Patient.rs`, `system/Observation.rs`, etc.)
20
+ * - **Elation**: SMART v1 scopes (e.g., `system/*.read` for read)
21
+ * - **Medplum, Phenostore**: SMART v2 scopes
10
22
  *
11
23
  * If neither `role` nor `scopes` is specified, the provider-specific default
12
24
  * role is used (typically `read`; `admin` for Medplum/sandbox).
13
25
  *
26
+ * If the generated scopes don't match what your EHR expects, use the `scopes`
27
+ * field to specify exact scopes instead.
28
+ *
14
29
  * Canvas does not support system-level roles — use `scopes` directly.
15
30
  * Google Healthcare, HAPI, and `none`/`token_passthrough` auth methods
16
31
  * do not use scopes at all.
@@ -4,14 +4,29 @@
4
4
  * Cannot be specified together with `scopes`. Only applicable to
5
5
  * `client_secret`, `jwt`, and `on_behalf_of` auth methods.
6
6
  *
7
- * The server resolves each role to the appropriate scopes for the provider:
8
- * - `admin`: Full CRUD access (create, read, update, delete, search)
9
- * - `read`: Read and search access only
10
- * - `write`: Create, update, and delete access (no read)
7
+ * Roles apply across **all FHIR resource types** (e.g., Patient, Observation,
8
+ * Condition, etc.) they are not limited to a single resource. The server
9
+ * resolves each role to the appropriate system-level scopes for the provider:
10
+ * - `admin`: Full CRUD access (create, read, update, delete, search) on all resources
11
+ * - `read`: Read and search access on all resources
12
+ * - `write`: Create, update, and delete access on all resources (no read)
13
+ *
14
+ * **The exact scopes generated depend on the provider**, because each EHR uses a
15
+ * different SMART on FHIR version or scope format:
16
+ * - **Epic**: SMART v2 scopes (e.g., `system/*.cruds` for admin)
17
+ * - **Cerner**: Cerner-specific SMART v2 scopes with per-resource grants for the
18
+ * subset of resources Cerner supports
19
+ * - **Athenahealth**: USCDI SMART v2 scopes with explicit per-resource grants
20
+ * (e.g., `system/Patient.rs`, `system/Observation.rs`, etc.)
21
+ * - **Elation**: SMART v1 scopes (e.g., `system/*.read` for read)
22
+ * - **Medplum, Phenostore**: SMART v2 scopes
11
23
  *
12
24
  * If neither `role` nor `scopes` is specified, the provider-specific default
13
25
  * role is used (typically `read`; `admin` for Medplum/sandbox).
14
26
  *
27
+ * If the generated scopes don't match what your EHR expects, use the `scopes`
28
+ * field to specify exact scopes instead.
29
+ *
15
30
  * Canvas does not support system-level roles — use `scopes` directly.
16
31
  * Google Healthcare, HAPI, and `none`/`token_passthrough` auth methods
17
32
  * do not use scopes at all.
@@ -0,0 +1 @@
1
+ export type TokenPassthroughAuth = {};
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,5 +1,8 @@
1
1
  export * from "./AuthMethod.mjs";
2
+ export * from "./ClientSecretAuth.mjs";
3
+ export * from "./FhirProviderAddAuthConfigRequest.mjs";
2
4
  export * from "./FhirProviderAuthConfig.mjs";
5
+ export * from "./FhirProviderCreateRequestAuth.mjs";
3
6
  export * from "./FhirProviderDeleteResponse.mjs";
4
7
  export * from "./FhirProviderListResponse.mjs";
5
8
  export * from "./FhirProviderRemoveAuthConfigResponse.mjs";
@@ -7,9 +10,14 @@ export * from "./FhirProviderResponse.mjs";
7
10
  export * from "./FhirProviderSandboxInfo.mjs";
8
11
  export * from "./FhirProviderTemplate.mjs";
9
12
  export * from "./FhirQueryResponse.mjs";
13
+ export * from "./GoogleHealthcareAuth.mjs";
10
14
  export * from "./JsonWebKey.mjs";
15
+ export * from "./JwtAuth.mjs";
16
+ export * from "./NoAuth.mjs";
17
+ export * from "./OnBehalfOfAuth.mjs";
11
18
  export * from "./Provider.mjs";
12
19
  export * from "./Role.mjs";
13
20
  export * from "./ServiceAccountKey.mjs";
14
21
  export * from "./ServiceAccountMetadata.mjs";
15
22
  export * from "./SmartConfiguration.mjs";
23
+ export * from "./TokenPassthroughAuth.mjs";
@@ -1,5 +1,8 @@
1
1
  export * from "./AuthMethod.mjs";
2
+ export * from "./ClientSecretAuth.mjs";
3
+ export * from "./FhirProviderAddAuthConfigRequest.mjs";
2
4
  export * from "./FhirProviderAuthConfig.mjs";
5
+ export * from "./FhirProviderCreateRequestAuth.mjs";
3
6
  export * from "./FhirProviderDeleteResponse.mjs";
4
7
  export * from "./FhirProviderListResponse.mjs";
5
8
  export * from "./FhirProviderRemoveAuthConfigResponse.mjs";
@@ -7,9 +10,14 @@ export * from "./FhirProviderResponse.mjs";
7
10
  export * from "./FhirProviderSandboxInfo.mjs";
8
11
  export * from "./FhirProviderTemplate.mjs";
9
12
  export * from "./FhirQueryResponse.mjs";
13
+ export * from "./GoogleHealthcareAuth.mjs";
10
14
  export * from "./JsonWebKey.mjs";
15
+ export * from "./JwtAuth.mjs";
16
+ export * from "./NoAuth.mjs";
17
+ export * from "./OnBehalfOfAuth.mjs";
11
18
  export * from "./Provider.mjs";
12
19
  export * from "./Role.mjs";
13
20
  export * from "./ServiceAccountKey.mjs";
14
21
  export * from "./ServiceAccountMetadata.mjs";
15
22
  export * from "./SmartConfiguration.mjs";
23
+ export * from "./TokenPassthroughAuth.mjs";
@@ -31,6 +31,7 @@ export declare namespace CreateRequest {
31
31
  readonly Procedure: "procedure";
32
32
  readonly Questionnaire: "questionnaire";
33
33
  readonly Questionnaireresponse: "questionnaireresponse";
34
+ readonly Servicerequest: "servicerequest";
34
35
  readonly SimpleObservation: "simple-observation";
35
36
  readonly VitalSigns: "vital-signs";
36
37
  };
@@ -17,6 +17,7 @@ export var CreateRequest;
17
17
  Procedure: "procedure",
18
18
  Questionnaire: "questionnaire",
19
19
  Questionnaireresponse: "questionnaireresponse",
20
+ Servicerequest: "servicerequest",
20
21
  SimpleObservation: "simple-observation",
21
22
  VitalSigns: "vital-signs",
22
23
  };
@@ -9,8 +9,8 @@
9
9
  export interface DocumentRequest {
10
10
  /** FHIR version to use */
11
11
  version: string;
12
- /** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
13
- resource: DocumentRequest.Resource;
12
+ /** Type of FHIR resource to create. Accepts any FHIR resource type or US Core profile name. */
13
+ resource: string;
14
14
  /**
15
15
  * Base64 encoded file content.
16
16
  * Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
@@ -18,11 +18,3 @@ export interface DocumentRequest {
18
18
  */
19
19
  content: string;
20
20
  }
21
- export declare namespace DocumentRequest {
22
- /** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
23
- const Resource: {
24
- readonly Questionnaire: "questionnaire";
25
- readonly Questionnaireresponse: "questionnaireresponse";
26
- };
27
- type Resource = (typeof Resource)[keyof typeof Resource];
28
- }
@@ -1,9 +1,2 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export var DocumentRequest;
3
- (function (DocumentRequest) {
4
- /** Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported) */
5
- DocumentRequest.Resource = {
6
- Questionnaire: "questionnaire",
7
- Questionnaireresponse: "questionnaireresponse",
8
- };
9
- })(DocumentRequest || (DocumentRequest = {}));
2
+ export {};
@@ -42,6 +42,7 @@ export declare namespace Lang2FhirAndCreateRequest {
42
42
  readonly Procedure: "procedure";
43
43
  readonly Questionnaire: "questionnaire";
44
44
  readonly Questionnaireresponse: "questionnaireresponse";
45
+ readonly Servicerequest: "servicerequest";
45
46
  readonly SimpleObservation: "simple-observation";
46
47
  readonly VitalSigns: "vital-signs";
47
48
  };
@@ -17,6 +17,7 @@ export var Lang2FhirAndCreateRequest;
17
17
  Procedure: "procedure",
18
18
  Questionnaire: "questionnaire",
19
19
  Questionnaireresponse: "questionnaireresponse",
20
+ Servicerequest: "servicerequest",
20
21
  SimpleObservation: "simple-observation",
21
22
  VitalSigns: "vital-signs",
22
23
  };
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "7.1.0";
1
+ export declare const SDK_VERSION = "9.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "7.1.0";
1
+ export const SDK_VERSION = "9.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "7.1.0",
3
+ "version": "9.0.0",
4
4
  "private": false,
5
5
  "repository": "github:PhenoML/phenoml-ts-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -2635,8 +2635,11 @@ Note: The "sandbox" provider type cannot be created via this API - it is managed
2635
2635
  await client.fhirProvider.create({
2636
2636
  name: "Epic Sandbox",
2637
2637
  provider: "athenahealth",
2638
- auth_method: "client_secret",
2639
- base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4"
2638
+ base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
2639
+ auth: {
2640
+ auth_method: "jwt",
2641
+ client_id: "your-client-id"
2642
+ }
2640
2643
  });
2641
2644
 
2642
2645
  ```
@@ -2893,7 +2896,8 @@ Note: Sandbox providers cannot be modified.
2893
2896
 
2894
2897
  ```typescript
2895
2898
  await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
2896
- auth_method: "client_secret"
2899
+ auth_method: "jwt",
2900
+ client_id: "your-client-id"
2897
2901
  });
2898
2902
 
2899
2903
  ```
@@ -2918,7 +2922,7 @@ await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad",
2918
2922
  <dl>
2919
2923
  <dd>
2920
2924
 
2921
- **request:** `phenoml.fhirProvider.FhirProviderAddAuthConfigRequest`
2925
+ **request:** `phenoml.FhirProviderAddAuthConfigRequest`
2922
2926
 
2923
2927
  </dd>
2924
2928
  </dl>
@@ -1,20 +0,0 @@
1
- import type * as phenoml from "../../../../index.js";
2
- /**
3
- * @example
4
- * {
5
- * auth_method: "client_secret"
6
- * }
7
- */
8
- export interface FhirProviderAddAuthConfigRequest {
9
- auth_method: phenoml.fhirProvider.AuthMethod;
10
- /** OAuth client ID for this auth configuration. Required for jwt, client_secret, and on_behalf_of auth methods if the provider does not already have a client_id set. */
11
- client_id?: string;
12
- /** OAuth client secret (required for client_secret and on_behalf_of auth methods) */
13
- client_secret?: string;
14
- service_account_key?: phenoml.fhirProvider.ServiceAccountKey;
15
- /** Expiry time for JWT credentials (only applicable for JWT auth method). If omitted, a default expiry is used. */
16
- credential_expiry?: string;
17
- role?: phenoml.fhirProvider.Role;
18
- /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. Only applicable to `client_secret`, `jwt`, and `on_behalf_of` auth methods; specifying scopes for other auth methods will return an error. Make sure the scopes you specify are appropriate for the auth config and provider you are using. */
19
- scopes?: string;
20
- }
@@ -1,20 +0,0 @@
1
- import type * as phenoml from "../../../../index.mjs";
2
- /**
3
- * @example
4
- * {
5
- * auth_method: "client_secret"
6
- * }
7
- */
8
- export interface FhirProviderAddAuthConfigRequest {
9
- auth_method: phenoml.fhirProvider.AuthMethod;
10
- /** OAuth client ID for this auth configuration. Required for jwt, client_secret, and on_behalf_of auth methods if the provider does not already have a client_id set. */
11
- client_id?: string;
12
- /** OAuth client secret (required for client_secret and on_behalf_of auth methods) */
13
- client_secret?: string;
14
- service_account_key?: phenoml.fhirProvider.ServiceAccountKey;
15
- /** Expiry time for JWT credentials (only applicable for JWT auth method). If omitted, a default expiry is used. */
16
- credential_expiry?: string;
17
- role?: phenoml.fhirProvider.Role;
18
- /** OAuth scopes to request. Cannot be specified with role. If neither role nor scopes are specified, the provider-specific default role will be used. Only applicable to `client_secret`, `jwt`, and `on_behalf_of` auth methods; specifying scopes for other auth methods will return an error. Make sure the scopes you specify are appropriate for the auth config and provider you are using. */
19
- scopes?: string;
20
- }