@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.
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nexalink.care/contracts/coding-rule-result.schema.json",
4
+ "title": "CodingRuleResult",
5
+ "description": "One deterministic rule execution trace attached to a decision. Rules never rely on the model for validity, bundling, sequencing, modifiers, units, or time calculations; each trace records the rule identity, version, inputs, outcome, and explanation needed to replay the decision.",
6
+ "version": "1.0.0",
7
+ "x-wire-version": "coding-rule-result-v1",
8
+ "x-wire-constant": "CODING_RULE_RESULT_SCHEMA_VERSION",
9
+ "x-code": "rule_result",
10
+ "x-keys-code": "rule_result_keys",
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["ruleId", "ruleVersion", "outcome"],
14
+ "properties": {
15
+ "ruleId": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "maxLength": 120,
19
+ "x-code": "rule_result_id"
20
+ },
21
+ "ruleVersion": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 40,
25
+ "x-code": "rule_result_version"
26
+ },
27
+ "outcome": {
28
+ "type": "string",
29
+ "enum": [
30
+ "satisfied",
31
+ "failed",
32
+ "rejected",
33
+ "escalated",
34
+ "conflicted",
35
+ "warning"
36
+ ],
37
+ "x-code": "rule_result_outcome"
38
+ },
39
+ "severity": {
40
+ "type": "string",
41
+ "enum": ["info", "warning", "blocking"],
42
+ "x-code": "rule_result_severity"
43
+ },
44
+ "inputs": {
45
+ "type": "array",
46
+ "maxItems": 30,
47
+ "x-code": "rule_result_inputs",
48
+ "items": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": ["name", "value"],
52
+ "x-code": "rule_result_input",
53
+ "x-keys-code": "rule_result_input_keys",
54
+ "properties": {
55
+ "name": {
56
+ "type": "string",
57
+ "minLength": 1,
58
+ "maxLength": 80,
59
+ "x-code": "rule_result_input_name"
60
+ },
61
+ "value": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "maxLength": 2000,
65
+ "x-code": "rule_result_input_value"
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "reason": {
71
+ "type": "string",
72
+ "minLength": 1,
73
+ "maxLength": 120,
74
+ "x-code": "rule_result_reason"
75
+ },
76
+ "explanation": {
77
+ "type": "string",
78
+ "minLength": 1,
79
+ "maxLength": 1000,
80
+ "x-strip-nonempty": true,
81
+ "x-code": "rule_result_explanation"
82
+ },
83
+ "evidence": {
84
+ "type": "string",
85
+ "minLength": 1,
86
+ "maxLength": 2000,
87
+ "x-code": "rule_result_evidence"
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nexalink.care/contracts/coding-service-line.schema.json",
4
+ "title": "CodingServiceLine",
5
+ "description": "One existing (submitted) claim line on a CodingCase. Decisions reference these lines by lineId; the line action is chosen by the decision, never stored here.",
6
+ "version": "1.0.0",
7
+ "x-wire-version": "coding-service-line-v1",
8
+ "x-wire-constant": "CODING_SERVICE_LINE_SCHEMA_VERSION",
9
+ "x-code": "service_line",
10
+ "x-keys-code": "service_line_keys",
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["lineId", "submittedCode"],
14
+ "properties": {
15
+ "lineId": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "maxLength": 60,
19
+ "x-code": "service_line_id"
20
+ },
21
+ "submittedCode": {
22
+ "type": "object",
23
+ "additionalProperties": false,
24
+ "required": ["code", "codeSystem"],
25
+ "x-code": "service_line_submitted_code",
26
+ "x-keys-code": "service_line_submitted_code_keys",
27
+ "properties": {
28
+ "code": {
29
+ "type": "string",
30
+ "minLength": 1,
31
+ "maxLength": 64,
32
+ "x-strip-nonempty": true,
33
+ "x-code": "service_line_code"
34
+ },
35
+ "codeSystem": {
36
+ "type": "string",
37
+ "enum": [
38
+ "ICD-10-CM",
39
+ "ICD-10-PCS",
40
+ "CPT",
41
+ "HCPCS",
42
+ "NDC",
43
+ "CDT",
44
+ "OTHER"
45
+ ],
46
+ "x-code": "service_line_code_system"
47
+ },
48
+ "codeVersion": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "maxLength": 40,
52
+ "x-code": "service_line_code_version"
53
+ }
54
+ }
55
+ },
56
+ "modifiers": {
57
+ "type": "array",
58
+ "maxItems": 8,
59
+ "x-code": "service_line_modifiers",
60
+ "items": {
61
+ "type": "string",
62
+ "minLength": 1,
63
+ "maxLength": 8,
64
+ "x-code": "service_line_modifiers"
65
+ }
66
+ },
67
+ "units": {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "x-code": "service_line_units",
71
+ "x-keys-code": "service_line_units_keys",
72
+ "properties": {
73
+ "count": {
74
+ "type": "integer",
75
+ "minimum": 0,
76
+ "maximum": 999999,
77
+ "x-code": "service_line_units_count"
78
+ },
79
+ "unitOfMeasure": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "maxLength": 20,
83
+ "x-code": "service_line_units_measure"
84
+ }
85
+ }
86
+ },
87
+ "linkedDiagnoses": {
88
+ "type": "array",
89
+ "maxItems": 20,
90
+ "x-code": "service_line_linked_diagnoses",
91
+ "items": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": ["diagnosisRef"],
95
+ "x-code": "service_line_linked_diagnosis",
96
+ "x-keys-code": "service_line_linked_diagnosis_keys",
97
+ "properties": {
98
+ "diagnosisRef": {
99
+ "type": "string",
100
+ "minLength": 1,
101
+ "maxLength": 60,
102
+ "x-code": "service_line_diagnosis_ref"
103
+ },
104
+ "sequence": {
105
+ "type": "integer",
106
+ "minimum": 1,
107
+ "maximum": 99,
108
+ "x-code": "service_line_diagnosis_sequence"
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "serviceDate": {
114
+ "type": "string",
115
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
116
+ "format": "date",
117
+ "x-code": "service_line_service_date"
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,160 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://nexalink.care/contracts/rcm-reviewer-event.schema.json",
4
+ "title": "RcmReviewerEvent",
5
+ "description": "Tenant-scoped, PHI-free reviewer engagement event for CareCompass RCM workflows. Events carry only an opaque case reference, categorical engagement facts, and aggregate durations. They never carry prompts, model responses, document contents, patient or member identifiers, claim identifiers, or free text.",
6
+ "version": "1.0.0",
7
+ "x-wire-version": "rcm-reviewer-event-v1",
8
+ "x-wire-constant": "RCM_REVIEWER_EVENT_SCHEMA_VERSION",
9
+ "x-code": "reviewer_event",
10
+ "x-keys-code": "reviewer_event_keys",
11
+ "x-semantic": [
12
+ {
13
+ "rule": "reviewer_event_shape",
14
+ "code": "reviewer_event_shape",
15
+ "on": "eventName"
16
+ }
17
+ ],
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "required": [
21
+ "eventName",
22
+ "occurredAt",
23
+ "tenantRef",
24
+ "caseRef",
25
+ "workflowId",
26
+ "source"
27
+ ],
28
+ "properties": {
29
+ "eventName": {
30
+ "type": "string",
31
+ "enum": [
32
+ "review_opened",
33
+ "decision_shown",
34
+ "evidence_opened",
35
+ "evidence_copied",
36
+ "review_active_time"
37
+ ],
38
+ "x-code": "reviewer_event_name"
39
+ },
40
+ "occurredAt": {
41
+ "type": "string",
42
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$",
43
+ "format": "date-time",
44
+ "maxLength": 64,
45
+ "x-code": "reviewer_event_occurred_at"
46
+ },
47
+ "tenantRef": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 128,
51
+ "pattern": "^[A-Za-z0-9_.:-]+$",
52
+ "x-code": "reviewer_event_tenant_ref"
53
+ },
54
+ "caseRef": {
55
+ "type": "string",
56
+ "minLength": 1,
57
+ "maxLength": 128,
58
+ "pattern": "^[A-Za-z0-9_.:-]+$",
59
+ "x-code": "reviewer_event_case_ref"
60
+ },
61
+ "reviewId": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "maxLength": 128,
65
+ "pattern": "^[A-Za-z0-9_.:-]+$",
66
+ "x-code": "reviewer_event_review_id"
67
+ },
68
+ "workflowId": {
69
+ "type": "string",
70
+ "enum": ["rcm-coding-assistance", "monthly-pin-time-aggregation"],
71
+ "x-code": "reviewer_event_workflow_id"
72
+ },
73
+ "packId": {
74
+ "type": "string",
75
+ "minLength": 1,
76
+ "maxLength": 80,
77
+ "pattern": "^[A-Za-z0-9_.:-]+$",
78
+ "x-code": "reviewer_event_pack_id"
79
+ },
80
+ "packVersion": {
81
+ "type": "string",
82
+ "minLength": 1,
83
+ "maxLength": 80,
84
+ "pattern": "^[A-Za-z0-9_.:-]+$",
85
+ "x-code": "reviewer_event_pack_version"
86
+ },
87
+ "environment": {
88
+ "type": "string",
89
+ "enum": ["development", "staging", "production"],
90
+ "x-code": "reviewer_event_environment"
91
+ },
92
+ "source": {
93
+ "type": "string",
94
+ "enum": ["portal", "embed"],
95
+ "x-code": "reviewer_event_source"
96
+ },
97
+ "evidenceId": {
98
+ "type": "string",
99
+ "minLength": 1,
100
+ "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
101
+ "maxLength": 64,
102
+ "x-code": "reviewer_event_evidence_id"
103
+ },
104
+ "activeSeconds": {
105
+ "type": "integer",
106
+ "minimum": 0,
107
+ "maximum": 86400,
108
+ "x-code": "reviewer_event_active_seconds"
109
+ },
110
+ "idlePaused": {
111
+ "type": "boolean",
112
+ "x-code": "reviewer_event_idle_paused"
113
+ }
114
+ },
115
+ "allOf": [
116
+ {
117
+ "if": {
118
+ "properties": {
119
+ "eventName": {
120
+ "enum": ["evidence_opened", "evidence_copied"]
121
+ }
122
+ },
123
+ "required": ["eventName"]
124
+ },
125
+ "then": {
126
+ "required": ["evidenceId"]
127
+ },
128
+ "else": {
129
+ "not": {
130
+ "required": ["evidenceId"]
131
+ }
132
+ }
133
+ },
134
+ {
135
+ "if": {
136
+ "properties": {
137
+ "eventName": {
138
+ "const": "review_active_time"
139
+ }
140
+ },
141
+ "required": ["eventName"]
142
+ },
143
+ "then": {
144
+ "required": ["activeSeconds"]
145
+ },
146
+ "else": {
147
+ "not": {
148
+ "anyOf": [
149
+ {
150
+ "required": ["activeSeconds"]
151
+ },
152
+ {
153
+ "required": ["idlePaused"]
154
+ }
155
+ ]
156
+ }
157
+ }
158
+ }
159
+ ]
160
+ }
@@ -2,11 +2,18 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://nexalink.care/contracts/rcm-workflow-catalog.schema.json",
4
4
  "title": "RcmWorkflowCatalog",
5
- "description": "A single authorized workflow entry. The catalog pins the workflow identifier, model policy, human-review policy, and output schema version that the runtime and portal may offer for the RCM coding-assistance workflow. Customer configuration can never redefine these immutable server-side values.",
6
- "version": "1.0.0",
5
+ "description": "A single authorized workflow entry. The catalog pins the workflow identifier, model policy, human-review policy, and output schema version that the runtime and portal may offer for registered coding workflows (currently rcm-coding-assistance and monthly-pin-time-aggregation). Customer configuration can never redefine these immutable server-side values.",
6
+ "version": "1.1.0",
7
7
  "x-wire-version": "rcm-workflow-catalog-v1",
8
8
  "x-code": "workflow_catalog",
9
9
  "x-keys-code": "workflow_catalog_keys",
10
+ "x-semantic": [
11
+ {
12
+ "rule": "workflow_policy_binding",
13
+ "code": "workflow_policy_binding",
14
+ "on": "modelPolicy"
15
+ }
16
+ ],
10
17
  "type": "object",
11
18
  "additionalProperties": false,
12
19
  "required": [
@@ -21,7 +28,7 @@
21
28
  "properties": {
22
29
  "id": {
23
30
  "type": "string",
24
- "enum": ["rcm-coding-assistance"],
31
+ "enum": ["rcm-coding-assistance", "monthly-pin-time-aggregation"],
25
32
  "x-code": "workflow_id"
26
33
  },
27
34
  "name": {
@@ -62,8 +69,11 @@
62
69
  "properties": {
63
70
  "policyId": {
64
71
  "type": "string",
65
- "const": "carecompass-rcm-review-v1",
66
- "x-code": "model_policy_id"
72
+ "x-code": "model_policy_id",
73
+ "enum": [
74
+ "carecompass-rcm-review-v1",
75
+ "carecompass-pin-time-policy-v1"
76
+ ]
67
77
  },
68
78
  "inferencePath": {
69
79
  "type": "string",
@@ -119,5 +129,52 @@
119
129
  "x-code": "workflow_output_schema_version"
120
130
  }
121
131
  },
132
+ "allOf": [
133
+ {
134
+ "if": {
135
+ "properties": {
136
+ "id": {
137
+ "const": "rcm-coding-assistance"
138
+ }
139
+ }
140
+ },
141
+ "then": {
142
+ "properties": {
143
+ "modelPolicy": {
144
+ "properties": {
145
+ "policyId": {
146
+ "const": "carecompass-rcm-review-v1"
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ },
153
+ {
154
+ "if": {
155
+ "properties": {
156
+ "id": {
157
+ "const": "monthly-pin-time-aggregation"
158
+ }
159
+ }
160
+ },
161
+ "then": {
162
+ "properties": {
163
+ "modelPolicy": {
164
+ "properties": {
165
+ "policyId": {
166
+ "const": "carecompass-pin-time-policy-v1"
167
+ }
168
+ }
169
+ },
170
+ "environments": {
171
+ "items": {
172
+ "const": "development"
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ],
122
179
  "x-wire-constant": "RCM_WORKFLOW_CATALOG_SCHEMA_VERSION"
123
180
  }
package/versions.json CHANGED
@@ -1,8 +1,68 @@
1
1
  {
2
2
  "$comment": "GENERATED FILE. Schema registry derived from schemas/*.schema.json.",
3
3
  "packageName": "@nexalink/coding-contracts",
4
- "packageVersion": "0.2.0",
4
+ "packageVersion": "0.4.0",
5
5
  "schemas": {
6
+ "coding-case-context": {
7
+ "file": "coding-case-context.schema.json",
8
+ "semver": "1.0.0",
9
+ "wireVersion": "coding-case-context-v1"
10
+ },
11
+ "coding-case-payer": {
12
+ "file": "coding-case-payer.schema.json",
13
+ "semver": "1.0.0",
14
+ "wireVersion": "coding-case-payer-v1"
15
+ },
16
+ "coding-case-clinical": {
17
+ "file": "coding-case-clinical.schema.json",
18
+ "semver": "1.0.0",
19
+ "wireVersion": "coding-case-clinical-v1"
20
+ },
21
+ "coding-service-line": {
22
+ "file": "coding-service-line.schema.json",
23
+ "semver": "1.0.0",
24
+ "wireVersion": "coding-service-line-v1"
25
+ },
26
+ "coding-extension": {
27
+ "file": "coding-extension.schema.json",
28
+ "semver": "1.0.0",
29
+ "wireVersion": "coding-extension-v1"
30
+ },
31
+ "coding-case": {
32
+ "file": "coding-case.schema.json",
33
+ "semver": "1.0.0",
34
+ "wireVersion": "coding-case-v1"
35
+ },
36
+ "coding-batch": {
37
+ "file": "coding-batch.schema.json",
38
+ "semver": "1.0.0",
39
+ "wireVersion": "coding-batch-v1"
40
+ },
41
+ "coding-decision-line": {
42
+ "file": "coding-decision-line.schema.json",
43
+ "semver": "1.0.0",
44
+ "wireVersion": "coding-decision-line-v1"
45
+ },
46
+ "coding-evidence": {
47
+ "file": "coding-evidence.schema.json",
48
+ "semver": "1.0.0",
49
+ "wireVersion": "coding-evidence-v1"
50
+ },
51
+ "coding-rule-result": {
52
+ "file": "coding-rule-result.schema.json",
53
+ "semver": "1.0.0",
54
+ "wireVersion": "coding-rule-result-v1"
55
+ },
56
+ "coding-reviewer-action": {
57
+ "file": "coding-reviewer-action.schema.json",
58
+ "semver": "1.1.0",
59
+ "wireVersion": "coding-reviewer-action-v1"
60
+ },
61
+ "coding-decision": {
62
+ "file": "coding-decision.schema.json",
63
+ "semver": "1.0.0",
64
+ "wireVersion": "coding-decision-v1"
65
+ },
6
66
  "rcm-supporting-reference": {
7
67
  "file": "rcm-supporting-reference.schema.json",
8
68
  "semver": "1.0.0",
@@ -28,6 +88,11 @@
28
88
  "semver": "1.0.0",
29
89
  "wireVersion": "rcm-retrieval-metadata-v1"
30
90
  },
91
+ "rcm-reviewer-event": {
92
+ "file": "rcm-reviewer-event.schema.json",
93
+ "semver": "1.0.0",
94
+ "wireVersion": "rcm-reviewer-event-v1"
95
+ },
31
96
  "rcm-runtime-event": {
32
97
  "file": "rcm-runtime-event.schema.json",
33
98
  "semver": "1.0.0",
@@ -35,7 +100,7 @@
35
100
  },
36
101
  "rcm-workflow-catalog": {
37
102
  "file": "rcm-workflow-catalog.schema.json",
38
- "semver": "1.0.0",
103
+ "semver": "1.1.0",
39
104
  "wireVersion": "rcm-workflow-catalog-v1"
40
105
  }
41
106
  }
@@ -5,6 +5,7 @@
5
5
  "rcmModelPolicyId": "carecompass-rcm-review-v1",
6
6
  "rcmHumanReviewPolicyId": "qualified-coder-review-v1",
7
7
  "rcmOutputSchemaName": "carecompass_rcm_grounded_review",
8
- "rcmHumanReviewInstruction": "Qualified human coder review is required before billing, coding, or claim submission."
8
+ "rcmHumanReviewInstruction": "Qualified human coder review is required before billing, coding, or claim submission.",
9
+ "pinTimeWorkflowId": "monthly-pin-time-aggregation"
9
10
  }
10
11
  }