phenoml 17.1.0 → 17.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "phenoml",
46
- "X-Fern-SDK-Version": "17.1.0",
47
- "User-Agent": "phenoml/17.1.0",
46
+ "X-Fern-SDK-Version": "17.2.0",
47
+ "User-Agent": "phenoml/17.2.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -15,22 +15,35 @@ export declare class Fhir2OmopClient {
15
15
  * (person, visit_occurrence, condition_occurrence, drug_exposure,
16
16
  * procedure_occurrence, measurement, observation).
17
17
  *
18
- * **This is a structural mapping (`mode: "structural"`).** Rows are
19
- * structurally valid OMOP, but every clinical and source `concept_id` is `0`:
20
- * the vocabulary crosswalk that assigns real OMOP `concept_id`s is a planned
21
- * follow-up. Each `*_source_value` carries the verbatim FHIR coding
18
+ * **Two resolution modes, reported in `mode`.** `mode` reflects which
19
+ * resolver is wired, not the path an individual coding took. With a
20
+ * concept-resolver configured (the default), `mode` is `"resolved"` and the
21
+ * resource's primary clinical coding is resolved to a real OMOP `concept_id`;
22
+ * with no resolver configured, `mode` is `"structural"` and every clinical
23
+ * and source `concept_id` is `0`. In `"resolved"` mode individual codings can
24
+ * still land at `concept_id` `0` without changing the mode: a coding the
25
+ * service finds no match for is `UNMAPPED`, and a coding that fell back to the
26
+ * structural tier (the resolver was briefly unavailable, or the resource was
27
+ * text-only) is surfaced in `scan_summary` (`concept_resolver_note`,
28
+ * `construe_resolutions`). A `concept_id` of `0` is "no matching concept" per
29
+ * OMOP semantics, deliberately not omitted. Only the primary clinical coding
30
+ * is resolved — `gender`/`race`/`ethnicity`/`visit`/`value`/`unit`
31
+ * `concept_id`s are always `0`.
32
+ *
33
+ * In every mode each `*_source_value` carries the verbatim FHIR coding
22
34
  * (`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the
23
- * response `report` lists a standard-code *suggestion* for each source coding
24
- * (already-standard, an unchecked normalization suggestion, or unmapped). Do
25
- * not treat the output as analytically resolved OMOP until `concept_id`s are
26
- * populated.
35
+ * response `report` lists one Usagi-shaped entry per source coding describing
36
+ * how it resolved (`ALREADY_STANDARD`, `MAPPED`, an `UNCHECKED` suggestion,
37
+ * or `UNMAPPED`).
27
38
  *
28
39
  * Medication codes are resolved whether they appear inline
29
40
  * (`medicationCodeableConcept`) or via a `medicationReference` to a contained,
30
41
  * relative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.
31
- * A medication with no usable code, resolvable reference, or display is
32
- * reported under `scan_summary.dropped_resources` rather than emitted as a
33
- * blank row. The bundle must contain at least one Patient resource.
42
+ * Resources that cannot be shaped into a row a medication with no usable
43
+ * code, resolvable reference, or display, or any clinical resource whose
44
+ * subject/patient reference cannot be tied to a person are reported under
45
+ * `scan_summary.dropped_resources` rather than emitted as blank rows. The
46
+ * bundle must contain at least one Patient resource.
34
47
  *
35
48
  * @param {phenoml.fhir2Omop.CreateOmopRequest} request
36
49
  * @param {Fhir2OmopClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -60,22 +60,35 @@ class Fhir2OmopClient {
60
60
  * (person, visit_occurrence, condition_occurrence, drug_exposure,
61
61
  * procedure_occurrence, measurement, observation).
62
62
  *
63
- * **This is a structural mapping (`mode: "structural"`).** Rows are
64
- * structurally valid OMOP, but every clinical and source `concept_id` is `0`:
65
- * the vocabulary crosswalk that assigns real OMOP `concept_id`s is a planned
66
- * follow-up. Each `*_source_value` carries the verbatim FHIR coding
63
+ * **Two resolution modes, reported in `mode`.** `mode` reflects which
64
+ * resolver is wired, not the path an individual coding took. With a
65
+ * concept-resolver configured (the default), `mode` is `"resolved"` and the
66
+ * resource's primary clinical coding is resolved to a real OMOP `concept_id`;
67
+ * with no resolver configured, `mode` is `"structural"` and every clinical
68
+ * and source `concept_id` is `0`. In `"resolved"` mode individual codings can
69
+ * still land at `concept_id` `0` without changing the mode: a coding the
70
+ * service finds no match for is `UNMAPPED`, and a coding that fell back to the
71
+ * structural tier (the resolver was briefly unavailable, or the resource was
72
+ * text-only) is surfaced in `scan_summary` (`concept_resolver_note`,
73
+ * `construe_resolutions`). A `concept_id` of `0` is "no matching concept" per
74
+ * OMOP semantics, deliberately not omitted. Only the primary clinical coding
75
+ * is resolved — `gender`/`race`/`ethnicity`/`visit`/`value`/`unit`
76
+ * `concept_id`s are always `0`.
77
+ *
78
+ * In every mode each `*_source_value` carries the verbatim FHIR coding
67
79
  * (`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the
68
- * response `report` lists a standard-code *suggestion* for each source coding
69
- * (already-standard, an unchecked normalization suggestion, or unmapped). Do
70
- * not treat the output as analytically resolved OMOP until `concept_id`s are
71
- * populated.
80
+ * response `report` lists one Usagi-shaped entry per source coding describing
81
+ * how it resolved (`ALREADY_STANDARD`, `MAPPED`, an `UNCHECKED` suggestion,
82
+ * or `UNMAPPED`).
72
83
  *
73
84
  * Medication codes are resolved whether they appear inline
74
85
  * (`medicationCodeableConcept`) or via a `medicationReference` to a contained,
75
86
  * relative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.
76
- * A medication with no usable code, resolvable reference, or display is
77
- * reported under `scan_summary.dropped_resources` rather than emitted as a
78
- * blank row. The bundle must contain at least one Patient resource.
87
+ * Resources that cannot be shaped into a row a medication with no usable
88
+ * code, resolvable reference, or display, or any clinical resource whose
89
+ * subject/patient reference cannot be tied to a person are reported under
90
+ * `scan_summary.dropped_resources` rather than emitted as blank rows. The
91
+ * bundle must contain at least one Patient resource.
79
92
  *
80
93
  * @param {phenoml.fhir2Omop.CreateOmopRequest} request
81
94
  * @param {Fhir2OmopClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -2,7 +2,13 @@ import type * as phenoml from "../../../index.js";
2
2
  export interface CreateOmopResponse {
3
3
  success?: boolean | undefined;
4
4
  message?: string | undefined;
5
- /** Resolution mode. `structural` means all clinical concept_ids are 0 (vocabulary crosswalk pending). */
5
+ /**
6
+ * Resolution mode. `resolved` (default) means clinical `concept_id`s were
7
+ * filled by the concept-resolver service; `structural` means no resolver
8
+ * was configured, so all clinical `concept_id`s are `0`. Reflects which
9
+ * resolver is wired, not the path an individual coding took — per-coding
10
+ * degradation is surfaced in `scan_summary`, not the mode.
11
+ */
6
12
  mode?: string | undefined;
7
13
  tables?: phenoml.fhir2Omop.OmopTables | undefined;
8
14
  /** One Usagi-shaped entry per source coding routed through concept resolution. */
@@ -9,10 +9,24 @@ export interface MappingReportEntry {
9
9
  source_code?: string | undefined;
10
10
  source_name?: string | undefined;
11
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
+ */
12
21
  target_code?: string | undefined;
13
22
  target_name?: string | undefined;
14
- /** ALREADY_STANDARD (source already in target vocabulary), UNCHECKED (unreviewed suggestion), or UNMAPPED (no candidate found). */
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
+ */
15
30
  mapping_status?: string | undefined;
16
- equivalence?: string | undefined;
17
31
  note?: string | undefined;
18
32
  }
@@ -12,4 +12,30 @@ export interface ScanSummary {
12
12
  codes_unmapped?: number | undefined;
13
13
  off_vocab_rate?: number | undefined;
14
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;
15
41
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "17.1.0";
1
+ export declare const SDK_VERSION = "17.2.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "17.1.0";
4
+ exports.SDK_VERSION = "17.2.0";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "phenoml",
9
- "X-Fern-SDK-Version": "17.1.0",
10
- "User-Agent": "phenoml/17.1.0",
9
+ "X-Fern-SDK-Version": "17.2.0",
10
+ "User-Agent": "phenoml/17.2.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -15,22 +15,35 @@ export declare class Fhir2OmopClient {
15
15
  * (person, visit_occurrence, condition_occurrence, drug_exposure,
16
16
  * procedure_occurrence, measurement, observation).
17
17
  *
18
- * **This is a structural mapping (`mode: "structural"`).** Rows are
19
- * structurally valid OMOP, but every clinical and source `concept_id` is `0`:
20
- * the vocabulary crosswalk that assigns real OMOP `concept_id`s is a planned
21
- * follow-up. Each `*_source_value` carries the verbatim FHIR coding
18
+ * **Two resolution modes, reported in `mode`.** `mode` reflects which
19
+ * resolver is wired, not the path an individual coding took. With a
20
+ * concept-resolver configured (the default), `mode` is `"resolved"` and the
21
+ * resource's primary clinical coding is resolved to a real OMOP `concept_id`;
22
+ * with no resolver configured, `mode` is `"structural"` and every clinical
23
+ * and source `concept_id` is `0`. In `"resolved"` mode individual codings can
24
+ * still land at `concept_id` `0` without changing the mode: a coding the
25
+ * service finds no match for is `UNMAPPED`, and a coding that fell back to the
26
+ * structural tier (the resolver was briefly unavailable, or the resource was
27
+ * text-only) is surfaced in `scan_summary` (`concept_resolver_note`,
28
+ * `construe_resolutions`). A `concept_id` of `0` is "no matching concept" per
29
+ * OMOP semantics, deliberately not omitted. Only the primary clinical coding
30
+ * is resolved — `gender`/`race`/`ethnicity`/`visit`/`value`/`unit`
31
+ * `concept_id`s are always `0`.
32
+ *
33
+ * In every mode each `*_source_value` carries the verbatim FHIR coding
22
34
  * (`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the
23
- * response `report` lists a standard-code *suggestion* for each source coding
24
- * (already-standard, an unchecked normalization suggestion, or unmapped). Do
25
- * not treat the output as analytically resolved OMOP until `concept_id`s are
26
- * populated.
35
+ * response `report` lists one Usagi-shaped entry per source coding describing
36
+ * how it resolved (`ALREADY_STANDARD`, `MAPPED`, an `UNCHECKED` suggestion,
37
+ * or `UNMAPPED`).
27
38
  *
28
39
  * Medication codes are resolved whether they appear inline
29
40
  * (`medicationCodeableConcept`) or via a `medicationReference` to a contained,
30
41
  * relative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.
31
- * A medication with no usable code, resolvable reference, or display is
32
- * reported under `scan_summary.dropped_resources` rather than emitted as a
33
- * blank row. The bundle must contain at least one Patient resource.
42
+ * Resources that cannot be shaped into a row a medication with no usable
43
+ * code, resolvable reference, or display, or any clinical resource whose
44
+ * subject/patient reference cannot be tied to a person are reported under
45
+ * `scan_summary.dropped_resources` rather than emitted as blank rows. The
46
+ * bundle must contain at least one Patient resource.
34
47
  *
35
48
  * @param {phenoml.fhir2Omop.CreateOmopRequest} request
36
49
  * @param {Fhir2OmopClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -24,22 +24,35 @@ export class Fhir2OmopClient {
24
24
  * (person, visit_occurrence, condition_occurrence, drug_exposure,
25
25
  * procedure_occurrence, measurement, observation).
26
26
  *
27
- * **This is a structural mapping (`mode: "structural"`).** Rows are
28
- * structurally valid OMOP, but every clinical and source `concept_id` is `0`:
29
- * the vocabulary crosswalk that assigns real OMOP `concept_id`s is a planned
30
- * follow-up. Each `*_source_value` carries the verbatim FHIR coding
27
+ * **Two resolution modes, reported in `mode`.** `mode` reflects which
28
+ * resolver is wired, not the path an individual coding took. With a
29
+ * concept-resolver configured (the default), `mode` is `"resolved"` and the
30
+ * resource's primary clinical coding is resolved to a real OMOP `concept_id`;
31
+ * with no resolver configured, `mode` is `"structural"` and every clinical
32
+ * and source `concept_id` is `0`. In `"resolved"` mode individual codings can
33
+ * still land at `concept_id` `0` without changing the mode: a coding the
34
+ * service finds no match for is `UNMAPPED`, and a coding that fell back to the
35
+ * structural tier (the resolver was briefly unavailable, or the resource was
36
+ * text-only) is surfaced in `scan_summary` (`concept_resolver_note`,
37
+ * `construe_resolutions`). A `concept_id` of `0` is "no matching concept" per
38
+ * OMOP semantics, deliberately not omitted. Only the primary clinical coding
39
+ * is resolved — `gender`/`race`/`ethnicity`/`visit`/`value`/`unit`
40
+ * `concept_id`s are always `0`.
41
+ *
42
+ * In every mode each `*_source_value` carries the verbatim FHIR coding
31
43
  * (`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the
32
- * response `report` lists a standard-code *suggestion* for each source coding
33
- * (already-standard, an unchecked normalization suggestion, or unmapped). Do
34
- * not treat the output as analytically resolved OMOP until `concept_id`s are
35
- * populated.
44
+ * response `report` lists one Usagi-shaped entry per source coding describing
45
+ * how it resolved (`ALREADY_STANDARD`, `MAPPED`, an `UNCHECKED` suggestion,
46
+ * or `UNMAPPED`).
36
47
  *
37
48
  * Medication codes are resolved whether they appear inline
38
49
  * (`medicationCodeableConcept`) or via a `medicationReference` to a contained,
39
50
  * relative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.
40
- * A medication with no usable code, resolvable reference, or display is
41
- * reported under `scan_summary.dropped_resources` rather than emitted as a
42
- * blank row. The bundle must contain at least one Patient resource.
51
+ * Resources that cannot be shaped into a row a medication with no usable
52
+ * code, resolvable reference, or display, or any clinical resource whose
53
+ * subject/patient reference cannot be tied to a person are reported under
54
+ * `scan_summary.dropped_resources` rather than emitted as blank rows. The
55
+ * bundle must contain at least one Patient resource.
43
56
  *
44
57
  * @param {phenoml.fhir2Omop.CreateOmopRequest} request
45
58
  * @param {Fhir2OmopClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -2,7 +2,13 @@ import type * as phenoml from "../../../index.mjs";
2
2
  export interface CreateOmopResponse {
3
3
  success?: boolean | undefined;
4
4
  message?: string | undefined;
5
- /** Resolution mode. `structural` means all clinical concept_ids are 0 (vocabulary crosswalk pending). */
5
+ /**
6
+ * Resolution mode. `resolved` (default) means clinical `concept_id`s were
7
+ * filled by the concept-resolver service; `structural` means no resolver
8
+ * was configured, so all clinical `concept_id`s are `0`. Reflects which
9
+ * resolver is wired, not the path an individual coding took — per-coding
10
+ * degradation is surfaced in `scan_summary`, not the mode.
11
+ */
6
12
  mode?: string | undefined;
7
13
  tables?: phenoml.fhir2Omop.OmopTables | undefined;
8
14
  /** One Usagi-shaped entry per source coding routed through concept resolution. */
@@ -9,10 +9,24 @@ export interface MappingReportEntry {
9
9
  source_code?: string | undefined;
10
10
  source_name?: string | undefined;
11
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
+ */
12
21
  target_code?: string | undefined;
13
22
  target_name?: string | undefined;
14
- /** ALREADY_STANDARD (source already in target vocabulary), UNCHECKED (unreviewed suggestion), or UNMAPPED (no candidate found). */
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
+ */
15
30
  mapping_status?: string | undefined;
16
- equivalence?: string | undefined;
17
31
  note?: string | undefined;
18
32
  }
@@ -12,4 +12,30 @@ export interface ScanSummary {
12
12
  codes_unmapped?: number | undefined;
13
13
  off_vocab_rate?: number | undefined;
14
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;
15
41
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "17.1.0";
1
+ export declare const SDK_VERSION = "17.2.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "17.1.0";
1
+ export const SDK_VERSION = "17.2.0";
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "Phenoml API",
5
- "version": "f063af0e8ddd9e9322b47bb8bc90c378af75764a"
5
+ "version": "f96459701356d9f1fe1acbeab0f6f2eccc498046"
6
6
  },
7
7
  "x-services": [
8
8
  {
@@ -3021,7 +3021,7 @@
3021
3021
  "post": {
3022
3022
  "operationId": "fhir2omop_create",
3023
3023
  "summary": "Map FHIR resources to OMOP CDM v5.4",
3024
- "description": "Shapes a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows\n(person, visit_occurrence, condition_occurrence, drug_exposure,\nprocedure_occurrence, measurement, observation).\n\n**This is a structural mapping (`mode: \"structural\"`).** Rows are\nstructurally valid OMOP, but every clinical and source `concept_id` is `0`:\nthe vocabulary crosswalk that assigns real OMOP `concept_id`s is a planned\nfollow-up. Each `*_source_value` carries the verbatim FHIR coding\n(`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the\nresponse `report` lists a standard-code *suggestion* for each source coding\n(already-standard, an unchecked normalization suggestion, or unmapped). Do\nnot treat the output as analytically resolved OMOP until `concept_id`s are\npopulated.\n\nMedication codes are resolved whether they appear inline\n(`medicationCodeableConcept`) or via a `medicationReference` to a contained,\nrelative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.\nA medication with no usable code, resolvable reference, or display is\nreported under `scan_summary.dropped_resources` rather than emitted as a\nblank row. The bundle must contain at least one Patient resource.\n",
3024
+ "description": "Shapes a FHIR R4 resource or Bundle into OMOP Common Data Model v5.4 rows\n(person, visit_occurrence, condition_occurrence, drug_exposure,\nprocedure_occurrence, measurement, observation).\n\n**Two resolution modes, reported in `mode`.** `mode` reflects which\nresolver is wired, not the path an individual coding took. With a\nconcept-resolver configured (the default), `mode` is `\"resolved\"` and the\nresource's primary clinical coding is resolved to a real OMOP `concept_id`;\nwith no resolver configured, `mode` is `\"structural\"` and every clinical\nand source `concept_id` is `0`. In `\"resolved\"` mode individual codings can\nstill land at `concept_id` `0` without changing the mode: a coding the\nservice finds no match for is `UNMAPPED`, and a coding that fell back to the\nstructural tier (the resolver was briefly unavailable, or the resource was\ntext-only) is surfaced in `scan_summary` (`concept_resolver_note`,\n`construe_resolutions`). A `concept_id` of `0` is \"no matching concept\" per\nOMOP semantics, deliberately not omitted. Only the primary clinical coding\nis resolved \u2014 `gender`/`race`/`ethnicity`/`visit`/`value`/`unit`\n`concept_id`s are always `0`.\n\nIn every mode each `*_source_value` carries the verbatim FHIR coding\n(`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the\nresponse `report` lists one Usagi-shaped entry per source coding describing\nhow it resolved (`ALREADY_STANDARD`, `MAPPED`, an `UNCHECKED` suggestion,\nor `UNMAPPED`).\n\nMedication codes are resolved whether they appear inline\n(`medicationCodeableConcept`) or via a `medicationReference` to a contained,\nrelative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.\nResources that cannot be shaped into a row \u2014 a medication with no usable\ncode, resolvable reference, or display, or any clinical resource whose\nsubject/patient reference cannot be tied to a person \u2014 are reported under\n`scan_summary.dropped_resources` rather than emitted as blank rows. The\nbundle must contain at least one Patient resource.\n",
3025
3025
  "requestBody": {
3026
3026
  "required": true,
3027
3027
  "content": {
@@ -3104,15 +3104,110 @@
3104
3104
  },
3105
3105
  "responses": {
3106
3106
  "200": {
3107
- "description": "FHIR resources mapped to OMOP CDM v5.4 (structural)",
3107
+ "description": "FHIR resources mapped to OMOP CDM v5.4",
3108
3108
  "content": {
3109
3109
  "application/json": {
3110
3110
  "schema": {
3111
3111
  "$ref": "#/components/schemas/fhir2omop_CreateOmopResponse"
3112
3112
  },
3113
3113
  "examples": {
3114
+ "resolved_mapping": {
3115
+ "summary": "Resolved mapping result (default)",
3116
+ "description": "Same bundle with `concept_id`s filled by the concept-resolver\nservice. Both source codes are already standard, so each carries\nits own OMOP `concept_id` with `ALREADY_STANDARD` status;\n`target_code` is omitted because the service returns the standard\nconcept's id, name, and vocabulary rather than its `concept_code`.\nIllustrative `concept_id` values.\n",
3117
+ "value": {
3118
+ "success": true,
3119
+ "message": "FHIR resources mapped to OMOP CDM v5.4 with vocabulary concept resolution",
3120
+ "mode": "resolved",
3121
+ "tables": {
3122
+ "person": [
3123
+ {
3124
+ "person_id": 1,
3125
+ "gender_concept_id": 0,
3126
+ "year_of_birth": 1985,
3127
+ "month_of_birth": 7,
3128
+ "day_of_birth": 22,
3129
+ "birth_datetime": "1985-07-22",
3130
+ "race_concept_id": 0,
3131
+ "ethnicity_concept_id": 0,
3132
+ "person_source_value": "patient-1",
3133
+ "gender_source_value": "female"
3134
+ }
3135
+ ],
3136
+ "condition_occurrence": [
3137
+ {
3138
+ "condition_occurrence_id": 1,
3139
+ "person_id": 1,
3140
+ "condition_concept_id": 201826,
3141
+ "condition_start_date": "2024-01-15",
3142
+ "condition_start_datetime": "2024-01-15",
3143
+ "condition_type_concept_id": 32817,
3144
+ "condition_source_value": "http://snomed.info/sct#44054006",
3145
+ "condition_source_concept_id": 201826
3146
+ }
3147
+ ],
3148
+ "drug_exposure": [
3149
+ {
3150
+ "drug_exposure_id": 1,
3151
+ "person_id": 1,
3152
+ "drug_concept_id": 40163924,
3153
+ "drug_exposure_start_date": "2024-01-16",
3154
+ "drug_exposure_start_datetime": "2024-01-16",
3155
+ "drug_type_concept_id": 32817,
3156
+ "drug_source_value": "http://www.nlm.nih.gov/research/umls/rxnorm#860975",
3157
+ "drug_source_concept_id": 40163924
3158
+ }
3159
+ ]
3160
+ },
3161
+ "report": [
3162
+ {
3163
+ "resource_type": "Condition",
3164
+ "resource_id": "condition-1",
3165
+ "omop_table": "condition_occurrence",
3166
+ "source_system": "http://snomed.info/sct",
3167
+ "source_code": "44054006",
3168
+ "source_name": "Type 2 diabetes mellitus",
3169
+ "target_vocabulary": "SNOMED",
3170
+ "target_name": "Type 2 diabetes mellitus",
3171
+ "mapping_status": "ALREADY_STANDARD"
3172
+ },
3173
+ {
3174
+ "resource_type": "MedicationRequest",
3175
+ "resource_id": "medreq-1",
3176
+ "omop_table": "drug_exposure",
3177
+ "source_system": "http://www.nlm.nih.gov/research/umls/rxnorm",
3178
+ "source_code": "860975",
3179
+ "source_name": "metformin hydrochloride 500 MG",
3180
+ "target_vocabulary": "RXNORM",
3181
+ "target_name": "metformin hydrochloride 500 MG",
3182
+ "mapping_status": "ALREADY_STANDARD"
3183
+ }
3184
+ ],
3185
+ "scan_summary": {
3186
+ "total_resources": 3,
3187
+ "resource_counts": {
3188
+ "Patient": 1,
3189
+ "Condition": 1,
3190
+ "MedicationRequest": 1
3191
+ },
3192
+ "tables_populated": {
3193
+ "person": 1,
3194
+ "condition_occurrence": 1,
3195
+ "drug_exposure": 1
3196
+ },
3197
+ "coding_systems": {
3198
+ "http://snomed.info/sct": 1,
3199
+ "http://www.nlm.nih.gov/research/umls/rxnorm": 1
3200
+ },
3201
+ "codes_already_standard": 2,
3202
+ "codes_normalized": 0,
3203
+ "codes_unmapped": 0,
3204
+ "off_vocab_rate": 0,
3205
+ "resolved_vocab_version": "v20240229"
3206
+ }
3207
+ }
3208
+ },
3114
3209
  "structural_mapping": {
3115
- "summary": "Structural mapping result",
3210
+ "summary": "Structural mapping result (fallback / no resolver configured)",
3116
3211
  "value": {
3117
3212
  "success": true,
3118
3213
  "message": "FHIR resources mapped to OMOP CDM v5.4 (structural; concept_ids pending vocabulary crosswalk)",
@@ -8561,7 +8656,7 @@
8561
8656
  },
8562
8657
  "mode": {
8563
8658
  "type": "string",
8564
- "description": "Resolution mode. `structural` means all clinical concept_ids are 0 (vocabulary crosswalk pending)."
8659
+ "description": "Resolution mode. `resolved` (default) means clinical `concept_id`s were\nfilled by the concept-resolver service; `structural` means no resolver\nwas configured, so all clinical `concept_id`s are `0`. Reflects which\nresolver is wired, not the path an individual coding took \u2014 per-coding\ndegradation is surfaced in `scan_summary`, not the mode.\n"
8565
8660
  },
8566
8661
  "tables": {
8567
8662
  "$ref": "#/components/schemas/fhir2omop_OmopTables"
@@ -8965,17 +9060,15 @@
8965
9060
  "type": "string"
8966
9061
  },
8967
9062
  "target_code": {
8968
- "type": "string"
9063
+ "type": "string",
9064
+ "description": "Standard concept code. Set when a coding is matched by the structural\n(construe) tier \u2014 an already-standard code taken verbatim, or a\nconstrue-suggested code \u2014 which is every match in structural mode and,\nin resolved mode, codings for text-only resources or ones that fell back\nwhen the resolver was unavailable. Omitted for codings resolved directly\nby the concept-resolver service, which returns the standard concept's\nid, name, and vocabulary but not its `concept_code`.\n"
8969
9065
  },
8970
9066
  "target_name": {
8971
9067
  "type": "string"
8972
9068
  },
8973
9069
  "mapping_status": {
8974
9070
  "type": "string",
8975
- "description": "ALREADY_STANDARD (source already in target vocabulary), UNCHECKED (unreviewed suggestion), or UNMAPPED (no candidate found)."
8976
- },
8977
- "equivalence": {
8978
- "type": "string"
9071
+ "description": "ALREADY_STANDARD (source already in the target standard vocabulary),\nMAPPED (resolved to a standard concept via the OMOP \"Maps to\" crosswalk\nor UMLS-CUI bridge; resolved mode only), UNCHECKED (an unreviewed\nconstrue suggestion; structural / fallback only), or UNMAPPED (no\ncandidate found).\n"
8979
9072
  },
8980
9073
  "note": {
8981
9074
  "type": "string"
@@ -9025,6 +9118,26 @@
9025
9118
  "items": {
9026
9119
  "$ref": "#/components/schemas/fhir2omop_DroppedResource"
9027
9120
  }
9121
+ },
9122
+ "resolved_vocab_version": {
9123
+ "type": "string",
9124
+ "description": "OMOP vocabulary release the resolver mapped against (e.g. \"v20240229\").\nResolved mode only; empty when no coded concept reached the service.\n"
9125
+ },
9126
+ "concept_resolver_note": {
9127
+ "type": "string",
9128
+ "description": "Set when concept resolution was degraded \u2014 the resolver was unavailable\nfor one or more codings, whose `concept_id`s fell back to the structural\n(construe) tier. Empty when resolution was clean.\n"
9129
+ },
9130
+ "concepts_bridged": {
9131
+ "type": "integer",
9132
+ "description": "Count of `concept_id`s chosen via the lower-confidence UMLS-CUI bridge\n(no direct OMOP crosswalk existed). Resolved mode only.\n"
9133
+ },
9134
+ "concept_candidates_truncated": {
9135
+ "type": "integer",
9136
+ "description": "Count of codings whose candidate list the resolver capped, so the best\nconcept may not have been among those returned.\n"
9137
+ },
9138
+ "construe_resolutions": {
9139
+ "type": "integer",
9140
+ "description": "Count of codings resolved via the construe ML extractor \u2014 the text-only\nor availability fallback path. A non-zero value bills the construe tier.\n"
9028
9141
  }
9029
9142
  }
9030
9143
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "17.1.0",
3
+ "version": "17.2.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -2677,22 +2677,35 @@ Shapes 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
- **This is a structural mapping (`mode: "structural"`).** Rows are
2681
- structurally valid OMOP, but every clinical and source `concept_id` is `0`:
2682
- the vocabulary crosswalk that assigns real OMOP `concept_id`s is a planned
2683
- follow-up. Each `*_source_value` carries the verbatim FHIR coding
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
2684
2696
  (`system#code`), `*_type_concept_id` is set to `32817` (EHR), and the
2685
- response `report` lists a standard-code *suggestion* for each source coding
2686
- (already-standard, an unchecked normalization suggestion, or unmapped). Do
2687
- not treat the output as analytically resolved OMOP until `concept_id`s are
2688
- populated.
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`).
2689
2700
 
2690
2701
  Medication codes are resolved whether they appear inline
2691
2702
  (`medicationCodeableConcept`) or via a `medicationReference` to a contained,
2692
2703
  relative (`Type/id`), or bundle-entry (`urn:uuid`) `Medication` resource.
2693
- A medication with no usable code, resolvable reference, or display is
2694
- reported under `scan_summary.dropped_resources` rather than emitted as a
2695
- blank row. The bundle must contain at least one Patient resource.
2704
+ Resources that cannot be shaped into a row a medication with no usable
2705
+ code, resolvable reference, or display, or any clinical resource whose
2706
+ subject/patient reference cannot be tied to a person are reported under
2707
+ `scan_summary.dropped_resources` rather than emitted as blank rows. The
2708
+ bundle must contain at least one Patient resource.
2696
2709
  </dd>
2697
2710
  </dl>
2698
2711
  </dd>