Skip to content

Commit 908a875

Browse files
Release 0.0.18
1 parent f75f264 commit 908a875

File tree

11 files changed

+48
-21
lines changed

11 files changed

+48
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phenoml",
3-
"version": "0.0.17",
3+
"version": "0.0.18",
44
"private": false,
55
"repository": "github:PhenoML/phenoml-ts-sdk",
66
"type": "commonjs",

reference.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,9 +2531,9 @@ Upload a custom FHIR StructureDefinition profile for use with the lang2fhir serv
25312531

25322532
```typescript
25332533
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)"
25372537
});
25382538

25392539
```
@@ -2976,9 +2976,10 @@ await client.summary.deleteTemplate("id");
29762976
<dl>
29772977
<dd>
29782978

2979-
Creates a summary from FHIR resources using one of two modes:
2979+
Creates a summary from FHIR resources using one of three modes:
29802980
- **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
29812981
- **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.
29822983
</dd>
29832984
</dl>
29842985
</dd>

src/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export class phenomlClient {
4040
{
4141
"X-Fern-Language": "JavaScript",
4242
"X-Fern-SDK-Name": "phenoml",
43-
"X-Fern-SDK-Version": "0.0.17",
44-
"User-Agent": "phenoml/0.0.17",
43+
"X-Fern-SDK-Version": "0.0.18",
44+
"User-Agent": "phenoml/0.0.18",
4545
"X-Fern-Runtime": core.RUNTIME.type,
4646
"X-Fern-Runtime-Version": core.RUNTIME.version,
4747
},

src/api/resources/lang2Fhir/client/Client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ export class Lang2Fhir {
225225
*
226226
* @example
227227
* await client.lang2Fhir.uploadProfile({
228-
* version: "version",
229-
* resource: "custom-patient",
230-
* profile: "profile"
228+
* version: "R4",
229+
* resource: "condition-encounter-diagnosis",
230+
* profile: "(base64 encoded JSON string of the FHIR profile)"
231231
* })
232232
*/
233233
public uploadProfile(

src/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
/**
44
* @example
55
* {
6-
* version: "version",
7-
* resource: "custom-patient",
8-
* profile: "profile"
6+
* version: "R4",
7+
* resource: "condition-encounter-diagnosis",
8+
* profile: "(base64 encoded JSON string of the FHIR profile)"
99
* }
1010
*/
1111
export interface ProfileUploadRequest {

src/api/resources/summary/client/Client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,10 @@ export class Summary {
483483
}
484484

485485
/**
486-
* Creates a summary from FHIR resources using one of two modes:
486+
* Creates a summary from FHIR resources using one of three modes:
487487
* - **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
488488
* - **flatten**: Flattens FHIR resources into a searchable format for RAG/search (no template needed)
489+
* - **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.
489490
*
490491
* @param {phenoml.summary.CreateSummaryRequest} request
491492
* @param {Summary.RequestOptions} requestOptions - Request-specific configuration.

src/api/resources/summary/client/requests/CreateSummaryRequest.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@ export interface CreateSummaryRequest {
1515
* Summary generation mode:
1616
* - narrative: Substitute FHIR data into a template (requires template_id)
1717
* - flatten: Flatten FHIR resources for RAG/search (no template needed)
18+
* - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
1819
*/
1920
mode?: CreateSummaryRequest.Mode;
2021
/** ID of the template to use (required for narrative mode) */
2122
template_id?: string;
22-
/** FHIR resources (single resource or Bundle) */
23+
/**
24+
* FHIR resources (single resource or Bundle).
25+
* For IPS mode, must be a Bundle containing exactly one Patient resource with at least one
26+
* identifier (id, fullUrl, or identifier field). Returns an error if no Patient is found,
27+
* if multiple Patients are present, or if the Patient has no identifiers. Resources are
28+
* automatically filtered to only include those referencing the patient.
29+
*/
2330
fhir_resources: CreateSummaryRequest.FhirResources;
2431
}
2532

@@ -28,14 +35,20 @@ export namespace CreateSummaryRequest {
2835
* Summary generation mode:
2936
* - narrative: Substitute FHIR data into a template (requires template_id)
3037
* - flatten: Flatten FHIR resources for RAG/search (no template needed)
38+
* - ips: Generate International Patient Summary (IPS) narrative per ISO 27269/HL7 FHIR IPS IG
3139
*/
3240
export const Mode = {
3341
Narrative: "narrative",
3442
Flatten: "flatten",
43+
Ips: "ips",
3544
} as const;
3645
export type Mode = (typeof Mode)[keyof typeof Mode];
3746
/**
38-
* FHIR resources (single resource or Bundle)
47+
* FHIR resources (single resource or Bundle).
48+
* For IPS mode, must be a Bundle containing exactly one Patient resource with at least one
49+
* identifier (id, fullUrl, or identifier field). Returns an error if no Patient is found,
50+
* if multiple Patients are present, or if the Patient has no identifiers. Resources are
51+
* automatically filtered to only include those referencing the patient.
3952
*/
4053
export type FhirResources = phenoml.summary.FhirResource | phenoml.summary.FhirBundle;
4154
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
export interface ErrorResponse {
4+
success?: boolean;
5+
/** Error message describing what went wrong */
6+
error?: string;
7+
}

src/api/resources/summary/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from "./CreateSummaryResponse.js";
22
export * from "./CreateSummaryTemplateResponse.js";
3+
export * from "./ErrorResponse.js";
34
export * from "./FhirBundle.js";
45
export * from "./FhirResource.js";
56
export * from "./SummaryDeleteTemplateResponse.js";

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SDK_VERSION = "0.0.17";
1+
export const SDK_VERSION = "0.0.18";

0 commit comments

Comments
 (0)