phenoml 17.2.0 → 17.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/fhir2Omop/client/Client.d.ts +18 -21
  3. package/dist/cjs/api/resources/fhir2Omop/client/Client.js +20 -21
  4. package/dist/cjs/api/resources/fhir2Omop/errors/ServiceUnavailableError.d.ts +5 -0
  5. package/dist/cjs/api/resources/fhir2Omop/errors/ServiceUnavailableError.js +54 -0
  6. package/dist/cjs/api/resources/fhir2Omop/errors/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/fhir2Omop/errors/index.js +1 -0
  8. package/dist/cjs/api/resources/fhir2Omop/types/ConditionOccurrenceRow.d.ts +1 -0
  9. package/dist/cjs/api/resources/fhir2Omop/types/CreateOmopResponse.d.ts +10 -10
  10. package/dist/cjs/api/resources/fhir2Omop/types/DrugExposureRow.d.ts +1 -0
  11. package/dist/cjs/api/resources/fhir2Omop/types/MappingEntry.d.ts +35 -0
  12. package/dist/cjs/api/resources/fhir2Omop/types/MeasurementRow.d.ts +3 -0
  13. package/dist/cjs/api/resources/fhir2Omop/types/ObservationRow.d.ts +1 -0
  14. package/dist/cjs/api/resources/fhir2Omop/types/ProcedureOccurrenceRow.d.ts +1 -0
  15. package/dist/cjs/api/resources/fhir2Omop/types/Summary.d.ts +17 -0
  16. package/dist/cjs/api/resources/fhir2Omop/types/index.d.ts +2 -2
  17. package/dist/cjs/api/resources/fhir2Omop/types/index.js +2 -2
  18. package/dist/cjs/core/fetcher/signals.js +9 -1
  19. package/dist/cjs/version.d.ts +1 -1
  20. package/dist/cjs/version.js +1 -1
  21. package/dist/esm/BaseClient.mjs +2 -2
  22. package/dist/esm/api/resources/fhir2Omop/client/Client.d.mts +18 -21
  23. package/dist/esm/api/resources/fhir2Omop/client/Client.mjs +20 -21
  24. package/dist/esm/api/resources/fhir2Omop/errors/ServiceUnavailableError.d.mts +5 -0
  25. package/dist/esm/api/resources/fhir2Omop/errors/ServiceUnavailableError.mjs +17 -0
  26. package/dist/esm/api/resources/fhir2Omop/errors/index.d.mts +1 -0
  27. package/dist/esm/api/resources/fhir2Omop/errors/index.mjs +1 -0
  28. package/dist/esm/api/resources/fhir2Omop/types/ConditionOccurrenceRow.d.mts +1 -0
  29. package/dist/esm/api/resources/fhir2Omop/types/CreateOmopResponse.d.mts +10 -10
  30. package/dist/esm/api/resources/fhir2Omop/types/DrugExposureRow.d.mts +1 -0
  31. package/dist/esm/api/resources/fhir2Omop/types/MappingEntry.d.mts +35 -0
  32. package/dist/esm/api/resources/fhir2Omop/types/MeasurementRow.d.mts +3 -0
  33. package/dist/esm/api/resources/fhir2Omop/types/ObservationRow.d.mts +1 -0
  34. package/dist/esm/api/resources/fhir2Omop/types/ProcedureOccurrenceRow.d.mts +1 -0
  35. package/dist/esm/api/resources/fhir2Omop/types/Summary.d.mts +17 -0
  36. package/dist/esm/api/resources/fhir2Omop/types/index.d.mts +2 -2
  37. package/dist/esm/api/resources/fhir2Omop/types/index.mjs +2 -2
  38. package/dist/esm/core/fetcher/signals.mjs +9 -1
  39. package/dist/esm/version.d.mts +1 -1
  40. package/dist/esm/version.mjs +1 -1
  41. package/openapi/openapi.json +82 -185
  42. package/package.json +1 -1
  43. package/reference.md +18 -22
  44. package/dist/cjs/api/resources/fhir2Omop/types/MappingReportEntry.d.ts +0 -32
  45. package/dist/cjs/api/resources/fhir2Omop/types/ScanSummary.d.ts +0 -41
  46. package/dist/esm/api/resources/fhir2Omop/types/MappingReportEntry.d.mts +0 -32
  47. package/dist/esm/api/resources/fhir2Omop/types/ScanSummary.d.mts +0 -41
  48. /package/dist/cjs/api/resources/fhir2Omop/types/{MappingReportEntry.js → MappingEntry.js} +0 -0
  49. /package/dist/cjs/api/resources/fhir2Omop/types/{ScanSummary.js → Summary.js} +0 -0
  50. /package/dist/esm/api/resources/fhir2Omop/types/{MappingReportEntry.mjs → MappingEntry.mjs} +0 -0
  51. /package/dist/esm/api/resources/fhir2Omop/types/{ScanSummary.mjs → Summary.mjs} +0 -0
package/reference.md CHANGED
@@ -2673,30 +2673,26 @@ The ID of the FHIR provider to use. Can be either:
2673
2673
  <dl>
2674
2674
  <dd>
2675
2675
 
2676
- Shapes a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows
2676
+ Maps a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows
2677
2677
  (person, visit_occurrence, condition_occurrence, drug_exposure,
2678
2678
  procedure_occurrence, measurement, observation).
2679
2679
 
2680
- **Two resolution modes, reported in `mode`.** `mode` reflects which
2681
- resolver is wired, not the path an individual coding took. With a
2682
- concept-resolver configured (the default), `mode` is `"resolved"` and the
2683
- resource's primary clinical coding is resolved to a real OMOP `concept_id`;
2684
- with no resolver configured, `mode` is `"structural"` and every clinical
2685
- and source `concept_id` is `0`. In `"resolved"` mode individual codings can
2686
- still land at `concept_id` `0` without changing the mode: a coding the
2687
- service finds no match for is `UNMAPPED`, and a coding that fell back to the
2688
- structural tier (the resolver was briefly unavailable, or the resource was
2689
- text-only) is surfaced in `scan_summary` (`concept_resolver_note`,
2690
- `construe_resolutions`). A `concept_id` of `0` is "no matching concept" per
2691
- OMOP semantics, deliberately not omitted. Only the primary clinical coding
2692
- is resolved `gender`/`race`/`ethnicity`/`visit`/`value`/`unit`
2693
- `concept_id`s are always `0`.
2694
-
2695
- In every mode each `*_source_value` carries the verbatim FHIR coding
2696
- (`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the
2697
- response `report` lists one Usagi-shaped entry per source coding describing
2698
- how it resolved (`ALREADY_STANDARD`, `MAPPED`, an `UNCHECKED` suggestion,
2699
- or `UNMAPPED`).
2680
+ Each resource's primary clinical coding is resolved to a standard OMOP
2681
+ `concept_id`. Alongside the OMOP rows grouped by table (`tables`), the
2682
+ response carries `mappings` (how each source coding resolved, linked back
2683
+ to the row it produced), `dropped` (resources that could not be shaped
2684
+ into a row), `vocab_version` (the OMOP vocabulary release codes were
2685
+ resolved against), and a small `summary` of the resolution outcomes.
2686
+
2687
+ A `concept_id` of `0` is reported, not omitted (OMOP "no matching
2688
+ concept" semantics): it covers both a coding with no standard match
2689
+ (`UNMAPPED`) and an unverified suggestion for a text-only resource
2690
+ (`UNCHECKED`). Only the primary clinical coding is resolved, so
2691
+ `gender`/`race`/`ethnicity`/`visit`/`value`/`unit` `concept_id`s are
2692
+ always `0`; the one populated non-resolved concept is measurement
2693
+ `operator_concept_id`, set from a value comparator (`<`, `<=`, `>`, `>=`)
2694
+ rather than the resolver. Each `*_source_value` carries the verbatim FHIR
2695
+ coding (`system#code`), and `*_type_concept_id` is set to `32817` (EHR).
2700
2696
 
2701
2697
  Medication codes are resolved whether they appear inline
2702
2698
  (`medicationCodeableConcept`) or via a `medicationReference` to a contained,
@@ -2704,7 +2700,7 @@ relative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.
2704
2700
  Resources that cannot be shaped into a row — a medication with no usable
2705
2701
  code, resolvable reference, or display, or any clinical resource whose
2706
2702
  subject/patient reference cannot be tied to a person — are reported under
2707
- `scan_summary.dropped_resources` rather than emitted as blank rows. The
2703
+ `dropped` rather than emitted as blank rows. The
2708
2704
  bundle must contain at least one Patient resource.
2709
2705
  </dd>
2710
2706
  </dl>
@@ -1,32 +0,0 @@
1
- /**
2
- * One source_to_concept_map-style mapping suggestion (Usagi-shaped).
3
- */
4
- export interface MappingReportEntry {
5
- resource_type?: string | undefined;
6
- resource_id?: string | undefined;
7
- omop_table?: string | undefined;
8
- source_system?: string | undefined;
9
- source_code?: string | undefined;
10
- source_name?: string | undefined;
11
- target_vocabulary?: string | undefined;
12
- /**
13
- * Standard concept code. Set when a coding is matched by the structural
14
- * (construe) tier — an already-standard code taken verbatim, or a
15
- * construe-suggested code — which is every match in structural mode and,
16
- * in resolved mode, codings for text-only resources or ones that fell back
17
- * when the resolver was unavailable. Omitted for codings resolved directly
18
- * by the concept-resolver service, which returns the standard concept's
19
- * id, name, and vocabulary but not its `concept_code`.
20
- */
21
- target_code?: string | undefined;
22
- target_name?: string | undefined;
23
- /**
24
- * ALREADY_STANDARD (source already in the target standard vocabulary),
25
- * MAPPED (resolved to a standard concept via the OMOP "Maps to" crosswalk
26
- * or UMLS-CUI bridge; resolved mode only), UNCHECKED (an unreviewed
27
- * construe suggestion; structural / fallback only), or UNMAPPED (no
28
- * candidate found).
29
- */
30
- mapping_status?: string | undefined;
31
- note?: string | undefined;
32
- }
@@ -1,41 +0,0 @@
1
- import type * as phenoml from "../../../index.js";
2
- /**
3
- * White Rabbit-style aggregate profile of the mapping request.
4
- */
5
- export interface ScanSummary {
6
- total_resources?: number | undefined;
7
- resource_counts?: Record<string, number> | undefined;
8
- tables_populated?: Record<string, number> | undefined;
9
- coding_systems?: Record<string, number> | undefined;
10
- codes_already_standard?: number | undefined;
11
- codes_normalized?: number | undefined;
12
- codes_unmapped?: number | undefined;
13
- off_vocab_rate?: number | undefined;
14
- dropped_resources?: phenoml.fhir2Omop.DroppedResource[] | undefined;
15
- /**
16
- * OMOP vocabulary release the resolver mapped against (e.g. "v20240229").
17
- * Resolved mode only; empty when no coded concept reached the service.
18
- */
19
- resolved_vocab_version?: string | undefined;
20
- /**
21
- * Set when concept resolution was degraded — the resolver was unavailable
22
- * for one or more codings, whose `concept_id`s fell back to the structural
23
- * (construe) tier. Empty when resolution was clean.
24
- */
25
- concept_resolver_note?: string | undefined;
26
- /**
27
- * Count of `concept_id`s chosen via the lower-confidence UMLS-CUI bridge
28
- * (no direct OMOP crosswalk existed). Resolved mode only.
29
- */
30
- concepts_bridged?: number | undefined;
31
- /**
32
- * Count of codings whose candidate list the resolver capped, so the best
33
- * concept may not have been among those returned.
34
- */
35
- concept_candidates_truncated?: number | undefined;
36
- /**
37
- * Count of codings resolved via the construe ML extractor — the text-only
38
- * or availability fallback path. A non-zero value bills the construe tier.
39
- */
40
- construe_resolutions?: number | undefined;
41
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * One source_to_concept_map-style mapping suggestion (Usagi-shaped).
3
- */
4
- export interface MappingReportEntry {
5
- resource_type?: string | undefined;
6
- resource_id?: string | undefined;
7
- omop_table?: string | undefined;
8
- source_system?: string | undefined;
9
- source_code?: string | undefined;
10
- source_name?: string | undefined;
11
- target_vocabulary?: string | undefined;
12
- /**
13
- * Standard concept code. Set when a coding is matched by the structural
14
- * (construe) tier — an already-standard code taken verbatim, or a
15
- * construe-suggested code — which is every match in structural mode and,
16
- * in resolved mode, codings for text-only resources or ones that fell back
17
- * when the resolver was unavailable. Omitted for codings resolved directly
18
- * by the concept-resolver service, which returns the standard concept's
19
- * id, name, and vocabulary but not its `concept_code`.
20
- */
21
- target_code?: string | undefined;
22
- target_name?: string | undefined;
23
- /**
24
- * ALREADY_STANDARD (source already in the target standard vocabulary),
25
- * MAPPED (resolved to a standard concept via the OMOP "Maps to" crosswalk
26
- * or UMLS-CUI bridge; resolved mode only), UNCHECKED (an unreviewed
27
- * construe suggestion; structural / fallback only), or UNMAPPED (no
28
- * candidate found).
29
- */
30
- mapping_status?: string | undefined;
31
- note?: string | undefined;
32
- }
@@ -1,41 +0,0 @@
1
- import type * as phenoml from "../../../index.mjs";
2
- /**
3
- * White Rabbit-style aggregate profile of the mapping request.
4
- */
5
- export interface ScanSummary {
6
- total_resources?: number | undefined;
7
- resource_counts?: Record<string, number> | undefined;
8
- tables_populated?: Record<string, number> | undefined;
9
- coding_systems?: Record<string, number> | undefined;
10
- codes_already_standard?: number | undefined;
11
- codes_normalized?: number | undefined;
12
- codes_unmapped?: number | undefined;
13
- off_vocab_rate?: number | undefined;
14
- dropped_resources?: phenoml.fhir2Omop.DroppedResource[] | undefined;
15
- /**
16
- * OMOP vocabulary release the resolver mapped against (e.g. "v20240229").
17
- * Resolved mode only; empty when no coded concept reached the service.
18
- */
19
- resolved_vocab_version?: string | undefined;
20
- /**
21
- * Set when concept resolution was degraded — the resolver was unavailable
22
- * for one or more codings, whose `concept_id`s fell back to the structural
23
- * (construe) tier. Empty when resolution was clean.
24
- */
25
- concept_resolver_note?: string | undefined;
26
- /**
27
- * Count of `concept_id`s chosen via the lower-confidence UMLS-CUI bridge
28
- * (no direct OMOP crosswalk existed). Resolved mode only.
29
- */
30
- concepts_bridged?: number | undefined;
31
- /**
32
- * Count of codings whose candidate list the resolver capped, so the best
33
- * concept may not have been among those returned.
34
- */
35
- concept_candidates_truncated?: number | undefined;
36
- /**
37
- * Count of codings resolved via the construe ML extractor — the text-only
38
- * or availability fallback path. A non-zero value bills the construe tier.
39
- */
40
- construe_resolutions?: number | undefined;
41
- }