@the-cascade-protocol/cli 0.2.0 → 0.2.1

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 (50) hide show
  1. package/dist/commands/pod/helpers.d.ts +1 -1
  2. package/dist/commands/pod/helpers.d.ts.map +1 -1
  3. package/dist/commands/pod/helpers.js +5 -20
  4. package/dist/commands/pod/helpers.js.map +1 -1
  5. package/package.json +17 -5
  6. package/.dockerignore +0 -7
  7. package/.eslintrc.json +0 -23
  8. package/.prettierrc +0 -7
  9. package/Dockerfile +0 -18
  10. package/src/commands/capabilities.ts +0 -235
  11. package/src/commands/conformance.ts +0 -447
  12. package/src/commands/convert.ts +0 -164
  13. package/src/commands/pod/export.ts +0 -85
  14. package/src/commands/pod/helpers.ts +0 -449
  15. package/src/commands/pod/index.ts +0 -32
  16. package/src/commands/pod/info.ts +0 -239
  17. package/src/commands/pod/init.ts +0 -273
  18. package/src/commands/pod/query.ts +0 -224
  19. package/src/commands/serve.ts +0 -92
  20. package/src/commands/validate.ts +0 -303
  21. package/src/index.ts +0 -58
  22. package/src/lib/fhir-converter/cascade-to-fhir.ts +0 -369
  23. package/src/lib/fhir-converter/converters-clinical.ts +0 -446
  24. package/src/lib/fhir-converter/converters-demographics.ts +0 -270
  25. package/src/lib/fhir-converter/fhir-to-cascade.ts +0 -82
  26. package/src/lib/fhir-converter/index.ts +0 -215
  27. package/src/lib/fhir-converter/types.ts +0 -318
  28. package/src/lib/mcp/audit.ts +0 -107
  29. package/src/lib/mcp/server.ts +0 -192
  30. package/src/lib/mcp/tools.ts +0 -668
  31. package/src/lib/output.ts +0 -76
  32. package/src/lib/shacl-validator.ts +0 -314
  33. package/src/lib/turtle-parser.ts +0 -277
  34. package/src/shapes/checkup.shapes.ttl +0 -1459
  35. package/src/shapes/clinical.shapes.ttl +0 -1350
  36. package/src/shapes/clinical.ttl +0 -1369
  37. package/src/shapes/core.shapes.ttl +0 -450
  38. package/src/shapes/core.ttl +0 -603
  39. package/src/shapes/coverage.shapes.ttl +0 -214
  40. package/src/shapes/coverage.ttl +0 -182
  41. package/src/shapes/health.shapes.ttl +0 -697
  42. package/src/shapes/health.ttl +0 -859
  43. package/src/shapes/pots.shapes.ttl +0 -481
  44. package/test-fixtures/fhir-bundle-example.json +0 -216
  45. package/test-fixtures/fhir-medication-example.json +0 -18
  46. package/tests/cli.test.ts +0 -126
  47. package/tests/fhir-converter.test.ts +0 -874
  48. package/tests/mcp-server.test.ts +0 -396
  49. package/tests/pod.test.ts +0 -400
  50. package/tsconfig.json +0 -24
@@ -1,214 +0,0 @@
1
- @prefix sh: <http://www.w3.org/ns/shacl#> .
2
- @prefix coverage: <https://ns.cascadeprotocol.org/coverage/v1#> .
3
- @prefix cascade: <https://ns.cascadeprotocol.org/core/v1#> .
4
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
6
-
7
- # ============================================================================
8
- # Cascade Protocol — Coverage Vocabulary SHACL Validation Shapes
9
- # Version: 1.0 (Phase 4, 2026-02-18)
10
- # Validates: coverage:InsurancePlan
11
- #
12
- # Layer 2 domain-specific vocabulary for patient-owned insurance and benefits data.
13
- # Aligns with FHIR Coverage resource (fhir:Coverage).
14
- # ============================================================================
15
-
16
- # ============================================================================
17
- # Shape: Insurance Plan
18
- # ============================================================================
19
-
20
- coverage:InsurancePlanShape a sh:NodeShape ;
21
- sh:targetClass coverage:InsurancePlan ;
22
- rdfs:label "Insurance Plan Shape"@en ;
23
- rdfs:comment "Validation constraints for patient insurance plan records. Covers core identification, plan classification, coverage period, subscriber info, and pharmacy benefits."@en ;
24
-
25
- # ------------------------------------------------------------------
26
- # REQUIRED (sh:Violation) — Must be present for valid plan record
27
- # ------------------------------------------------------------------
28
-
29
- # Required: providerName
30
- sh:property [
31
- sh:path coverage:providerName ;
32
- sh:datatype xsd:string ;
33
- sh:minCount 1 ;
34
- sh:maxCount 1 ;
35
- sh:minLength 1 ;
36
- sh:name "Provider Name"@en ;
37
- sh:message "Insurance provider name is required"@en ;
38
- sh:severity sh:Violation
39
- ] ;
40
-
41
- # Required: memberId
42
- sh:property [
43
- sh:path coverage:memberId ;
44
- sh:datatype xsd:string ;
45
- sh:minCount 1 ;
46
- sh:maxCount 1 ;
47
- sh:minLength 1 ;
48
- sh:name "Member ID"@en ;
49
- sh:message "Member ID is required for claims processing"@en ;
50
- sh:severity sh:Violation
51
- ] ;
52
-
53
- # Required: coverageType
54
- sh:property [
55
- sh:path coverage:coverageType ;
56
- sh:datatype xsd:string ;
57
- sh:minCount 1 ;
58
- sh:maxCount 1 ;
59
- sh:in ("primary" "secondary" "dental" "vision") ;
60
- sh:name "Coverage Type"@en ;
61
- sh:message "Coverage type must be primary, secondary, dental, or vision"@en ;
62
- sh:severity sh:Violation
63
- ] ;
64
-
65
- # ------------------------------------------------------------------
66
- # WARNING (sh:Warning) — Important for coverage verification
67
- # ------------------------------------------------------------------
68
-
69
- # Warning: groupNumber
70
- sh:property [
71
- sh:path coverage:groupNumber ;
72
- sh:datatype xsd:string ;
73
- sh:maxCount 1 ;
74
- sh:name "Group Number"@en ;
75
- sh:message "Group number helps verify coverage"@en ;
76
- sh:severity sh:Warning
77
- ] ;
78
-
79
- # Warning: planType
80
- sh:property [
81
- sh:path coverage:planType ;
82
- sh:datatype xsd:string ;
83
- sh:maxCount 1 ;
84
- sh:in ("hmo" "ppo" "epo" "pos" "hdhp" "medicare" "medicaid" "tricare" "other") ;
85
- sh:name "Plan Type"@en ;
86
- sh:message "Plan type should be hmo, ppo, epo, pos, hdhp, medicare, medicaid, tricare, or other"@en ;
87
- sh:severity sh:Warning
88
- ] ;
89
-
90
- # Warning: effectiveStart
91
- sh:property [
92
- sh:path coverage:effectiveStart ;
93
- sh:datatype xsd:date ;
94
- sh:maxCount 1 ;
95
- sh:name "Effective Start"@en ;
96
- sh:message "Plan effective date helps verify active coverage"@en ;
97
- sh:severity sh:Warning
98
- ] ;
99
-
100
- # Warning: subscriberRelationship
101
- sh:property [
102
- sh:path coverage:subscriberRelationship ;
103
- sh:datatype xsd:string ;
104
- sh:maxCount 1 ;
105
- sh:in ("self" "spouse" "child" "parent" "other") ;
106
- sh:name "Subscriber Relationship"@en ;
107
- sh:message "Subscriber relationship needed for dependent verification"@en ;
108
- sh:severity sh:Warning
109
- ] ;
110
-
111
- # ------------------------------------------------------------------
112
- # INFO (sh:Info) — Suggested for completeness
113
- # ------------------------------------------------------------------
114
-
115
- # Info: planName
116
- sh:property [
117
- sh:path coverage:planName ;
118
- sh:datatype xsd:string ;
119
- sh:maxCount 1 ;
120
- sh:name "Plan Name"@en ;
121
- sh:severity sh:Info
122
- ] ;
123
-
124
- # Info: effectiveEnd
125
- sh:property [
126
- sh:path coverage:effectiveEnd ;
127
- sh:datatype xsd:date ;
128
- sh:maxCount 1 ;
129
- sh:name "Effective End"@en ;
130
- sh:severity sh:Info
131
- ] ;
132
-
133
- # Info: subscriberId
134
- sh:property [
135
- sh:path coverage:subscriberId ;
136
- sh:datatype xsd:string ;
137
- sh:maxCount 1 ;
138
- sh:name "Subscriber ID"@en ;
139
- sh:severity sh:Info
140
- ] ;
141
-
142
- # Info: subscriberName
143
- sh:property [
144
- sh:path coverage:subscriberName ;
145
- sh:datatype xsd:string ;
146
- sh:maxCount 1 ;
147
- sh:name "Subscriber Name"@en ;
148
- sh:severity sh:Info
149
- ] ;
150
-
151
- # Info: rxBin
152
- sh:property [
153
- sh:path coverage:rxBin ;
154
- sh:datatype xsd:string ;
155
- sh:maxCount 1 ;
156
- sh:name "Rx BIN"@en ;
157
- sh:severity sh:Info
158
- ] ;
159
-
160
- # Info: rxPcn
161
- sh:property [
162
- sh:path coverage:rxPcn ;
163
- sh:datatype xsd:string ;
164
- sh:maxCount 1 ;
165
- sh:name "Rx PCN"@en ;
166
- sh:severity sh:Info
167
- ] ;
168
-
169
- # Info: rxGroup
170
- sh:property [
171
- sh:path coverage:rxGroup ;
172
- sh:datatype xsd:string ;
173
- sh:maxCount 1 ;
174
- sh:name "Rx Group"@en ;
175
- sh:severity sh:Info
176
- ] ;
177
-
178
- # ------------------------------------------------------------------
179
- # Standard Cascade metadata
180
- # ------------------------------------------------------------------
181
-
182
- # Required: provenance
183
- sh:property [
184
- sh:path cascade:dataProvenance ;
185
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
186
- sh:minCount 1 ;
187
- sh:maxCount 1 ;
188
- sh:name "Data Provenance"@en ;
189
- sh:message "Insurance plan must have valid provenance"@en
190
- ] ;
191
-
192
- # Required: schemaVersion
193
- sh:property [
194
- sh:path cascade:schemaVersion ;
195
- sh:datatype xsd:string ;
196
- sh:minCount 1 ;
197
- sh:maxCount 1 ;
198
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
199
- sh:name "Schema Version"@en ;
200
- sh:message "Schema version must be in format major.minor"@en
201
- ] .
202
-
203
- # ============================================================================
204
- # Changelog
205
- # ============================================================================
206
- #
207
- # Version 1.0 (2026-02-18)
208
- # - Initial release with InsurancePlanShape
209
- # - 3 REQUIRED (sh:Violation): providerName, memberId, coverageType
210
- # - 4 WARNING (sh:Warning): groupNumber, planType, effectiveStart, subscriberRelationship
211
- # - 6 INFO (sh:Info): planName, effectiveEnd, subscriberId, subscriberName, rxBin, rxPcn, rxGroup
212
- # - Standard Cascade metadata: dataProvenance, schemaVersion
213
- # - Aligns with coverage.ttl v1.0 InsurancePlan class (14 properties)
214
- #
@@ -1,182 +0,0 @@
1
- @prefix coverage: <https://ns.cascadeprotocol.org/coverage/v1#> .
2
- @prefix cascade: <https://ns.cascadeprotocol.org/core/v1#> .
3
- @prefix fhir: <http://hl7.org/fhir/> .
4
- @prefix prov: <http://www.w3.org/ns/prov#> .
5
- @prefix owl: <http://www.w3.org/2002/07/owl#> .
6
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
7
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
8
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
9
- @prefix dct: <http://purl.org/dc/terms/> .
10
-
11
- # ============================================================================
12
- # Ontology Metadata
13
- # ============================================================================
14
-
15
- <https://ns.cascadeprotocol.org/coverage/v1#> a owl:Ontology ;
16
- owl:imports <https://ns.cascadeprotocol.org/core/v1#> ;
17
- dct:title "Cascade Protocol Coverage Vocabulary"@en ;
18
- dct:description "Domain vocabulary for patient-owned insurance, benefits, and financial health data. Layer 2 vocabulary resolving the overlap between checkup:InsuranceInfo (patient-reported) and clinical:CoverageRecord (EHR-imported) with a unified, standardized representation."@en ;
19
- dct:creator "Cascade Agentic Labs" ;
20
- dct:created "2026-02-18"^^xsd:date ;
21
- dct:modified "2026-02-18"^^xsd:date ;
22
- owl:versionInfo "1.0" ;
23
- rdfs:comment "Insurance and benefits data is cross-cutting: not clinical (it's administrative/financial), not app-specific (any health app benefits from knowing coverage), and contributed by both patient self-report and EHR import. This vocabulary provides a single Layer 2 domain model that both checkup: (Layer 3, patient-reported) and clinical: (Layer 2, EHR-imported) can reference via the mixed namespace pattern. Recommended Pod storage path: /coverage/"@en ;
24
- rdfs:seeAlso <https://cascadeprotocol.org/docs/coverage/v1/> .
25
-
26
- # ============================================================================
27
- # Classes
28
- # ============================================================================
29
-
30
- coverage:InsurancePlan a owl:Class ;
31
- rdfs:label "Insurance Plan"@en ;
32
- rdfs:comment "An insurance plan the patient is enrolled in. Unifies patient-reported data (from checkup:InsuranceInfo) and EHR-imported data (from clinical:CoverageRecord) into a single standardized representation. Recommended Pod storage: /coverage/plans/{plan-id}.ttl"@en ;
33
- rdfs:subClassOf prov:Entity ;
34
- rdfs:seeAlso fhir:Coverage .
35
-
36
- coverage:Deductible a owl:Class ;
37
- rdfs:label "Deductible"@en ;
38
- rdfs:comment "Annual deductible status and progress tracking for an insurance plan. Enables patients to monitor their progress toward meeting annual deductible limits. Properties for this class will be defined in a future version."@en ;
39
- rdfs:subClassOf prov:Entity ;
40
- rdfs:seeAlso fhir:ExplanationOfBenefit .
41
-
42
- coverage:CopaySchedule a owl:Class ;
43
- rdfs:label "Copay Schedule"@en ;
44
- rdfs:comment "Copay amounts by service category for an insurance plan. Helps patients understand their cost-sharing responsibilities for different types of care. Properties for this class will be defined in a future version."@en ;
45
- rdfs:subClassOf prov:Entity .
46
-
47
- # ============================================================================
48
- # Data Properties - Core Insurance (from checkup:InsuranceInfo + clinical:CoverageRecord)
49
- # ============================================================================
50
-
51
- coverage:providerName a owl:DatatypeProperty ;
52
- rdfs:label "Provider Name"@en ;
53
- rdfs:comment "Name of insurance company or plan provider (e.g., Aetna, Blue Cross, Medicare). Unifies checkup:insuranceProvider and clinical:providerName."@en ;
54
- rdfs:domain coverage:InsurancePlan ;
55
- rdfs:range xsd:string .
56
-
57
- coverage:memberId a owl:DatatypeProperty ;
58
- rdfs:label "Member ID"@en ;
59
- rdfs:comment "Insurance policy member/subscriber ID number. Present in both patient-reported and EHR-imported data."@en ;
60
- rdfs:domain coverage:InsurancePlan ;
61
- rdfs:range xsd:string .
62
-
63
- coverage:groupNumber a owl:DatatypeProperty ;
64
- rdfs:label "Group Number"@en ;
65
- rdfs:comment "Employer group number for employer-sponsored plans. Present in both patient-reported and EHR-imported data."@en ;
66
- rdfs:domain coverage:InsurancePlan ;
67
- rdfs:range xsd:string .
68
-
69
- coverage:planName a owl:DatatypeProperty ;
70
- rdfs:label "Plan Name"@en ;
71
- rdfs:comment "Name of the insurance plan (e.g., 'Gold PPO 500'). Originally from clinical:CoverageRecord."@en ;
72
- rdfs:domain coverage:InsurancePlan ;
73
- rdfs:range xsd:string .
74
-
75
- coverage:planType a owl:DatatypeProperty ;
76
- rdfs:label "Plan Type"@en ;
77
- rdfs:comment "Type of insurance plan: hmo, ppo, epo, pos, hdhp, medicare, medicaid, tricare, other."@en ;
78
- rdfs:domain coverage:InsurancePlan ;
79
- rdfs:range xsd:string .
80
-
81
- coverage:coverageType a owl:DatatypeProperty ;
82
- rdfs:label "Coverage Type"@en ;
83
- rdfs:comment "Classification of coverage: primary, secondary, dental, vision."@en ;
84
- rdfs:domain coverage:InsurancePlan ;
85
- rdfs:range xsd:string .
86
-
87
- coverage:effectiveStart a owl:DatatypeProperty ;
88
- rdfs:label "Effective Start"@en ;
89
- rdfs:comment "Start date of coverage period. Maps to clinical:effectivePeriodStart and checkup:effectiveDate."@en ;
90
- rdfs:domain coverage:InsurancePlan ;
91
- rdfs:range xsd:date .
92
-
93
- coverage:effectiveEnd a owl:DatatypeProperty ;
94
- rdfs:label "Effective End"@en ;
95
- rdfs:comment "End date of coverage period. Maps to clinical:effectivePeriodEnd and checkup:expirationDate (for insurance usage)."@en ;
96
- rdfs:domain coverage:InsurancePlan ;
97
- rdfs:range xsd:date .
98
-
99
- coverage:subscriberId a owl:DatatypeProperty ;
100
- rdfs:label "Subscriber ID"@en ;
101
- rdfs:comment "Identifier for the policy holder from the insurer. From clinical:CoverageRecord."@en ;
102
- rdfs:domain coverage:InsurancePlan ;
103
- rdfs:range xsd:string .
104
-
105
- # ============================================================================
106
- # Data Properties - Subscriber (from Intake Form, 2026-02-16)
107
- # ============================================================================
108
-
109
- coverage:subscriberName a owl:DatatypeProperty ;
110
- rdfs:label "Subscriber Name"@en ;
111
- rdfs:comment "Name of insurance subscriber (the primary policyholder). From patient-reported intake form data."@en ;
112
- rdfs:domain coverage:InsurancePlan ;
113
- rdfs:range xsd:string .
114
-
115
- coverage:subscriberRelationship a owl:DatatypeProperty ;
116
- rdfs:label "Subscriber Relationship"@en ;
117
- rdfs:comment "Relationship of patient to subscriber: self, spouse, child, parent, other. Unifies clinical:relationship and checkup:subscriberRelationship with a typed enum constraint."@en ;
118
- rdfs:domain coverage:InsurancePlan ;
119
- rdfs:range xsd:string .
120
-
121
- # ============================================================================
122
- # Data Properties - Pharmacy Benefits (from InsuranceInfo model)
123
- # ============================================================================
124
-
125
- coverage:rxBin a owl:DatatypeProperty ;
126
- rdfs:label "Rx BIN"@en ;
127
- rdfs:comment "Pharmacy benefit BIN (Bank Identification Number). Used for prescription drug claims processing."@en ;
128
- rdfs:domain coverage:InsurancePlan ;
129
- rdfs:range xsd:string .
130
-
131
- coverage:rxPcn a owl:DatatypeProperty ;
132
- rdfs:label "Rx PCN"@en ;
133
- rdfs:comment "Pharmacy benefit PCN (Processor Control Number). Used for prescription drug claims routing."@en ;
134
- rdfs:domain coverage:InsurancePlan ;
135
- rdfs:range xsd:string .
136
-
137
- coverage:rxGroup a owl:DatatypeProperty ;
138
- rdfs:label "Rx Group"@en ;
139
- rdfs:comment "Pharmacy benefit group number. Identifies the patient's pharmacy benefit group for claims processing."@en ;
140
- rdfs:domain coverage:InsurancePlan ;
141
- rdfs:range xsd:string .
142
-
143
- # ============================================================================
144
- # Alignment with Healthcare Standards
145
- # ============================================================================
146
-
147
- # FHIR Coverage Resource Mapping
148
- # - coverage:InsurancePlan -> fhir:Coverage
149
- # - coverage:providerName -> fhir:Coverage.payor (display)
150
- # - coverage:memberId -> fhir:Coverage.identifier
151
- # - coverage:groupNumber -> fhir:Coverage.class (group)
152
- # - coverage:planName -> fhir:Coverage.class (plan)
153
- # - coverage:planType -> fhir:Coverage.type
154
- # - coverage:coverageType -> fhir:Coverage.class (category)
155
- # - coverage:effectiveStart -> fhir:Coverage.period.start
156
- # - coverage:effectiveEnd -> fhir:Coverage.period.end
157
- # - coverage:subscriberId -> fhir:Coverage.subscriberId
158
- # - coverage:subscriberRelationship -> fhir:Coverage.relationship
159
-
160
- # Future companion vocabulary: billing: (Layer 2)
161
- # - billing:Claim, billing:Bill, billing:Payment, billing:ExplanationOfBenefits
162
- # - Enables patient healthcare spending tracking and cost management
163
- # - Not in scope for this version
164
-
165
- # ============================================================================
166
- # Changelog
167
- # ============================================================================
168
- #
169
- # Version 1.0 (2026-02-18)
170
- # - Initial release as part of Schema Refactoring Plan Phase 2 (WS4)
171
- # - Created to resolve overlap between checkup:InsuranceInfo (L3, patient-reported)
172
- # and clinical:CoverageRecord (L2, EHR-imported)
173
- # - InsurancePlan class with 14 properties:
174
- # - 8 core properties (providerName, memberId, groupNumber, planName, planType,
175
- # coverageType, effectiveStart, effectiveEnd)
176
- # - 3 subscriber properties (subscriberId, subscriberName, subscriberRelationship)
177
- # - 3 pharmacy benefit properties (rxBin, rxPcn, rxGroup)
178
- # - Deductible and CopaySchedule classes defined (properties deferred to future version)
179
- # - FHIR Coverage resource alignment documented
180
- # - Layer 2 domain vocabulary per three-layer architecture
181
- # - Recommended Pod storage: /coverage/plans/{plan-id}.ttl
182
- #