@clinia/context-engine-js 0.7.0-rc.3 → 0.7.0-rc.5

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.
@@ -691,13 +691,7 @@ export interface components {
691
691
  data: {
692
692
  /** @description Caller-assigned identifier used in all REST API routes. */
693
693
  registryKey: string;
694
- /** @description Demographic data extracted from the ingested record. Null if no patient resource was found during ingestion. */
695
- patient: {
696
- /** @description Internal patient ID extracted from the ingested record (e.g., FHIR Patient.id). Used in VFS paths. */
697
- id: string;
698
- /** @description Patient display name extracted from the ingested record. */
699
- name: string;
700
- } | null;
694
+ patient: components["schemas"]["PatientDemographics"];
701
695
  }[];
702
696
  /** @description Pagination metadata for the returned page. */
703
697
  meta: {
@@ -709,6 +703,13 @@ export interface components {
709
703
  perPage: number;
710
704
  };
711
705
  };
706
+ /** @description Demographic data extracted from the ingested record. Null if no patient resource was found during ingestion. */
707
+ PatientDemographics: {
708
+ /** @description Internal patient ID extracted from the ingested record (e.g., FHIR Patient.id). Used in VFS paths. */
709
+ id: string;
710
+ /** @description Patient display name extracted from the ingested record. */
711
+ name: string;
712
+ } | null;
712
713
  /** @description Demographic metadata and pipeline stats for a single patient. */
713
714
  PatientDetail: {
714
715
  /** @description Internal patient ID extracted from the ingested record. Used in VFS paths. */
@@ -1086,8 +1087,13 @@ export interface components {
1086
1087
  content: string;
1087
1088
  };
1088
1089
  /** @description A node in the patient context graph. */
1089
- Node: {
1090
- /** @enum {string} */
1090
+ Node: components["schemas"]["ExtractedFactNode"] | components["schemas"]["FactNode"] | components["schemas"]["ExtractedNarrativeNode"] | components["schemas"]["NarrativePassageNode"] | components["schemas"]["NarrativeNode"] | components["schemas"]["LearnedMemoryNode"] | components["schemas"]["ExtractedClinicalEventNode"];
1091
+ /** @description An `extracted_fact` node in the patient context graph. */
1092
+ ExtractedFactNode: {
1093
+ /**
1094
+ * @description discriminator enum property added by openapi-typescript
1095
+ * @enum {string}
1096
+ */
1091
1097
  type: "extracted_fact";
1092
1098
  /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
1093
1099
  id: string;
@@ -1095,7 +1101,7 @@ export interface components {
1095
1101
  createdAt: string;
1096
1102
  /** @description ISO 8601 timestamp when this node was last updated. */
1097
1103
  updatedAt: string;
1098
- /** @description Type-specific attributes of the `extracted_fact` node. */
1104
+ /** @description Type-specific attributes of an `extracted_fact` node. */
1099
1105
  payload: {
1100
1106
  /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
1101
1107
  display: string;
@@ -1557,8 +1563,13 @@ export interface components {
1557
1563
  /** @description The ingestion request that introduced this row. */
1558
1564
  ingestionId: string;
1559
1565
  };
1560
- } | {
1561
- /** @enum {string} */
1566
+ };
1567
+ /** @description A `fact` node in the patient context graph. */
1568
+ FactNode: {
1569
+ /**
1570
+ * @description discriminator enum property added by openapi-typescript
1571
+ * @enum {string}
1572
+ */
1562
1573
  type: "fact";
1563
1574
  /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
1564
1575
  id: string;
@@ -1566,7 +1577,7 @@ export interface components {
1566
1577
  createdAt: string;
1567
1578
  /** @description ISO 8601 timestamp when this node was last updated. */
1568
1579
  updatedAt: string;
1569
- /** @description Type-specific attributes of the `fact` node. */
1580
+ /** @description Type-specific attributes of a `fact` node. */
1570
1581
  payload: {
1571
1582
  /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
1572
1583
  display: string;
@@ -1908,8 +1919,33 @@ export interface components {
1908
1919
  }[];
1909
1920
  fieldVerdicts: components["schemas"]["FactConflicts"];
1910
1921
  };
1911
- } | {
1912
- /** @enum {string} */
1922
+ };
1923
+ /** @description One verdict per field decided across the members, keyed by the field it settled. A field every member agreed on still carries a verdict, with an empty `conflict`. */
1924
+ FactConflicts: {
1925
+ [key: string]: {
1926
+ picked: components["schemas"]["ScoredFactMember"];
1927
+ /** @description Members that carried the same value as the picked one. */
1928
+ agreed: components["schemas"]["ScoredFactMember"][];
1929
+ /** @description Members that carried a different value. */
1930
+ conflict: (components["schemas"]["ScoredFactMember"] & {
1931
+ /** @description The value this member lost the field with — null when it carried nothing. Untyped: its type is the field's own. */
1932
+ value?: unknown;
1933
+ })[];
1934
+ };
1935
+ };
1936
+ /** @description One member of a fact's cluster, as a field's verdict names it. */
1937
+ ScoredFactMember: {
1938
+ /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
1939
+ extractedFactId: string;
1940
+ /** @description Score this member was ranked with when the field was decided. */
1941
+ score: number;
1942
+ };
1943
+ /** @description An `extracted_narrative` node in the patient context graph. */
1944
+ ExtractedNarrativeNode: {
1945
+ /**
1946
+ * @description discriminator enum property added by openapi-typescript
1947
+ * @enum {string}
1948
+ */
1913
1949
  type: "extracted_narrative";
1914
1950
  /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
1915
1951
  id: string;
@@ -1917,7 +1953,7 @@ export interface components {
1917
1953
  createdAt: string;
1918
1954
  /** @description ISO 8601 timestamp when this node was last updated. */
1919
1955
  updatedAt: string;
1920
- /** @description Type-specific attributes of the `extracted_narrative` node. */
1956
+ /** @description Type-specific attributes of an `extracted_narrative` node. */
1921
1957
  payload: {
1922
1958
  /** @description Deterministic human-readable label from the source, or null when the source provides none. */
1923
1959
  summary: string | null;
@@ -1948,8 +1984,13 @@ export interface components {
1948
1984
  /** @description The ingestion request that introduced this row. */
1949
1985
  ingestionId: string;
1950
1986
  };
1951
- } | {
1952
- /** @enum {string} */
1987
+ };
1988
+ /** @description A `narrative_passage` node in the patient context graph. */
1989
+ NarrativePassageNode: {
1990
+ /**
1991
+ * @description discriminator enum property added by openapi-typescript
1992
+ * @enum {string}
1993
+ */
1953
1994
  type: "narrative_passage";
1954
1995
  /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
1955
1996
  id: string;
@@ -1957,7 +1998,7 @@ export interface components {
1957
1998
  createdAt: string;
1958
1999
  /** @description ISO 8601 timestamp when this node was last updated. */
1959
2000
  updatedAt: string;
1960
- /** @description Type-specific attributes of the `narrative_passage` node. */
2001
+ /** @description Type-specific attributes of a `narrative_passage` node. */
1961
2002
  payload: {
1962
2003
  /** @description Id of the `extracted_narrative` node this passage was rendered from (`en_...`). */
1963
2004
  extractedNarrativeId: string;
@@ -1970,8 +2011,13 @@ export interface components {
1970
2011
  /** @description End offset (exclusive) within its extracted narrative's rendered content. */
1971
2012
  offsetEnd: number;
1972
2013
  };
1973
- } | {
1974
- /** @enum {string} */
2014
+ };
2015
+ /** @description A `narrative` node in the patient context graph. */
2016
+ NarrativeNode: {
2017
+ /**
2018
+ * @description discriminator enum property added by openapi-typescript
2019
+ * @enum {string}
2020
+ */
1975
2021
  type: "narrative";
1976
2022
  /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
1977
2023
  id: string;
@@ -1979,7 +2025,7 @@ export interface components {
1979
2025
  createdAt: string;
1980
2026
  /** @description ISO 8601 timestamp when this node was last updated. */
1981
2027
  updatedAt: string;
1982
- /** @description Type-specific attributes of the `narrative` node. */
2028
+ /** @description Type-specific attributes of a `narrative` node. */
1983
2029
  payload: {
1984
2030
  /** @description Latest defined member clinical time, or null when no member carries one. */
1985
2031
  effectiveAt: string | null;
@@ -2017,8 +2063,13 @@ export interface components {
2017
2063
  /** @description Clinical-event types this narrative plausibly concerns. */
2018
2064
  boundEventTypes: ("encounter" | "observation" | "procedure" | "medication_event")[];
2019
2065
  };
2020
- } | {
2021
- /** @enum {string} */
2066
+ };
2067
+ /** @description A `learned_memory` node in the patient context graph. */
2068
+ LearnedMemoryNode: {
2069
+ /**
2070
+ * @description discriminator enum property added by openapi-typescript
2071
+ * @enum {string}
2072
+ */
2022
2073
  type: "learned_memory";
2023
2074
  /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
2024
2075
  id: string;
@@ -2026,7 +2077,7 @@ export interface components {
2026
2077
  createdAt: string;
2027
2078
  /** @description ISO 8601 timestamp when this node was last updated. */
2028
2079
  updatedAt: string;
2029
- /** @description Type-specific attributes of the `learned_memory` node. */
2080
+ /** @description Type-specific attributes of a `learned_memory` node. */
2030
2081
  payload: {
2031
2082
  /**
2032
2083
  * @description The memory taxonomy — symptom | adherence | concern | preference.
@@ -2038,8 +2089,13 @@ export interface components {
2038
2089
  /** @description Provenance: the id of the session that produced this memory. */
2039
2090
  sessionId: string;
2040
2091
  };
2041
- } | {
2042
- /** @enum {string} */
2092
+ };
2093
+ /** @description An `extracted_clinical_event` node in the patient context graph. */
2094
+ ExtractedClinicalEventNode: {
2095
+ /**
2096
+ * @description discriminator enum property added by openapi-typescript
2097
+ * @enum {string}
2098
+ */
2043
2099
  type: "extracted_clinical_event";
2044
2100
  /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
2045
2101
  id: string;
@@ -2047,7 +2103,7 @@ export interface components {
2047
2103
  createdAt: string;
2048
2104
  /** @description ISO 8601 timestamp when this node was last updated. */
2049
2105
  updatedAt: string;
2050
- /** @description Type-specific attributes of the `extracted_clinical_event` node. */
2106
+ /** @description Type-specific attributes of an `extracted_clinical_event` node. */
2051
2107
  payload: {
2052
2108
  /** @enum {string} */
2053
2109
  type: "encounter";
@@ -2259,26 +2315,6 @@ export interface components {
2259
2315
  };
2260
2316
  };
2261
2317
  };
2262
- /** @description One verdict per field decided across the members, keyed by the field it settled. A field every member agreed on still carries a verdict, with an empty `conflict`. */
2263
- FactConflicts: {
2264
- [key: string]: {
2265
- picked: components["schemas"]["ScoredFactMember"];
2266
- /** @description Members that carried the same value as the picked one. */
2267
- agreed: components["schemas"]["ScoredFactMember"][];
2268
- /** @description Members that carried a different value. */
2269
- conflict: (components["schemas"]["ScoredFactMember"] & {
2270
- /** @description The value this member lost the field with — null when it carried nothing. Untyped: its type is the field's own. */
2271
- value?: unknown;
2272
- })[];
2273
- };
2274
- };
2275
- /** @description One member of a fact's cluster, as a field's verdict names it. */
2276
- ScoredFactMember: {
2277
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
2278
- extractedFactId: string;
2279
- /** @description Score this member was ranked with when the field was decided. */
2280
- score: number;
2281
- };
2282
2318
  /** @description A page of nodes of one type from the patient context graph. */
2283
2319
  NodeList: {
2284
2320
  /** @description The requested page of items. */
@@ -2294,8 +2330,13 @@ export interface components {
2294
2330
  };
2295
2331
  };
2296
2332
  /** @description An edge in the patient context graph. */
2297
- Edge: {
2298
- /** @enum {string} */
2333
+ Edge: components["schemas"]["ResolutionDecisionEdge"] | components["schemas"]["ResolvesToEdge"] | components["schemas"]["ChunkedIntoEdge"] | components["schemas"]["RelationshipEdge"];
2334
+ /** @description A `resolution_decision` edge in the patient context graph. */
2335
+ ResolutionDecisionEdge: {
2336
+ /**
2337
+ * @description discriminator enum property added by openapi-typescript
2338
+ * @enum {string}
2339
+ */
2299
2340
  type: "resolution_decision";
2300
2341
  /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
2301
2342
  id: string;
@@ -2305,7 +2346,7 @@ export interface components {
2305
2346
  updatedAt: string;
2306
2347
  from: components["schemas"]["NodeRef"];
2307
2348
  to: components["schemas"]["NodeRef"] & unknown;
2308
- /** @description Type-specific attributes of the `resolution_decision` edge. */
2349
+ /** @description Type-specific attributes of a `resolution_decision` edge. */
2309
2350
  payload: {
2310
2351
  /**
2311
2352
  * @description The decided outcome. `continue` is a control-flow signal for stop rules and is never recorded here.
@@ -2364,6 +2405,99 @@ export interface components {
2364
2405
  codeA: string;
2365
2406
  /** @description The code from entity B. */
2366
2407
  codeB: string;
2408
+ } | {
2409
+ /** @enum {string} */
2410
+ layer: "concept-identity";
2411
+ a: {
2412
+ /** @description The best candidate's base-ingredient concept ids — more than one for a combination product. */
2413
+ conceptIds: string[];
2414
+ /** @description The best candidate's salt/ester-grain concept ids. Empty when the match carries no precise grain. */
2415
+ preciseConceptIds: string[];
2416
+ /**
2417
+ * @description The cascade rung that grounded this side.
2418
+ * @enum {string}
2419
+ */
2420
+ rung: "code" | "crosswalk" | "exact-name" | "normalized-name";
2421
+ score: number;
2422
+ compositionId: string;
2423
+ };
2424
+ b: {
2425
+ /** @description The best candidate's base-ingredient concept ids — more than one for a combination product. */
2426
+ conceptIds: string[];
2427
+ /** @description The best candidate's salt/ester-grain concept ids. Empty when the match carries no precise grain. */
2428
+ preciseConceptIds: string[];
2429
+ /**
2430
+ * @description The cascade rung that grounded this side.
2431
+ * @enum {string}
2432
+ */
2433
+ rung: "code" | "crosswalk" | "exact-name" | "normalized-name";
2434
+ score: number;
2435
+ compositionId: string;
2436
+ };
2437
+ /** @enum {string} */
2438
+ kind: "concept-identity-match";
2439
+ } | {
2440
+ /** @enum {string} */
2441
+ layer: "concept-identity";
2442
+ a: {
2443
+ /** @description The best candidate's base-ingredient concept ids — more than one for a combination product. */
2444
+ conceptIds: string[];
2445
+ /** @description The best candidate's salt/ester-grain concept ids. Empty when the match carries no precise grain. */
2446
+ preciseConceptIds: string[];
2447
+ /**
2448
+ * @description The cascade rung that grounded this side.
2449
+ * @enum {string}
2450
+ */
2451
+ rung: "code" | "crosswalk" | "exact-name" | "normalized-name";
2452
+ score: number;
2453
+ compositionId: string;
2454
+ };
2455
+ b: {
2456
+ /** @description The best candidate's base-ingredient concept ids — more than one for a combination product. */
2457
+ conceptIds: string[];
2458
+ /** @description The best candidate's salt/ester-grain concept ids. Empty when the match carries no precise grain. */
2459
+ preciseConceptIds: string[];
2460
+ /**
2461
+ * @description The cascade rung that grounded this side.
2462
+ * @enum {string}
2463
+ */
2464
+ rung: "code" | "crosswalk" | "exact-name" | "normalized-name";
2465
+ score: number;
2466
+ compositionId: string;
2467
+ };
2468
+ /** @enum {string} */
2469
+ kind: "concept-identity-partial-match";
2470
+ } | {
2471
+ /** @enum {string} */
2472
+ layer: "concept-identity";
2473
+ a: {
2474
+ /** @description The best candidate's base-ingredient concept ids — more than one for a combination product. */
2475
+ conceptIds: string[];
2476
+ /** @description The best candidate's salt/ester-grain concept ids. Empty when the match carries no precise grain. */
2477
+ preciseConceptIds: string[];
2478
+ /**
2479
+ * @description The cascade rung that grounded this side.
2480
+ * @enum {string}
2481
+ */
2482
+ rung: "code" | "crosswalk" | "exact-name" | "normalized-name";
2483
+ score: number;
2484
+ compositionId: string;
2485
+ };
2486
+ b: {
2487
+ /** @description The best candidate's base-ingredient concept ids — more than one for a combination product. */
2488
+ conceptIds: string[];
2489
+ /** @description The best candidate's salt/ester-grain concept ids. Empty when the match carries no precise grain. */
2490
+ preciseConceptIds: string[];
2491
+ /**
2492
+ * @description The cascade rung that grounded this side.
2493
+ * @enum {string}
2494
+ */
2495
+ rung: "code" | "crosswalk" | "exact-name" | "normalized-name";
2496
+ score: number;
2497
+ compositionId: string;
2498
+ };
2499
+ /** @enum {string} */
2500
+ kind: "concept-identity-mismatch";
2367
2501
  } | {
2368
2502
  /** @enum {string} */
2369
2503
  kind: "field-similarity";
@@ -2481,8 +2615,23 @@ export interface components {
2481
2615
  reasoning: string;
2482
2616
  })[];
2483
2617
  };
2484
- } | {
2485
- /** @enum {string} */
2618
+ };
2619
+ /** @description The node this edge originates from. */
2620
+ NodeRef: {
2621
+ /** @description Id of the referenced node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
2622
+ id: string;
2623
+ /**
2624
+ * @description Node type of the referenced node.
2625
+ * @enum {string}
2626
+ */
2627
+ type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
2628
+ };
2629
+ /** @description A `resolves_to` edge in the patient context graph. */
2630
+ ResolvesToEdge: {
2631
+ /**
2632
+ * @description discriminator enum property added by openapi-typescript
2633
+ * @enum {string}
2634
+ */
2486
2635
  type: "resolves_to";
2487
2636
  /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
2488
2637
  id: string;
@@ -2492,10 +2641,15 @@ export interface components {
2492
2641
  updatedAt: string;
2493
2642
  from: components["schemas"]["NodeRef"];
2494
2643
  to: components["schemas"]["NodeRef"] & unknown;
2495
- /** @description Type-specific attributes of the `resolves_to` edge. */
2644
+ /** @description Type-specific attributes of a `resolves_to` edge. */
2496
2645
  payload: Record<string, never>;
2497
- } | {
2498
- /** @enum {string} */
2646
+ };
2647
+ /** @description A `chunked_into` edge in the patient context graph. */
2648
+ ChunkedIntoEdge: {
2649
+ /**
2650
+ * @description discriminator enum property added by openapi-typescript
2651
+ * @enum {string}
2652
+ */
2499
2653
  type: "chunked_into";
2500
2654
  /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
2501
2655
  id: string;
@@ -2505,10 +2659,15 @@ export interface components {
2505
2659
  updatedAt: string;
2506
2660
  from: components["schemas"]["NodeRef"];
2507
2661
  to: components["schemas"]["NodeRef"] & unknown;
2508
- /** @description Type-specific attributes of the `chunked_into` edge. */
2662
+ /** @description Type-specific attributes of a `chunked_into` edge. */
2509
2663
  payload: Record<string, never>;
2510
- } | {
2511
- /** @enum {string} */
2664
+ };
2665
+ /** @description A `relationship` edge in the patient context graph. */
2666
+ RelationshipEdge: {
2667
+ /**
2668
+ * @description discriminator enum property added by openapi-typescript
2669
+ * @enum {string}
2670
+ */
2512
2671
  type: "relationship";
2513
2672
  /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
2514
2673
  id: string;
@@ -2518,7 +2677,7 @@ export interface components {
2518
2677
  updatedAt: string;
2519
2678
  from: components["schemas"]["NodeRef"];
2520
2679
  to: components["schemas"]["NodeRef"] & unknown;
2521
- /** @description Type-specific attributes of the `relationship` edge. */
2680
+ /** @description Type-specific attributes of a `relationship` edge. */
2522
2681
  payload: {
2523
2682
  type: string;
2524
2683
  attributes?: {
@@ -2530,16 +2689,6 @@ export interface components {
2530
2689
  reasoning?: string;
2531
2690
  };
2532
2691
  };
2533
- /** @description The node this edge originates from. */
2534
- NodeRef: {
2535
- /** @description Id of the referenced node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
2536
- id: string;
2537
- /**
2538
- * @description Node type of the referenced node.
2539
- * @enum {string}
2540
- */
2541
- type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
2542
- };
2543
2692
  /** @description A page of edges of one type from the patient context graph. */
2544
2693
  EdgeList: {
2545
2694
  /** @description The requested page of items. */
@@ -2557,478 +2706,7 @@ export interface components {
2557
2706
  /** @description A page of `extracted_fact` nodes from the patient context graph. */
2558
2707
  ExtractedFactNodeList: {
2559
2708
  /** @description The requested page of items. */
2560
- data: {
2561
- /** @enum {string} */
2562
- type: "extracted_fact";
2563
- /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
2564
- id: string;
2565
- /** @description ISO 8601 timestamp when this node was first created. */
2566
- createdAt: string;
2567
- /** @description ISO 8601 timestamp when this node was last updated. */
2568
- updatedAt: string;
2569
- /** @description Type-specific attributes of the `extracted_fact` node. */
2570
- payload: {
2571
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2572
- display: string;
2573
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2574
- codes?: {
2575
- system: string;
2576
- code: string;
2577
- display?: string;
2578
- }[];
2579
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2580
- date?: string;
2581
- /** @description Temporal bounds of the fact's validity. */
2582
- effectivePeriod?: {
2583
- /** @description ISO date when this fact became active. */
2584
- start?: string;
2585
- /** @description ISO date when this fact ended or was resolved. */
2586
- end?: string;
2587
- };
2588
- /** @enum {string} */
2589
- type: "condition";
2590
- /**
2591
- * @description Clinical status of the condition. active = currently present; resolved = no longer present; inactive = present but not actively managed.
2592
- * @enum {string}
2593
- */
2594
- status: "active" | "resolved" | "inactive" | "unknown";
2595
- /** @description ISO date when the condition first started, from Condition.onsetPeriod.start or onsetDateTime. */
2596
- onsetDate?: string;
2597
- /** @description Where this fact was extracted from. */
2598
- source: {
2599
- /**
2600
- * @description Format of the source record.
2601
- * @enum {string}
2602
- */
2603
- type: "fhir" | "cda" | "document" | "patient-reported";
2604
- /** @description System or process that produced the source record. */
2605
- origin: string;
2606
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2607
- ref: string;
2608
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2609
- recordedAt: string | null;
2610
- /** @description ISO 8601 timestamp when this record was ingested. */
2611
- ingestedAt: string;
2612
- };
2613
- /** @description The ingestion request that introduced this row. */
2614
- ingestionId: string;
2615
- } | {
2616
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2617
- display: string;
2618
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2619
- codes?: {
2620
- system: string;
2621
- code: string;
2622
- display?: string;
2623
- }[];
2624
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2625
- date?: string;
2626
- /** @description Temporal bounds of the fact's validity. */
2627
- effectivePeriod?: {
2628
- /** @description ISO date when this fact became active. */
2629
- start?: string;
2630
- /** @description ISO date when this fact ended or was resolved. */
2631
- end?: string;
2632
- };
2633
- /** @enum {string} */
2634
- type: "medication";
2635
- /**
2636
- * @description Current regimen status. active = currently taking; on-hold = temporarily paused; completed = full course finished as planned; discontinued = stopped early or cancelled; unknown = indeterminate.
2637
- * @enum {string}
2638
- */
2639
- status: "active" | "on-hold" | "completed" | "discontinued" | "unknown";
2640
- /** @description Free-text dosage instructions from MedicationStatement.dosage[].additionalInstruction[].text, e.g. 'Take 1 tablet by mouth daily for hypertension.' */
2641
- dosageInstructions?: string;
2642
- /** @description Route of administration from dosage[].route, e.g. 'Oral', 'IV', 'Topical'. */
2643
- route?: string;
2644
- /** @description Where this fact was extracted from. */
2645
- source: {
2646
- /**
2647
- * @description Format of the source record.
2648
- * @enum {string}
2649
- */
2650
- type: "fhir" | "cda" | "document" | "patient-reported";
2651
- /** @description System or process that produced the source record. */
2652
- origin: string;
2653
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2654
- ref: string;
2655
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2656
- recordedAt: string | null;
2657
- /** @description ISO 8601 timestamp when this record was ingested. */
2658
- ingestedAt: string;
2659
- };
2660
- /** @description The ingestion request that introduced this row. */
2661
- ingestionId: string;
2662
- } | {
2663
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2664
- display: string;
2665
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2666
- codes?: {
2667
- system: string;
2668
- code: string;
2669
- display?: string;
2670
- }[];
2671
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2672
- date?: string;
2673
- /** @description Temporal bounds of the fact's validity. */
2674
- effectivePeriod?: {
2675
- /** @description ISO date when this fact became active. */
2676
- start?: string;
2677
- /** @description ISO date when this fact ended or was resolved. */
2678
- end?: string;
2679
- };
2680
- /** @enum {string} */
2681
- type: "allergy";
2682
- /**
2683
- * @description Clinical status of the allergy record. active = allergy is current; inactive = no longer considered relevant; entered-in-error = recorded by mistake.
2684
- * @enum {string}
2685
- */
2686
- status: "active" | "inactive" | "entered-in-error";
2687
- /**
2688
- * @description Worst-case potential harm from exposure. high = life-threatening (e.g. anaphylaxis); low = non-life-threatening (e.g. rash).
2689
- * @enum {string}
2690
- */
2691
- criticality?: "low" | "high" | "unable-to-assess";
2692
- /** @description Substance category from AllergyIntolerance.category, e.g. ['medication'], ['food', 'environment']. */
2693
- category?: string[];
2694
- /** @description Observed reaction manifestations as display strings from reaction[].manifestation, e.g. ['Swelling', 'Anaphylaxis']. */
2695
- reactions?: string[];
2696
- /** @description Where this fact was extracted from. */
2697
- source: {
2698
- /**
2699
- * @description Format of the source record.
2700
- * @enum {string}
2701
- */
2702
- type: "fhir" | "cda" | "document" | "patient-reported";
2703
- /** @description System or process that produced the source record. */
2704
- origin: string;
2705
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2706
- ref: string;
2707
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2708
- recordedAt: string | null;
2709
- /** @description ISO 8601 timestamp when this record was ingested. */
2710
- ingestedAt: string;
2711
- };
2712
- /** @description The ingestion request that introduced this row. */
2713
- ingestionId: string;
2714
- } | {
2715
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2716
- display: string;
2717
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2718
- codes?: {
2719
- system: string;
2720
- code: string;
2721
- display?: string;
2722
- }[];
2723
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2724
- date?: string;
2725
- /** @description Temporal bounds of the fact's validity. */
2726
- effectivePeriod?: {
2727
- /** @description ISO date when this fact became active. */
2728
- start?: string;
2729
- /** @description ISO date when this fact ended or was resolved. */
2730
- end?: string;
2731
- };
2732
- /** @enum {string} */
2733
- type: "family_history";
2734
- /** @description Relationship of the relative to the patient from FamilyMemberHistory.relationship.text, e.g. 'Brother', 'Father', 'Maternal grandmother'. */
2735
- relationship: string;
2736
- /**
2737
- * @description Biological sex of the relative from FamilyMemberHistory.sex.
2738
- * @enum {string}
2739
- */
2740
- sex?: "male" | "female" | "other" | "unknown";
2741
- /** @description Health conditions recorded for this relative from FamilyMemberHistory.condition[]. */
2742
- conditions: {
2743
- /** @description Condition name for this relative, e.g. 'Multiple sclerosis'. */
2744
- display: string;
2745
- }[];
2746
- /** @description Where this fact was extracted from. */
2747
- source: {
2748
- /**
2749
- * @description Format of the source record.
2750
- * @enum {string}
2751
- */
2752
- type: "fhir" | "cda" | "document" | "patient-reported";
2753
- /** @description System or process that produced the source record. */
2754
- origin: string;
2755
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2756
- ref: string;
2757
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2758
- recordedAt: string | null;
2759
- /** @description ISO 8601 timestamp when this record was ingested. */
2760
- ingestedAt: string;
2761
- };
2762
- /** @description The ingestion request that introduced this row. */
2763
- ingestionId: string;
2764
- } | {
2765
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2766
- display: string;
2767
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2768
- codes?: {
2769
- system: string;
2770
- code: string;
2771
- display?: string;
2772
- }[];
2773
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2774
- date?: string;
2775
- /** @description Temporal bounds of the fact's validity. */
2776
- effectivePeriod?: {
2777
- /** @description ISO date when this fact became active. */
2778
- start?: string;
2779
- /** @description ISO date when this fact ended or was resolved. */
2780
- end?: string;
2781
- };
2782
- /** @enum {string} */
2783
- type: "social_history";
2784
- /** @description Observation topic from Observation.code.text, e.g. 'Tobacco use and exposure', 'Alcohol use'. */
2785
- category?: string;
2786
- /** @description Current state as a string from Observation.valueString or valueCodeableConcept.text, e.g. 'Smokeless tobacco non-user', 'Current every day smoker'. */
2787
- value?: string;
2788
- /** @description Where this fact was extracted from. */
2789
- source: {
2790
- /**
2791
- * @description Format of the source record.
2792
- * @enum {string}
2793
- */
2794
- type: "fhir" | "cda" | "document" | "patient-reported";
2795
- /** @description System or process that produced the source record. */
2796
- origin: string;
2797
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2798
- ref: string;
2799
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2800
- recordedAt: string | null;
2801
- /** @description ISO 8601 timestamp when this record was ingested. */
2802
- ingestedAt: string;
2803
- };
2804
- /** @description The ingestion request that introduced this row. */
2805
- ingestionId: string;
2806
- } | {
2807
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2808
- display: string;
2809
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2810
- codes?: {
2811
- system: string;
2812
- code: string;
2813
- display?: string;
2814
- }[];
2815
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2816
- date?: string;
2817
- /** @description Temporal bounds of the fact's validity. */
2818
- effectivePeriod?: {
2819
- /** @description ISO date when this fact became active. */
2820
- start?: string;
2821
- /** @description ISO date when this fact ended or was resolved. */
2822
- end?: string;
2823
- };
2824
- /** @enum {string} */
2825
- type: "immunization";
2826
- /**
2827
- * @description Administration status from Immunization.status. HG provides individual shot records — each administered vaccine is its own Fact, not a rolled-up series status.
2828
- * @enum {string}
2829
- */
2830
- status: "completed" | "not-done";
2831
- /** @description ISO date when the vaccine was administered, from Immunization.occurrenceDateTime. */
2832
- occurrenceDate?: string;
2833
- /** @description Where this fact was extracted from. */
2834
- source: {
2835
- /**
2836
- * @description Format of the source record.
2837
- * @enum {string}
2838
- */
2839
- type: "fhir" | "cda" | "document" | "patient-reported";
2840
- /** @description System or process that produced the source record. */
2841
- origin: string;
2842
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2843
- ref: string;
2844
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2845
- recordedAt: string | null;
2846
- /** @description ISO 8601 timestamp when this record was ingested. */
2847
- ingestedAt: string;
2848
- };
2849
- /** @description The ingestion request that introduced this row. */
2850
- ingestionId: string;
2851
- } | {
2852
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2853
- display: string;
2854
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2855
- codes?: {
2856
- system: string;
2857
- code: string;
2858
- display?: string;
2859
- }[];
2860
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2861
- date?: string;
2862
- /** @description Temporal bounds of the fact's validity. */
2863
- effectivePeriod?: {
2864
- /** @description ISO date when this fact became active. */
2865
- start?: string;
2866
- /** @description ISO date when this fact ended or was resolved. */
2867
- end?: string;
2868
- };
2869
- /** @enum {string} */
2870
- type: "device";
2871
- /**
2872
- * @description Whether the device is currently in use. active = currently implanted or in active use; inactive = removed or no longer used; unknown = not reported by the source.
2873
- * @enum {string}
2874
- */
2875
- status: "active" | "inactive" | "entered-in-error" | "unknown";
2876
- /** @description Where this fact was extracted from. */
2877
- source: {
2878
- /**
2879
- * @description Format of the source record.
2880
- * @enum {string}
2881
- */
2882
- type: "fhir" | "cda" | "document" | "patient-reported";
2883
- /** @description System or process that produced the source record. */
2884
- origin: string;
2885
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2886
- ref: string;
2887
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2888
- recordedAt: string | null;
2889
- /** @description ISO 8601 timestamp when this record was ingested. */
2890
- ingestedAt: string;
2891
- };
2892
- /** @description The ingestion request that introduced this row. */
2893
- ingestionId: string;
2894
- } | {
2895
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2896
- display: string;
2897
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2898
- codes?: {
2899
- system: string;
2900
- code: string;
2901
- display?: string;
2902
- }[];
2903
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2904
- date?: string;
2905
- /** @description Temporal bounds of the fact's validity. */
2906
- effectivePeriod?: {
2907
- /** @description ISO date when this fact became active. */
2908
- start?: string;
2909
- /** @description ISO date when this fact ended or was resolved. */
2910
- end?: string;
2911
- };
2912
- /** @enum {string} */
2913
- type: "demographic";
2914
- /** @description Patient date of birth in ISO format (YYYY-MM-DD), from Patient.birthDate. */
2915
- birthDate?: string;
2916
- /** @description Administrative sex from Patient.gender, e.g. 'male', 'female'. */
2917
- sex?: string;
2918
- /** @description Flattened address string from Patient.address, e.g. 'Laporte, CO'. Kept as a single string since HG provides it pre-formatted. */
2919
- address?: string;
2920
- /** @description Where this fact was extracted from. */
2921
- source: {
2922
- /**
2923
- * @description Format of the source record.
2924
- * @enum {string}
2925
- */
2926
- type: "fhir" | "cda" | "document" | "patient-reported";
2927
- /** @description System or process that produced the source record. */
2928
- origin: string;
2929
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2930
- ref: string;
2931
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2932
- recordedAt: string | null;
2933
- /** @description ISO 8601 timestamp when this record was ingested. */
2934
- ingestedAt: string;
2935
- };
2936
- /** @description The ingestion request that introduced this row. */
2937
- ingestionId: string;
2938
- } | {
2939
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2940
- display: string;
2941
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2942
- codes?: {
2943
- system: string;
2944
- code: string;
2945
- display?: string;
2946
- }[];
2947
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2948
- date?: string;
2949
- /** @description Temporal bounds of the fact's validity. */
2950
- effectivePeriod?: {
2951
- /** @description ISO date when this fact became active. */
2952
- start?: string;
2953
- /** @description ISO date when this fact ended or was resolved. */
2954
- end?: string;
2955
- };
2956
- /** @enum {string} */
2957
- type: "insurance";
2958
- /**
2959
- * @description Coverage status from Coverage.status.
2960
- * @enum {string}
2961
- */
2962
- status: "active" | "cancelled" | "draft" | "entered-in-error";
2963
- /** @description Payer name from Coverage.payor[].display, e.g. 'MEDICARE', 'BCBS'. */
2964
- planName?: string;
2965
- /** @description Member identifier from Coverage.identifier[].value. */
2966
- memberId?: string;
2967
- /** @description Where this fact was extracted from. */
2968
- source: {
2969
- /**
2970
- * @description Format of the source record.
2971
- * @enum {string}
2972
- */
2973
- type: "fhir" | "cda" | "document" | "patient-reported";
2974
- /** @description System or process that produced the source record. */
2975
- origin: string;
2976
- /** @description Reference to the source record (e.g. "Condition/abc"). */
2977
- ref: string;
2978
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
2979
- recordedAt: string | null;
2980
- /** @description ISO 8601 timestamp when this record was ingested. */
2981
- ingestedAt: string;
2982
- };
2983
- /** @description The ingestion request that introduced this row. */
2984
- ingestionId: string;
2985
- } | {
2986
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
2987
- display: string;
2988
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
2989
- codes?: {
2990
- system: string;
2991
- code: string;
2992
- display?: string;
2993
- }[];
2994
- /** @description ISO date when this fact was recorded or last updated in the source system. */
2995
- date?: string;
2996
- /** @description Temporal bounds of the fact's validity. */
2997
- effectivePeriod?: {
2998
- /** @description ISO date when this fact became active. */
2999
- start?: string;
3000
- /** @description ISO date when this fact ended or was resolved. */
3001
- end?: string;
3002
- };
3003
- /** @enum {string} */
3004
- type: "directive";
3005
- /**
3006
- * @description Whether this directive is currently in effect. active = legally binding; void = revoked or superseded.
3007
- * @enum {string}
3008
- */
3009
- status: "active" | "void" | "entered-in-error";
3010
- /** @description Directive content extracted from the source document (e.g. living will, POLST). HG delivers these as PDFs rather than structured Consent resources. */
3011
- notes?: string;
3012
- /** @description Where this fact was extracted from. */
3013
- source: {
3014
- /**
3015
- * @description Format of the source record.
3016
- * @enum {string}
3017
- */
3018
- type: "fhir" | "cda" | "document" | "patient-reported";
3019
- /** @description System or process that produced the source record. */
3020
- origin: string;
3021
- /** @description Reference to the source record (e.g. "Condition/abc"). */
3022
- ref: string;
3023
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
3024
- recordedAt: string | null;
3025
- /** @description ISO 8601 timestamp when this record was ingested. */
3026
- ingestedAt: string;
3027
- };
3028
- /** @description The ingestion request that introduced this row. */
3029
- ingestionId: string;
3030
- };
3031
- }[];
2709
+ data: components["schemas"]["ExtractedFactNode"][];
3032
2710
  /** @description Pagination metadata for the returned page. */
3033
2711
  meta: {
3034
2712
  /** @description Total number of items across all pages. */
@@ -3042,358 +2720,7 @@ export interface components {
3042
2720
  /** @description A page of `fact` nodes from the patient context graph. */
3043
2721
  FactNodeList: {
3044
2722
  /** @description The requested page of items. */
3045
- data: {
3046
- /** @enum {string} */
3047
- type: "fact";
3048
- /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
3049
- id: string;
3050
- /** @description ISO 8601 timestamp when this node was first created. */
3051
- createdAt: string;
3052
- /** @description ISO 8601 timestamp when this node was last updated. */
3053
- updatedAt: string;
3054
- /** @description Type-specific attributes of the `fact` node. */
3055
- payload: {
3056
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3057
- display: string;
3058
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3059
- codes?: {
3060
- system: string;
3061
- code: string;
3062
- display?: string;
3063
- }[];
3064
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3065
- date?: string;
3066
- /** @description Temporal bounds of the fact's validity. */
3067
- effectivePeriod?: {
3068
- /** @description ISO date when this fact became active. */
3069
- start?: string;
3070
- /** @description ISO date when this fact ended or was resolved. */
3071
- end?: string;
3072
- };
3073
- /** @enum {string} */
3074
- type: "condition";
3075
- /**
3076
- * @description Clinical status of the condition. active = currently present; resolved = no longer present; inactive = present but not actively managed.
3077
- * @enum {string}
3078
- */
3079
- status: "active" | "resolved" | "inactive" | "unknown";
3080
- /** @description ISO date when the condition first started, from Condition.onsetPeriod.start or onsetDateTime. */
3081
- onsetDate?: string;
3082
- /** @description Every extracted fact this fact was projected from. */
3083
- members: {
3084
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3085
- extractedFactId: string;
3086
- }[];
3087
- fieldVerdicts: components["schemas"]["FactConflicts"];
3088
- } | {
3089
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3090
- display: string;
3091
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3092
- codes?: {
3093
- system: string;
3094
- code: string;
3095
- display?: string;
3096
- }[];
3097
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3098
- date?: string;
3099
- /** @description Temporal bounds of the fact's validity. */
3100
- effectivePeriod?: {
3101
- /** @description ISO date when this fact became active. */
3102
- start?: string;
3103
- /** @description ISO date when this fact ended or was resolved. */
3104
- end?: string;
3105
- };
3106
- /** @enum {string} */
3107
- type: "medication";
3108
- /**
3109
- * @description Current regimen status. active = currently taking; on-hold = temporarily paused; completed = full course finished as planned; discontinued = stopped early or cancelled; unknown = indeterminate.
3110
- * @enum {string}
3111
- */
3112
- status: "active" | "on-hold" | "completed" | "discontinued" | "unknown";
3113
- /** @description Free-text dosage instructions from MedicationStatement.dosage[].additionalInstruction[].text, e.g. 'Take 1 tablet by mouth daily for hypertension.' */
3114
- dosageInstructions?: string;
3115
- /** @description Route of administration from dosage[].route, e.g. 'Oral', 'IV', 'Topical'. */
3116
- route?: string;
3117
- /** @description Every extracted fact this fact was projected from. */
3118
- members: {
3119
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3120
- extractedFactId: string;
3121
- }[];
3122
- fieldVerdicts: components["schemas"]["FactConflicts"];
3123
- } | {
3124
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3125
- display: string;
3126
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3127
- codes?: {
3128
- system: string;
3129
- code: string;
3130
- display?: string;
3131
- }[];
3132
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3133
- date?: string;
3134
- /** @description Temporal bounds of the fact's validity. */
3135
- effectivePeriod?: {
3136
- /** @description ISO date when this fact became active. */
3137
- start?: string;
3138
- /** @description ISO date when this fact ended or was resolved. */
3139
- end?: string;
3140
- };
3141
- /** @enum {string} */
3142
- type: "allergy";
3143
- /**
3144
- * @description Clinical status of the allergy record. active = allergy is current; inactive = no longer considered relevant; entered-in-error = recorded by mistake.
3145
- * @enum {string}
3146
- */
3147
- status: "active" | "inactive" | "entered-in-error";
3148
- /**
3149
- * @description Worst-case potential harm from exposure. high = life-threatening (e.g. anaphylaxis); low = non-life-threatening (e.g. rash).
3150
- * @enum {string}
3151
- */
3152
- criticality?: "low" | "high" | "unable-to-assess";
3153
- /** @description Substance category from AllergyIntolerance.category, e.g. ['medication'], ['food', 'environment']. */
3154
- category?: string[];
3155
- /** @description Observed reaction manifestations as display strings from reaction[].manifestation, e.g. ['Swelling', 'Anaphylaxis']. */
3156
- reactions?: string[];
3157
- /** @description Every extracted fact this fact was projected from. */
3158
- members: {
3159
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3160
- extractedFactId: string;
3161
- }[];
3162
- fieldVerdicts: components["schemas"]["FactConflicts"];
3163
- } | {
3164
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3165
- display: string;
3166
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3167
- codes?: {
3168
- system: string;
3169
- code: string;
3170
- display?: string;
3171
- }[];
3172
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3173
- date?: string;
3174
- /** @description Temporal bounds of the fact's validity. */
3175
- effectivePeriod?: {
3176
- /** @description ISO date when this fact became active. */
3177
- start?: string;
3178
- /** @description ISO date when this fact ended or was resolved. */
3179
- end?: string;
3180
- };
3181
- /** @enum {string} */
3182
- type: "family_history";
3183
- /** @description Relationship of the relative to the patient from FamilyMemberHistory.relationship.text, e.g. 'Brother', 'Father', 'Maternal grandmother'. */
3184
- relationship: string;
3185
- /**
3186
- * @description Biological sex of the relative from FamilyMemberHistory.sex.
3187
- * @enum {string}
3188
- */
3189
- sex?: "male" | "female" | "other" | "unknown";
3190
- /** @description Health conditions recorded for this relative from FamilyMemberHistory.condition[]. */
3191
- conditions: {
3192
- /** @description Condition name for this relative, e.g. 'Multiple sclerosis'. */
3193
- display: string;
3194
- }[];
3195
- /** @description Every extracted fact this fact was projected from. */
3196
- members: {
3197
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3198
- extractedFactId: string;
3199
- }[];
3200
- fieldVerdicts: components["schemas"]["FactConflicts"];
3201
- } | {
3202
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3203
- display: string;
3204
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3205
- codes?: {
3206
- system: string;
3207
- code: string;
3208
- display?: string;
3209
- }[];
3210
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3211
- date?: string;
3212
- /** @description Temporal bounds of the fact's validity. */
3213
- effectivePeriod?: {
3214
- /** @description ISO date when this fact became active. */
3215
- start?: string;
3216
- /** @description ISO date when this fact ended or was resolved. */
3217
- end?: string;
3218
- };
3219
- /** @enum {string} */
3220
- type: "social_history";
3221
- /** @description Observation topic from Observation.code.text, e.g. 'Tobacco use and exposure', 'Alcohol use'. */
3222
- category?: string;
3223
- /** @description Current state as a string from Observation.valueString or valueCodeableConcept.text, e.g. 'Smokeless tobacco non-user', 'Current every day smoker'. */
3224
- value?: string;
3225
- /** @description Every extracted fact this fact was projected from. */
3226
- members: {
3227
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3228
- extractedFactId: string;
3229
- }[];
3230
- fieldVerdicts: components["schemas"]["FactConflicts"];
3231
- } | {
3232
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3233
- display: string;
3234
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3235
- codes?: {
3236
- system: string;
3237
- code: string;
3238
- display?: string;
3239
- }[];
3240
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3241
- date?: string;
3242
- /** @description Temporal bounds of the fact's validity. */
3243
- effectivePeriod?: {
3244
- /** @description ISO date when this fact became active. */
3245
- start?: string;
3246
- /** @description ISO date when this fact ended or was resolved. */
3247
- end?: string;
3248
- };
3249
- /** @enum {string} */
3250
- type: "immunization";
3251
- /**
3252
- * @description Administration status from Immunization.status. HG provides individual shot records — each administered vaccine is its own Fact, not a rolled-up series status.
3253
- * @enum {string}
3254
- */
3255
- status: "completed" | "not-done";
3256
- /** @description ISO date when the vaccine was administered, from Immunization.occurrenceDateTime. */
3257
- occurrenceDate?: string;
3258
- /** @description Every extracted fact this fact was projected from. */
3259
- members: {
3260
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3261
- extractedFactId: string;
3262
- }[];
3263
- fieldVerdicts: components["schemas"]["FactConflicts"];
3264
- } | {
3265
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3266
- display: string;
3267
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3268
- codes?: {
3269
- system: string;
3270
- code: string;
3271
- display?: string;
3272
- }[];
3273
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3274
- date?: string;
3275
- /** @description Temporal bounds of the fact's validity. */
3276
- effectivePeriod?: {
3277
- /** @description ISO date when this fact became active. */
3278
- start?: string;
3279
- /** @description ISO date when this fact ended or was resolved. */
3280
- end?: string;
3281
- };
3282
- /** @enum {string} */
3283
- type: "device";
3284
- /**
3285
- * @description Whether the device is currently in use. active = currently implanted or in active use; inactive = removed or no longer used; unknown = not reported by the source.
3286
- * @enum {string}
3287
- */
3288
- status: "active" | "inactive" | "entered-in-error" | "unknown";
3289
- /** @description Every extracted fact this fact was projected from. */
3290
- members: {
3291
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3292
- extractedFactId: string;
3293
- }[];
3294
- fieldVerdicts: components["schemas"]["FactConflicts"];
3295
- } | {
3296
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3297
- display: string;
3298
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3299
- codes?: {
3300
- system: string;
3301
- code: string;
3302
- display?: string;
3303
- }[];
3304
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3305
- date?: string;
3306
- /** @description Temporal bounds of the fact's validity. */
3307
- effectivePeriod?: {
3308
- /** @description ISO date when this fact became active. */
3309
- start?: string;
3310
- /** @description ISO date when this fact ended or was resolved. */
3311
- end?: string;
3312
- };
3313
- /** @enum {string} */
3314
- type: "demographic";
3315
- /** @description Patient date of birth in ISO format (YYYY-MM-DD), from Patient.birthDate. */
3316
- birthDate?: string;
3317
- /** @description Administrative sex from Patient.gender, e.g. 'male', 'female'. */
3318
- sex?: string;
3319
- /** @description Flattened address string from Patient.address, e.g. 'Laporte, CO'. Kept as a single string since HG provides it pre-formatted. */
3320
- address?: string;
3321
- /** @description Every extracted fact this fact was projected from. */
3322
- members: {
3323
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3324
- extractedFactId: string;
3325
- }[];
3326
- fieldVerdicts: components["schemas"]["FactConflicts"];
3327
- } | {
3328
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3329
- display: string;
3330
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3331
- codes?: {
3332
- system: string;
3333
- code: string;
3334
- display?: string;
3335
- }[];
3336
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3337
- date?: string;
3338
- /** @description Temporal bounds of the fact's validity. */
3339
- effectivePeriod?: {
3340
- /** @description ISO date when this fact became active. */
3341
- start?: string;
3342
- /** @description ISO date when this fact ended or was resolved. */
3343
- end?: string;
3344
- };
3345
- /** @enum {string} */
3346
- type: "insurance";
3347
- /**
3348
- * @description Coverage status from Coverage.status.
3349
- * @enum {string}
3350
- */
3351
- status: "active" | "cancelled" | "draft" | "entered-in-error";
3352
- /** @description Payer name from Coverage.payor[].display, e.g. 'MEDICARE', 'BCBS'. */
3353
- planName?: string;
3354
- /** @description Member identifier from Coverage.identifier[].value. */
3355
- memberId?: string;
3356
- /** @description Every extracted fact this fact was projected from. */
3357
- members: {
3358
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3359
- extractedFactId: string;
3360
- }[];
3361
- fieldVerdicts: components["schemas"]["FactConflicts"];
3362
- } | {
3363
- /** @description Human-readable label — condition name, drug name, vaccine name, etc. */
3364
- display: string;
3365
- /** @description Clinical codes for this fact (SNOMED, ICD-10, RxNorm, CVX…). More than one when multiple coding systems apply. */
3366
- codes?: {
3367
- system: string;
3368
- code: string;
3369
- display?: string;
3370
- }[];
3371
- /** @description ISO date when this fact was recorded or last updated in the source system. */
3372
- date?: string;
3373
- /** @description Temporal bounds of the fact's validity. */
3374
- effectivePeriod?: {
3375
- /** @description ISO date when this fact became active. */
3376
- start?: string;
3377
- /** @description ISO date when this fact ended or was resolved. */
3378
- end?: string;
3379
- };
3380
- /** @enum {string} */
3381
- type: "directive";
3382
- /**
3383
- * @description Whether this directive is currently in effect. active = legally binding; void = revoked or superseded.
3384
- * @enum {string}
3385
- */
3386
- status: "active" | "void" | "entered-in-error";
3387
- /** @description Directive content extracted from the source document (e.g. living will, POLST). HG delivers these as PDFs rather than structured Consent resources. */
3388
- notes?: string;
3389
- /** @description Every extracted fact this fact was projected from. */
3390
- members: {
3391
- /** @description Id of the `extracted_fact` node this member traces to (`ef_...`). */
3392
- extractedFactId: string;
3393
- }[];
3394
- fieldVerdicts: components["schemas"]["FactConflicts"];
3395
- };
3396
- }[];
2723
+ data: components["schemas"]["FactNode"][];
3397
2724
  /** @description Pagination metadata for the returned page. */
3398
2725
  meta: {
3399
2726
  /** @description Total number of items across all pages. */
@@ -3407,47 +2734,7 @@ export interface components {
3407
2734
  /** @description A page of `extracted_narrative` nodes from the patient context graph. */
3408
2735
  ExtractedNarrativeNodeList: {
3409
2736
  /** @description The requested page of items. */
3410
- data: {
3411
- /** @enum {string} */
3412
- type: "extracted_narrative";
3413
- /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
3414
- id: string;
3415
- /** @description ISO 8601 timestamp when this node was first created. */
3416
- createdAt: string;
3417
- /** @description ISO 8601 timestamp when this node was last updated. */
3418
- updatedAt: string;
3419
- /** @description Type-specific attributes of the `extracted_narrative` node. */
3420
- payload: {
3421
- /** @description Deterministic human-readable label from the source, or null when the source provides none. */
3422
- summary: string | null;
3423
- /** @description ISO 8601 clinical effective time, or null when the source carries none. */
3424
- effectiveAt: string | null;
3425
- /** @description Provenance of the originating document, end-to-end. */
3426
- source: {
3427
- /**
3428
- * @description Format of the source record.
3429
- * @enum {string}
3430
- */
3431
- type: "fhir" | "cda" | "document" | "patient-reported";
3432
- /** @description System or process that produced the source record. */
3433
- origin: string;
3434
- /** @description Reference to the source record (e.g. "Condition/abc"). */
3435
- ref: string;
3436
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
3437
- recordedAt: string | null;
3438
- /** @description ISO 8601 timestamp when this record was ingested. */
3439
- ingestedAt: string;
3440
- };
3441
- /** @description The decoded text of this source unit. */
3442
- content: string;
3443
- /** @description Deterministically extracted source fields (e.g. DocumentReference.status). */
3444
- metadata: {
3445
- [key: string]: unknown;
3446
- };
3447
- /** @description The ingestion request that introduced this row. */
3448
- ingestionId: string;
3449
- };
3450
- }[];
2737
+ data: components["schemas"]["ExtractedNarrativeNode"][];
3451
2738
  /** @description Pagination metadata for the returned page. */
3452
2739
  meta: {
3453
2740
  /** @description Total number of items across all pages. */
@@ -3461,29 +2748,7 @@ export interface components {
3461
2748
  /** @description A page of `narrative_passage` nodes from the patient context graph. */
3462
2749
  NarrativePassageNodeList: {
3463
2750
  /** @description The requested page of items. */
3464
- data: {
3465
- /** @enum {string} */
3466
- type: "narrative_passage";
3467
- /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
3468
- id: string;
3469
- /** @description ISO 8601 timestamp when this node was first created. */
3470
- createdAt: string;
3471
- /** @description ISO 8601 timestamp when this node was last updated. */
3472
- updatedAt: string;
3473
- /** @description Type-specific attributes of the `narrative_passage` node. */
3474
- payload: {
3475
- /** @description Id of the `extracted_narrative` node this passage was rendered from (`en_...`). */
3476
- extractedNarrativeId: string;
3477
- /** @description Rendered narrative text of the source section. */
3478
- content: string;
3479
- /** @description Title of the source section, or null when the source has none. */
3480
- sectionTitle: string | null;
3481
- /** @description Start offset of this passage within its extracted narrative's rendered content. */
3482
- offsetStart: number;
3483
- /** @description End offset (exclusive) within its extracted narrative's rendered content. */
3484
- offsetEnd: number;
3485
- };
3486
- }[];
2751
+ data: components["schemas"]["NarrativePassageNode"][];
3487
2752
  /** @description Pagination metadata for the returned page. */
3488
2753
  meta: {
3489
2754
  /** @description Total number of items across all pages. */
@@ -3497,54 +2762,7 @@ export interface components {
3497
2762
  /** @description A page of `narrative` nodes from the patient context graph. */
3498
2763
  NarrativeNodeList: {
3499
2764
  /** @description The requested page of items. */
3500
- data: {
3501
- /** @enum {string} */
3502
- type: "narrative";
3503
- /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
3504
- id: string;
3505
- /** @description ISO 8601 timestamp when this node was first created. */
3506
- createdAt: string;
3507
- /** @description ISO 8601 timestamp when this node was last updated. */
3508
- updatedAt: string;
3509
- /** @description Type-specific attributes of the `narrative` node. */
3510
- payload: {
3511
- /** @description Latest defined member clinical time, or null when no member carries one. */
3512
- effectiveAt: string | null;
3513
- /** @description Model asked to write `title` and `summary`. */
3514
- modelSource: {
3515
- /** @description Model provider identifier. */
3516
- provider: string;
3517
- /** @description Exact provider model identifier. */
3518
- model: string;
3519
- /** @description Provider model version when it is distinct from the model identifier. */
3520
- version?: string;
3521
- };
3522
- /** @description The member narrative passages this narrative projects. */
3523
- members: {
3524
- /** @description Id of the member `narrative_passage` node (`np_...`). */
3525
- narrativePassageId: string;
3526
- }[];
3527
- /** @description Short LLM-written heading, or null when summarization produced nothing. */
3528
- title: string | null;
3529
- /** @description LLM-written account of the member passages, or null when summarization produced nothing. */
3530
- summary: string | null;
3531
- /** @description Representative verbatim span from one member passage, or null when none was selected. */
3532
- quote: {
3533
- /** @description Id of the member `narrative_passage` node the quote was taken from (`np_...`). */
3534
- narrativePassageId: string;
3535
- /** @description Exact substring of that passage's rendered content. */
3536
- text: string;
3537
- /** @description Start of the quote within the passage's own content. */
3538
- offsetStart: number;
3539
- /** @description End offset (exclusive) within the passage's own content. */
3540
- offsetEnd: number;
3541
- } | null;
3542
- /** @description Fact types this narrative plausibly concerns. */
3543
- boundFactTypes: ("condition" | "medication" | "allergy" | "family_history" | "social_history" | "immunization" | "device" | "demographic" | "insurance" | "directive")[];
3544
- /** @description Clinical-event types this narrative plausibly concerns. */
3545
- boundEventTypes: ("encounter" | "observation" | "procedure" | "medication_event")[];
3546
- };
3547
- }[];
2765
+ data: components["schemas"]["NarrativeNode"][];
3548
2766
  /** @description Pagination metadata for the returned page. */
3549
2767
  meta: {
3550
2768
  /** @description Total number of items across all pages. */
@@ -3558,28 +2776,7 @@ export interface components {
3558
2776
  /** @description A page of `learned_memory` nodes from the patient context graph. */
3559
2777
  LearnedMemoryNodeList: {
3560
2778
  /** @description The requested page of items. */
3561
- data: {
3562
- /** @enum {string} */
3563
- type: "learned_memory";
3564
- /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
3565
- id: string;
3566
- /** @description ISO 8601 timestamp when this node was first created. */
3567
- createdAt: string;
3568
- /** @description ISO 8601 timestamp when this node was last updated. */
3569
- updatedAt: string;
3570
- /** @description Type-specific attributes of the `learned_memory` node. */
3571
- payload: {
3572
- /**
3573
- * @description The memory taxonomy — symptom | adherence | concern | preference.
3574
- * @enum {string}
3575
- */
3576
- type: "symptom" | "adherence" | "concern" | "preference";
3577
- /** @description The statement as expressed by or on behalf of the patient. */
3578
- content: string;
3579
- /** @description Provenance: the id of the session that produced this memory. */
3580
- sessionId: string;
3581
- };
3582
- }[];
2779
+ data: components["schemas"]["LearnedMemoryNode"][];
3583
2780
  /** @description Pagination metadata for the returned page. */
3584
2781
  meta: {
3585
2782
  /** @description Total number of items across all pages. */
@@ -3593,227 +2790,7 @@ export interface components {
3593
2790
  /** @description A page of `extracted_clinical_event` nodes from the patient context graph. */
3594
2791
  ExtractedClinicalEventNodeList: {
3595
2792
  /** @description The requested page of items. */
3596
- data: {
3597
- /** @enum {string} */
3598
- type: "extracted_clinical_event";
3599
- /** @description Unique identifier for this node, as a prefixed node id (`{type}_{id}`, e.g. `ef_...`). */
3600
- id: string;
3601
- /** @description ISO 8601 timestamp when this node was first created. */
3602
- createdAt: string;
3603
- /** @description ISO 8601 timestamp when this node was last updated. */
3604
- updatedAt: string;
3605
- /** @description Type-specific attributes of the `extracted_clinical_event` node. */
3606
- payload: {
3607
- /** @enum {string} */
3608
- type: "encounter";
3609
- /** @description Temporal bounds of the event, for one that spans time rather than happening at an instant. */
3610
- effectivePeriod?: {
3611
- /** @description ISO date when the event's span began. */
3612
- start?: string;
3613
- /** @description ISO date when it ended. */
3614
- end?: string;
3615
- };
3616
- /** @description One-line description for display and timeline. */
3617
- summary: string;
3618
- /** @description Provenance: the ingestion request that introduced this event. Absent for a row written outside a run, which is every row predating the run model. */
3619
- ingestionId?: string;
3620
- /**
3621
- * @description Encounter class. Maps from FHIR V3 ActEncounterCode: IMP/ACUTE/NONAC/SS → inpatient, AMB/OBSENC → outpatient, EMER → emergency, VR → virtual, HH/FLD → home.
3622
- * @enum {string}
3623
- */
3624
- kind: "inpatient" | "outpatient" | "emergency" | "virtual" | "home" | "unknown";
3625
- /** @description Clinical codes for why the encounter occurred. */
3626
- reasonCodes?: {
3627
- system: string;
3628
- code: string;
3629
- display?: string;
3630
- }[];
3631
- /** @description Display name of the encounter location. */
3632
- location?: string;
3633
- /** @description Where the patient went after discharge. */
3634
- dischargeDisposition?: string;
3635
- /** @description ISO 8601 timestamp when this clinical event occurred. */
3636
- timestamp: string;
3637
- /** @description Where this event was extracted from. Events are single-source — not merged across sources. */
3638
- source: {
3639
- /**
3640
- * @description Format of the source record.
3641
- * @enum {string}
3642
- */
3643
- type: "fhir" | "cda" | "document" | "patient-reported";
3644
- /** @description System or process that produced the source record. */
3645
- origin: string;
3646
- /** @description Reference to the source record (e.g. "Condition/abc"). */
3647
- ref: string;
3648
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
3649
- recordedAt: string | null;
3650
- /** @description ISO 8601 timestamp when this record was ingested. */
3651
- ingestedAt: string;
3652
- };
3653
- } | {
3654
- /** @enum {string} */
3655
- type: "observation";
3656
- /** @description Temporal bounds of the event, for one that spans time rather than happening at an instant. */
3657
- effectivePeriod?: {
3658
- /** @description ISO date when the event's span began. */
3659
- start?: string;
3660
- /** @description ISO date when it ended. */
3661
- end?: string;
3662
- };
3663
- /** @description One-line description for display and timeline. */
3664
- summary: string;
3665
- /** @description Provenance: the ingestion request that introduced this event. Absent for a row written outside a run, which is every row predating the run model. */
3666
- ingestionId?: string;
3667
- /**
3668
- * @description Observation sub-domain. Maps from FHIR Observation.category and CDA section LOINC codes: 30954-2 → laboratory/imaging, 8716-3 → vital-signs, Functional Status / Mental Status sections → functional-status.
3669
- * @enum {string}
3670
- */
3671
- kind?: "laboratory" | "vital-signs" | "imaging" | "survey" | "functional-status" | "social-history" | "activity" | "other";
3672
- /** @description Codes for the observation or panel, in whatever systems the source used — LOINC where it has one, e.g. '2947-0' (Sodium), but also CPT, a local analyte id, or a translation set. */
3673
- codes?: {
3674
- system: string;
3675
- code: string;
3676
- display?: string;
3677
- }[];
3678
- /** @description Bare panel/measurement name without the value, e.g. 'Hemoglobin A1c'. Stable across different values for the same LOINC — used to slug trend panels so the time series groups correctly. Distinct from `summary`, which embeds the value for timeline display. */
3679
- displayName?: string;
3680
- /** @description Display representation of the result value, e.g. '8.9 %', 'Positive', '138 mmol/L'. */
3681
- value?: string;
3682
- /** @description UCUM unit from valueQuantity.unit, e.g. 'mmol/L', 'mm[Hg]'. */
3683
- unit?: string;
3684
- /**
3685
- * @description Clinical interpretation of the value relative to the reference range. Maps from Observation.interpretation.
3686
- * @enum {string}
3687
- */
3688
- interpretation?: "critical-high" | "critical-low" | "high" | "low" | "normal" | "absent" | "unknown";
3689
- /** @description Reference range as a display string, e.g. '3.5–5.5 mmol/L'. */
3690
- referenceRange?: string;
3691
- /**
3692
- * @description Result status from Observation.status or DiagnosticReport.status.
3693
- * @enum {string}
3694
- */
3695
- status: "final" | "preliminary" | "amended" | "corrected" | "cancelled" | "unknown";
3696
- /** @description ISO 8601 timestamp when this clinical event occurred. */
3697
- timestamp: string;
3698
- /** @description Where this event was extracted from. Events are single-source — not merged across sources. */
3699
- source: {
3700
- /**
3701
- * @description Format of the source record.
3702
- * @enum {string}
3703
- */
3704
- type: "fhir" | "cda" | "document" | "patient-reported";
3705
- /** @description System or process that produced the source record. */
3706
- origin: string;
3707
- /** @description Reference to the source record (e.g. "Condition/abc"). */
3708
- ref: string;
3709
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
3710
- recordedAt: string | null;
3711
- /** @description ISO 8601 timestamp when this record was ingested. */
3712
- ingestedAt: string;
3713
- };
3714
- } | {
3715
- /** @enum {string} */
3716
- type: "procedure";
3717
- /** @description Temporal bounds of the event, for one that spans time rather than happening at an instant. */
3718
- effectivePeriod?: {
3719
- /** @description ISO date when the event's span began. */
3720
- start?: string;
3721
- /** @description ISO date when it ended. */
3722
- end?: string;
3723
- };
3724
- /** @description One-line description for display and timeline. */
3725
- summary: string;
3726
- /** @description Provenance: the ingestion request that introduced this event. Absent for a row written outside a run, which is every row predating the run model. */
3727
- ingestionId?: string;
3728
- /** @description Procedure codes from CPT, SNOMED-CT, or ICD PCS. */
3729
- codes?: {
3730
- system: string;
3731
- code: string;
3732
- display?: string;
3733
- }[];
3734
- /** @description Anatomical site of the procedure, from bodySite[0].text. */
3735
- bodySite?: string;
3736
- /** @description Outcome text, from Procedure.outcome.text. */
3737
- outcome?: string;
3738
- /**
3739
- * @description Procedure status. not-done covers CDA 'Procedure Refused'; aborted covers CDA 'Procedure Unsuccessful'.
3740
- * @enum {string}
3741
- */
3742
- status: "completed" | "not-done" | "aborted" | "in-progress" | "stopped" | "unknown";
3743
- /** @description ISO 8601 timestamp when this clinical event occurred. */
3744
- timestamp: string;
3745
- /** @description Where this event was extracted from. Events are single-source — not merged across sources. */
3746
- source: {
3747
- /**
3748
- * @description Format of the source record.
3749
- * @enum {string}
3750
- */
3751
- type: "fhir" | "cda" | "document" | "patient-reported";
3752
- /** @description System or process that produced the source record. */
3753
- origin: string;
3754
- /** @description Reference to the source record (e.g. "Condition/abc"). */
3755
- ref: string;
3756
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
3757
- recordedAt: string | null;
3758
- /** @description ISO 8601 timestamp when this record was ingested. */
3759
- ingestedAt: string;
3760
- };
3761
- } | {
3762
- /** @enum {string} */
3763
- type: "medication_event";
3764
- /** @description Temporal bounds of the event, for one that spans time rather than happening at an instant. */
3765
- effectivePeriod?: {
3766
- /** @description ISO date when the event's span began. */
3767
- start?: string;
3768
- /** @description ISO date when it ended. */
3769
- end?: string;
3770
- };
3771
- /** @description One-line description for display and timeline. */
3772
- summary: string;
3773
- /** @description Provenance: the ingestion request that introduced this event. Absent for a row written outside a run, which is every row predating the run model. */
3774
- ingestionId?: string;
3775
- /** @description Medication name as it appears in the source, e.g. 'Lisinopril 10 mg tablet'. */
3776
- medicationDisplay: string;
3777
- /** @description RxNorm or NDC codes for the medication. */
3778
- medicationCodes?: {
3779
- system: string;
3780
- code: string;
3781
- display?: string;
3782
- }[];
3783
- /**
3784
- * @description Lifecycle step this event represents.
3785
- * prescribed = MedicationRequest / CDA order written;
3786
- * dispensed = MedicationDispense / pharmacy filled;
3787
- * administered = MedicationAdministration / CDA single administration;
3788
- * stopped = discontinued / CDA withdrawn;
3789
- * refused = patient refused / CDA Medication Refused.
3790
- * @enum {string}
3791
- */
3792
- kind: "prescribed" | "dispensed" | "administered" | "completed" | "stopped" | "on-hold" | "refused" | "unknown";
3793
- /** @description Dosage instructions as a display string, e.g. '10 mg daily'. Includes CDA free-text SIG. */
3794
- dose?: string;
3795
- /** @description Route of administration, e.g. 'oral', 'IV'. */
3796
- route?: string;
3797
- /** @description ISO 8601 timestamp when this clinical event occurred. */
3798
- timestamp: string;
3799
- /** @description Where this event was extracted from. Events are single-source — not merged across sources. */
3800
- source: {
3801
- /**
3802
- * @description Format of the source record.
3803
- * @enum {string}
3804
- */
3805
- type: "fhir" | "cda" | "document" | "patient-reported";
3806
- /** @description System or process that produced the source record. */
3807
- origin: string;
3808
- /** @description Reference to the source record (e.g. "Condition/abc"). */
3809
- ref: string;
3810
- /** @description ISO 8601 timestamp when the source record was last updated at its origin, or null when unknown. */
3811
- recordedAt: string | null;
3812
- /** @description ISO 8601 timestamp when this record was ingested. */
3813
- ingestedAt: string;
3814
- };
3815
- };
3816
- }[];
2793
+ data: components["schemas"]["ExtractedClinicalEventNode"][];
3817
2794
  /** @description Pagination metadata for the returned page. */
3818
2795
  meta: {
3819
2796
  /** @description Total number of items across all pages. */
@@ -3827,194 +2804,7 @@ export interface components {
3827
2804
  /** @description A page of `resolution_decision` edges from the patient context graph. */
3828
2805
  ResolutionDecisionEdgeList: {
3829
2806
  /** @description The requested page of items. */
3830
- data: {
3831
- /** @enum {string} */
3832
- type: "resolution_decision";
3833
- /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
3834
- id: string;
3835
- /** @description ISO 8601 timestamp when this edge was first created. */
3836
- createdAt: string;
3837
- /** @description ISO 8601 timestamp when this edge was last updated. */
3838
- updatedAt: string;
3839
- from: components["schemas"]["NodeRef"];
3840
- to: components["schemas"]["NodeRef"] & unknown;
3841
- /** @description Type-specific attributes of the `resolution_decision` edge. */
3842
- payload: {
3843
- /**
3844
- * @description The decided outcome. `continue` is a control-flow signal for stop rules and is never recorded here.
3845
- * @enum {string}
3846
- */
3847
- verdict: "merge" | "reject";
3848
- /**
3849
- * @description The quality signal carried by the verdict (confirmed | probable | uncertain) — authoritative, and the only quality measure now that confidence floats are dropped. Both merges and rejects carry one.
3850
- * @enum {string}
3851
- */
3852
- resolution: "uncertain" | "probable" | "confirmed";
3853
- /** @description Id of the stop rule that fired, e.g. 'corroborated-hierarchical-merge'. This is the audit's 'why'. */
3854
- ruleId: string;
3855
- /** @description The full accumulated evidence the rule evaluated, in the order the layers ran. */
3856
- evidence: ({
3857
- /** @enum {string} */
3858
- kind: "source-ref";
3859
- /** @enum {string} */
3860
- layer: "source-ref-equality";
3861
- } | {
3862
- /** @enum {string} */
3863
- kind: "exact-code-match";
3864
- /** @enum {string} */
3865
- layer: "deterministic-code";
3866
- /** @description The code system the match was made in: its canonical URI when recognized, the source spelling otherwise. */
3867
- system: string;
3868
- /** @description Whether the code system was one the vocabulary layer recognizes at decision time. */
3869
- systemRecognized: boolean;
3870
- /** @description The code that both entities share in the given code system. */
3871
- code: string;
3872
- } | {
3873
- /** @enum {string} */
3874
- kind: "hierarchical-code-match";
3875
- /** @enum {string} */
3876
- layer: "deterministic-code";
3877
- /** @description The code system the match was made in: its canonical URI when recognized, the source spelling otherwise. */
3878
- system: string;
3879
- /** @description Whether the code system was one the vocabulary layer recognizes at decision time. */
3880
- systemRecognized: boolean;
3881
- /** @description The code from entity A. */
3882
- codeA: string;
3883
- /** @description The code from entity B. */
3884
- codeB: string;
3885
- /** @description The ancestor code that links the two entities' codes hierarchically. */
3886
- ancestorCode: string;
3887
- } | {
3888
- /** @enum {string} */
3889
- kind: "code-mismatch";
3890
- /** @enum {string} */
3891
- layer: "deterministic-code";
3892
- /** @description The code system the match was made in: its canonical URI when recognized, the source spelling otherwise. */
3893
- system: string;
3894
- /** @description Whether the code system was one the vocabulary layer recognizes at decision time. */
3895
- systemRecognized: boolean;
3896
- /** @description The code from entity A. */
3897
- codeA: string;
3898
- /** @description The code from entity B. */
3899
- codeB: string;
3900
- } | {
3901
- /** @enum {string} */
3902
- kind: "field-similarity";
3903
- /** @enum {string} */
3904
- layer: "nlp-normalization";
3905
- /** @description The field for which the text similarity was computed. */
3906
- field: string;
3907
- /** @description The similarity score for the normalized values. */
3908
- similarity: number;
3909
- /** @description Entity A's raw normalized value for this field. */
3910
- aValue: string | null;
3911
- /** @description Entity B's raw normalized value for this field. */
3912
- bValue: string | null;
3913
- } | {
3914
- /** @enum {string} */
3915
- kind: "semantic-similarity";
3916
- /** @enum {string} */
3917
- layer: "embedding-similarity";
3918
- measurement: {
3919
- /** @enum {string} */
3920
- algorithm: "cosine";
3921
- similarity: number;
3922
- };
3923
- } | {
3924
- /** @enum {string} */
3925
- kind: "narrative-semantic-similarity";
3926
- /** @enum {string} */
3927
- layer: "embedding-similarity";
3928
- /** @description One-based rank within the passage's top-k candidates. */
3929
- candidateRank: number;
3930
- measurement: {
3931
- /** @enum {string} */
3932
- algorithm: "cosine";
3933
- similarity: number;
3934
- thresholds: {
3935
- rejectAtOrBelow: number;
3936
- mergeAtOrAbove: number;
3937
- };
3938
- };
3939
- modelSource: {
3940
- /** @description Model provider identifier. */
3941
- provider: string;
3942
- /** @description Exact provider model identifier. */
3943
- model: string;
3944
- /** @description Provider model version when it is distinct from the model identifier. */
3945
- version?: string;
3946
- };
3947
- } | ({
3948
- /** @enum {string} */
3949
- kind: "llm";
3950
- /** @enum {string} */
3951
- layer: "llm-adjudication";
3952
- /** @description The LLM adjudicator's confidence in its match judgment. */
3953
- confidence: number;
3954
- /** @description The LLM adjudicator's reasoning for its judgment. */
3955
- reasoning: string;
3956
- /** @enum {boolean} */
3957
- match: false;
3958
- } | ({
3959
- /** @enum {string} */
3960
- kind: "llm";
3961
- /** @enum {string} */
3962
- layer: "llm-adjudication";
3963
- /** @description The LLM adjudicator's confidence in its match judgment. */
3964
- confidence: number;
3965
- /** @description The LLM adjudicator's reasoning for its judgment. */
3966
- reasoning: string;
3967
- /** @enum {boolean} */
3968
- match: true;
3969
- /**
3970
- * @description The entity the LLM adjudicator judged to be canonical, verbatim.
3971
- * @enum {string}
3972
- */
3973
- canonical: "a" | "b";
3974
- } | {
3975
- /** @enum {string} */
3976
- kind: "llm";
3977
- /** @enum {string} */
3978
- layer: "llm-adjudication";
3979
- /** @description The LLM adjudicator's confidence in its match judgment. */
3980
- confidence: number;
3981
- /** @description The LLM adjudicator's reasoning for its judgment. */
3982
- reasoning: string;
3983
- /** @enum {boolean} */
3984
- match: true;
3985
- /** @enum {string} */
3986
- canonical: "merged";
3987
- /** @description Per-field conflicts the LLM adjudicator found and resolved while merging. */
3988
- conflicts: {
3989
- /** @description The field for which the LLM adjudicator found a conflict. */
3990
- field: string;
3991
- /** @description The value from entity A for this field. */
3992
- sourceAValue?: unknown;
3993
- /** @description The value from entity B for this field. */
3994
- sourceBValue?: unknown;
3995
- /** @description The resolution for this field. */
3996
- resolution?: unknown;
3997
- /** @description The strategy the LLM adjudicator used to resolve this field. */
3998
- strategy: string;
3999
- }[];
4000
- })) | {
4001
- /** @enum {string} */
4002
- kind: "narrative-llm";
4003
- /** @enum {string} */
4004
- layer: "llm-adjudication";
4005
- modelSource: {
4006
- /** @description Model provider identifier. */
4007
- provider: string;
4008
- /** @description Exact provider model identifier. */
4009
- model: string;
4010
- /** @description Provider model version when it is distinct from the model identifier. */
4011
- version?: string;
4012
- };
4013
- /** @description Human-readable reasoning returned for the pair. */
4014
- reasoning: string;
4015
- })[];
4016
- };
4017
- }[];
2807
+ data: components["schemas"]["ResolutionDecisionEdge"][];
4018
2808
  /** @description Pagination metadata for the returned page. */
4019
2809
  meta: {
4020
2810
  /** @description Total number of items across all pages. */
@@ -4028,20 +2818,7 @@ export interface components {
4028
2818
  /** @description A page of `resolves_to` edges from the patient context graph. */
4029
2819
  ResolvesToEdgeList: {
4030
2820
  /** @description The requested page of items. */
4031
- data: {
4032
- /** @enum {string} */
4033
- type: "resolves_to";
4034
- /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
4035
- id: string;
4036
- /** @description ISO 8601 timestamp when this edge was first created. */
4037
- createdAt: string;
4038
- /** @description ISO 8601 timestamp when this edge was last updated. */
4039
- updatedAt: string;
4040
- from: components["schemas"]["NodeRef"];
4041
- to: components["schemas"]["NodeRef"] & unknown;
4042
- /** @description Type-specific attributes of the `resolves_to` edge. */
4043
- payload: Record<string, never>;
4044
- }[];
2821
+ data: components["schemas"]["ResolvesToEdge"][];
4045
2822
  /** @description Pagination metadata for the returned page. */
4046
2823
  meta: {
4047
2824
  /** @description Total number of items across all pages. */
@@ -4055,20 +2832,7 @@ export interface components {
4055
2832
  /** @description A page of `chunked_into` edges from the patient context graph. */
4056
2833
  ChunkedIntoEdgeList: {
4057
2834
  /** @description The requested page of items. */
4058
- data: {
4059
- /** @enum {string} */
4060
- type: "chunked_into";
4061
- /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
4062
- id: string;
4063
- /** @description ISO 8601 timestamp when this edge was first created. */
4064
- createdAt: string;
4065
- /** @description ISO 8601 timestamp when this edge was last updated. */
4066
- updatedAt: string;
4067
- from: components["schemas"]["NodeRef"];
4068
- to: components["schemas"]["NodeRef"] & unknown;
4069
- /** @description Type-specific attributes of the `chunked_into` edge. */
4070
- payload: Record<string, never>;
4071
- }[];
2835
+ data: components["schemas"]["ChunkedIntoEdge"][];
4072
2836
  /** @description Pagination metadata for the returned page. */
4073
2837
  meta: {
4074
2838
  /** @description Total number of items across all pages. */
@@ -4082,29 +2846,7 @@ export interface components {
4082
2846
  /** @description A page of `relationship` edges from the patient context graph. */
4083
2847
  RelationshipEdgeList: {
4084
2848
  /** @description The requested page of items. */
4085
- data: {
4086
- /** @enum {string} */
4087
- type: "relationship";
4088
- /** @description Unique identifier for this edge, as a prefixed edge id (`{type}_{id}`, e.g. `rd_...`). */
4089
- id: string;
4090
- /** @description ISO 8601 timestamp when this edge was first created. */
4091
- createdAt: string;
4092
- /** @description ISO 8601 timestamp when this edge was last updated. */
4093
- updatedAt: string;
4094
- from: components["schemas"]["NodeRef"];
4095
- to: components["schemas"]["NodeRef"] & unknown;
4096
- /** @description Type-specific attributes of the `relationship` edge. */
4097
- payload: {
4098
- type: string;
4099
- attributes?: {
4100
- [key: string]: unknown;
4101
- };
4102
- /** @enum {string} */
4103
- source?: "explicit_reference" | "knowledge_base" | "temporal_inference" | "llm_inferred" | "narrative_verification";
4104
- confidence?: number;
4105
- reasoning?: string;
4106
- };
4107
- }[];
2849
+ data: components["schemas"]["RelationshipEdge"][];
4108
2850
  /** @description Pagination metadata for the returned page. */
4109
2851
  meta: {
4110
2852
  /** @description Total number of items across all pages. */