@nexalink/coding-contracts 0.2.0 → 0.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.
- package/README.md +48 -8
- package/dist/cjs/index.cjs +4756 -76
- package/dist/index.d.ts +1090 -3
- package/dist/index.js +4728 -75
- package/package.json +8 -2
- package/schemas/coding-batch.schema.json +63 -0
- package/schemas/coding-case-clinical.schema.json +428 -0
- package/schemas/coding-case-context.schema.json +128 -0
- package/schemas/coding-case-payer.schema.json +126 -0
- package/schemas/coding-case.schema.json +97 -0
- package/schemas/coding-decision-line.schema.json +172 -0
- package/schemas/coding-decision.schema.json +430 -0
- package/schemas/coding-evidence.schema.json +100 -0
- package/schemas/coding-extension.schema.json +36 -0
- package/schemas/coding-reviewer-action.schema.json +64 -0
- package/schemas/coding-rule-result.schema.json +90 -0
- package/schemas/coding-service-line.schema.json +120 -0
- package/schemas/rcm-reviewer-event.schema.json +160 -0
- package/schemas/rcm-workflow-catalog.schema.json +62 -5
- package/versions.json +67 -2
- package/workflow-constants.json +2 -1
package/README.md
CHANGED
|
@@ -108,14 +108,54 @@ approved evidence set.
|
|
|
108
108
|
|
|
109
109
|
## Main exports
|
|
110
110
|
|
|
111
|
-
| Category | Exports
|
|
112
|
-
| ---------------- |
|
|
113
|
-
| Types | `RcmCodingInput`, `RcmCodingOutput`, `RcmSupportingReference`, `RcmModelPrompt`, `RcmRetrievalMetadata`, `RcmRuntimeEvent`, `RcmWorkflowCatalog`
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
111
|
+
| Category | Exports |
|
|
112
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
113
|
+
| Types | `RcmCodingInput`, `RcmCodingOutput`, `RcmSupportingReference`, `RcmModelPrompt`, `RcmRetrievalMetadata`, `RcmRuntimeEvent`, `RcmReviewerEvent`, `RcmWorkflowCatalog` |
|
|
114
|
+
| Case models | `CodingCase`, `CodingCaseContext`, `CodingCasePayer`, `CodingCaseClinical`, `CodingServiceLine`, `CodingExtension`, `CodingBatch` |
|
|
115
|
+
| Decision models | `CodingDecision`, `CodingDecisionLine`, `CodingEvidence`, `CodingRuleResult`, `CodingReviewerAction` |
|
|
116
|
+
| Zod schemas | `rcmCodingInputSchema`, `rcmCodingOutputSchema`, `codingCaseSchema`, `codingDecisionSchema`, and one schema for each additional contract type |
|
|
117
|
+
| Validation | `rcm*ValidationError` functions, `coding*ValidationError` functions, and `valid*` boolean helpers |
|
|
118
|
+
| Workflow policy | `RCM_WORKFLOW_ID`, `PIN_TIME_WORKFLOW_ID`, `RCM_MODEL_POLICY_ID`, `RCM_HUMAN_REVIEW_POLICY_ID`, `RCM_HUMAN_REVIEW_INSTRUCTION`, `RCM_OUTPUT_SCHEMA_NAME` |
|
|
119
|
+
| Schema versions | `RCM_INPUT_SCHEMA_VERSION`, `RCM_OUTPUT_SCHEMA_VERSION`, `RCM_REFERENCE_SCHEMA_VERSION`, `CODING_CASE_SCHEMA_VERSION`, `CODING_DECISION_SCHEMA_VERSION`, and the other contract wire-version constants |
|
|
120
|
+
| Schema documents | `Rcm*SchemaJson`, `Coding*SchemaJson` values, JSON Schema package subpaths, `versions.json`, and `workflow-constants.json` |
|
|
121
|
+
|
|
122
|
+
## Canonical CodingCase and CodingDecision
|
|
123
|
+
|
|
124
|
+
`CodingCase` is the canonical case envelope for encounter review, claim review,
|
|
125
|
+
longitudinal review, monthly multi-activity time aggregation, and bounded batch
|
|
126
|
+
review. `CodingDecision` is the corresponding reconstructable decision.
|
|
127
|
+
|
|
128
|
+
- **CodingCase** carries case identity (`caseId` is client-supplied and may be
|
|
129
|
+
a direct reference; `analyticsId` is the separate analytics-safe identifier),
|
|
130
|
+
coding intent, the service period, setting/jurisdiction/provider context,
|
|
131
|
+
payer/plan/program/contract context, structured clinical facts (diagnoses,
|
|
132
|
+
procedures, medications, supplies, `timeUnits` with `durationMinutes` and
|
|
133
|
+
`activityCode`, notes, source references), existing claim lines, and
|
|
134
|
+
namespaced `extensions`.
|
|
135
|
+
- **CodingDecision** references the case by the analytics-safe `caseRef` only,
|
|
136
|
+
proposes claim-line actions (`add`, `retain`, `replace`, `remove`, `review`)
|
|
137
|
+
with code identity, modifiers, units, linked diagnoses, and sequencing, and
|
|
138
|
+
records typed evidence, documentation gaps, conflicts, extracted facts, rule
|
|
139
|
+
traces, confidence, and the qualified-human-review disposition.
|
|
140
|
+
- **Provenance** (`decisionSchemaVersion`, `caseSchemaVersion`, pack, model,
|
|
141
|
+
terminology editions with license status, rule versions, retrieval corpus,
|
|
142
|
+
and generation time) lets every recommendation be reconstructed.
|
|
143
|
+
- **ReviewerAction** is appended immutably: the original decision and the
|
|
144
|
+
attributable reviewer disposition are both preserved.
|
|
145
|
+
- **Extensions** are `{ namespace, schemaVersion, payload }` objects. Payloads
|
|
146
|
+
are bounded (at most 50 properties) but otherwise opaque; Nexalink reserves
|
|
147
|
+
`com.nexalink` and `org.nexalink` namespaces. Extensions keep pack-specific
|
|
148
|
+
data out of the shared envelope without making every field optional.
|
|
149
|
+
- **Identifiers**: direct identifiers (`caseId`, provider NPIs/names, `memberId`)
|
|
150
|
+
are documented as such in the schemas and must never be promoted to analytics
|
|
151
|
+
surfaces. Decisions and metrics reference the analytics-safe `analyticsId` /
|
|
152
|
+
`caseRef` only.
|
|
153
|
+
- **Batching**: `CodingBatch` wraps 1–100 cases for bounded batch review; one
|
|
154
|
+
execution stays within runtime limits.
|
|
155
|
+
|
|
156
|
+
The current RCM example (`DEMO-ENC-1042`) and a monthly multi-activity
|
|
157
|
+
time-aggregation workflow both have lossless, round-trip fixtures under
|
|
158
|
+
`fixtures/coding-case/` and `fixtures/coding-decision/`.
|
|
119
159
|
|
|
120
160
|
## Use the raw JSON Schemas
|
|
121
161
|
|