phenoml 12.3.0 → 12.5.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 (38) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/construe/types/CodeCategory.d.ts +9 -0
  3. package/dist/cjs/api/resources/construe/types/CodeCategory.js +3 -0
  4. package/dist/cjs/api/resources/construe/types/ExtractRequestConfig.d.ts +10 -1
  5. package/dist/cjs/api/resources/construe/types/ExtractRequestConfig.js +5 -0
  6. package/dist/cjs/api/resources/construe/types/ExtractedCodeResult.d.ts +5 -0
  7. package/dist/cjs/api/resources/construe/types/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/construe/types/index.js +1 -0
  9. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +1 -1
  10. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +1 -1
  11. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.ts +10 -1
  12. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.js +6 -0
  13. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +9 -0
  14. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.js +6 -0
  15. package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.d.ts +63 -0
  16. package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.js +26 -0
  17. package/dist/cjs/version.d.ts +1 -1
  18. package/dist/cjs/version.js +1 -1
  19. package/dist/esm/BaseClient.mjs +2 -2
  20. package/dist/esm/api/resources/construe/types/CodeCategory.d.mts +9 -0
  21. package/dist/esm/api/resources/construe/types/CodeCategory.mjs +2 -0
  22. package/dist/esm/api/resources/construe/types/ExtractRequestConfig.d.mts +10 -1
  23. package/dist/esm/api/resources/construe/types/ExtractRequestConfig.mjs +5 -0
  24. package/dist/esm/api/resources/construe/types/ExtractedCodeResult.d.mts +5 -0
  25. package/dist/esm/api/resources/construe/types/index.d.mts +1 -0
  26. package/dist/esm/api/resources/construe/types/index.mjs +1 -0
  27. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +1 -1
  28. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +1 -1
  29. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.mts +10 -1
  30. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.mjs +6 -0
  31. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +9 -0
  32. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.mjs +6 -0
  33. package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.d.mts +63 -0
  34. package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.mjs +25 -1
  35. package/dist/esm/version.d.mts +1 -1
  36. package/dist/esm/version.mjs +1 -1
  37. package/package.json +1 -1
  38. package/reference.md +1 -1
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "phenoml",
46
- "X-Fern-SDK-Version": "12.3.0",
47
- "User-Agent": "phenoml/12.3.0",
46
+ "X-Fern-SDK-Version": "12.5.0",
47
+ "User-Agent": "phenoml/12.5.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A higher-level grouping (e.g. HPO category) for an extracted code.
3
+ */
4
+ export interface CodeCategory {
5
+ /** Identifier for the category term (e.g. an HPO URI). */
6
+ uri: string;
7
+ /** Human-readable label for the category term. */
8
+ label: string;
9
+ }
@@ -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 });
@@ -6,6 +6,10 @@ export interface ExtractRequestConfig {
6
6
  * * paragraphs / topics / soap_note - LLM-based chunking.
7
7
  * * clinical_ner_extract - Extract clinical concepts (problems, tests,
8
8
  * treatments) and use each as a chunk (supports citations).
9
+ * * fasthpocr - Extract HPO concepts directly with category
10
+ * annotations (supports citations). Requires `system: HPO`;
11
+ * other systems are rejected. Causes most other config options
12
+ * to be ignored.
9
13
  */
10
14
  chunking_method?: ExtractRequestConfig.ChunkingMethod | undefined;
11
15
  /**
@@ -39,7 +43,7 @@ export interface ExtractRequestConfig {
39
43
  /**
40
44
  * Whether to include source text citations for each extracted code.
41
45
  * Citations show the exact text spans (with character offsets) that led to each code.
42
- * Supported when chunking_method is "sentences" or "clinical_ner_extract".
46
+ * Supported when chunking_method is "sentences", "clinical_ner_extract", or "fasthpocr".
43
47
  */
44
48
  include_citations?: boolean | undefined;
45
49
  /**
@@ -78,6 +82,10 @@ export declare namespace ExtractRequestConfig {
78
82
  * * paragraphs / topics / soap_note - LLM-based chunking.
79
83
  * * clinical_ner_extract - Extract clinical concepts (problems, tests,
80
84
  * treatments) and use each as a chunk (supports citations).
85
+ * * fasthpocr - Extract HPO concepts directly with category
86
+ * annotations (supports citations). Requires `system: HPO`;
87
+ * other systems are rejected. Causes most other config options
88
+ * to be ignored.
81
89
  */
82
90
  const ChunkingMethod: {
83
91
  readonly None: "none";
@@ -86,6 +94,7 @@ export declare namespace ExtractRequestConfig {
86
94
  readonly Topics: "topics";
87
95
  readonly SoapNote: "soap_note";
88
96
  readonly ClinicalNerExtract: "clinical_ner_extract";
97
+ readonly Fasthpocr: "fasthpocr";
89
98
  };
90
99
  type ChunkingMethod = (typeof ChunkingMethod)[keyof typeof ChunkingMethod];
91
100
  /**
@@ -11,6 +11,10 @@ var ExtractRequestConfig;
11
11
  * * paragraphs / topics / soap_note - LLM-based chunking.
12
12
  * * clinical_ner_extract - Extract clinical concepts (problems, tests,
13
13
  * treatments) and use each as a chunk (supports citations).
14
+ * * fasthpocr - Extract HPO concepts directly with category
15
+ * annotations (supports citations). Requires `system: HPO`;
16
+ * other systems are rejected. Causes most other config options
17
+ * to be ignored.
14
18
  */
15
19
  ExtractRequestConfig.ChunkingMethod = {
16
20
  None: "none",
@@ -19,6 +23,7 @@ var ExtractRequestConfig;
19
23
  Topics: "topics",
20
24
  SoapNote: "soap_note",
21
25
  ClinicalNerExtract: "clinical_ner_extract",
26
+ Fasthpocr: "fasthpocr",
22
27
  };
23
28
  /**
24
29
  * Method for validating extracted codes:
@@ -19,4 +19,9 @@ export interface ExtractedCodeResult {
19
19
  * Ancestor codes do not receive citations.
20
20
  */
21
21
  citations?: phenoml.construe.Citation[] | undefined;
22
+ /**
23
+ * Higher-level groupings the extracted code belongs to (e.g. HPO category terms).
24
+ * Only populated by full-extraction chunking methods such as "fasthpocr".
25
+ */
26
+ categories?: phenoml.construe.CodeCategory[] | undefined;
22
27
  }
@@ -1,4 +1,5 @@
1
1
  export * from "./Citation.js";
2
+ export * from "./CodeCategory.js";
2
3
  export * from "./CodeResponse.js";
3
4
  export * from "./CodeSystemDetails.js";
4
5
  export * from "./CodeSystemInfo.js";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Citation.js"), exports);
18
+ __exportStar(require("./CodeCategory.js"), exports);
18
19
  __exportStar(require("./CodeResponse.js"), exports);
19
20
  __exportStar(require("./CodeSystemDetails.js"), exports);
20
21
  __exportStar(require("./CodeSystemInfo.js"), exports);
@@ -43,7 +43,7 @@ export declare class Lang2FhirClient {
43
43
  *
44
44
  * @example
45
45
  * await client.lang2Fhir.createMulti({
46
- * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
46
+ * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
47
47
  * })
48
48
  */
49
49
  createMulti(request: phenoml.lang2Fhir.CreateMultiRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.CreateMultiResponse>;
@@ -130,7 +130,7 @@ class Lang2FhirClient {
130
130
  *
131
131
  * @example
132
132
  * await client.lang2Fhir.createMulti({
133
- * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
133
+ * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
134
134
  * })
135
135
  */
136
136
  createMulti(request, requestOptions) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
4
+ * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
5
5
  * }
6
6
  */
7
7
  export interface CreateMultiRequest {
@@ -15,6 +15,8 @@ export interface CreateMultiRequest {
15
15
  implementation_guide?: string;
16
16
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
17
17
  detection_effort?: CreateMultiRequest.DetectionEffort;
18
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
19
+ validation_method?: CreateMultiRequest.ValidationMethod;
18
20
  }
19
21
  export declare namespace CreateMultiRequest {
20
22
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
@@ -23,4 +25,11 @@ export declare namespace CreateMultiRequest {
23
25
  readonly Deep: "deep";
24
26
  };
25
27
  type DetectionEffort = (typeof DetectionEffort)[keyof typeof DetectionEffort];
28
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
29
+ const ValidationMethod: {
30
+ readonly None: "none";
31
+ readonly Check: "check";
32
+ readonly Fix: "fix";
33
+ };
34
+ type ValidationMethod = (typeof ValidationMethod)[keyof typeof ValidationMethod];
26
35
  }
@@ -9,4 +9,10 @@ var CreateMultiRequest;
9
9
  Standard: "standard",
10
10
  Deep: "deep",
11
11
  };
12
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
13
+ CreateMultiRequest.ValidationMethod = {
14
+ None: "none",
15
+ Check: "check",
16
+ Fix: "fix",
17
+ };
12
18
  })(CreateMultiRequest || (exports.CreateMultiRequest = CreateMultiRequest = {}));
@@ -20,6 +20,8 @@ export interface DocumentMultiRequest {
20
20
  implementation_guide?: string;
21
21
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
22
22
  detection_effort?: DocumentMultiRequest.DetectionEffort;
23
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
24
+ validation_method?: DocumentMultiRequest.ValidationMethod;
23
25
  }
24
26
  export declare namespace DocumentMultiRequest {
25
27
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
@@ -28,4 +30,11 @@ export declare namespace DocumentMultiRequest {
28
30
  readonly Deep: "deep";
29
31
  };
30
32
  type DetectionEffort = (typeof DetectionEffort)[keyof typeof DetectionEffort];
33
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
34
+ const ValidationMethod: {
35
+ readonly None: "none";
36
+ readonly Check: "check";
37
+ readonly Fix: "fix";
38
+ };
39
+ type ValidationMethod = (typeof ValidationMethod)[keyof typeof ValidationMethod];
31
40
  }
@@ -9,4 +9,10 @@ var DocumentMultiRequest;
9
9
  Standard: "standard",
10
10
  Deep: "deep",
11
11
  };
12
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
13
+ DocumentMultiRequest.ValidationMethod = {
14
+ None: "none",
15
+ Check: "check",
16
+ Fix: "fix",
17
+ };
12
18
  })(DocumentMultiRequest || (exports.DocumentMultiRequest = DocumentMultiRequest = {}));
@@ -7,6 +7,8 @@ export interface CreateMultiResponse {
7
7
  bundle?: CreateMultiResponse.Bundle | undefined;
8
8
  /** Summary of extracted resources */
9
9
  resources?: CreateMultiResponse.Resources.Item[] | undefined;
10
+ /** FHIR validation results. Present when validation_method is 'check' or 'fix'. Contains results from each validation pass. For 'check', there is one pass. For 'fix', there may be up to 3 passes as the system attempts auto-correction. */
11
+ validation?: CreateMultiResponse.Validation | undefined;
10
12
  }
11
13
  export declare namespace CreateMultiResponse {
12
14
  /**
@@ -44,4 +46,65 @@ export declare namespace CreateMultiResponse {
44
46
  description?: string | undefined;
45
47
  }
46
48
  }
49
+ /**
50
+ * FHIR validation results. Present when validation_method is 'check' or 'fix'. Contains results from each validation pass. For 'check', there is one pass. For 'fix', there may be up to 3 passes as the system attempts auto-correction.
51
+ */
52
+ interface Validation {
53
+ /** Results from each validation pass, in chronological order */
54
+ passes?: Validation.Passes.Item[] | undefined;
55
+ /** Whether validation errors were successfully fixed by the LLM. Always false for 'check' mode. For 'fix' mode, true if errors were resolved and the returned bundle is the corrected version. */
56
+ fixed?: boolean | undefined;
57
+ /** Total number of validation passes run (1 for check, 1-3 for fix) */
58
+ attempts?: number | undefined;
59
+ /** Human-readable summary of the validation outcome */
60
+ summary?: string | undefined;
61
+ }
62
+ namespace Validation {
63
+ type Passes = Passes.Item[];
64
+ namespace Passes {
65
+ interface Item {
66
+ /** Validation issues found in this pass */
67
+ issues?: Item.Issues.Item[] | undefined;
68
+ /** Validation statistics for this pass */
69
+ stats?: Item.Stats | undefined;
70
+ }
71
+ namespace Item {
72
+ type Issues = Issues.Item[];
73
+ namespace Issues {
74
+ interface Item {
75
+ /** Issue severity level */
76
+ severity?: Item.Severity | undefined;
77
+ /** Issue type code */
78
+ code?: string | undefined;
79
+ /** Human-readable description of the issue */
80
+ diagnostics?: string | undefined;
81
+ /** FHIRPath expression(s) pointing to the issue location */
82
+ expression?: string[] | undefined;
83
+ /** Validation phase that generated this issue */
84
+ source?: string | undefined;
85
+ }
86
+ namespace Item {
87
+ /** Issue severity level */
88
+ const Severity: {
89
+ readonly Fatal: "fatal";
90
+ readonly Error: "error";
91
+ readonly Warning: "warning";
92
+ readonly Information: "information";
93
+ };
94
+ type Severity = (typeof Severity)[keyof typeof Severity];
95
+ }
96
+ }
97
+ /**
98
+ * Validation statistics for this pass
99
+ */
100
+ interface Stats {
101
+ resource_type?: string | undefined;
102
+ profile_url?: string | undefined;
103
+ is_custom_profile?: boolean | undefined;
104
+ /** Validation duration in milliseconds */
105
+ duration_ms?: number | undefined;
106
+ }
107
+ }
108
+ }
109
+ }
47
110
  }
@@ -1,3 +1,29 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CreateMultiResponse = void 0;
5
+ var CreateMultiResponse;
6
+ (function (CreateMultiResponse) {
7
+ let Validation;
8
+ (function (Validation) {
9
+ let Passes;
10
+ (function (Passes) {
11
+ let Item;
12
+ (function (Item_1) {
13
+ let Issues;
14
+ (function (Issues) {
15
+ let Item;
16
+ (function (Item) {
17
+ /** Issue severity level */
18
+ Item.Severity = {
19
+ Fatal: "fatal",
20
+ Error: "error",
21
+ Warning: "warning",
22
+ Information: "information",
23
+ };
24
+ })(Item = Issues.Item || (Issues.Item = {}));
25
+ })(Issues = Item_1.Issues || (Item_1.Issues = {}));
26
+ })(Item = Passes.Item || (Passes.Item = {}));
27
+ })(Passes = Validation.Passes || (Validation.Passes = {}));
28
+ })(Validation = CreateMultiResponse.Validation || (CreateMultiResponse.Validation = {}));
29
+ })(CreateMultiResponse || (exports.CreateMultiResponse = CreateMultiResponse = {}));
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "12.3.0";
1
+ export declare const SDK_VERSION = "12.5.0";
@@ -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 = "12.3.0";
4
+ exports.SDK_VERSION = "12.5.0";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "phenoml",
9
- "X-Fern-SDK-Version": "12.3.0",
10
- "User-Agent": "phenoml/12.3.0",
9
+ "X-Fern-SDK-Version": "12.5.0",
10
+ "User-Agent": "phenoml/12.5.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A higher-level grouping (e.g. HPO category) for an extracted code.
3
+ */
4
+ export interface CodeCategory {
5
+ /** Identifier for the category term (e.g. an HPO URI). */
6
+ uri: string;
7
+ /** Human-readable label for the category term. */
8
+ label: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -6,6 +6,10 @@ export interface ExtractRequestConfig {
6
6
  * * paragraphs / topics / soap_note - LLM-based chunking.
7
7
  * * clinical_ner_extract - Extract clinical concepts (problems, tests,
8
8
  * treatments) and use each as a chunk (supports citations).
9
+ * * fasthpocr - Extract HPO concepts directly with category
10
+ * annotations (supports citations). Requires `system: HPO`;
11
+ * other systems are rejected. Causes most other config options
12
+ * to be ignored.
9
13
  */
10
14
  chunking_method?: ExtractRequestConfig.ChunkingMethod | undefined;
11
15
  /**
@@ -39,7 +43,7 @@ export interface ExtractRequestConfig {
39
43
  /**
40
44
  * Whether to include source text citations for each extracted code.
41
45
  * Citations show the exact text spans (with character offsets) that led to each code.
42
- * Supported when chunking_method is "sentences" or "clinical_ner_extract".
46
+ * Supported when chunking_method is "sentences", "clinical_ner_extract", or "fasthpocr".
43
47
  */
44
48
  include_citations?: boolean | undefined;
45
49
  /**
@@ -78,6 +82,10 @@ export declare namespace ExtractRequestConfig {
78
82
  * * paragraphs / topics / soap_note - LLM-based chunking.
79
83
  * * clinical_ner_extract - Extract clinical concepts (problems, tests,
80
84
  * treatments) and use each as a chunk (supports citations).
85
+ * * fasthpocr - Extract HPO concepts directly with category
86
+ * annotations (supports citations). Requires `system: HPO`;
87
+ * other systems are rejected. Causes most other config options
88
+ * to be ignored.
81
89
  */
82
90
  const ChunkingMethod: {
83
91
  readonly None: "none";
@@ -86,6 +94,7 @@ export declare namespace ExtractRequestConfig {
86
94
  readonly Topics: "topics";
87
95
  readonly SoapNote: "soap_note";
88
96
  readonly ClinicalNerExtract: "clinical_ner_extract";
97
+ readonly Fasthpocr: "fasthpocr";
89
98
  };
90
99
  type ChunkingMethod = (typeof ChunkingMethod)[keyof typeof ChunkingMethod];
91
100
  /**
@@ -8,6 +8,10 @@ export var ExtractRequestConfig;
8
8
  * * paragraphs / topics / soap_note - LLM-based chunking.
9
9
  * * clinical_ner_extract - Extract clinical concepts (problems, tests,
10
10
  * treatments) and use each as a chunk (supports citations).
11
+ * * fasthpocr - Extract HPO concepts directly with category
12
+ * annotations (supports citations). Requires `system: HPO`;
13
+ * other systems are rejected. Causes most other config options
14
+ * to be ignored.
11
15
  */
12
16
  ExtractRequestConfig.ChunkingMethod = {
13
17
  None: "none",
@@ -16,6 +20,7 @@ export var ExtractRequestConfig;
16
20
  Topics: "topics",
17
21
  SoapNote: "soap_note",
18
22
  ClinicalNerExtract: "clinical_ner_extract",
23
+ Fasthpocr: "fasthpocr",
19
24
  };
20
25
  /**
21
26
  * Method for validating extracted codes:
@@ -19,4 +19,9 @@ export interface ExtractedCodeResult {
19
19
  * Ancestor codes do not receive citations.
20
20
  */
21
21
  citations?: phenoml.construe.Citation[] | undefined;
22
+ /**
23
+ * Higher-level groupings the extracted code belongs to (e.g. HPO category terms).
24
+ * Only populated by full-extraction chunking methods such as "fasthpocr".
25
+ */
26
+ categories?: phenoml.construe.CodeCategory[] | undefined;
22
27
  }
@@ -1,4 +1,5 @@
1
1
  export * from "./Citation.mjs";
2
+ export * from "./CodeCategory.mjs";
2
3
  export * from "./CodeResponse.mjs";
3
4
  export * from "./CodeSystemDetails.mjs";
4
5
  export * from "./CodeSystemInfo.mjs";
@@ -1,4 +1,5 @@
1
1
  export * from "./Citation.mjs";
2
+ export * from "./CodeCategory.mjs";
2
3
  export * from "./CodeResponse.mjs";
3
4
  export * from "./CodeSystemDetails.mjs";
4
5
  export * from "./CodeSystemInfo.mjs";
@@ -43,7 +43,7 @@ export declare class Lang2FhirClient {
43
43
  *
44
44
  * @example
45
45
  * await client.lang2Fhir.createMulti({
46
- * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
46
+ * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
47
47
  * })
48
48
  */
49
49
  createMulti(request: phenoml.lang2Fhir.CreateMultiRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.CreateMultiResponse>;
@@ -94,7 +94,7 @@ export class Lang2FhirClient {
94
94
  *
95
95
  * @example
96
96
  * await client.lang2Fhir.createMulti({
97
- * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
97
+ * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
98
98
  * })
99
99
  */
100
100
  createMulti(request, requestOptions) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
4
+ * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
5
5
  * }
6
6
  */
7
7
  export interface CreateMultiRequest {
@@ -15,6 +15,8 @@ export interface CreateMultiRequest {
15
15
  implementation_guide?: string;
16
16
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
17
17
  detection_effort?: CreateMultiRequest.DetectionEffort;
18
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
19
+ validation_method?: CreateMultiRequest.ValidationMethod;
18
20
  }
19
21
  export declare namespace CreateMultiRequest {
20
22
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
@@ -23,4 +25,11 @@ export declare namespace CreateMultiRequest {
23
25
  readonly Deep: "deep";
24
26
  };
25
27
  type DetectionEffort = (typeof DetectionEffort)[keyof typeof DetectionEffort];
28
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
29
+ const ValidationMethod: {
30
+ readonly None: "none";
31
+ readonly Check: "check";
32
+ readonly Fix: "fix";
33
+ };
34
+ type ValidationMethod = (typeof ValidationMethod)[keyof typeof ValidationMethod];
26
35
  }
@@ -6,4 +6,10 @@ export var CreateMultiRequest;
6
6
  Standard: "standard",
7
7
  Deep: "deep",
8
8
  };
9
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
10
+ CreateMultiRequest.ValidationMethod = {
11
+ None: "none",
12
+ Check: "check",
13
+ Fix: "fix",
14
+ };
9
15
  })(CreateMultiRequest || (CreateMultiRequest = {}));
@@ -20,6 +20,8 @@ export interface DocumentMultiRequest {
20
20
  implementation_guide?: string;
21
21
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
22
22
  detection_effort?: DocumentMultiRequest.DetectionEffort;
23
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
24
+ validation_method?: DocumentMultiRequest.ValidationMethod;
23
25
  }
24
26
  export declare namespace DocumentMultiRequest {
25
27
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
@@ -28,4 +30,11 @@ export declare namespace DocumentMultiRequest {
28
30
  readonly Deep: "deep";
29
31
  };
30
32
  type DetectionEffort = (typeof DetectionEffort)[keyof typeof DetectionEffort];
33
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
34
+ const ValidationMethod: {
35
+ readonly None: "none";
36
+ readonly Check: "check";
37
+ readonly Fix: "fix";
38
+ };
39
+ type ValidationMethod = (typeof ValidationMethod)[keyof typeof ValidationMethod];
31
40
  }
@@ -6,4 +6,10 @@ export var DocumentMultiRequest;
6
6
  Standard: "standard",
7
7
  Deep: "deep",
8
8
  };
9
+ /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
10
+ DocumentMultiRequest.ValidationMethod = {
11
+ None: "none",
12
+ Check: "check",
13
+ Fix: "fix",
14
+ };
9
15
  })(DocumentMultiRequest || (DocumentMultiRequest = {}));
@@ -7,6 +7,8 @@ export interface CreateMultiResponse {
7
7
  bundle?: CreateMultiResponse.Bundle | undefined;
8
8
  /** Summary of extracted resources */
9
9
  resources?: CreateMultiResponse.Resources.Item[] | undefined;
10
+ /** FHIR validation results. Present when validation_method is 'check' or 'fix'. Contains results from each validation pass. For 'check', there is one pass. For 'fix', there may be up to 3 passes as the system attempts auto-correction. */
11
+ validation?: CreateMultiResponse.Validation | undefined;
10
12
  }
11
13
  export declare namespace CreateMultiResponse {
12
14
  /**
@@ -44,4 +46,65 @@ export declare namespace CreateMultiResponse {
44
46
  description?: string | undefined;
45
47
  }
46
48
  }
49
+ /**
50
+ * FHIR validation results. Present when validation_method is 'check' or 'fix'. Contains results from each validation pass. For 'check', there is one pass. For 'fix', there may be up to 3 passes as the system attempts auto-correction.
51
+ */
52
+ interface Validation {
53
+ /** Results from each validation pass, in chronological order */
54
+ passes?: Validation.Passes.Item[] | undefined;
55
+ /** Whether validation errors were successfully fixed by the LLM. Always false for 'check' mode. For 'fix' mode, true if errors were resolved and the returned bundle is the corrected version. */
56
+ fixed?: boolean | undefined;
57
+ /** Total number of validation passes run (1 for check, 1-3 for fix) */
58
+ attempts?: number | undefined;
59
+ /** Human-readable summary of the validation outcome */
60
+ summary?: string | undefined;
61
+ }
62
+ namespace Validation {
63
+ type Passes = Passes.Item[];
64
+ namespace Passes {
65
+ interface Item {
66
+ /** Validation issues found in this pass */
67
+ issues?: Item.Issues.Item[] | undefined;
68
+ /** Validation statistics for this pass */
69
+ stats?: Item.Stats | undefined;
70
+ }
71
+ namespace Item {
72
+ type Issues = Issues.Item[];
73
+ namespace Issues {
74
+ interface Item {
75
+ /** Issue severity level */
76
+ severity?: Item.Severity | undefined;
77
+ /** Issue type code */
78
+ code?: string | undefined;
79
+ /** Human-readable description of the issue */
80
+ diagnostics?: string | undefined;
81
+ /** FHIRPath expression(s) pointing to the issue location */
82
+ expression?: string[] | undefined;
83
+ /** Validation phase that generated this issue */
84
+ source?: string | undefined;
85
+ }
86
+ namespace Item {
87
+ /** Issue severity level */
88
+ const Severity: {
89
+ readonly Fatal: "fatal";
90
+ readonly Error: "error";
91
+ readonly Warning: "warning";
92
+ readonly Information: "information";
93
+ };
94
+ type Severity = (typeof Severity)[keyof typeof Severity];
95
+ }
96
+ }
97
+ /**
98
+ * Validation statistics for this pass
99
+ */
100
+ interface Stats {
101
+ resource_type?: string | undefined;
102
+ profile_url?: string | undefined;
103
+ is_custom_profile?: boolean | undefined;
104
+ /** Validation duration in milliseconds */
105
+ duration_ms?: number | undefined;
106
+ }
107
+ }
108
+ }
109
+ }
47
110
  }
@@ -1,2 +1,26 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var CreateMultiResponse;
3
+ (function (CreateMultiResponse) {
4
+ let Validation;
5
+ (function (Validation) {
6
+ let Passes;
7
+ (function (Passes) {
8
+ let Item;
9
+ (function (Item_1) {
10
+ let Issues;
11
+ (function (Issues) {
12
+ let Item;
13
+ (function (Item) {
14
+ /** Issue severity level */
15
+ Item.Severity = {
16
+ Fatal: "fatal",
17
+ Error: "error",
18
+ Warning: "warning",
19
+ Information: "information",
20
+ };
21
+ })(Item = Issues.Item || (Issues.Item = {}));
22
+ })(Issues = Item_1.Issues || (Item_1.Issues = {}));
23
+ })(Item = Passes.Item || (Passes.Item = {}));
24
+ })(Passes = Validation.Passes || (Validation.Passes = {}));
25
+ })(Validation = CreateMultiResponse.Validation || (CreateMultiResponse.Validation = {}));
26
+ })(CreateMultiResponse || (CreateMultiResponse = {}));
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "12.3.0";
1
+ export declare const SDK_VERSION = "12.5.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "12.3.0";
1
+ export const SDK_VERSION = "12.5.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "12.3.0",
3
+ "version": "12.5.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -3256,7 +3256,7 @@ Resources are linked with proper references (e.g., Conditions reference the Pati
3256
3256
 
3257
3257
  ```typescript
3258
3258
  await client.lang2Fhir.createMulti({
3259
- text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
3259
+ text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
3260
3260
  });
3261
3261
 
3262
3262
  ```