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
@@ -34,8 +34,15 @@ export class Lang2FhirClient {
34
34
  * @example
35
35
  * await client.lang2Fhir.create({
36
36
  * version: "R4",
37
- * resource: "auto",
38
- * text: "Patient has severe asthma with acute exacerbation"
37
+ * resource: "condition-encounter-diagnosis",
38
+ * text: "Patient has severe persistent asthma with acute exacerbation"
39
+ * })
40
+ *
41
+ * @example
42
+ * await client.lang2Fhir.create({
43
+ * version: "R4",
44
+ * resource: "medicationrequest",
45
+ * text: "Prescribe Amoxicillin 500mg capsules, take one capsule three times daily for 10 days"
39
46
  * })
40
47
  */
41
48
  create(request, requestOptions) {
@@ -98,7 +105,8 @@ export class Lang2FhirClient {
98
105
  *
99
106
  * @example
100
107
  * await client.lang2Fhir.createMulti({
101
- * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
108
+ * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily. Blood pressure 140/90.",
109
+ * version: "R4"
102
110
  * })
103
111
  */
104
112
  createMulti(request, requestOptions) {
@@ -239,7 +247,9 @@ export class Lang2FhirClient {
239
247
  *
240
248
  * @example
241
249
  * await client.lang2Fhir.uploadProfile({
242
- * profile: "(base64 encoded FHIR StructureDefinition JSON)"
250
+ * profile: "eyJyZXNvdXJjZVR5cGUiOiJTdHJ1Y3R1cmVEZWZpbml0aW9uIiwiaWQiOiJjdXN0b20tcGF0aWVudCIsInVybCI6Imh0dHA6Ly9waGVub21sLmNvbS9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vY3VzdG9tLXBhdGllbnQiLCJuYW1lIjoiQ3VzdG9tUGF0aWVudCIsInN0YXR1cyI6ImFjdGl2ZSIsImZoaXJWZXJzaW9uIjoiNC4wLjEiLCJraW5kIjoicmVzb3VyY2UiLCJhYnN0cmFjdCI6ZmFsc2UsInR5cGUiOiJQYXRpZW50IiwiYmFzZURlZmluaXRpb24iOiJodHRwOi8vaGw3Lm9yZy9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vUGF0aWVudCIsImRlcml2YXRpb24iOiJjb25zdHJhaW50Iiwic25hcHNob3QiOnsiZWxlbWVudCI6W3siaWQiOiJQYXRpZW50IiwicGF0aCI6IlBhdGllbnQiLCJtaW4iOjAsIm1heCI6IioifSx7ImlkIjoiUGF0aWVudC5uYW1lIiwicGF0aCI6IlBhdGllbnQubmFtZSIsIm1pbiI6MSwibWF4IjoiKiJ9XX19Cg==",
251
+ * implementation_guide: "acme-cardiology",
252
+ * profile_context: "When clinical text describes cardiology-specific findings, prefer this profile over the generic US Core Condition."
243
253
  * })
244
254
  */
245
255
  uploadProfile(request, requestOptions) {
@@ -307,7 +317,7 @@ export class Lang2FhirClient {
307
317
  * await client.lang2Fhir.document({
308
318
  * version: "R4",
309
319
  * resource: "questionnaire",
310
- * content: "content"
320
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)"
311
321
  * })
312
322
  */
313
323
  document(request, requestOptions) {
@@ -373,7 +383,8 @@ export class Lang2FhirClient {
373
383
  * @example
374
384
  * await client.lang2Fhir.extractMultipleFhirResourcesFromADocument({
375
385
  * version: "R4",
376
- * content: "content"
386
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)",
387
+ * provider: "medplum"
377
388
  * })
378
389
  */
379
390
  extractMultipleFhirResourcesFromADocument(request, requestOptions) {
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
4
+ * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily. Blood pressure 140/90.",
5
+ * version: "R4"
5
6
  * }
6
7
  */
7
8
  export interface CreateMultiRequest {
@@ -2,8 +2,15 @@
2
2
  * @example
3
3
  * {
4
4
  * version: "R4",
5
- * resource: "auto",
6
- * text: "Patient has severe asthma with acute exacerbation"
5
+ * resource: "condition-encounter-diagnosis",
6
+ * text: "Patient has severe persistent asthma with acute exacerbation"
7
+ * }
8
+ *
9
+ * @example
10
+ * {
11
+ * version: "R4",
12
+ * resource: "medicationrequest",
13
+ * text: "Prescribe Amoxicillin 500mg capsules, take one capsule three times daily for 10 days"
7
14
  * }
8
15
  */
9
16
  export interface CreateRequest {
@@ -3,7 +3,8 @@ import type * as phenoml from "../../../../index.mjs";
3
3
  * @example
4
4
  * {
5
5
  * version: "R4",
6
- * content: "content"
6
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)",
7
+ * provider: "medplum"
7
8
  * }
8
9
  */
9
10
  export interface DocumentMultiRequest {
@@ -4,7 +4,7 @@ import type * as phenoml from "../../../../index.mjs";
4
4
  * {
5
5
  * version: "R4",
6
6
  * resource: "questionnaire",
7
- * content: "content"
7
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)"
8
8
  * }
9
9
  */
10
10
  export interface DocumentRequest {
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * profile: "(base64 encoded FHIR StructureDefinition JSON)"
4
+ * profile: "eyJyZXNvdXJjZVR5cGUiOiJTdHJ1Y3R1cmVEZWZpbml0aW9uIiwiaWQiOiJjdXN0b20tcGF0aWVudCIsInVybCI6Imh0dHA6Ly9waGVub21sLmNvbS9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vY3VzdG9tLXBhdGllbnQiLCJuYW1lIjoiQ3VzdG9tUGF0aWVudCIsInN0YXR1cyI6ImFjdGl2ZSIsImZoaXJWZXJzaW9uIjoiNC4wLjEiLCJraW5kIjoicmVzb3VyY2UiLCJhYnN0cmFjdCI6ZmFsc2UsInR5cGUiOiJQYXRpZW50IiwiYmFzZURlZmluaXRpb24iOiJodHRwOi8vaGw3Lm9yZy9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vUGF0aWVudCIsImRlcml2YXRpb24iOiJjb25zdHJhaW50Iiwic25hcHNob3QiOnsiZWxlbWVudCI6W3siaWQiOiJQYXRpZW50IiwicGF0aCI6IlBhdGllbnQiLCJtaW4iOjAsIm1heCI6IioifSx7ImlkIjoiUGF0aWVudC5uYW1lIiwicGF0aCI6IlBhdGllbnQubmFtZSIsIm1pbiI6MSwibWF4IjoiKiJ9XX19Cg==",
5
+ * implementation_guide: "acme-cardiology",
6
+ * profile_context: "When clinical text describes cardiology-specific findings, prefer this profile over the generic US Core Condition."
5
7
  * }
6
8
  */
7
9
  export interface ProfileUploadRequest {
@@ -1,12 +1,12 @@
1
1
  export interface SearchResponse {
2
2
  /** The FHIR resource type identified for the search */
3
- resourceType?: SearchResponse.ResourceType | undefined;
3
+ resource_type?: SearchResponse.ResourceType | undefined;
4
4
  /**
5
5
  * FHIR search parameters in standard query string format.
6
6
  * Parameters are formatted according to the FHIR specification with appropriate operators.
7
7
  * Code parameters are resolved to standard terminology codes (SNOMED CT, LOINC, RxNorm, ICD-10-CM).
8
8
  */
9
- searchParams?: string | undefined;
9
+ search_params?: string | undefined;
10
10
  }
11
11
  export declare namespace SearchResponse {
12
12
  /** The FHIR resource type identified for the search */
@@ -35,10 +35,10 @@ export declare class SummaryClient {
35
35
  *
36
36
  * @example
37
37
  * await client.summary.createTemplate({
38
- * name: "name",
39
- * example_summary: "Patient John Doe, age 45, presents with hypertension diagnosed on 2024-01-15.",
40
- * target_resources: ["Patient", "Condition", "Observation"],
41
- * mode: "mode"
38
+ * name: "Discharge Summary",
39
+ * 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.",
40
+ * target_resources: ["Patient", "Condition", "MedicationRequest"],
41
+ * mode: "narrative"
42
42
  * })
43
43
  */
44
44
  createTemplate(request: phenoml.summary.CreateSummaryTemplateRequest, requestOptions?: SummaryClient.RequestOptions): core.HttpResponsePromise<phenoml.summary.CreateSummaryTemplateResponse>;
@@ -74,10 +74,10 @@ export declare class SummaryClient {
74
74
  *
75
75
  * @example
76
76
  * await client.summary.updateTemplate("id", {
77
- * name: "name",
78
- * template: "template",
79
- * target_resources: ["target_resources"],
80
- * mode: "mode"
77
+ * name: "Discharge Summary",
78
+ * 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}}.",
79
+ * target_resources: ["Patient", "Encounter", "MedicationRequest"],
80
+ * mode: "narrative"
81
81
  * })
82
82
  */
83
83
  updateTemplate(id: string, request: phenoml.summary.UpdateSummaryTemplateRequest, requestOptions?: SummaryClient.RequestOptions): core.HttpResponsePromise<phenoml.summary.SummaryUpdateTemplateResponse>;
@@ -115,8 +115,73 @@ export declare class SummaryClient {
115
115
  *
116
116
  * @example
117
117
  * await client.summary.create({
118
+ * mode: "narrative",
119
+ * template_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
118
120
  * fhir_resources: {
119
- * resourceType: "resourceType"
121
+ * "resourceType": "Bundle",
122
+ * "type": "collection",
123
+ * "entry": [
124
+ * {
125
+ * "resource": {
126
+ * "resourceType": "Patient",
127
+ * "name": [
128
+ * {
129
+ * "given": [
130
+ * "John"
131
+ * ],
132
+ * "family": "Doe"
133
+ * }
134
+ * ],
135
+ * "gender": "male",
136
+ * "birthDate": "1979-03-15"
137
+ * }
138
+ * },
139
+ * {
140
+ * "resource": {
141
+ * "resourceType": "Condition",
142
+ * "code": {
143
+ * "text": "Type 2 Diabetes Mellitus"
144
+ * },
145
+ * "onsetDateTime": "2024-01-15"
146
+ * }
147
+ * }
148
+ * ]
149
+ * }
150
+ * })
151
+ *
152
+ * @example
153
+ * await client.summary.create({
154
+ * mode: "ips",
155
+ * fhir_resources: {
156
+ * "resourceType": "Bundle",
157
+ * "type": "collection",
158
+ * "entry": [
159
+ * {
160
+ * "resource": {
161
+ * "resourceType": "Patient",
162
+ * "id": "maria-garcia-001",
163
+ * "name": [
164
+ * {
165
+ * "given": [
166
+ * "Maria"
167
+ * ],
168
+ * "family": "Garcia"
169
+ * }
170
+ * ],
171
+ * "gender": "female",
172
+ * "birthDate": "1985-07-22"
173
+ * }
174
+ * },
175
+ * {
176
+ * "resource": {
177
+ * "resourceType": "AllergyIntolerance",
178
+ * "code": {
179
+ * "text": "Penicillin"
180
+ * },
181
+ * "criticality": "high"
182
+ * }
183
+ * }
184
+ * ]
120
185
  * }
121
186
  * })
122
187
  */
@@ -84,10 +84,10 @@ export class SummaryClient {
84
84
  *
85
85
  * @example
86
86
  * await client.summary.createTemplate({
87
- * name: "name",
88
- * example_summary: "Patient John Doe, age 45, presents with hypertension diagnosed on 2024-01-15.",
89
- * target_resources: ["Patient", "Condition", "Observation"],
90
- * mode: "mode"
87
+ * name: "Discharge Summary",
88
+ * 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.",
89
+ * target_resources: ["Patient", "Condition", "MedicationRequest"],
90
+ * mode: "narrative"
91
91
  * })
92
92
  */
93
93
  createTemplate(request, requestOptions) {
@@ -212,10 +212,10 @@ export class SummaryClient {
212
212
  *
213
213
  * @example
214
214
  * await client.summary.updateTemplate("id", {
215
- * name: "name",
216
- * template: "template",
217
- * target_resources: ["target_resources"],
218
- * mode: "mode"
215
+ * name: "Discharge Summary",
216
+ * 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}}.",
217
+ * target_resources: ["Patient", "Encounter", "MedicationRequest"],
218
+ * mode: "narrative"
219
219
  * })
220
220
  */
221
221
  updateTemplate(id, request, requestOptions) {
@@ -346,8 +346,73 @@ export class SummaryClient {
346
346
  *
347
347
  * @example
348
348
  * await client.summary.create({
349
+ * mode: "narrative",
350
+ * template_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
349
351
  * fhir_resources: {
350
- * resourceType: "resourceType"
352
+ * "resourceType": "Bundle",
353
+ * "type": "collection",
354
+ * "entry": [
355
+ * {
356
+ * "resource": {
357
+ * "resourceType": "Patient",
358
+ * "name": [
359
+ * {
360
+ * "given": [
361
+ * "John"
362
+ * ],
363
+ * "family": "Doe"
364
+ * }
365
+ * ],
366
+ * "gender": "male",
367
+ * "birthDate": "1979-03-15"
368
+ * }
369
+ * },
370
+ * {
371
+ * "resource": {
372
+ * "resourceType": "Condition",
373
+ * "code": {
374
+ * "text": "Type 2 Diabetes Mellitus"
375
+ * },
376
+ * "onsetDateTime": "2024-01-15"
377
+ * }
378
+ * }
379
+ * ]
380
+ * }
381
+ * })
382
+ *
383
+ * @example
384
+ * await client.summary.create({
385
+ * mode: "ips",
386
+ * fhir_resources: {
387
+ * "resourceType": "Bundle",
388
+ * "type": "collection",
389
+ * "entry": [
390
+ * {
391
+ * "resource": {
392
+ * "resourceType": "Patient",
393
+ * "id": "maria-garcia-001",
394
+ * "name": [
395
+ * {
396
+ * "given": [
397
+ * "Maria"
398
+ * ],
399
+ * "family": "Garcia"
400
+ * }
401
+ * ],
402
+ * "gender": "female",
403
+ * "birthDate": "1985-07-22"
404
+ * }
405
+ * },
406
+ * {
407
+ * "resource": {
408
+ * "resourceType": "AllergyIntolerance",
409
+ * "code": {
410
+ * "text": "Penicillin"
411
+ * },
412
+ * "criticality": "high"
413
+ * }
414
+ * }
415
+ * ]
351
416
  * }
352
417
  * })
353
418
  */
@@ -1,9 +1,73 @@
1
- import type * as phenoml from "../../../../index.mjs";
2
1
  /**
3
2
  * @example
4
3
  * {
4
+ * mode: "narrative",
5
+ * template_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
5
6
  * fhir_resources: {
6
- * resourceType: "resourceType"
7
+ * "resourceType": "Bundle",
8
+ * "type": "collection",
9
+ * "entry": [
10
+ * {
11
+ * "resource": {
12
+ * "resourceType": "Patient",
13
+ * "name": [
14
+ * {
15
+ * "given": [
16
+ * "John"
17
+ * ],
18
+ * "family": "Doe"
19
+ * }
20
+ * ],
21
+ * "gender": "male",
22
+ * "birthDate": "1979-03-15"
23
+ * }
24
+ * },
25
+ * {
26
+ * "resource": {
27
+ * "resourceType": "Condition",
28
+ * "code": {
29
+ * "text": "Type 2 Diabetes Mellitus"
30
+ * },
31
+ * "onsetDateTime": "2024-01-15"
32
+ * }
33
+ * }
34
+ * ]
35
+ * }
36
+ * }
37
+ *
38
+ * @example
39
+ * {
40
+ * mode: "ips",
41
+ * fhir_resources: {
42
+ * "resourceType": "Bundle",
43
+ * "type": "collection",
44
+ * "entry": [
45
+ * {
46
+ * "resource": {
47
+ * "resourceType": "Patient",
48
+ * "id": "maria-garcia-001",
49
+ * "name": [
50
+ * {
51
+ * "given": [
52
+ * "Maria"
53
+ * ],
54
+ * "family": "Garcia"
55
+ * }
56
+ * ],
57
+ * "gender": "female",
58
+ * "birthDate": "1985-07-22"
59
+ * }
60
+ * },
61
+ * {
62
+ * "resource": {
63
+ * "resourceType": "AllergyIntolerance",
64
+ * "code": {
65
+ * "text": "Penicillin"
66
+ * },
67
+ * "criticality": "high"
68
+ * }
69
+ * }
70
+ * ]
7
71
  * }
8
72
  * }
9
73
  */
@@ -24,7 +88,7 @@ export interface CreateSummaryRequest {
24
88
  * if multiple Patients are present, or if the Patient has no identifiers. Resources are
25
89
  * automatically filtered to only include those referencing the patient.
26
90
  */
27
- fhir_resources: CreateSummaryRequest.FhirResources;
91
+ fhir_resources: Record<string, unknown>;
28
92
  }
29
93
  export declare namespace CreateSummaryRequest {
30
94
  /**
@@ -39,12 +103,4 @@ export declare namespace CreateSummaryRequest {
39
103
  readonly Ips: "ips";
40
104
  };
41
105
  type Mode = (typeof Mode)[keyof typeof Mode];
42
- /**
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.
48
- */
49
- type FhirResources = phenoml.summary.FhirResource | phenoml.summary.FhirBundle;
50
106
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * name: "name",
5
- * example_summary: "Patient John Doe, age 45, presents with hypertension diagnosed on 2024-01-15.",
6
- * target_resources: ["Patient", "Condition", "Observation"],
7
- * mode: "mode"
4
+ * name: "Discharge Summary",
5
+ * 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.",
6
+ * target_resources: ["Patient", "Condition", "MedicationRequest"],
7
+ * mode: "narrative"
8
8
  * }
9
9
  */
10
10
  export interface CreateSummaryTemplateRequest {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * name: "name",
5
- * template: "template",
6
- * target_resources: ["target_resources"],
7
- * mode: "mode"
4
+ * name: "Discharge Summary",
5
+ * 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}}.",
6
+ * target_resources: ["Patient", "Encounter", "MedicationRequest"],
7
+ * mode: "narrative"
8
8
  * }
9
9
  */
10
10
  export interface UpdateSummaryTemplateRequest {
@@ -1,7 +1,5 @@
1
1
  export * from "./CreateSummaryResponse.mjs";
2
2
  export * from "./CreateSummaryTemplateResponse.mjs";
3
- export * from "./FhirBundle.mjs";
4
- export * from "./FhirResource.mjs";
5
3
  export * from "./SummaryDeleteTemplateResponse.mjs";
6
4
  export * from "./SummaryGetTemplateResponse.mjs";
7
5
  export * from "./SummaryListTemplatesResponse.mjs";
@@ -1,7 +1,5 @@
1
1
  export * from "./CreateSummaryResponse.mjs";
2
2
  export * from "./CreateSummaryTemplateResponse.mjs";
3
- export * from "./FhirBundle.mjs";
4
- export * from "./FhirResource.mjs";
5
3
  export * from "./SummaryDeleteTemplateResponse.mjs";
6
4
  export * from "./SummaryGetTemplateResponse.mjs";
7
5
  export * from "./SummaryListTemplatesResponse.mjs";
@@ -29,8 +29,9 @@ export declare class ToolsClient {
29
29
  * await client.tools.createFhirResource({
30
30
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
31
31
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
32
- * resource: "auto",
33
- * text: "Patient John Doe has severe asthma with acute exacerbation"
32
+ * resource: "condition-encounter-diagnosis",
33
+ * text: "Patient has severe persistent asthma with acute exacerbation",
34
+ * provider: "550e8400-e29b-41d4-a716-446655440000"
34
35
  * })
35
36
  */
36
37
  createFhirResource(request: phenoml.tools.Lang2FhirAndCreateRequest, requestOptions?: ToolsClient.RequestOptions): core.HttpResponsePromise<phenoml.tools.Lang2FhirAndCreateResponse>;
@@ -56,6 +57,7 @@ export declare class ToolsClient {
56
57
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
57
58
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
58
59
  * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
60
+ * version: "R4",
59
61
  * provider: "medplum"
60
62
  * })
61
63
  */
@@ -77,7 +79,9 @@ export declare class ToolsClient {
77
79
  * await client.tools.searchFhirResources({
78
80
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
79
81
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
80
- * text: "Find all appointments for patient John Doe next week"
82
+ * text: "Find all appointments for patient John Doe next week",
83
+ * count: 10,
84
+ * provider: "550e8400-e29b-41d4-a716-446655440000"
81
85
  * })
82
86
  */
83
87
  searchFhirResources(request: phenoml.tools.Lang2FhirAndSearchRequest, requestOptions?: ToolsClient.RequestOptions): core.HttpResponsePromise<phenoml.tools.Lang2FhirAndSearchResponse>;
@@ -51,8 +51,9 @@ export class ToolsClient {
51
51
  * await client.tools.createFhirResource({
52
52
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
53
53
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
54
- * resource: "auto",
55
- * text: "Patient John Doe has severe asthma with acute exacerbation"
54
+ * resource: "condition-encounter-diagnosis",
55
+ * text: "Patient has severe persistent asthma with acute exacerbation",
56
+ * provider: "550e8400-e29b-41d4-a716-446655440000"
56
57
  * })
57
58
  */
58
59
  createFhirResource(request, requestOptions) {
@@ -131,6 +132,7 @@ export class ToolsClient {
131
132
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
132
133
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
133
134
  * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
135
+ * version: "R4",
134
136
  * provider: "medplum"
135
137
  * })
136
138
  */
@@ -205,7 +207,9 @@ export class ToolsClient {
205
207
  * await client.tools.searchFhirResources({
206
208
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
207
209
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
208
- * text: "Find all appointments for patient John Doe next week"
210
+ * text: "Find all appointments for patient John Doe next week",
211
+ * count: 10,
212
+ * provider: "550e8400-e29b-41d4-a716-446655440000"
209
213
  * })
210
214
  */
211
215
  searchFhirResources(request, requestOptions) {
@@ -4,6 +4,7 @@
4
4
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
5
5
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
6
6
  * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
7
+ * version: "R4",
7
8
  * provider: "medplum"
8
9
  * }
9
10
  */
@@ -3,8 +3,9 @@
3
3
  * {
4
4
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
5
5
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
6
- * resource: "auto",
7
- * text: "Patient John Doe has severe asthma with acute exacerbation"
6
+ * resource: "condition-encounter-diagnosis",
7
+ * text: "Patient has severe persistent asthma with acute exacerbation",
8
+ * provider: "550e8400-e29b-41d4-a716-446655440000"
8
9
  * }
9
10
  */
10
11
  export interface Lang2FhirAndCreateRequest {
@@ -3,7 +3,9 @@
3
3
  * {
4
4
  * "X-Phenoml-On-Behalf-Of": "Patient/550e8400-e29b-41d4-a716-446655440000",
5
5
  * "X-Phenoml-Fhir-Provider": "550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
6
- * text: "Find all appointments for patient John Doe next week"
6
+ * text: "Find all appointments for patient John Doe next week",
7
+ * count: 10,
8
+ * provider: "550e8400-e29b-41d4-a716-446655440000"
7
9
  * }
8
10
  */
9
11
  export interface Lang2FhirAndSearchRequest {
@@ -0,0 +1,10 @@
1
+ export interface McpServer {
2
+ /** ID of the MCP server */
3
+ id?: string | undefined;
4
+ /** Name of the MCP server */
5
+ name?: string | undefined;
6
+ /** Description of the MCP server */
7
+ description?: string | undefined;
8
+ /** URL of the MCP server */
9
+ mcp_server_url?: string | undefined;
10
+ }
@@ -1,23 +1,19 @@
1
+ import type * as phenoml from "../../../index.mjs";
1
2
  export interface McpServerResponse {
2
- /** Whether the MCP server was created successfully */
3
+ /** Whether the operation succeeded */
3
4
  success?: boolean | undefined;
4
5
  /** Status message */
5
6
  message?: string | undefined;
6
- /** MCP server data */
7
- data?: McpServerResponse.Data | undefined;
8
- }
9
- export declare namespace McpServerResponse {
7
+ /** Single MCP server (returned by GET /tools/mcp-server/{mcp_server_id}). */
8
+ data?: phenoml.tools.McpServer | undefined;
9
+ /**
10
+ * List of MCP servers. Returned by /tools/mcp-server/create (the
11
+ * newly created server) and /tools/mcp-server/list (all servers).
12
+ */
13
+ mcp_servers?: phenoml.tools.McpServer[] | undefined;
10
14
  /**
11
- * MCP server data
15
+ * Tools loaded from the MCP server. Returned by /tools/mcp-server/create
16
+ * alongside the server record, since tool discovery happens at create time.
12
17
  */
13
- interface Data {
14
- /** ID of the MCP server */
15
- id?: string | undefined;
16
- /** Name of the MCP server */
17
- name?: string | undefined;
18
- /** Description of the MCP server */
19
- description?: string | undefined;
20
- /** URL of the MCP server */
21
- mcp_server_url?: string | undefined;
22
- }
18
+ mcp_server_tools?: phenoml.tools.McpServerTool[] | undefined;
23
19
  }