phenoml 13.1.0 → 14.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 (124) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agent/client/Client.d.ts +24 -12
  3. package/dist/cjs/api/resources/agent/client/Client.js +24 -12
  4. package/dist/cjs/api/resources/agent/client/requests/AgentChatRequest.d.ts +11 -0
  5. package/dist/cjs/api/resources/agent/client/requests/AgentStreamChatRequest.d.ts +1 -0
  6. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +13 -25
  7. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +13 -64
  8. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.ts +4 -1
  9. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.ts +7 -1
  10. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +4 -1
  11. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +4 -1
  12. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +4 -1
  13. package/dist/cjs/api/resources/construe/client/Client.d.ts +95 -11
  14. package/dist/cjs/api/resources/construe/client/Client.js +95 -11
  15. package/dist/cjs/api/resources/construe/client/requests/ExtractRequest.d.ts +60 -1
  16. package/dist/cjs/api/resources/construe/client/requests/FeedbackRequest.d.ts +14 -7
  17. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +18 -1
  18. package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +10 -7
  19. package/dist/cjs/api/resources/fhirProvider/client/Client.js +10 -7
  20. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.ts +5 -3
  21. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.ts +1 -1
  22. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.ts +1 -1
  23. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.ts +6 -4
  24. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +10 -5
  25. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +17 -6
  26. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +17 -6
  27. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.ts +2 -1
  28. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateRequest.d.ts +9 -2
  29. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +2 -1
  30. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +1 -1
  31. package/dist/cjs/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.ts +3 -1
  32. package/dist/cjs/api/resources/lang2Fhir/types/SearchResponse.d.ts +2 -2
  33. package/dist/cjs/api/resources/summary/client/Client.d.ts +74 -9
  34. package/dist/cjs/api/resources/summary/client/Client.js +74 -9
  35. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.d.ts +67 -11
  36. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.ts +4 -4
  37. package/dist/cjs/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.ts +4 -4
  38. package/dist/cjs/api/resources/summary/types/index.d.ts +0 -2
  39. package/dist/cjs/api/resources/summary/types/index.js +0 -2
  40. package/dist/cjs/api/resources/tools/client/Client.d.ts +7 -3
  41. package/dist/cjs/api/resources/tools/client/Client.js +7 -3
  42. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.ts +1 -0
  43. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.ts +3 -2
  44. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +3 -1
  45. package/dist/cjs/api/resources/tools/types/McpServer.d.ts +10 -0
  46. package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +12 -16
  47. package/dist/cjs/api/resources/tools/types/McpServerTool.d.ts +14 -0
  48. package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +7 -20
  49. package/dist/cjs/api/resources/tools/types/index.d.ts +2 -0
  50. package/dist/cjs/api/resources/tools/types/index.js +2 -0
  51. package/dist/cjs/api/resources/workflows/client/Client.d.ts +21 -9
  52. package/dist/cjs/api/resources/workflows/client/Client.js +21 -9
  53. package/dist/cjs/api/resources/workflows/client/requests/CreateWorkflowRequest.d.ts +3 -2
  54. package/dist/cjs/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.ts +11 -1
  55. package/dist/cjs/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.ts +6 -5
  56. package/dist/cjs/version.d.ts +1 -1
  57. package/dist/cjs/version.js +1 -1
  58. package/dist/esm/BaseClient.mjs +2 -2
  59. package/dist/esm/api/resources/agent/client/Client.d.mts +24 -12
  60. package/dist/esm/api/resources/agent/client/Client.mjs +24 -12
  61. package/dist/esm/api/resources/agent/client/requests/AgentChatRequest.d.mts +11 -0
  62. package/dist/esm/api/resources/agent/client/requests/AgentStreamChatRequest.d.mts +1 -0
  63. package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +13 -25
  64. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +13 -64
  65. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.mts +4 -1
  66. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.mts +7 -1
  67. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +4 -1
  68. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +4 -1
  69. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +4 -1
  70. package/dist/esm/api/resources/construe/client/Client.d.mts +95 -11
  71. package/dist/esm/api/resources/construe/client/Client.mjs +95 -11
  72. package/dist/esm/api/resources/construe/client/requests/ExtractRequest.d.mts +60 -1
  73. package/dist/esm/api/resources/construe/client/requests/FeedbackRequest.d.mts +14 -7
  74. package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +18 -1
  75. package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +10 -7
  76. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +10 -7
  77. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.mts +5 -3
  78. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.mts +1 -1
  79. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.mts +1 -1
  80. package/dist/esm/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.mts +6 -4
  81. package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +10 -5
  82. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +17 -6
  83. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +17 -6
  84. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.mts +2 -1
  85. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateRequest.d.mts +9 -2
  86. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +2 -1
  87. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +1 -1
  88. package/dist/esm/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.mts +3 -1
  89. package/dist/esm/api/resources/lang2Fhir/types/SearchResponse.d.mts +2 -2
  90. package/dist/esm/api/resources/summary/client/Client.d.mts +74 -9
  91. package/dist/esm/api/resources/summary/client/Client.mjs +74 -9
  92. package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.d.mts +67 -11
  93. package/dist/esm/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.mts +4 -4
  94. package/dist/esm/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.mts +4 -4
  95. package/dist/esm/api/resources/summary/types/index.d.mts +0 -2
  96. package/dist/esm/api/resources/summary/types/index.mjs +0 -2
  97. package/dist/esm/api/resources/tools/client/Client.d.mts +7 -3
  98. package/dist/esm/api/resources/tools/client/Client.mjs +7 -3
  99. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.mts +1 -0
  100. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.mts +3 -2
  101. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +3 -1
  102. package/dist/esm/api/resources/tools/types/McpServer.d.mts +10 -0
  103. package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +12 -16
  104. package/dist/esm/api/resources/tools/types/McpServerTool.d.mts +14 -0
  105. package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +7 -20
  106. package/dist/esm/api/resources/tools/types/index.d.mts +2 -0
  107. package/dist/esm/api/resources/tools/types/index.mjs +2 -0
  108. package/dist/esm/api/resources/workflows/client/Client.d.mts +21 -9
  109. package/dist/esm/api/resources/workflows/client/Client.mjs +21 -9
  110. package/dist/esm/api/resources/workflows/client/requests/CreateWorkflowRequest.d.mts +3 -2
  111. package/dist/esm/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.mts +11 -1
  112. package/dist/esm/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.mts +6 -5
  113. package/dist/esm/version.d.mts +1 -1
  114. package/dist/esm/version.mjs +1 -1
  115. package/package.json +1 -1
  116. package/reference.md +140 -124
  117. package/dist/cjs/api/resources/summary/types/FhirBundle.d.ts +0 -13
  118. package/dist/cjs/api/resources/summary/types/FhirResource.d.ts +0 -6
  119. package/dist/esm/api/resources/summary/types/FhirBundle.d.mts +0 -13
  120. package/dist/esm/api/resources/summary/types/FhirResource.d.mts +0 -6
  121. /package/dist/cjs/api/resources/{summary/types/FhirBundle.js → tools/types/McpServer.js} +0 -0
  122. /package/dist/cjs/api/resources/{summary/types/FhirResource.js → tools/types/McpServerTool.js} +0 -0
  123. /package/dist/esm/api/resources/{summary/types/FhirBundle.mjs → tools/types/McpServer.mjs} +0 -0
  124. /package/dist/esm/api/resources/{summary/types/FhirResource.mjs → tools/types/McpServerTool.mjs} +0 -0
package/reference.md CHANGED
@@ -28,9 +28,11 @@ Creates a new PhenoAgent with specified configuration
28
28
 
29
29
  ```typescript
30
30
  await client.agent.create({
31
- name: "name",
32
- prompts: ["prompt_123", "prompt_456"],
33
- provider: "provider"
31
+ name: "Medical Assistant",
32
+ description: "An AI assistant for medical information processing",
33
+ prompts: ["prompt_123"],
34
+ tags: ["medical", "fhir"],
35
+ provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
34
36
  });
35
37
 
36
38
  ```
@@ -223,9 +225,11 @@ Updates an existing agent's configuration
223
225
 
224
226
  ```typescript
225
227
  await client.agent.update("id", {
226
- name: "name",
227
- prompts: ["prompt_123", "prompt_456"],
228
- provider: "provider"
228
+ name: "Medical Assistant",
229
+ description: "Updated description for the medical assistant",
230
+ prompts: ["prompt_123"],
231
+ tags: ["medical", "fhir", "updated"],
232
+ provider: "7002b0b4-8d09-445a-bf65-0fafdaf26c35"
229
233
  });
230
234
 
231
235
  ```
@@ -362,15 +366,12 @@ Patches an existing agent's configuration
362
366
  ```typescript
363
367
  await client.agent.patch("id", [{
364
368
  op: "replace",
365
- path: "/name",
366
- value: "Updated Agent Name"
369
+ path: "/description",
370
+ value: "patched description"
367
371
  }, {
368
372
  op: "add",
369
373
  path: "/tags/-",
370
- value: "new-tag"
371
- }, {
372
- op: "remove",
373
- path: "/description"
374
+ value: "updated"
374
375
  }]);
375
376
 
376
377
  ```
@@ -446,6 +447,7 @@ await client.agent.chat({
446
447
  "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
447
448
  "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
448
449
  message: "What is the patient's current condition?",
450
+ session_id: "session-abc123",
449
451
  agent_id: "agent-123"
450
452
  });
451
453
 
@@ -516,6 +518,7 @@ const response = await client.agent.streamChat({
516
518
  "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
517
519
  "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
518
520
  message: "What is the patient's current condition?",
521
+ session_id: "session-abc123",
519
522
  agent_id: "agent-123"
520
523
  });
521
524
  for await (const item of response) {
@@ -654,7 +657,10 @@ Creates a new agent prompt
654
657
  ```typescript
655
658
  await client.agent.prompts.create({
656
659
  name: "Medical Assistant System Prompt",
657
- content: "You are a helpful medical assistant specialized in FHIR data processing..."
660
+ description: "System prompt for medical assistant agent",
661
+ content: "You are a helpful medical assistant specialized in FHIR data processing.",
662
+ is_default: false,
663
+ tags: ["medical", "system"]
658
664
  });
659
665
 
660
666
  ```
@@ -836,7 +842,13 @@ Updates an existing prompt
836
842
  <dd>
837
843
 
838
844
  ```typescript
839
- await client.agent.prompts.update("id");
845
+ await client.agent.prompts.update("id", {
846
+ name: "Medical Assistant System Prompt",
847
+ description: "Updated system prompt",
848
+ content: "You are a helpful medical assistant. Always cite ICD-10 codes when discussing diagnoses.",
849
+ is_default: false,
850
+ tags: ["medical", "system", "updated"]
851
+ });
840
852
 
841
853
  ```
842
854
  </dd>
@@ -972,15 +984,8 @@ Patches an existing prompt
972
984
  ```typescript
973
985
  await client.agent.prompts.patch("id", [{
974
986
  op: "replace",
975
- path: "/name",
976
- value: "Updated Agent Name"
977
- }, {
978
- op: "add",
979
- path: "/tags/-",
980
- value: "new-tag"
981
- }, {
982
- op: "remove",
983
- path: "/description"
987
+ path: "/content",
988
+ value: "Updated prompt content."
984
989
  }]);
985
990
 
986
991
  ```
@@ -1021,61 +1026,6 @@ await client.agent.prompts.patch("id", [{
1021
1026
  </dl>
1022
1027
 
1023
1028
 
1024
- </dd>
1025
- </dl>
1026
- </details>
1027
-
1028
- <details><summary><code>client.agent.prompts.<a href="/src/api/resources/agent/resources/prompts/client/Client.ts">loadDefaults</a>() -> phenoml.SuccessResponse</code></summary>
1029
- <dl>
1030
- <dd>
1031
-
1032
- #### 📝 Description
1033
-
1034
- <dl>
1035
- <dd>
1036
-
1037
- <dl>
1038
- <dd>
1039
-
1040
- Loads default agent prompts for the authenticated user
1041
- </dd>
1042
- </dl>
1043
- </dd>
1044
- </dl>
1045
-
1046
- #### 🔌 Usage
1047
-
1048
- <dl>
1049
- <dd>
1050
-
1051
- <dl>
1052
- <dd>
1053
-
1054
- ```typescript
1055
- await client.agent.prompts.loadDefaults();
1056
-
1057
- ```
1058
- </dd>
1059
- </dl>
1060
- </dd>
1061
- </dl>
1062
-
1063
- #### ⚙️ Parameters
1064
-
1065
- <dl>
1066
- <dd>
1067
-
1068
- <dl>
1069
- <dd>
1070
-
1071
- **requestOptions:** `PromptsClient.RequestOptions`
1072
-
1073
- </dd>
1074
- </dl>
1075
- </dd>
1076
- </dl>
1077
-
1078
-
1079
1029
  </dd>
1080
1030
  </dl>
1081
1031
  </details>
@@ -1111,7 +1061,10 @@ returns an access token with expiration information.
1111
1061
  <dd>
1112
1062
 
1113
1063
  ```typescript
1114
- await client.authtoken.auth.getToken();
1064
+ await client.authtoken.auth.getToken({
1065
+ client_id: "your_client_id",
1066
+ client_secret: "your_client_secret"
1067
+ });
1115
1068
 
1116
1069
  ```
1117
1070
  </dd>
@@ -1247,7 +1200,14 @@ transitions from "processing" to "ready" or "failed".
1247
1200
  await client.construe.uploadCodeSystem({
1248
1201
  name: "CUSTOM_CODES",
1249
1202
  version: "1.0",
1250
- format: "csv"
1203
+ format: "json",
1204
+ codes: [{
1205
+ code: "X001",
1206
+ description: "Example custom code 1"
1207
+ }, {
1208
+ code: "X002",
1209
+ description: "Example custom code 2"
1210
+ }]
1251
1211
  });
1252
1212
 
1253
1213
  ```
@@ -1314,7 +1274,11 @@ Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
1314
1274
 
1315
1275
  ```typescript
1316
1276
  await client.construe.extractCodes({
1317
- text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney"
1277
+ text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney.",
1278
+ system: {
1279
+ name: "ICD-10-CM",
1280
+ version: "2025"
1281
+ }
1318
1282
  });
1319
1283
 
1320
1284
  ```
@@ -1734,7 +1698,7 @@ Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
1734
1698
  <dd>
1735
1699
 
1736
1700
  ```typescript
1737
- await client.construe.getASpecificCode("ICD-10-CM", "E11.65", {
1701
+ await client.construe.getASpecificCode("ICD-10-CM", "E1165", {
1738
1702
  version: "version"
1739
1703
  });
1740
1704
 
@@ -1760,7 +1724,10 @@ await client.construe.getASpecificCode("ICD-10-CM", "E11.65", {
1760
1724
  <dl>
1761
1725
  <dd>
1762
1726
 
1763
- **codeID:** `string` — The code identifier
1727
+ **codeID:** `string`
1728
+
1729
+ The code identifier. ICD-10-CM codes are stored without their
1730
+ cosmetic dot (use "E1165", not "E11.65").
1764
1731
 
1765
1732
  </dd>
1766
1733
  </dl>
@@ -1912,21 +1879,28 @@ Feedback includes the full extraction result received and the result the user ex
1912
1879
  await client.construe.submitFeedbackOnExtractionResults({
1913
1880
  text: "Patient has type 2 diabetes with hyperglycemia",
1914
1881
  received_result: {
1915
- system: {},
1882
+ system: {
1883
+ name: "ICD-10-CM",
1884
+ version: "2025"
1885
+ },
1916
1886
  codes: [{
1917
- code: "195967001",
1918
- description: "Asthma",
1887
+ code: "E11.9",
1888
+ description: "Type 2 diabetes mellitus without complications",
1919
1889
  valid: true
1920
1890
  }]
1921
1891
  },
1922
1892
  expected_result: {
1923
- system: {},
1893
+ system: {
1894
+ name: "ICD-10-CM",
1895
+ version: "2025"
1896
+ },
1924
1897
  codes: [{
1925
- code: "195967001",
1926
- description: "Asthma",
1898
+ code: "E11.65",
1899
+ description: "Type 2 diabetes mellitus with hyperglycemia",
1927
1900
  valid: true
1928
1901
  }]
1929
- }
1902
+ },
1903
+ detail: "Expected code E11.65 because the text mentions hyperglycemia"
1930
1904
  });
1931
1905
 
1932
1906
  ```
@@ -2695,11 +2669,13 @@ Note: The "sandbox" provider type cannot be created via this API - it is managed
2695
2669
  ```typescript
2696
2670
  await client.fhirProvider.create({
2697
2671
  name: "Epic Sandbox",
2698
- provider: "athenahealth",
2672
+ description: "Epic sandbox environment for testing",
2673
+ provider: "epic",
2699
2674
  base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
2700
2675
  auth: {
2701
- auth_method: "jwt",
2702
- client_id: "your-client-id"
2676
+ auth_method: "client_secret",
2677
+ client_id: "your-client-id",
2678
+ client_secret: "your-client-secret"
2703
2679
  }
2704
2680
  });
2705
2681
 
@@ -2957,8 +2933,9 @@ Note: Sandbox providers cannot be modified.
2957
2933
 
2958
2934
  ```typescript
2959
2935
  await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
2960
- auth_method: "jwt",
2961
- client_id: "your-client-id"
2936
+ auth_method: "client_secret",
2937
+ client_id: "your-client-id",
2938
+ client_secret: "your-client-secret"
2962
2939
  });
2963
2940
 
2964
2941
  ```
@@ -3037,7 +3014,7 @@ Note: Sandbox providers cannot be modified.
3037
3014
 
3038
3015
  ```typescript
3039
3016
  await client.fhirProvider.setActiveAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
3040
- auth_config_id: "auth-config-123"
3017
+ auth_config_id: "auth-config-456"
3041
3018
  });
3042
3019
 
3043
3020
  ```
@@ -3113,7 +3090,7 @@ Note: Sandbox providers cannot be modified.
3113
3090
 
3114
3091
  ```typescript
3115
3092
  await client.fhirProvider.removeAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
3116
- auth_config_id: "auth-config-123"
3093
+ auth_config_id: "auth-config-456"
3117
3094
  });
3118
3095
 
3119
3096
  ```
@@ -3190,8 +3167,8 @@ Converts natural language text into a structured FHIR resource.
3190
3167
  ```typescript
3191
3168
  await client.lang2Fhir.create({
3192
3169
  version: "R4",
3193
- resource: "auto",
3194
- text: "Patient has severe asthma with acute exacerbation"
3170
+ resource: "condition-encounter-diagnosis",
3171
+ text: "Patient has severe persistent asthma with acute exacerbation"
3195
3172
  });
3196
3173
 
3197
3174
  ```
@@ -3260,7 +3237,8 @@ Resources are linked with proper references (e.g., Conditions reference the Pati
3260
3237
 
3261
3238
  ```typescript
3262
3239
  await client.lang2Fhir.createMulti({
3263
- text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
3240
+ text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily. Blood pressure 140/90.",
3241
+ version: "R4"
3264
3242
  });
3265
3243
 
3266
3244
  ```
@@ -3406,7 +3384,9 @@ Uploads will be rejected if:
3406
3384
 
3407
3385
  ```typescript
3408
3386
  await client.lang2Fhir.uploadProfile({
3409
- profile: "(base64 encoded FHIR StructureDefinition JSON)"
3387
+ profile: "eyJyZXNvdXJjZVR5cGUiOiJTdHJ1Y3R1cmVEZWZpbml0aW9uIiwiaWQiOiJjdXN0b20tcGF0aWVudCIsInVybCI6Imh0dHA6Ly9waGVub21sLmNvbS9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vY3VzdG9tLXBhdGllbnQiLCJuYW1lIjoiQ3VzdG9tUGF0aWVudCIsInN0YXR1cyI6ImFjdGl2ZSIsImZoaXJWZXJzaW9uIjoiNC4wLjEiLCJraW5kIjoicmVzb3VyY2UiLCJhYnN0cmFjdCI6ZmFsc2UsInR5cGUiOiJQYXRpZW50IiwiYmFzZURlZmluaXRpb24iOiJodHRwOi8vaGw3Lm9yZy9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vUGF0aWVudCIsImRlcml2YXRpb24iOiJjb25zdHJhaW50Iiwic25hcHNob3QiOnsiZWxlbWVudCI6W3siaWQiOiJQYXRpZW50IiwicGF0aCI6IlBhdGllbnQiLCJtaW4iOjAsIm1heCI6IioifSx7ImlkIjoiUGF0aWVudC5uYW1lIiwicGF0aCI6IlBhdGllbnQubmFtZSIsIm1pbiI6MSwibWF4IjoiKiJ9XX19Cg==",
3388
+ implementation_guide: "acme-cardiology",
3389
+ profile_context: "When clinical text describes cardiology-specific findings, prefer this profile over the generic US Core Condition."
3410
3390
  });
3411
3391
 
3412
3392
  ```
@@ -3475,7 +3455,7 @@ Extracts text from a document (PDF or image) and converts it into a structured F
3475
3455
  await client.lang2Fhir.document({
3476
3456
  version: "R4",
3477
3457
  resource: "questionnaire",
3478
- content: "content"
3458
+ content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)"
3479
3459
  });
3480
3460
 
3481
3461
  ```
@@ -3546,7 +3526,8 @@ Resources are linked with proper references (e.g., Conditions reference the Pati
3546
3526
  ```typescript
3547
3527
  await client.lang2Fhir.extractMultipleFhirResourcesFromADocument({
3548
3528
  version: "R4",
3549
- content: "content"
3529
+ content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)",
3530
+ provider: "medplum"
3550
3531
  });
3551
3532
 
3552
3533
  ```
@@ -3667,10 +3648,10 @@ Creates a summary template from an example using LLM function calling
3667
3648
 
3668
3649
  ```typescript
3669
3650
  await client.summary.createTemplate({
3670
- name: "name",
3671
- example_summary: "Patient John Doe, age 45, presents with hypertension diagnosed on 2024-01-15.",
3672
- target_resources: ["Patient", "Condition", "Observation"],
3673
- mode: "mode"
3651
+ name: "Discharge Summary",
3652
+ example_summary: "Patient John Doe, age 45, was admitted on 2024-01-10 with Type 2 Diabetes. Discharged on 2024-01-15 with Metformin 500mg BID.",
3653
+ target_resources: ["Patient", "Condition", "MedicationRequest"],
3654
+ mode: "narrative"
3674
3655
  });
3675
3656
 
3676
3657
  ```
@@ -3798,10 +3779,10 @@ Updates an existing summary template
3798
3779
 
3799
3780
  ```typescript
3800
3781
  await client.summary.updateTemplate("id", {
3801
- name: "name",
3802
- template: "template",
3803
- target_resources: ["target_resources"],
3804
- mode: "mode"
3782
+ name: "Discharge Summary",
3783
+ template: "Patient {{Patient.name[0].text}} was discharged on {{Encounter[0].period.end}} with {{MedicationRequest[0].medicationCodeableConcept.coding[0].display}} {{MedicationRequest[0].dosageInstruction[0].text}}.",
3784
+ target_resources: ["Patient", "Encounter", "MedicationRequest"],
3785
+ mode: "narrative"
3805
3786
  });
3806
3787
 
3807
3788
  ```
@@ -3940,8 +3921,37 @@ Creates a summary from FHIR resources using one of three modes:
3940
3921
 
3941
3922
  ```typescript
3942
3923
  await client.summary.create({
3924
+ mode: "narrative",
3925
+ template_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
3943
3926
  fhir_resources: {
3944
- resourceType: "resourceType"
3927
+ "resourceType": "Bundle",
3928
+ "type": "collection",
3929
+ "entry": [
3930
+ {
3931
+ "resource": {
3932
+ "resourceType": "Patient",
3933
+ "name": [
3934
+ {
3935
+ "given": [
3936
+ "John"
3937
+ ],
3938
+ "family": "Doe"
3939
+ }
3940
+ ],
3941
+ "gender": "male",
3942
+ "birthDate": "1979-03-15"
3943
+ }
3944
+ },
3945
+ {
3946
+ "resource": {
3947
+ "resourceType": "Condition",
3948
+ "code": {
3949
+ "text": "Type 2 Diabetes Mellitus"
3950
+ },
3951
+ "onsetDateTime": "2024-01-15"
3952
+ }
3953
+ }
3954
+ ]
3945
3955
  }
3946
3956
  });
3947
3957
 
@@ -4010,8 +4020,9 @@ Converts natural language to FHIR resource and optionally stores it in a FHIR se
4010
4020
  await client.tools.createFhirResource({
4011
4021
  "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
4012
4022
  "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
4013
- resource: "auto",
4014
- text: "Patient John Doe has severe asthma with acute exacerbation"
4023
+ resource: "condition-encounter-diagnosis",
4024
+ text: "Patient has severe persistent asthma with acute exacerbation",
4025
+ provider: "550e8400-e29b-41d4-a716-446655440000"
4015
4026
  });
4016
4027
 
4017
4028
  ```
@@ -4083,6 +4094,7 @@ await client.tools.createFhirResourcesMulti({
4083
4094
  "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
4084
4095
  "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
4085
4096
  text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
4097
+ version: "R4",
4086
4098
  provider: "medplum"
4087
4099
  });
4088
4100
 
@@ -4150,7 +4162,9 @@ Converts natural language to FHIR search parameters and executes search in FHIR
4150
4162
  await client.tools.searchFhirResources({
4151
4163
  "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
4152
4164
  "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
4153
- text: "Find all appointments for patient John Doe next week"
4165
+ text: "Find all appointments for patient John Doe next week",
4166
+ count: 10,
4167
+ provider: "550e8400-e29b-41d4-a716-446655440000"
4154
4168
  });
4155
4169
 
4156
4170
  ```
@@ -4864,11 +4878,12 @@ Creates a new workflow definition with graph generation from workflow instructio
4864
4878
  await client.workflows.create({
4865
4879
  verbose: true,
4866
4880
  name: "Patient Data Mapping Workflow",
4867
- workflow_instructions: "Given diagnosis data, find the patient and create condition record",
4881
+ workflow_instructions: "Given diagnosis data, find the patient and create a condition record linked to their encounter",
4868
4882
  sample_data: {
4869
4883
  "patient_last_name": "Rippin",
4870
4884
  "patient_first_name": "Clay",
4871
- "diagnosis_code": "I10"
4885
+ "diagnosis_code": "I10",
4886
+ "encounter_date": "2024-01-15"
4872
4887
  },
4873
4888
  fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
4874
4889
  });
@@ -5009,12 +5024,13 @@ Updates an existing workflow definition
5009
5024
  ```typescript
5010
5025
  await client.workflows.update("id", {
5011
5026
  verbose: true,
5012
- name: "Updated Patient Data Mapping Workflow",
5013
- workflow_instructions: "Given diagnosis data, find the patient and create condition record",
5027
+ name: "Patient Data Mapping Workflow (v2)",
5028
+ workflow_instructions: "Given diagnosis data, find the patient and create a condition record linked to their encounter",
5014
5029
  sample_data: {
5015
- "patient_last_name": "Smith",
5016
- "patient_first_name": "John",
5017
- "diagnosis_code": "E11"
5030
+ "patient_last_name": "Rippin",
5031
+ "patient_first_name": "Clay",
5032
+ "diagnosis_code": "I10",
5033
+ "encounter_date": "2024-01-15"
5018
5034
  },
5019
5035
  fhir_provider_id: "550e8400-e29b-41d4-a716-446655440000"
5020
5036
  });
@@ -5151,12 +5167,12 @@ Executes a workflow with provided input data and returns results
5151
5167
  <dd>
5152
5168
 
5153
5169
  ```typescript
5154
- await client.workflows.execute("id", {
5170
+ await client.workflows.execute("7a8b9c0d-1234-5678-abcd-ef9876543210", {
5155
5171
  input_data: {
5156
5172
  "patient_last_name": "Johnson",
5157
5173
  "patient_first_name": "Mary",
5158
5174
  "diagnosis_code": "M79.3",
5159
- "encounter_date": "2024-01-15"
5175
+ "encounter_date": "2024-03-20"
5160
5176
  }
5161
5177
  });
5162
5178
 
@@ -1,13 +0,0 @@
1
- import type * as phenoml from "../../../index.js";
2
- export interface FhirBundle {
3
- resourceType: "Bundle";
4
- entry: FhirBundle.Entry.Item[];
5
- }
6
- export declare namespace FhirBundle {
7
- type Entry = Entry.Item[];
8
- namespace Entry {
9
- interface Item {
10
- resource?: phenoml.summary.FhirResource | undefined;
11
- }
12
- }
13
- }
@@ -1,6 +0,0 @@
1
- export interface FhirResource {
2
- /** FHIR resource type */
3
- resourceType: string;
4
- /** Accepts any additional properties */
5
- [key: string]: any;
6
- }
@@ -1,13 +0,0 @@
1
- import type * as phenoml from "../../../index.mjs";
2
- export interface FhirBundle {
3
- resourceType: "Bundle";
4
- entry: FhirBundle.Entry.Item[];
5
- }
6
- export declare namespace FhirBundle {
7
- type Entry = Entry.Item[];
8
- namespace Entry {
9
- interface Item {
10
- resource?: phenoml.summary.FhirResource | undefined;
11
- }
12
- }
13
- }
@@ -1,6 +0,0 @@
1
- export interface FhirResource {
2
- /** FHIR resource type */
3
- resourceType: string;
4
- /** Accepts any additional properties */
5
- [key: string]: any;
6
- }