phenoml 0.0.17 → 0.0.18

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 (30) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +3 -3
  3. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +3 -3
  4. package/dist/cjs/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.ts +3 -3
  5. package/dist/cjs/api/resources/summary/client/Client.d.ts +2 -1
  6. package/dist/cjs/api/resources/summary/client/Client.js +2 -1
  7. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.d.ts +15 -2
  8. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.js +2 -0
  9. package/dist/cjs/api/resources/summary/types/ErrorResponse.d.ts +5 -0
  10. package/dist/cjs/api/resources/summary/types/ErrorResponse.js +3 -0
  11. package/dist/cjs/api/resources/summary/types/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/summary/types/index.js +1 -0
  13. package/dist/cjs/version.d.ts +1 -1
  14. package/dist/cjs/version.js +1 -1
  15. package/dist/esm/Client.mjs +2 -2
  16. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +3 -3
  17. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +3 -3
  18. package/dist/esm/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.mts +3 -3
  19. package/dist/esm/api/resources/summary/client/Client.d.mts +2 -1
  20. package/dist/esm/api/resources/summary/client/Client.mjs +2 -1
  21. package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.d.mts +15 -2
  22. package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.mjs +2 -0
  23. package/dist/esm/api/resources/summary/types/ErrorResponse.d.mts +5 -0
  24. package/dist/esm/api/resources/summary/types/ErrorResponse.mjs +2 -0
  25. package/dist/esm/api/resources/summary/types/index.d.mts +1 -0
  26. package/dist/esm/api/resources/summary/types/index.mjs +1 -0
  27. package/dist/esm/version.d.mts +1 -1
  28. package/dist/esm/version.mjs +1 -1
  29. package/package.json +1 -1
  30. package/reference.md +5 -4
@@ -52,8 +52,8 @@ class phenomlClient {
52
52
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
53
53
  "X-Fern-Language": "JavaScript",
54
54
  "X-Fern-SDK-Name": "phenoml",
55
- "X-Fern-SDK-Version": "0.0.17",
56
- "User-Agent": "phenoml/0.0.17",
55
+ "X-Fern-SDK-Version": "0.0.18",
56
+ "User-Agent": "phenoml/0.0.18",
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) });
@@ -60,9 +60,9 @@ export declare class Lang2Fhir {
60
60
  *
61
61
  * @example
62
62
  * await client.lang2Fhir.uploadProfile({
63
- * version: "version",
64
- * resource: "custom-patient",
65
- * profile: "profile"
63
+ * version: "R4",
64
+ * resource: "condition-encounter-diagnosis",
65
+ * profile: "(base64 encoded JSON string of the FHIR profile)"
66
66
  * })
67
67
  */
68
68
  uploadProfile(request: phenoml.lang2Fhir.ProfileUploadRequest, requestOptions?: Lang2Fhir.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.Lang2FhirUploadProfileResponse>;
@@ -211,9 +211,9 @@ class Lang2Fhir {
211
211
  *
212
212
  * @example
213
213
  * await client.lang2Fhir.uploadProfile({
214
- * version: "version",
215
- * resource: "custom-patient",
216
- * profile: "profile"
214
+ * version: "R4",
215
+ * resource: "condition-encounter-diagnosis",
216
+ * profile: "(base64 encoded JSON string of the FHIR profile)"
217
217
  * })
218
218
  */
219
219
  uploadProfile(request, requestOptions) {
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * version: "version",
5
- * resource: "custom-patient",
6
- * profile: "profile"
4
+ * version: "R4",
5
+ * resource: "condition-encounter-diagnosis",
6
+ * profile: "(base64 encoded JSON string of the FHIR profile)"
7
7
  * }
8
8
  */
9
9
  export interface ProfileUploadRequest {
@@ -99,9 +99,10 @@ export declare class Summary {
99
99
  deleteTemplate(id: string, requestOptions?: Summary.RequestOptions): core.HttpResponsePromise<phenoml.summary.SummaryDeleteTemplateResponse>;
100
100
  private __deleteTemplate;
101
101
  /**
102
- * Creates a summary from FHIR resources using one of two modes:
102
+ * Creates a summary from FHIR resources using one of three modes:
103
103
  * - **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
104
104
  * - **flatten**: Flattens FHIR resources into a searchable format for RAG/search (no template needed)
105
+ * - **ips**: Generates an International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG. Requires a Bundle with exactly one Patient resource (returns 400 error if no Patient or multiple Patients are present). Automatically filters resources to those referencing the patient and generates sections for allergies, medications, problems, immunizations, procedures, and vital signs.
105
106
  *
106
107
  * @param {phenoml.summary.CreateSummaryRequest} request
107
108
  * @param {Summary.RequestOptions} requestOptions - Request-specific configuration.
@@ -419,9 +419,10 @@ class Summary {
419
419
  });
420
420
  }
421
421
  /**
422
- * Creates a summary from FHIR resources using one of two modes:
422
+ * Creates a summary from FHIR resources using one of three modes:
423
423
  * - **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
424
424
  * - **flatten**: Flattens FHIR resources into a searchable format for RAG/search (no template needed)
425
+ * - **ips**: Generates an International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG. Requires a Bundle with exactly one Patient resource (returns 400 error if no Patient or multiple Patients are present). Automatically filters resources to those referencing the patient and generates sections for allergies, medications, problems, immunizations, procedures, and vital signs.
425
426
  *
426
427
  * @param {phenoml.summary.CreateSummaryRequest} request
427
428
  * @param {Summary.RequestOptions} requestOptions - Request-specific configuration.
@@ -12,11 +12,18 @@ export interface CreateSummaryRequest {
12
12
  * Summary generation mode:
13
13
  * - narrative: Substitute FHIR data into a template (requires template_id)
14
14
  * - flatten: Flatten FHIR resources for RAG/search (no template needed)
15
+ * - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
15
16
  */
16
17
  mode?: CreateSummaryRequest.Mode;
17
18
  /** ID of the template to use (required for narrative mode) */
18
19
  template_id?: string;
19
- /** FHIR resources (single resource or Bundle) */
20
+ /**
21
+ * FHIR resources (single resource or Bundle).
22
+ * For IPS mode, must be a Bundle containing exactly one Patient resource with at least one
23
+ * identifier (id, fullUrl, or identifier field). Returns an error if no Patient is found,
24
+ * if multiple Patients are present, or if the Patient has no identifiers. Resources are
25
+ * automatically filtered to only include those referencing the patient.
26
+ */
20
27
  fhir_resources: CreateSummaryRequest.FhirResources;
21
28
  }
22
29
  export declare namespace CreateSummaryRequest {
@@ -24,14 +31,20 @@ export declare namespace CreateSummaryRequest {
24
31
  * Summary generation mode:
25
32
  * - narrative: Substitute FHIR data into a template (requires template_id)
26
33
  * - flatten: Flatten FHIR resources for RAG/search (no template needed)
34
+ * - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
27
35
  */
28
36
  const Mode: {
29
37
  readonly Narrative: "narrative";
30
38
  readonly Flatten: "flatten";
39
+ readonly Ips: "ips";
31
40
  };
32
41
  type Mode = (typeof Mode)[keyof typeof Mode];
33
42
  /**
34
- * FHIR resources (single resource or Bundle)
43
+ * FHIR resources (single resource or Bundle).
44
+ * For IPS mode, must be a Bundle containing exactly one Patient resource with at least one
45
+ * identifier (id, fullUrl, or identifier field). Returns an error if no Patient is found,
46
+ * if multiple Patients are present, or if the Patient has no identifiers. Resources are
47
+ * automatically filtered to only include those referencing the patient.
35
48
  */
36
49
  type FhirResources = phenoml.summary.FhirResource | phenoml.summary.FhirBundle;
37
50
  }
@@ -8,9 +8,11 @@ var CreateSummaryRequest;
8
8
  * Summary generation mode:
9
9
  * - narrative: Substitute FHIR data into a template (requires template_id)
10
10
  * - flatten: Flatten FHIR resources for RAG/search (no template needed)
11
+ * - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
11
12
  */
12
13
  CreateSummaryRequest.Mode = {
13
14
  Narrative: "narrative",
14
15
  Flatten: "flatten",
16
+ Ips: "ips",
15
17
  };
16
18
  })(CreateSummaryRequest || (exports.CreateSummaryRequest = CreateSummaryRequest = {}));
@@ -0,0 +1,5 @@
1
+ export interface ErrorResponse {
2
+ success?: boolean;
3
+ /** Error message describing what went wrong */
4
+ error?: string;
5
+ }
@@ -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,6 @@
1
1
  export * from "./CreateSummaryResponse.js";
2
2
  export * from "./CreateSummaryTemplateResponse.js";
3
+ export * from "./ErrorResponse.js";
3
4
  export * from "./FhirBundle.js";
4
5
  export * from "./FhirResource.js";
5
6
  export * from "./SummaryDeleteTemplateResponse.js";
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CreateSummaryResponse.js"), exports);
18
18
  __exportStar(require("./CreateSummaryTemplateResponse.js"), exports);
19
+ __exportStar(require("./ErrorResponse.js"), exports);
19
20
  __exportStar(require("./FhirBundle.js"), exports);
20
21
  __exportStar(require("./FhirResource.js"), exports);
21
22
  __exportStar(require("./SummaryDeleteTemplateResponse.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.17";
1
+ export declare const SDK_VERSION = "0.0.18";
@@ -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 = "0.0.17";
4
+ exports.SDK_VERSION = "0.0.18";
@@ -16,8 +16,8 @@ export class phenomlClient {
16
16
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
17
17
  "X-Fern-Language": "JavaScript",
18
18
  "X-Fern-SDK-Name": "phenoml",
19
- "X-Fern-SDK-Version": "0.0.17",
20
- "User-Agent": "phenoml/0.0.17",
19
+ "X-Fern-SDK-Version": "0.0.18",
20
+ "User-Agent": "phenoml/0.0.18",
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) });
@@ -60,9 +60,9 @@ export declare class Lang2Fhir {
60
60
  *
61
61
  * @example
62
62
  * await client.lang2Fhir.uploadProfile({
63
- * version: "version",
64
- * resource: "custom-patient",
65
- * profile: "profile"
63
+ * version: "R4",
64
+ * resource: "condition-encounter-diagnosis",
65
+ * profile: "(base64 encoded JSON string of the FHIR profile)"
66
66
  * })
67
67
  */
68
68
  uploadProfile(request: phenoml.lang2Fhir.ProfileUploadRequest, requestOptions?: Lang2Fhir.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.Lang2FhirUploadProfileResponse>;
@@ -175,9 +175,9 @@ export class Lang2Fhir {
175
175
  *
176
176
  * @example
177
177
  * await client.lang2Fhir.uploadProfile({
178
- * version: "version",
179
- * resource: "custom-patient",
180
- * profile: "profile"
178
+ * version: "R4",
179
+ * resource: "condition-encounter-diagnosis",
180
+ * profile: "(base64 encoded JSON string of the FHIR profile)"
181
181
  * })
182
182
  */
183
183
  uploadProfile(request, requestOptions) {
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * version: "version",
5
- * resource: "custom-patient",
6
- * profile: "profile"
4
+ * version: "R4",
5
+ * resource: "condition-encounter-diagnosis",
6
+ * profile: "(base64 encoded JSON string of the FHIR profile)"
7
7
  * }
8
8
  */
9
9
  export interface ProfileUploadRequest {
@@ -99,9 +99,10 @@ export declare class Summary {
99
99
  deleteTemplate(id: string, requestOptions?: Summary.RequestOptions): core.HttpResponsePromise<phenoml.summary.SummaryDeleteTemplateResponse>;
100
100
  private __deleteTemplate;
101
101
  /**
102
- * Creates a summary from FHIR resources using one of two modes:
102
+ * Creates a summary from FHIR resources using one of three modes:
103
103
  * - **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
104
104
  * - **flatten**: Flattens FHIR resources into a searchable format for RAG/search (no template needed)
105
+ * - **ips**: Generates an International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG. Requires a Bundle with exactly one Patient resource (returns 400 error if no Patient or multiple Patients are present). Automatically filters resources to those referencing the patient and generates sections for allergies, medications, problems, immunizations, procedures, and vital signs.
105
106
  *
106
107
  * @param {phenoml.summary.CreateSummaryRequest} request
107
108
  * @param {Summary.RequestOptions} requestOptions - Request-specific configuration.
@@ -383,9 +383,10 @@ export class Summary {
383
383
  });
384
384
  }
385
385
  /**
386
- * Creates a summary from FHIR resources using one of two modes:
386
+ * Creates a summary from FHIR resources using one of three modes:
387
387
  * - **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
388
388
  * - **flatten**: Flattens FHIR resources into a searchable format for RAG/search (no template needed)
389
+ * - **ips**: Generates an International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG. Requires a Bundle with exactly one Patient resource (returns 400 error if no Patient or multiple Patients are present). Automatically filters resources to those referencing the patient and generates sections for allergies, medications, problems, immunizations, procedures, and vital signs.
389
390
  *
390
391
  * @param {phenoml.summary.CreateSummaryRequest} request
391
392
  * @param {Summary.RequestOptions} requestOptions - Request-specific configuration.
@@ -12,11 +12,18 @@ export interface CreateSummaryRequest {
12
12
  * Summary generation mode:
13
13
  * - narrative: Substitute FHIR data into a template (requires template_id)
14
14
  * - flatten: Flatten FHIR resources for RAG/search (no template needed)
15
+ * - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
15
16
  */
16
17
  mode?: CreateSummaryRequest.Mode;
17
18
  /** ID of the template to use (required for narrative mode) */
18
19
  template_id?: string;
19
- /** FHIR resources (single resource or Bundle) */
20
+ /**
21
+ * FHIR resources (single resource or Bundle).
22
+ * For IPS mode, must be a Bundle containing exactly one Patient resource with at least one
23
+ * identifier (id, fullUrl, or identifier field). Returns an error if no Patient is found,
24
+ * if multiple Patients are present, or if the Patient has no identifiers. Resources are
25
+ * automatically filtered to only include those referencing the patient.
26
+ */
20
27
  fhir_resources: CreateSummaryRequest.FhirResources;
21
28
  }
22
29
  export declare namespace CreateSummaryRequest {
@@ -24,14 +31,20 @@ export declare namespace CreateSummaryRequest {
24
31
  * Summary generation mode:
25
32
  * - narrative: Substitute FHIR data into a template (requires template_id)
26
33
  * - flatten: Flatten FHIR resources for RAG/search (no template needed)
34
+ * - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
27
35
  */
28
36
  const Mode: {
29
37
  readonly Narrative: "narrative";
30
38
  readonly Flatten: "flatten";
39
+ readonly Ips: "ips";
31
40
  };
32
41
  type Mode = (typeof Mode)[keyof typeof Mode];
33
42
  /**
34
- * FHIR resources (single resource or Bundle)
43
+ * FHIR resources (single resource or Bundle).
44
+ * For IPS mode, must be a Bundle containing exactly one Patient resource with at least one
45
+ * identifier (id, fullUrl, or identifier field). Returns an error if no Patient is found,
46
+ * if multiple Patients are present, or if the Patient has no identifiers. Resources are
47
+ * automatically filtered to only include those referencing the patient.
35
48
  */
36
49
  type FhirResources = phenoml.summary.FhirResource | phenoml.summary.FhirBundle;
37
50
  }
@@ -5,9 +5,11 @@ export var CreateSummaryRequest;
5
5
  * Summary generation mode:
6
6
  * - narrative: Substitute FHIR data into a template (requires template_id)
7
7
  * - flatten: Flatten FHIR resources for RAG/search (no template needed)
8
+ * - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
8
9
  */
9
10
  CreateSummaryRequest.Mode = {
10
11
  Narrative: "narrative",
11
12
  Flatten: "flatten",
13
+ Ips: "ips",
12
14
  };
13
15
  })(CreateSummaryRequest || (CreateSummaryRequest = {}));
@@ -0,0 +1,5 @@
1
+ export interface ErrorResponse {
2
+ success?: boolean;
3
+ /** Error message describing what went wrong */
4
+ error?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,5 +1,6 @@
1
1
  export * from "./CreateSummaryResponse.mjs";
2
2
  export * from "./CreateSummaryTemplateResponse.mjs";
3
+ export * from "./ErrorResponse.mjs";
3
4
  export * from "./FhirBundle.mjs";
4
5
  export * from "./FhirResource.mjs";
5
6
  export * from "./SummaryDeleteTemplateResponse.mjs";
@@ -1,5 +1,6 @@
1
1
  export * from "./CreateSummaryResponse.mjs";
2
2
  export * from "./CreateSummaryTemplateResponse.mjs";
3
+ export * from "./ErrorResponse.mjs";
3
4
  export * from "./FhirBundle.mjs";
4
5
  export * from "./FhirResource.mjs";
5
6
  export * from "./SummaryDeleteTemplateResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.17";
1
+ export declare const SDK_VERSION = "0.0.18";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.17";
1
+ export const SDK_VERSION = "0.0.18";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "private": false,
5
5
  "repository": "github:PhenoML/phenoml-ts-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -2531,9 +2531,9 @@ Upload a custom FHIR StructureDefinition profile for use with the lang2fhir serv
2531
2531
 
2532
2532
  ```typescript
2533
2533
  await client.lang2Fhir.uploadProfile({
2534
- version: "version",
2535
- resource: "custom-patient",
2536
- profile: "profile"
2534
+ version: "R4",
2535
+ resource: "condition-encounter-diagnosis",
2536
+ profile: "(base64 encoded JSON string of the FHIR profile)"
2537
2537
  });
2538
2538
 
2539
2539
  ```
@@ -2976,9 +2976,10 @@ await client.summary.deleteTemplate("id");
2976
2976
  <dl>
2977
2977
  <dd>
2978
2978
 
2979
- Creates a summary from FHIR resources using one of two modes:
2979
+ Creates a summary from FHIR resources using one of three modes:
2980
2980
  - **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
2981
2981
  - **flatten**: Flattens FHIR resources into a searchable format for RAG/search (no template needed)
2982
+ - **ips**: Generates an International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG. Requires a Bundle with exactly one Patient resource (returns 400 error if no Patient or multiple Patients are present). Automatically filters resources to those referencing the patient and generates sections for allergies, medications, problems, immunizations, procedures, and vital signs.
2982
2983
  </dd>
2983
2984
  </dl>
2984
2985
  </dd>