phenoml 0.0.17 → 0.0.19

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 (64) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/construe/types/ExtractRequestConfig.d.ts +6 -1
  3. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +22 -3
  4. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +78 -3
  5. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.ts +14 -0
  6. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.js +3 -0
  7. package/dist/cjs/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.ts +3 -3
  8. package/dist/cjs/api/resources/lang2Fhir/client/requests/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.d.ts +47 -0
  10. package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.js +3 -0
  11. package/dist/cjs/api/resources/lang2Fhir/types/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/lang2Fhir/types/index.js +1 -0
  13. package/dist/cjs/api/resources/summary/client/Client.d.ts +2 -1
  14. package/dist/cjs/api/resources/summary/client/Client.js +2 -1
  15. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.d.ts +15 -2
  16. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.js +2 -0
  17. package/dist/cjs/api/resources/summary/types/ErrorResponse.d.ts +5 -0
  18. package/dist/cjs/api/resources/summary/types/ErrorResponse.js +3 -0
  19. package/dist/cjs/api/resources/summary/types/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/summary/types/index.js +1 -0
  21. package/dist/cjs/api/resources/tools/client/Client.d.ts +26 -0
  22. package/dist/cjs/api/resources/tools/client/Client.js +91 -0
  23. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.ts +27 -0
  24. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.js +3 -0
  25. package/dist/cjs/api/resources/tools/client/requests/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.d.ts +31 -0
  27. package/dist/cjs/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.js +3 -0
  28. package/dist/cjs/api/resources/tools/types/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/tools/types/index.js +1 -0
  30. package/dist/cjs/version.d.ts +1 -1
  31. package/dist/cjs/version.js +1 -1
  32. package/dist/esm/Client.mjs +2 -2
  33. package/dist/esm/api/resources/construe/types/ExtractRequestConfig.d.mts +6 -1
  34. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +22 -3
  35. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +78 -3
  36. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.mts +14 -0
  37. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.mjs +2 -0
  38. package/dist/esm/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.mts +3 -3
  39. package/dist/esm/api/resources/lang2Fhir/client/requests/index.d.mts +1 -0
  40. package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.d.mts +47 -0
  41. package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.mjs +2 -0
  42. package/dist/esm/api/resources/lang2Fhir/types/index.d.mts +1 -0
  43. package/dist/esm/api/resources/lang2Fhir/types/index.mjs +1 -0
  44. package/dist/esm/api/resources/summary/client/Client.d.mts +2 -1
  45. package/dist/esm/api/resources/summary/client/Client.mjs +2 -1
  46. package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.d.mts +15 -2
  47. package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.mjs +2 -0
  48. package/dist/esm/api/resources/summary/types/ErrorResponse.d.mts +5 -0
  49. package/dist/esm/api/resources/summary/types/ErrorResponse.mjs +2 -0
  50. package/dist/esm/api/resources/summary/types/index.d.mts +1 -0
  51. package/dist/esm/api/resources/summary/types/index.mjs +1 -0
  52. package/dist/esm/api/resources/tools/client/Client.d.mts +26 -0
  53. package/dist/esm/api/resources/tools/client/Client.mjs +91 -0
  54. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.mts +27 -0
  55. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.mjs +2 -0
  56. package/dist/esm/api/resources/tools/client/requests/index.d.mts +1 -0
  57. package/dist/esm/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.d.mts +31 -0
  58. package/dist/esm/api/resources/tools/types/Lang2FhirAndCreateMultiResponse.mjs +2 -0
  59. package/dist/esm/api/resources/tools/types/index.d.mts +1 -0
  60. package/dist/esm/api/resources/tools/types/index.mjs +1 -0
  61. package/dist/esm/version.d.mts +1 -1
  62. package/dist/esm/version.mjs +1 -1
  63. package/package.json +1 -1
  64. package/reference.md +144 -4
package/reference.md CHANGED
@@ -2434,6 +2434,73 @@ await client.lang2Fhir.create({
2434
2434
  </dl>
2435
2435
 
2436
2436
 
2437
+ </dd>
2438
+ </dl>
2439
+ </details>
2440
+
2441
+ <details><summary><code>client.lang2Fhir.<a href="/src/api/resources/lang2Fhir/client/Client.ts">createMulti</a>({ ...params }) -> phenoml.CreateMultiResponse</code></summary>
2442
+ <dl>
2443
+ <dd>
2444
+
2445
+ #### 📝 Description
2446
+
2447
+ <dl>
2448
+ <dd>
2449
+
2450
+ <dl>
2451
+ <dd>
2452
+
2453
+ Analyzes natural language text and extracts multiple FHIR resources, returning them as a transaction Bundle.
2454
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text.
2455
+ Resources are linked with proper references (e.g., Conditions reference the Patient).
2456
+ </dd>
2457
+ </dl>
2458
+ </dd>
2459
+ </dl>
2460
+
2461
+ #### 🔌 Usage
2462
+
2463
+ <dl>
2464
+ <dd>
2465
+
2466
+ <dl>
2467
+ <dd>
2468
+
2469
+ ```typescript
2470
+ await client.lang2Fhir.createMulti({
2471
+ text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
2472
+ });
2473
+
2474
+ ```
2475
+ </dd>
2476
+ </dl>
2477
+ </dd>
2478
+ </dl>
2479
+
2480
+ #### ⚙️ Parameters
2481
+
2482
+ <dl>
2483
+ <dd>
2484
+
2485
+ <dl>
2486
+ <dd>
2487
+
2488
+ **request:** `phenoml.lang2Fhir.CreateMultiRequest`
2489
+
2490
+ </dd>
2491
+ </dl>
2492
+
2493
+ <dl>
2494
+ <dd>
2495
+
2496
+ **requestOptions:** `Lang2Fhir.RequestOptions`
2497
+
2498
+ </dd>
2499
+ </dl>
2500
+ </dd>
2501
+ </dl>
2502
+
2503
+
2437
2504
  </dd>
2438
2505
  </dl>
2439
2506
  </details>
@@ -2531,9 +2598,9 @@ Upload a custom FHIR StructureDefinition profile for use with the lang2fhir serv
2531
2598
 
2532
2599
  ```typescript
2533
2600
  await client.lang2Fhir.uploadProfile({
2534
- version: "version",
2535
- resource: "custom-patient",
2536
- profile: "profile"
2601
+ version: "R4",
2602
+ resource: "condition-encounter-diagnosis",
2603
+ profile: "(base64 encoded JSON string of the FHIR profile)"
2537
2604
  });
2538
2605
 
2539
2606
  ```
@@ -2976,9 +3043,10 @@ await client.summary.deleteTemplate("id");
2976
3043
  <dl>
2977
3044
  <dd>
2978
3045
 
2979
- Creates a summary from FHIR resources using one of two modes:
3046
+ Creates a summary from FHIR resources using one of three modes:
2980
3047
  - **narrative**: Uses a template to substitute FHIR data into placeholders (requires template_id)
2981
3048
  - **flatten**: Flattens FHIR resources into a searchable format for RAG/search (no template needed)
3049
+ - **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
3050
  </dd>
2983
3051
  </dl>
2984
3052
  </dd>
@@ -3098,6 +3166,78 @@ await client.tools.createFhirResource({
3098
3166
  </dl>
3099
3167
 
3100
3168
 
3169
+ </dd>
3170
+ </dl>
3171
+ </details>
3172
+
3173
+ <details><summary><code>client.tools.<a href="/src/api/resources/tools/client/Client.ts">createFhirResourcesMulti</a>({ ...params }) -> phenoml.Lang2FhirAndCreateMultiResponse</code></summary>
3174
+ <dl>
3175
+ <dd>
3176
+
3177
+ #### 📝 Description
3178
+
3179
+ <dl>
3180
+ <dd>
3181
+
3182
+ <dl>
3183
+ <dd>
3184
+
3185
+ Extracts multiple FHIR resources from natural language text and stores them in a FHIR server.
3186
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types.
3187
+ Resources are linked with proper references and submitted as a transaction bundle.
3188
+ For FHIR servers that don't auto-resolve urn:uuid references, this endpoint will automatically
3189
+ resolve them via PUT requests after the initial bundle creation.
3190
+ </dd>
3191
+ </dl>
3192
+ </dd>
3193
+ </dl>
3194
+
3195
+ #### 🔌 Usage
3196
+
3197
+ <dl>
3198
+ <dd>
3199
+
3200
+ <dl>
3201
+ <dd>
3202
+
3203
+ ```typescript
3204
+ await client.tools.createFhirResourcesMulti({
3205
+ "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
3206
+ "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
3207
+ text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
3208
+ provider: "medplum"
3209
+ });
3210
+
3211
+ ```
3212
+ </dd>
3213
+ </dl>
3214
+ </dd>
3215
+ </dl>
3216
+
3217
+ #### ⚙️ Parameters
3218
+
3219
+ <dl>
3220
+ <dd>
3221
+
3222
+ <dl>
3223
+ <dd>
3224
+
3225
+ **request:** `phenoml.tools.Lang2FhirAndCreateMultiRequest`
3226
+
3227
+ </dd>
3228
+ </dl>
3229
+
3230
+ <dl>
3231
+ <dd>
3232
+
3233
+ **requestOptions:** `Tools.RequestOptions`
3234
+
3235
+ </dd>
3236
+ </dl>
3237
+ </dd>
3238
+ </dl>
3239
+
3240
+
3101
3241
  </dd>
3102
3242
  </dl>
3103
3243
  </details>