phenoml 12.1.0 → 12.3.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.
@@ -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.1.0",
47
- "User-Agent": "phenoml/12.1.0",
46
+ "X-Fern-SDK-Version": "12.3.0",
47
+ "User-Agent": "phenoml/12.3.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);
@@ -1,5 +1,12 @@
1
1
  export interface ExtractRequestConfig {
2
- /** Method for splitting input text into chunks before code extraction */
2
+ /**
3
+ * Method for splitting input text into chunks before code extraction.
4
+ * * none - Treat the full input as a single chunk.
5
+ * * sentences - Split on sentence boundaries (supports citations).
6
+ * * paragraphs / topics / soap_note - LLM-based chunking.
7
+ * * clinical_ner_extract - Extract clinical concepts (problems, tests,
8
+ * treatments) and use each as a chunk (supports citations).
9
+ */
3
10
  chunking_method?: ExtractRequestConfig.ChunkingMethod | undefined;
4
11
  /**
5
12
  * Maximum number of codes to extract per chunk. If not specified, uses system-specific defaults:
@@ -15,8 +22,14 @@ export interface ExtractRequestConfig {
15
22
  * * none - No validation, returns all candidate codes
16
23
  * * simple - LLM-based validation
17
24
  * * medication_search - LLM-based validation tailored for medication concepts
25
+ * * chunk_code_jaccard_similarity - Token-level Jaccard similarity between source text chunk and code description
18
26
  */
19
27
  validation_method?: ExtractRequestConfig.ValidationMethod | undefined;
28
+ /**
29
+ * Minimum Jaccard similarity (0.0-1.0) for a code to be considered valid
30
+ * when using the "chunk_code_jaccard_similarity" validation method. Ignored by other methods.
31
+ */
32
+ chunk_code_jaccard_similarity_filtering_threshold?: number | undefined;
20
33
  /** Whether to include explanations for why each code was extracted */
21
34
  include_rationale?: boolean | undefined;
22
35
  /** Whether to include ancestor/parent codes in the results */
@@ -26,9 +39,7 @@ export interface ExtractRequestConfig {
26
39
  /**
27
40
  * Whether to include source text citations for each extracted code.
28
41
  * Citations show the exact text spans (with character offsets) that led to each code.
29
- * Only available when using chunking_method: "sentences".
30
- * The "none" method returns full text as one chunk (not useful for citations).
31
- * LLM-based chunking (paragraphs, topics, soap_note) does not support citations.
42
+ * Supported when chunking_method is "sentences" or "clinical_ner_extract".
32
43
  */
33
44
  include_citations?: boolean | undefined;
34
45
  /**
@@ -60,13 +71,21 @@ export interface ExtractRequestConfig {
60
71
  consistency_effort?: ExtractRequestConfig.ConsistencyEffort | undefined;
61
72
  }
62
73
  export declare namespace ExtractRequestConfig {
63
- /** Method for splitting input text into chunks before code extraction */
74
+ /**
75
+ * Method for splitting input text into chunks before code extraction.
76
+ * * none - Treat the full input as a single chunk.
77
+ * * sentences - Split on sentence boundaries (supports citations).
78
+ * * paragraphs / topics / soap_note - LLM-based chunking.
79
+ * * clinical_ner_extract - Extract clinical concepts (problems, tests,
80
+ * treatments) and use each as a chunk (supports citations).
81
+ */
64
82
  const ChunkingMethod: {
65
83
  readonly None: "none";
66
84
  readonly Sentences: "sentences";
67
85
  readonly Paragraphs: "paragraphs";
68
86
  readonly Topics: "topics";
69
87
  readonly SoapNote: "soap_note";
88
+ readonly ClinicalNerExtract: "clinical_ner_extract";
70
89
  };
71
90
  type ChunkingMethod = (typeof ChunkingMethod)[keyof typeof ChunkingMethod];
72
91
  /**
@@ -74,11 +93,13 @@ export declare namespace ExtractRequestConfig {
74
93
  * * none - No validation, returns all candidate codes
75
94
  * * simple - LLM-based validation
76
95
  * * medication_search - LLM-based validation tailored for medication concepts
96
+ * * chunk_code_jaccard_similarity - Token-level Jaccard similarity between source text chunk and code description
77
97
  */
78
98
  const ValidationMethod: {
79
99
  readonly None: "none";
80
100
  readonly Simple: "simple";
81
101
  readonly MedicationSearch: "medication_search";
102
+ readonly ChunkCodeJaccardSimilarity: "chunk_code_jaccard_similarity";
82
103
  };
83
104
  type ValidationMethod = (typeof ValidationMethod)[keyof typeof ValidationMethod];
84
105
  /**
@@ -4,24 +4,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ExtractRequestConfig = void 0;
5
5
  var ExtractRequestConfig;
6
6
  (function (ExtractRequestConfig) {
7
- /** Method for splitting input text into chunks before code extraction */
7
+ /**
8
+ * Method for splitting input text into chunks before code extraction.
9
+ * * none - Treat the full input as a single chunk.
10
+ * * sentences - Split on sentence boundaries (supports citations).
11
+ * * paragraphs / topics / soap_note - LLM-based chunking.
12
+ * * clinical_ner_extract - Extract clinical concepts (problems, tests,
13
+ * treatments) and use each as a chunk (supports citations).
14
+ */
8
15
  ExtractRequestConfig.ChunkingMethod = {
9
16
  None: "none",
10
17
  Sentences: "sentences",
11
18
  Paragraphs: "paragraphs",
12
19
  Topics: "topics",
13
20
  SoapNote: "soap_note",
21
+ ClinicalNerExtract: "clinical_ner_extract",
14
22
  };
15
23
  /**
16
24
  * Method for validating extracted codes:
17
25
  * * none - No validation, returns all candidate codes
18
26
  * * simple - LLM-based validation
19
27
  * * medication_search - LLM-based validation tailored for medication concepts
28
+ * * chunk_code_jaccard_similarity - Token-level Jaccard similarity between source text chunk and code description
20
29
  */
21
30
  ExtractRequestConfig.ValidationMethod = {
22
31
  None: "none",
23
32
  Simple: "simple",
24
33
  MedicationSearch: "medication_search",
34
+ ChunkCodeJaccardSimilarity: "chunk_code_jaccard_similarity",
25
35
  };
26
36
  /**
27
37
  * How much effort to spend ensuring consistent results across repeated requests.
@@ -11,6 +11,8 @@ export interface CreateMultiRequest {
11
11
  version?: string;
12
12
  /** Optional FHIR provider name for provider-specific profiles */
13
13
  provider?: string;
14
+ /** Custom Implementation Guide name. When specified, profiles from this IG are included alongside US Core profiles during resource detection. US Core is always the base layer; custom IG profiles are additive. */
15
+ implementation_guide?: string;
14
16
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
15
17
  detection_effort?: CreateMultiRequest.DetectionEffort;
16
18
  }
@@ -16,6 +16,8 @@ export interface DocumentMultiRequest {
16
16
  content: string;
17
17
  /** Optional FHIR provider name for provider-specific profiles */
18
18
  provider?: string;
19
+ /** Custom Implementation Guide name. When specified, profiles from this IG are included alongside US Core profiles during resource detection. US Core is always the base layer; custom IG profiles are additive. */
20
+ implementation_guide?: string;
19
21
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
20
22
  detection_effort?: DocumentMultiRequest.DetectionEffort;
21
23
  }
@@ -7,4 +7,8 @@
7
7
  export interface ProfileUploadRequest {
8
8
  /** Base64 encoded JSON string of a FHIR StructureDefinition. The profile must include id, url, type, and a snapshot with elements. All metadata (version, resource type, identifier) is derived from the StructureDefinition itself. The lowercase id from the StructureDefinition becomes the profile's lookup key. */
9
9
  profile: string;
10
+ /** Implementation Guide name to group this profile under. Defaults to "custom" if omitted. Cannot be "us_core" (reserved). Use this to organize custom profiles into named IGs that can be referenced when calling create/multi or document/multi endpoints. */
11
+ implementation_guide?: string;
12
+ /** Natural language context that helps the LLM select the right profiles from this implementation guide during resource detection. For example, "When the text mentions phenotypic features or abnormalities, prefer the hpo-observation profile over Condition." This is stored as IG-level metadata and injected into the LLM prompt. Max 2000 characters. Providing this field on any upload will update the context for the entire IG (last write wins). */
13
+ profile_context?: string;
10
14
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "12.1.0";
1
+ export declare const SDK_VERSION = "12.3.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.1.0";
4
+ exports.SDK_VERSION = "12.3.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.1.0",
10
- "User-Agent": "phenoml/12.1.0",
9
+ "X-Fern-SDK-Version": "12.3.0",
10
+ "User-Agent": "phenoml/12.3.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);
@@ -1,5 +1,12 @@
1
1
  export interface ExtractRequestConfig {
2
- /** Method for splitting input text into chunks before code extraction */
2
+ /**
3
+ * Method for splitting input text into chunks before code extraction.
4
+ * * none - Treat the full input as a single chunk.
5
+ * * sentences - Split on sentence boundaries (supports citations).
6
+ * * paragraphs / topics / soap_note - LLM-based chunking.
7
+ * * clinical_ner_extract - Extract clinical concepts (problems, tests,
8
+ * treatments) and use each as a chunk (supports citations).
9
+ */
3
10
  chunking_method?: ExtractRequestConfig.ChunkingMethod | undefined;
4
11
  /**
5
12
  * Maximum number of codes to extract per chunk. If not specified, uses system-specific defaults:
@@ -15,8 +22,14 @@ export interface ExtractRequestConfig {
15
22
  * * none - No validation, returns all candidate codes
16
23
  * * simple - LLM-based validation
17
24
  * * medication_search - LLM-based validation tailored for medication concepts
25
+ * * chunk_code_jaccard_similarity - Token-level Jaccard similarity between source text chunk and code description
18
26
  */
19
27
  validation_method?: ExtractRequestConfig.ValidationMethod | undefined;
28
+ /**
29
+ * Minimum Jaccard similarity (0.0-1.0) for a code to be considered valid
30
+ * when using the "chunk_code_jaccard_similarity" validation method. Ignored by other methods.
31
+ */
32
+ chunk_code_jaccard_similarity_filtering_threshold?: number | undefined;
20
33
  /** Whether to include explanations for why each code was extracted */
21
34
  include_rationale?: boolean | undefined;
22
35
  /** Whether to include ancestor/parent codes in the results */
@@ -26,9 +39,7 @@ export interface ExtractRequestConfig {
26
39
  /**
27
40
  * Whether to include source text citations for each extracted code.
28
41
  * Citations show the exact text spans (with character offsets) that led to each code.
29
- * Only available when using chunking_method: "sentences".
30
- * The "none" method returns full text as one chunk (not useful for citations).
31
- * LLM-based chunking (paragraphs, topics, soap_note) does not support citations.
42
+ * Supported when chunking_method is "sentences" or "clinical_ner_extract".
32
43
  */
33
44
  include_citations?: boolean | undefined;
34
45
  /**
@@ -60,13 +71,21 @@ export interface ExtractRequestConfig {
60
71
  consistency_effort?: ExtractRequestConfig.ConsistencyEffort | undefined;
61
72
  }
62
73
  export declare namespace ExtractRequestConfig {
63
- /** Method for splitting input text into chunks before code extraction */
74
+ /**
75
+ * Method for splitting input text into chunks before code extraction.
76
+ * * none - Treat the full input as a single chunk.
77
+ * * sentences - Split on sentence boundaries (supports citations).
78
+ * * paragraphs / topics / soap_note - LLM-based chunking.
79
+ * * clinical_ner_extract - Extract clinical concepts (problems, tests,
80
+ * treatments) and use each as a chunk (supports citations).
81
+ */
64
82
  const ChunkingMethod: {
65
83
  readonly None: "none";
66
84
  readonly Sentences: "sentences";
67
85
  readonly Paragraphs: "paragraphs";
68
86
  readonly Topics: "topics";
69
87
  readonly SoapNote: "soap_note";
88
+ readonly ClinicalNerExtract: "clinical_ner_extract";
70
89
  };
71
90
  type ChunkingMethod = (typeof ChunkingMethod)[keyof typeof ChunkingMethod];
72
91
  /**
@@ -74,11 +93,13 @@ export declare namespace ExtractRequestConfig {
74
93
  * * none - No validation, returns all candidate codes
75
94
  * * simple - LLM-based validation
76
95
  * * medication_search - LLM-based validation tailored for medication concepts
96
+ * * chunk_code_jaccard_similarity - Token-level Jaccard similarity between source text chunk and code description
77
97
  */
78
98
  const ValidationMethod: {
79
99
  readonly None: "none";
80
100
  readonly Simple: "simple";
81
101
  readonly MedicationSearch: "medication_search";
102
+ readonly ChunkCodeJaccardSimilarity: "chunk_code_jaccard_similarity";
82
103
  };
83
104
  type ValidationMethod = (typeof ValidationMethod)[keyof typeof ValidationMethod];
84
105
  /**
@@ -1,24 +1,34 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  export var ExtractRequestConfig;
3
3
  (function (ExtractRequestConfig) {
4
- /** Method for splitting input text into chunks before code extraction */
4
+ /**
5
+ * Method for splitting input text into chunks before code extraction.
6
+ * * none - Treat the full input as a single chunk.
7
+ * * sentences - Split on sentence boundaries (supports citations).
8
+ * * paragraphs / topics / soap_note - LLM-based chunking.
9
+ * * clinical_ner_extract - Extract clinical concepts (problems, tests,
10
+ * treatments) and use each as a chunk (supports citations).
11
+ */
5
12
  ExtractRequestConfig.ChunkingMethod = {
6
13
  None: "none",
7
14
  Sentences: "sentences",
8
15
  Paragraphs: "paragraphs",
9
16
  Topics: "topics",
10
17
  SoapNote: "soap_note",
18
+ ClinicalNerExtract: "clinical_ner_extract",
11
19
  };
12
20
  /**
13
21
  * Method for validating extracted codes:
14
22
  * * none - No validation, returns all candidate codes
15
23
  * * simple - LLM-based validation
16
24
  * * medication_search - LLM-based validation tailored for medication concepts
25
+ * * chunk_code_jaccard_similarity - Token-level Jaccard similarity between source text chunk and code description
17
26
  */
18
27
  ExtractRequestConfig.ValidationMethod = {
19
28
  None: "none",
20
29
  Simple: "simple",
21
30
  MedicationSearch: "medication_search",
31
+ ChunkCodeJaccardSimilarity: "chunk_code_jaccard_similarity",
22
32
  };
23
33
  /**
24
34
  * How much effort to spend ensuring consistent results across repeated requests.
@@ -11,6 +11,8 @@ export interface CreateMultiRequest {
11
11
  version?: string;
12
12
  /** Optional FHIR provider name for provider-specific profiles */
13
13
  provider?: string;
14
+ /** Custom Implementation Guide name. When specified, profiles from this IG are included alongside US Core profiles during resource detection. US Core is always the base layer; custom IG profiles are additive. */
15
+ implementation_guide?: string;
14
16
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
15
17
  detection_effort?: CreateMultiRequest.DetectionEffort;
16
18
  }
@@ -16,6 +16,8 @@ export interface DocumentMultiRequest {
16
16
  content: string;
17
17
  /** Optional FHIR provider name for provider-specific profiles */
18
18
  provider?: string;
19
+ /** Custom Implementation Guide name. When specified, profiles from this IG are included alongside US Core profiles during resource detection. US Core is always the base layer; custom IG profiles are additive. */
20
+ implementation_guide?: string;
19
21
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
20
22
  detection_effort?: DocumentMultiRequest.DetectionEffort;
21
23
  }
@@ -7,4 +7,8 @@
7
7
  export interface ProfileUploadRequest {
8
8
  /** Base64 encoded JSON string of a FHIR StructureDefinition. The profile must include id, url, type, and a snapshot with elements. All metadata (version, resource type, identifier) is derived from the StructureDefinition itself. The lowercase id from the StructureDefinition becomes the profile's lookup key. */
9
9
  profile: string;
10
+ /** Implementation Guide name to group this profile under. Defaults to "custom" if omitted. Cannot be "us_core" (reserved). Use this to organize custom profiles into named IGs that can be referenced when calling create/multi or document/multi endpoints. */
11
+ implementation_guide?: string;
12
+ /** Natural language context that helps the LLM select the right profiles from this implementation guide during resource detection. For example, "When the text mentions phenotypic features or abnormalities, prefer the hpo-observation profile over Condition." This is stored as IG-level metadata and injected into the LLM prompt. Max 2000 characters. Providing this field on any upload will update the context for the entire IG (last write wins). */
13
+ profile_context?: string;
10
14
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "12.1.0";
1
+ export declare const SDK_VERSION = "12.3.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "12.1.0";
1
+ export const SDK_VERSION = "12.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "12.1.0",
3
+ "version": "12.3.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",