@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.
- package/dist/commands/pod/helpers.d.ts +1 -1
- package/dist/commands/pod/helpers.d.ts.map +1 -1
- package/dist/commands/pod/helpers.js +5 -20
- package/dist/commands/pod/helpers.js.map +1 -1
- package/package.json +17 -5
- package/.dockerignore +0 -7
- package/.eslintrc.json +0 -23
- package/.prettierrc +0 -7
- package/Dockerfile +0 -18
- package/src/commands/capabilities.ts +0 -235
- package/src/commands/conformance.ts +0 -447
- package/src/commands/convert.ts +0 -164
- package/src/commands/pod/export.ts +0 -85
- package/src/commands/pod/helpers.ts +0 -449
- package/src/commands/pod/index.ts +0 -32
- package/src/commands/pod/info.ts +0 -239
- package/src/commands/pod/init.ts +0 -273
- package/src/commands/pod/query.ts +0 -224
- package/src/commands/serve.ts +0 -92
- package/src/commands/validate.ts +0 -303
- package/src/index.ts +0 -58
- package/src/lib/fhir-converter/cascade-to-fhir.ts +0 -369
- package/src/lib/fhir-converter/converters-clinical.ts +0 -446
- package/src/lib/fhir-converter/converters-demographics.ts +0 -270
- package/src/lib/fhir-converter/fhir-to-cascade.ts +0 -82
- package/src/lib/fhir-converter/index.ts +0 -215
- package/src/lib/fhir-converter/types.ts +0 -318
- package/src/lib/mcp/audit.ts +0 -107
- package/src/lib/mcp/server.ts +0 -192
- package/src/lib/mcp/tools.ts +0 -668
- package/src/lib/output.ts +0 -76
- package/src/lib/shacl-validator.ts +0 -314
- package/src/lib/turtle-parser.ts +0 -277
- package/src/shapes/checkup.shapes.ttl +0 -1459
- package/src/shapes/clinical.shapes.ttl +0 -1350
- package/src/shapes/clinical.ttl +0 -1369
- package/src/shapes/core.shapes.ttl +0 -450
- package/src/shapes/core.ttl +0 -603
- package/src/shapes/coverage.shapes.ttl +0 -214
- package/src/shapes/coverage.ttl +0 -182
- package/src/shapes/health.shapes.ttl +0 -697
- package/src/shapes/health.ttl +0 -859
- package/src/shapes/pots.shapes.ttl +0 -481
- package/test-fixtures/fhir-bundle-example.json +0 -216
- package/test-fixtures/fhir-medication-example.json +0 -18
- package/tests/cli.test.ts +0 -126
- package/tests/fhir-converter.test.ts +0 -874
- package/tests/mcp-server.test.ts +0 -396
- package/tests/pod.test.ts +0 -400
- package/tsconfig.json +0 -24
|
@@ -1,697 +0,0 @@
|
|
|
1
|
-
@prefix sh: <http://www.w3.org/ns/shacl#> .
|
|
2
|
-
@prefix health: <https://ns.cascadeprotocol.org/health/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
|
-
@prefix fhir: <http://hl7.org/fhir/> .
|
|
7
|
-
|
|
8
|
-
# ============================================================================
|
|
9
|
-
# Cascade Protocol — Health & Wellness Vocabulary SHACL Validation Shapes
|
|
10
|
-
# ============================================================================
|
|
11
|
-
# Version: 1.0 (Phase 4, 2026-02-18)
|
|
12
|
-
# Validates: health:SelfReport, health:VO2MaxStatistics, health:HRVStatistics,
|
|
13
|
-
# health:BPStatistics, health:MetricTrend, health:ActivitySnapshot,
|
|
14
|
-
# health:SleepSnapshot, health:HealthProfile
|
|
15
|
-
#
|
|
16
|
-
# SEVERITY LEVELS:
|
|
17
|
-
# - sh:Violation = Must fix (data invalid without) - e.g., missing required stats
|
|
18
|
-
# - sh:Warning = Should address (important for completeness) - e.g., missing period
|
|
19
|
-
# - sh:Info = Nice to have (suggested enrichment) - e.g., optional context fields
|
|
20
|
-
#
|
|
21
|
-
# Validates against: health.ttl v2.2 (2026-02-17)
|
|
22
|
-
# ============================================================================
|
|
23
|
-
|
|
24
|
-
# ============================================================================
|
|
25
|
-
# Shape 1: Self Report
|
|
26
|
-
# ============================================================================
|
|
27
|
-
|
|
28
|
-
health:SelfReportShape a sh:NodeShape ;
|
|
29
|
-
sh:targetClass health:SelfReport ;
|
|
30
|
-
rdfs:label "Self Report Shape"@en ;
|
|
31
|
-
rdfs:comment "Validation constraints for patient-reported daily check-ins and self-assessments. Ensures required timestamping, type classification, and completion tracking."@en ;
|
|
32
|
-
|
|
33
|
-
# REQUIRED: reportDate (when the self-report was recorded)
|
|
34
|
-
sh:property [
|
|
35
|
-
sh:path health:reportDate ;
|
|
36
|
-
sh:datatype xsd:dateTime ;
|
|
37
|
-
sh:minCount 1 ;
|
|
38
|
-
sh:maxCount 1 ;
|
|
39
|
-
sh:name "Report Date"@en ;
|
|
40
|
-
sh:message "Self-report must have exactly one reportDate timestamp"@en ;
|
|
41
|
-
sh:severity sh:Violation
|
|
42
|
-
] ;
|
|
43
|
-
|
|
44
|
-
# REQUIRED: reportType (category of self-report)
|
|
45
|
-
sh:property [
|
|
46
|
-
sh:path health:reportType ;
|
|
47
|
-
sh:datatype xsd:string ;
|
|
48
|
-
sh:minCount 1 ;
|
|
49
|
-
sh:maxCount 1 ;
|
|
50
|
-
sh:minLength 1 ;
|
|
51
|
-
sh:name "Report Type"@en ;
|
|
52
|
-
sh:message "Self-report must specify a reportType (e.g., medication_adherence, symptom_tracking, mood, sleep)"@en ;
|
|
53
|
-
sh:severity sh:Violation
|
|
54
|
-
] ;
|
|
55
|
-
|
|
56
|
-
# REQUIRED: completionStatus (whether report is complete)
|
|
57
|
-
sh:property [
|
|
58
|
-
sh:path health:completionStatus ;
|
|
59
|
-
sh:datatype xsd:string ;
|
|
60
|
-
sh:minCount 1 ;
|
|
61
|
-
sh:maxCount 1 ;
|
|
62
|
-
sh:in ("complete" "partial" "skipped") ;
|
|
63
|
-
sh:name "Completion Status"@en ;
|
|
64
|
-
sh:message "Self-report must have a completionStatus of complete, partial, or skipped"@en ;
|
|
65
|
-
sh:severity sh:Violation
|
|
66
|
-
] ;
|
|
67
|
-
|
|
68
|
-
# INFO: reportContext (what tracking plan this relates to)
|
|
69
|
-
sh:property [
|
|
70
|
-
sh:path health:reportContext ;
|
|
71
|
-
sh:datatype xsd:string ;
|
|
72
|
-
sh:maxCount 1 ;
|
|
73
|
-
sh:name "Report Context"@en ;
|
|
74
|
-
sh:message "Consider adding reportContext to link this report to a tracking plan"@en ;
|
|
75
|
-
sh:severity sh:Info
|
|
76
|
-
] ;
|
|
77
|
-
|
|
78
|
-
# INFO: reportNotes (free-text patient notes)
|
|
79
|
-
sh:property [
|
|
80
|
-
sh:path health:reportNotes ;
|
|
81
|
-
sh:datatype xsd:string ;
|
|
82
|
-
sh:maxCount 1 ;
|
|
83
|
-
sh:name "Report Notes"@en ;
|
|
84
|
-
sh:message "Consider adding reportNotes for additional patient context"@en ;
|
|
85
|
-
sh:severity sh:Info
|
|
86
|
-
] .
|
|
87
|
-
|
|
88
|
-
# ============================================================================
|
|
89
|
-
# Shape 2: VO2 Max Statistics
|
|
90
|
-
# ============================================================================
|
|
91
|
-
|
|
92
|
-
health:VO2MaxStatisticsShape a sh:NodeShape ;
|
|
93
|
-
sh:targetClass health:VO2MaxStatistics ;
|
|
94
|
-
rdfs:label "VO2 Max Statistics Shape"@en ;
|
|
95
|
-
rdfs:comment "Validation constraints for VO2 Max statistical summaries. Ensures core statistics, fitness classification, and trend analysis fields are present. Supports the dual-path UI pattern where rich statistics are preferred when available."@en ;
|
|
96
|
-
|
|
97
|
-
# REQUIRED: vo2Mean (average VO2 Max over period)
|
|
98
|
-
sh:property [
|
|
99
|
-
sh:path health:vo2Mean ;
|
|
100
|
-
sh:datatype xsd:double ;
|
|
101
|
-
sh:minCount 1 ;
|
|
102
|
-
sh:maxCount 1 ;
|
|
103
|
-
sh:minInclusive 0 ;
|
|
104
|
-
sh:name "Mean VO2 Max"@en ;
|
|
105
|
-
sh:message "VO2 Max statistics must have a mean value (mL/kg/min, >= 0)"@en ;
|
|
106
|
-
sh:severity sh:Violation
|
|
107
|
-
] ;
|
|
108
|
-
|
|
109
|
-
# REQUIRED: vo2SampleCount (number of measurements)
|
|
110
|
-
sh:property [
|
|
111
|
-
sh:path health:vo2SampleCount ;
|
|
112
|
-
sh:datatype xsd:integer ;
|
|
113
|
-
sh:minCount 1 ;
|
|
114
|
-
sh:maxCount 1 ;
|
|
115
|
-
sh:minInclusive 1 ;
|
|
116
|
-
sh:name "VO2 Sample Count"@en ;
|
|
117
|
-
sh:message "VO2 Max statistics must have at least 1 sample"@en ;
|
|
118
|
-
sh:severity sh:Violation
|
|
119
|
-
] ;
|
|
120
|
-
|
|
121
|
-
# REQUIRED: fitnessClassification (cardiorespiratory fitness level)
|
|
122
|
-
sh:property [
|
|
123
|
-
sh:path health:fitnessClassification ;
|
|
124
|
-
sh:datatype xsd:string ;
|
|
125
|
-
sh:minCount 1 ;
|
|
126
|
-
sh:maxCount 1 ;
|
|
127
|
-
sh:in ("veryPoor" "poor" "fair" "good" "excellent" "superior") ;
|
|
128
|
-
sh:name "Fitness Classification"@en ;
|
|
129
|
-
sh:message "VO2 Max statistics must have a fitnessClassification (veryPoor, poor, fair, good, excellent, or superior)"@en ;
|
|
130
|
-
sh:severity sh:Violation
|
|
131
|
-
] ;
|
|
132
|
-
|
|
133
|
-
# WARNING: periodStart (measurement window start)
|
|
134
|
-
sh:property [
|
|
135
|
-
sh:path health:periodStart ;
|
|
136
|
-
sh:datatype xsd:dateTime ;
|
|
137
|
-
sh:maxCount 1 ;
|
|
138
|
-
sh:name "Period Start"@en ;
|
|
139
|
-
sh:message "VO2 Max statistics should specify the measurement period start date"@en ;
|
|
140
|
-
sh:severity sh:Warning
|
|
141
|
-
] ;
|
|
142
|
-
|
|
143
|
-
# WARNING: periodEnd (measurement window end)
|
|
144
|
-
sh:property [
|
|
145
|
-
sh:path health:periodEnd ;
|
|
146
|
-
sh:datatype xsd:dateTime ;
|
|
147
|
-
sh:maxCount 1 ;
|
|
148
|
-
sh:name "Period End"@en ;
|
|
149
|
-
sh:message "VO2 Max statistics should specify the measurement period end date"@en ;
|
|
150
|
-
sh:severity sh:Warning
|
|
151
|
-
] ;
|
|
152
|
-
|
|
153
|
-
# INFO: vo2Min (lowest reading)
|
|
154
|
-
sh:property [
|
|
155
|
-
sh:path health:vo2Min ;
|
|
156
|
-
sh:datatype xsd:double ;
|
|
157
|
-
sh:maxCount 1 ;
|
|
158
|
-
sh:name "Minimum VO2 Max"@en ;
|
|
159
|
-
sh:message "Consider including minimum VO2 Max for range analysis"@en ;
|
|
160
|
-
sh:severity sh:Info
|
|
161
|
-
] ;
|
|
162
|
-
|
|
163
|
-
# INFO: vo2MaxValue (highest reading)
|
|
164
|
-
sh:property [
|
|
165
|
-
sh:path health:vo2MaxValue ;
|
|
166
|
-
sh:datatype xsd:double ;
|
|
167
|
-
sh:maxCount 1 ;
|
|
168
|
-
sh:name "Maximum VO2 Max"@en ;
|
|
169
|
-
sh:message "Consider including maximum VO2 Max for range analysis"@en ;
|
|
170
|
-
sh:severity sh:Info
|
|
171
|
-
] ;
|
|
172
|
-
|
|
173
|
-
# INFO: vo2TrendDirection (trend over period)
|
|
174
|
-
sh:property [
|
|
175
|
-
sh:path health:vo2TrendDirection ;
|
|
176
|
-
sh:datatype xsd:string ;
|
|
177
|
-
sh:maxCount 1 ;
|
|
178
|
-
sh:in ("improving" "declining" "stable" "unknown") ;
|
|
179
|
-
sh:name "VO2 Trend Direction"@en ;
|
|
180
|
-
sh:message "Consider including vo2TrendDirection for fitness trend analysis"@en ;
|
|
181
|
-
sh:severity sh:Info
|
|
182
|
-
] ;
|
|
183
|
-
|
|
184
|
-
# INFO: isSparseData (data quality indicator)
|
|
185
|
-
sh:property [
|
|
186
|
-
sh:path health:isSparseData ;
|
|
187
|
-
sh:datatype xsd:boolean ;
|
|
188
|
-
sh:maxCount 1 ;
|
|
189
|
-
sh:name "Sparse Data Indicator"@en ;
|
|
190
|
-
sh:message "Consider setting isSparseData to flag limited measurement periods"@en ;
|
|
191
|
-
sh:severity sh:Info
|
|
192
|
-
] .
|
|
193
|
-
|
|
194
|
-
# ============================================================================
|
|
195
|
-
# Shape 3: HRV Statistics
|
|
196
|
-
# ============================================================================
|
|
197
|
-
|
|
198
|
-
health:HRVStatisticsShape a sh:NodeShape ;
|
|
199
|
-
sh:targetClass health:HRVStatistics ;
|
|
200
|
-
rdfs:label "HRV Statistics Shape"@en ;
|
|
201
|
-
rdfs:comment "Validation constraints for Heart Rate Variability (SDNN) statistical summaries. Ensures core statistics and measurement period are present for trend analysis."@en ;
|
|
202
|
-
|
|
203
|
-
# REQUIRED: hrvMean (average HRV over period)
|
|
204
|
-
sh:property [
|
|
205
|
-
sh:path health:hrvMean ;
|
|
206
|
-
sh:datatype xsd:double ;
|
|
207
|
-
sh:minCount 1 ;
|
|
208
|
-
sh:maxCount 1 ;
|
|
209
|
-
sh:minInclusive 0 ;
|
|
210
|
-
sh:name "Mean HRV"@en ;
|
|
211
|
-
sh:message "HRV statistics must have a mean value (ms, >= 0)"@en ;
|
|
212
|
-
sh:severity sh:Violation
|
|
213
|
-
] ;
|
|
214
|
-
|
|
215
|
-
# REQUIRED: hrvSampleCount (number of readings)
|
|
216
|
-
sh:property [
|
|
217
|
-
sh:path health:hrvSampleCount ;
|
|
218
|
-
sh:datatype xsd:integer ;
|
|
219
|
-
sh:minCount 1 ;
|
|
220
|
-
sh:maxCount 1 ;
|
|
221
|
-
sh:minInclusive 1 ;
|
|
222
|
-
sh:name "HRV Sample Count"@en ;
|
|
223
|
-
sh:message "HRV statistics must have at least 1 sample"@en ;
|
|
224
|
-
sh:severity sh:Violation
|
|
225
|
-
] ;
|
|
226
|
-
|
|
227
|
-
# REQUIRED: periodStart (measurement window start)
|
|
228
|
-
sh:property [
|
|
229
|
-
sh:path health:periodStart ;
|
|
230
|
-
sh:datatype xsd:dateTime ;
|
|
231
|
-
sh:minCount 1 ;
|
|
232
|
-
sh:maxCount 1 ;
|
|
233
|
-
sh:name "Period Start"@en ;
|
|
234
|
-
sh:message "HRV statistics must specify the measurement period start date"@en ;
|
|
235
|
-
sh:severity sh:Violation
|
|
236
|
-
] ;
|
|
237
|
-
|
|
238
|
-
# REQUIRED: periodEnd (measurement window end)
|
|
239
|
-
sh:property [
|
|
240
|
-
sh:path health:periodEnd ;
|
|
241
|
-
sh:datatype xsd:dateTime ;
|
|
242
|
-
sh:minCount 1 ;
|
|
243
|
-
sh:maxCount 1 ;
|
|
244
|
-
sh:name "Period End"@en ;
|
|
245
|
-
sh:message "HRV statistics must specify the measurement period end date"@en ;
|
|
246
|
-
sh:severity sh:Violation
|
|
247
|
-
] ;
|
|
248
|
-
|
|
249
|
-
# INFO: hrvMedian (median HRV)
|
|
250
|
-
sh:property [
|
|
251
|
-
sh:path health:hrvMedian ;
|
|
252
|
-
sh:datatype xsd:double ;
|
|
253
|
-
sh:maxCount 1 ;
|
|
254
|
-
sh:name "Median HRV"@en ;
|
|
255
|
-
sh:message "Consider including median HRV for distribution analysis"@en ;
|
|
256
|
-
sh:severity sh:Info
|
|
257
|
-
] ;
|
|
258
|
-
|
|
259
|
-
# INFO: hrvStdDev (standard deviation)
|
|
260
|
-
sh:property [
|
|
261
|
-
sh:path health:hrvStdDev ;
|
|
262
|
-
sh:datatype xsd:double ;
|
|
263
|
-
sh:maxCount 1 ;
|
|
264
|
-
sh:name "HRV Standard Deviation"@en ;
|
|
265
|
-
sh:message "Consider including HRV standard deviation for variability analysis"@en ;
|
|
266
|
-
sh:severity sh:Info
|
|
267
|
-
] ;
|
|
268
|
-
|
|
269
|
-
# INFO: hrvMin (lowest reading)
|
|
270
|
-
sh:property [
|
|
271
|
-
sh:path health:hrvMin ;
|
|
272
|
-
sh:datatype xsd:double ;
|
|
273
|
-
sh:maxCount 1 ;
|
|
274
|
-
sh:name "Minimum HRV"@en ;
|
|
275
|
-
sh:message "Consider including minimum HRV for range analysis"@en ;
|
|
276
|
-
sh:severity sh:Info
|
|
277
|
-
] ;
|
|
278
|
-
|
|
279
|
-
# INFO: hrvMax (highest reading)
|
|
280
|
-
sh:property [
|
|
281
|
-
sh:path health:hrvMax ;
|
|
282
|
-
sh:datatype xsd:double ;
|
|
283
|
-
sh:maxCount 1 ;
|
|
284
|
-
sh:name "Maximum HRV"@en ;
|
|
285
|
-
sh:message "Consider including maximum HRV for range analysis"@en ;
|
|
286
|
-
sh:severity sh:Info
|
|
287
|
-
] ;
|
|
288
|
-
|
|
289
|
-
# INFO: hrvTrendDirection (trend over period)
|
|
290
|
-
sh:property [
|
|
291
|
-
sh:path health:hrvTrendDirection ;
|
|
292
|
-
sh:datatype xsd:string ;
|
|
293
|
-
sh:maxCount 1 ;
|
|
294
|
-
sh:in ("improving" "declining" "stable" "unknown") ;
|
|
295
|
-
sh:name "HRV Trend Direction"@en ;
|
|
296
|
-
sh:message "Consider including hrvTrendDirection for autonomic nervous system trend analysis"@en ;
|
|
297
|
-
sh:severity sh:Info
|
|
298
|
-
] .
|
|
299
|
-
|
|
300
|
-
# ============================================================================
|
|
301
|
-
# Shape 4: Blood Pressure Statistics
|
|
302
|
-
# ============================================================================
|
|
303
|
-
|
|
304
|
-
health:BPStatisticsShape a sh:NodeShape ;
|
|
305
|
-
sh:targetClass health:BPStatistics ;
|
|
306
|
-
rdfs:label "Blood Pressure Statistics Shape"@en ;
|
|
307
|
-
rdfs:comment "Validation constraints for blood pressure statistical summaries. Ensures mean systolic/diastolic values and AHA category classification are present."@en ;
|
|
308
|
-
|
|
309
|
-
# REQUIRED: bpMeanSystolic (average systolic BP)
|
|
310
|
-
sh:property [
|
|
311
|
-
sh:path health:bpMeanSystolic ;
|
|
312
|
-
sh:datatype xsd:double ;
|
|
313
|
-
sh:minCount 1 ;
|
|
314
|
-
sh:maxCount 1 ;
|
|
315
|
-
sh:minInclusive 40 ;
|
|
316
|
-
sh:maxInclusive 300 ;
|
|
317
|
-
sh:name "Mean Systolic BP"@en ;
|
|
318
|
-
sh:message "BP statistics must have a mean systolic value (mmHg, 40-300)"@en ;
|
|
319
|
-
sh:severity sh:Violation
|
|
320
|
-
] ;
|
|
321
|
-
|
|
322
|
-
# REQUIRED: bpMeanDiastolic (average diastolic BP)
|
|
323
|
-
sh:property [
|
|
324
|
-
sh:path health:bpMeanDiastolic ;
|
|
325
|
-
sh:datatype xsd:double ;
|
|
326
|
-
sh:minCount 1 ;
|
|
327
|
-
sh:maxCount 1 ;
|
|
328
|
-
sh:minInclusive 20 ;
|
|
329
|
-
sh:maxInclusive 200 ;
|
|
330
|
-
sh:name "Mean Diastolic BP"@en ;
|
|
331
|
-
sh:message "BP statistics must have a mean diastolic value (mmHg, 20-200)"@en ;
|
|
332
|
-
sh:severity sh:Violation
|
|
333
|
-
] ;
|
|
334
|
-
|
|
335
|
-
# REQUIRED: bpCategory (AHA classification)
|
|
336
|
-
sh:property [
|
|
337
|
-
sh:path health:bpCategory ;
|
|
338
|
-
sh:datatype xsd:string ;
|
|
339
|
-
sh:minCount 1 ;
|
|
340
|
-
sh:maxCount 1 ;
|
|
341
|
-
sh:in ("normal" "elevated" "hypertension_stage1" "hypertension_stage2" "hypertensive_crisis") ;
|
|
342
|
-
sh:name "BP Category"@en ;
|
|
343
|
-
sh:message "BP statistics must have an AHA category (normal, elevated, hypertension_stage1, hypertension_stage2, or hypertensive_crisis)"@en ;
|
|
344
|
-
sh:severity sh:Violation
|
|
345
|
-
] ;
|
|
346
|
-
|
|
347
|
-
# WARNING: bpSampleCount (number of readings)
|
|
348
|
-
sh:property [
|
|
349
|
-
sh:path health:bpSampleCount ;
|
|
350
|
-
sh:datatype xsd:integer ;
|
|
351
|
-
sh:maxCount 1 ;
|
|
352
|
-
sh:minInclusive 1 ;
|
|
353
|
-
sh:name "BP Sample Count"@en ;
|
|
354
|
-
sh:message "BP statistics should include a sample count for data quality assessment"@en ;
|
|
355
|
-
sh:severity sh:Warning
|
|
356
|
-
] ;
|
|
357
|
-
|
|
358
|
-
# INFO: bpMinSystolic (lowest systolic reading)
|
|
359
|
-
sh:property [
|
|
360
|
-
sh:path health:bpMinSystolic ;
|
|
361
|
-
sh:datatype xsd:double ;
|
|
362
|
-
sh:maxCount 1 ;
|
|
363
|
-
sh:name "Minimum Systolic BP"@en ;
|
|
364
|
-
sh:message "Consider including minimum systolic BP for range analysis"@en ;
|
|
365
|
-
sh:severity sh:Info
|
|
366
|
-
] ;
|
|
367
|
-
|
|
368
|
-
# INFO: bpMaxSystolic (highest systolic reading)
|
|
369
|
-
sh:property [
|
|
370
|
-
sh:path health:bpMaxSystolic ;
|
|
371
|
-
sh:datatype xsd:double ;
|
|
372
|
-
sh:maxCount 1 ;
|
|
373
|
-
sh:name "Maximum Systolic BP"@en ;
|
|
374
|
-
sh:message "Consider including maximum systolic BP for range analysis"@en ;
|
|
375
|
-
sh:severity sh:Info
|
|
376
|
-
] ;
|
|
377
|
-
|
|
378
|
-
# INFO: bpMinDiastolic (lowest diastolic reading)
|
|
379
|
-
sh:property [
|
|
380
|
-
sh:path health:bpMinDiastolic ;
|
|
381
|
-
sh:datatype xsd:double ;
|
|
382
|
-
sh:maxCount 1 ;
|
|
383
|
-
sh:name "Minimum Diastolic BP"@en ;
|
|
384
|
-
sh:message "Consider including minimum diastolic BP for range analysis"@en ;
|
|
385
|
-
sh:severity sh:Info
|
|
386
|
-
] ;
|
|
387
|
-
|
|
388
|
-
# INFO: bpMaxDiastolic (highest diastolic reading)
|
|
389
|
-
sh:property [
|
|
390
|
-
sh:path health:bpMaxDiastolic ;
|
|
391
|
-
sh:datatype xsd:double ;
|
|
392
|
-
sh:maxCount 1 ;
|
|
393
|
-
sh:name "Maximum Diastolic BP"@en ;
|
|
394
|
-
sh:message "Consider including maximum diastolic BP for range analysis"@en ;
|
|
395
|
-
sh:severity sh:Info
|
|
396
|
-
] .
|
|
397
|
-
|
|
398
|
-
# ============================================================================
|
|
399
|
-
# Shape 5: Metric Trend
|
|
400
|
-
# ============================================================================
|
|
401
|
-
|
|
402
|
-
health:MetricTrendShape a sh:NodeShape ;
|
|
403
|
-
sh:targetClass health:MetricTrend ;
|
|
404
|
-
rdfs:label "Metric Trend Shape"@en ;
|
|
405
|
-
rdfs:comment "Validation constraints for time-bounded wellness metric trends. Ensures trend direction is present and encourages confidence and period metadata for proper interpretation."@en ;
|
|
406
|
-
|
|
407
|
-
# REQUIRED: trendDirection (direction of change)
|
|
408
|
-
sh:property [
|
|
409
|
-
sh:path health:trendDirection ;
|
|
410
|
-
sh:datatype xsd:string ;
|
|
411
|
-
sh:minCount 1 ;
|
|
412
|
-
sh:maxCount 1 ;
|
|
413
|
-
sh:in ("increasing" "decreasing" "stable" "insufficient_data") ;
|
|
414
|
-
sh:name "Trend Direction"@en ;
|
|
415
|
-
sh:message "Metric trend must have a direction (increasing, decreasing, stable, or insufficient_data)"@en ;
|
|
416
|
-
sh:severity sh:Violation
|
|
417
|
-
] ;
|
|
418
|
-
|
|
419
|
-
# WARNING: trendConfidence (data quality indicator)
|
|
420
|
-
sh:property [
|
|
421
|
-
sh:path health:trendConfidence ;
|
|
422
|
-
sh:datatype xsd:string ;
|
|
423
|
-
sh:maxCount 1 ;
|
|
424
|
-
sh:in ("high" "medium" "low") ;
|
|
425
|
-
sh:name "Trend Confidence"@en ;
|
|
426
|
-
sh:message "Metric trend should include confidence level (high >30d, medium 14-30d, low <14d)"@en ;
|
|
427
|
-
sh:severity sh:Warning
|
|
428
|
-
] ;
|
|
429
|
-
|
|
430
|
-
# WARNING: trendPeriodStart (observation window start)
|
|
431
|
-
sh:property [
|
|
432
|
-
sh:path health:trendPeriodStart ;
|
|
433
|
-
sh:datatype xsd:dateTime ;
|
|
434
|
-
sh:maxCount 1 ;
|
|
435
|
-
sh:name "Trend Period Start"@en ;
|
|
436
|
-
sh:message "Metric trend should specify the observation period start date"@en ;
|
|
437
|
-
sh:severity sh:Warning
|
|
438
|
-
] ;
|
|
439
|
-
|
|
440
|
-
# WARNING: trendPeriodEnd (observation window end)
|
|
441
|
-
sh:property [
|
|
442
|
-
sh:path health:trendPeriodEnd ;
|
|
443
|
-
sh:datatype xsd:dateTime ;
|
|
444
|
-
sh:maxCount 1 ;
|
|
445
|
-
sh:name "Trend Period End"@en ;
|
|
446
|
-
sh:message "Metric trend should specify the observation period end date"@en ;
|
|
447
|
-
sh:severity sh:Warning
|
|
448
|
-
] ;
|
|
449
|
-
|
|
450
|
-
# INFO: trendMagnitude (percentage change)
|
|
451
|
-
sh:property [
|
|
452
|
-
sh:path health:trendMagnitude ;
|
|
453
|
-
sh:datatype xsd:decimal ;
|
|
454
|
-
sh:maxCount 1 ;
|
|
455
|
-
sh:name "Trend Magnitude"@en ;
|
|
456
|
-
sh:message "Consider including trendMagnitude (percentage change) for quantitative trend analysis"@en ;
|
|
457
|
-
sh:severity sh:Info
|
|
458
|
-
] ;
|
|
459
|
-
|
|
460
|
-
# INFO: trendBaselineValue (reference value)
|
|
461
|
-
sh:property [
|
|
462
|
-
sh:path health:trendBaselineValue ;
|
|
463
|
-
sh:datatype xsd:decimal ;
|
|
464
|
-
sh:maxCount 1 ;
|
|
465
|
-
sh:name "Baseline Value"@en ;
|
|
466
|
-
sh:message "Consider including trendBaselineValue for comparative analysis"@en ;
|
|
467
|
-
sh:severity sh:Info
|
|
468
|
-
] ;
|
|
469
|
-
|
|
470
|
-
# INFO: trendCurrentValue (current period average)
|
|
471
|
-
sh:property [
|
|
472
|
-
sh:path health:trendCurrentValue ;
|
|
473
|
-
sh:datatype xsd:decimal ;
|
|
474
|
-
sh:maxCount 1 ;
|
|
475
|
-
sh:name "Current Value"@en ;
|
|
476
|
-
sh:message "Consider including trendCurrentValue for comparative analysis"@en ;
|
|
477
|
-
sh:severity sh:Info
|
|
478
|
-
] .
|
|
479
|
-
|
|
480
|
-
# ============================================================================
|
|
481
|
-
# Shape 6: Activity Snapshot
|
|
482
|
-
# ============================================================================
|
|
483
|
-
|
|
484
|
-
health:ActivitySnapshotShape a sh:NodeShape ;
|
|
485
|
-
sh:targetClass health:ActivitySnapshot ;
|
|
486
|
-
rdfs:label "Activity Snapshot Shape"@en ;
|
|
487
|
-
rdfs:comment "Validation constraints for aggregated activity metrics over a measurement period (typically 7 days). All fields are optional since activity data availability depends on device capabilities."@en ;
|
|
488
|
-
|
|
489
|
-
# WARNING: averageDailySteps (primary activity metric)
|
|
490
|
-
sh:property [
|
|
491
|
-
sh:path health:averageDailySteps ;
|
|
492
|
-
sh:datatype xsd:integer ;
|
|
493
|
-
sh:maxCount 1 ;
|
|
494
|
-
sh:minInclusive 0 ;
|
|
495
|
-
sh:name "Average Daily Steps"@en ;
|
|
496
|
-
sh:message "Activity snapshot should include average daily steps as a primary activity metric"@en ;
|
|
497
|
-
sh:severity sh:Warning
|
|
498
|
-
] ;
|
|
499
|
-
|
|
500
|
-
# INFO: exerciseMinutesWeekly (exercise activity)
|
|
501
|
-
sh:property [
|
|
502
|
-
sh:path health:exerciseMinutesWeekly ;
|
|
503
|
-
sh:datatype xsd:integer ;
|
|
504
|
-
sh:maxCount 1 ;
|
|
505
|
-
sh:minInclusive 0 ;
|
|
506
|
-
sh:name "Exercise Minutes (Weekly)"@en ;
|
|
507
|
-
sh:message "Consider including weekly exercise minutes for fitness context"@en ;
|
|
508
|
-
sh:severity sh:Info
|
|
509
|
-
] ;
|
|
510
|
-
|
|
511
|
-
# INFO: standHoursDaily (standing activity)
|
|
512
|
-
sh:property [
|
|
513
|
-
sh:path health:standHoursDaily ;
|
|
514
|
-
sh:datatype xsd:integer ;
|
|
515
|
-
sh:maxCount 1 ;
|
|
516
|
-
sh:minInclusive 0 ;
|
|
517
|
-
sh:maxInclusive 24 ;
|
|
518
|
-
sh:name "Stand Hours (Daily)"@en ;
|
|
519
|
-
sh:message "Consider including daily stand hours for sedentary behavior tracking"@en ;
|
|
520
|
-
sh:severity sh:Info
|
|
521
|
-
] ;
|
|
522
|
-
|
|
523
|
-
# INFO: activeEnergyBurnedKcal (energy expenditure)
|
|
524
|
-
sh:property [
|
|
525
|
-
sh:path health:activeEnergyBurnedKcal ;
|
|
526
|
-
sh:datatype xsd:decimal ;
|
|
527
|
-
sh:maxCount 1 ;
|
|
528
|
-
sh:minInclusive 0 ;
|
|
529
|
-
sh:name "Active Energy Burned (kcal)"@en ;
|
|
530
|
-
sh:message "Consider including active energy burned for caloric expenditure tracking"@en ;
|
|
531
|
-
sh:severity sh:Info
|
|
532
|
-
] .
|
|
533
|
-
|
|
534
|
-
# ============================================================================
|
|
535
|
-
# Shape 7: Sleep Snapshot
|
|
536
|
-
# ============================================================================
|
|
537
|
-
|
|
538
|
-
health:SleepSnapshotShape a sh:NodeShape ;
|
|
539
|
-
sh:targetClass health:SleepSnapshot ;
|
|
540
|
-
rdfs:label "Sleep Snapshot Shape"@en ;
|
|
541
|
-
rdfs:comment "Validation constraints for aggregated sleep metrics over a measurement period (typically 7 days). Sleep data availability depends on device capabilities and user behavior."@en ;
|
|
542
|
-
|
|
543
|
-
# WARNING: averageDurationHours (primary sleep metric)
|
|
544
|
-
sh:property [
|
|
545
|
-
sh:path health:averageDurationHours ;
|
|
546
|
-
sh:datatype xsd:decimal ;
|
|
547
|
-
sh:maxCount 1 ;
|
|
548
|
-
sh:minInclusive 0 ;
|
|
549
|
-
sh:maxInclusive 24 ;
|
|
550
|
-
sh:name "Average Sleep Duration (hours)"@en ;
|
|
551
|
-
sh:message "Sleep snapshot should include average duration as a primary sleep metric"@en ;
|
|
552
|
-
sh:severity sh:Warning
|
|
553
|
-
] ;
|
|
554
|
-
|
|
555
|
-
# INFO: sleepQuality (qualitative assessment)
|
|
556
|
-
sh:property [
|
|
557
|
-
sh:path health:sleepQuality ;
|
|
558
|
-
sh:datatype xsd:string ;
|
|
559
|
-
sh:maxCount 1 ;
|
|
560
|
-
sh:name "Sleep Quality"@en ;
|
|
561
|
-
sh:message "Consider including sleep quality assessment for comprehensive sleep analysis"@en ;
|
|
562
|
-
sh:severity sh:Info
|
|
563
|
-
] .
|
|
564
|
-
|
|
565
|
-
# ============================================================================
|
|
566
|
-
# Shape 8: Health Profile (Top-level Container)
|
|
567
|
-
# ============================================================================
|
|
568
|
-
|
|
569
|
-
health:HealthProfileShape a sh:NodeShape ;
|
|
570
|
-
sh:targetClass health:HealthProfile ;
|
|
571
|
-
rdfs:label "Health Profile Shape"@en ;
|
|
572
|
-
rdfs:comment "Validation constraints for the top-level wellness profile aggregating vital signs, body measurements, activity, and sleep data from consumer devices. Stored at /wellness/ in the Cascade Pod."@en ;
|
|
573
|
-
|
|
574
|
-
# WARNING: bloodType (ABO blood group characteristic)
|
|
575
|
-
sh:property [
|
|
576
|
-
sh:path health:bloodType ;
|
|
577
|
-
sh:datatype xsd:string ;
|
|
578
|
-
sh:maxCount 1 ;
|
|
579
|
-
sh:in ("aPositive" "aNegative" "bPositive" "bNegative" "abPositive" "abNegative" "oPositive" "oNegative") ;
|
|
580
|
-
sh:name "Blood Type"@en ;
|
|
581
|
-
sh:message "Blood type should be a valid ABO/Rh value if provided"@en ;
|
|
582
|
-
sh:severity sh:Warning
|
|
583
|
-
] ;
|
|
584
|
-
|
|
585
|
-
# INFO: restingHeartRateHistory (90-day vital trend)
|
|
586
|
-
sh:property [
|
|
587
|
-
sh:path health:restingHeartRateHistory ;
|
|
588
|
-
sh:class health:DailyVitalReading ;
|
|
589
|
-
sh:name "Resting Heart Rate History"@en ;
|
|
590
|
-
sh:message "Consider populating resting heart rate history for cardiac trend analysis"@en ;
|
|
591
|
-
sh:severity sh:Info
|
|
592
|
-
] ;
|
|
593
|
-
|
|
594
|
-
# INFO: walkingHeartRateHistory (90-day vital trend)
|
|
595
|
-
sh:property [
|
|
596
|
-
sh:path health:walkingHeartRateHistory ;
|
|
597
|
-
sh:class health:DailyVitalReading ;
|
|
598
|
-
sh:name "Walking Heart Rate History"@en ;
|
|
599
|
-
sh:message "Consider populating walking heart rate history for activity-related cardiac trends"@en ;
|
|
600
|
-
sh:severity sh:Info
|
|
601
|
-
] ;
|
|
602
|
-
|
|
603
|
-
# INFO: hrvHistory (7-day HRV readings)
|
|
604
|
-
sh:property [
|
|
605
|
-
sh:path health:hrvHistory ;
|
|
606
|
-
sh:class health:HRVReading ;
|
|
607
|
-
sh:name "HRV History"@en ;
|
|
608
|
-
sh:message "Consider populating HRV history for autonomic nervous system analysis"@en ;
|
|
609
|
-
sh:severity sh:Info
|
|
610
|
-
] ;
|
|
611
|
-
|
|
612
|
-
# INFO: bloodPressureHistory (30-day BP readings)
|
|
613
|
-
sh:property [
|
|
614
|
-
sh:path health:bloodPressureHistory ;
|
|
615
|
-
sh:class health:BloodPressureReading ;
|
|
616
|
-
sh:name "Blood Pressure History"@en ;
|
|
617
|
-
sh:message "Consider populating blood pressure history for cardiovascular trend analysis"@en ;
|
|
618
|
-
sh:severity sh:Info
|
|
619
|
-
] ;
|
|
620
|
-
|
|
621
|
-
# INFO: vo2MaxHistory (180-day VO2 Max readings)
|
|
622
|
-
sh:property [
|
|
623
|
-
sh:path health:vo2MaxHistory ;
|
|
624
|
-
sh:class health:VitalSignReading ;
|
|
625
|
-
sh:name "VO2 Max History"@en ;
|
|
626
|
-
sh:message "Consider populating VO2 Max history for fitness trend analysis"@en ;
|
|
627
|
-
sh:severity sh:Info
|
|
628
|
-
] ;
|
|
629
|
-
|
|
630
|
-
# INFO: bodyMassHistory (30-day weight readings)
|
|
631
|
-
sh:property [
|
|
632
|
-
sh:path health:bodyMassHistory ;
|
|
633
|
-
sh:class health:DailyVitalReading ;
|
|
634
|
-
sh:name "Body Mass History"@en ;
|
|
635
|
-
sh:message "Consider populating body mass history for weight trend analysis"@en ;
|
|
636
|
-
sh:severity sh:Info
|
|
637
|
-
] ;
|
|
638
|
-
|
|
639
|
-
# INFO: dailyActivityHistory (90-day activity snapshots)
|
|
640
|
-
sh:property [
|
|
641
|
-
sh:path health:dailyActivityHistory ;
|
|
642
|
-
sh:class health:DailyActivitySnapshot ;
|
|
643
|
-
sh:name "Daily Activity History"@en ;
|
|
644
|
-
sh:message "Consider populating daily activity history for activity trend analysis"@en ;
|
|
645
|
-
sh:severity sh:Info
|
|
646
|
-
] ;
|
|
647
|
-
|
|
648
|
-
# INFO: dailySleepHistory (90-day sleep snapshots)
|
|
649
|
-
sh:property [
|
|
650
|
-
sh:path health:dailySleepHistory ;
|
|
651
|
-
sh:class health:DailySleepSnapshot ;
|
|
652
|
-
sh:name "Daily Sleep History"@en ;
|
|
653
|
-
sh:message "Consider populating daily sleep history for sleep pattern analysis"@en ;
|
|
654
|
-
sh:severity sh:Info
|
|
655
|
-
] ;
|
|
656
|
-
|
|
657
|
-
# INFO: hasHRVStatistics (link to HRV statistical summary)
|
|
658
|
-
sh:property [
|
|
659
|
-
sh:path health:hasHRVStatistics ;
|
|
660
|
-
sh:class health:HRVStatistics ;
|
|
661
|
-
sh:maxCount 1 ;
|
|
662
|
-
sh:node health:HRVStatisticsShape ;
|
|
663
|
-
sh:name "HRV Statistics"@en ;
|
|
664
|
-
sh:message "Consider linking HRV statistics for heart rate variability summary"@en ;
|
|
665
|
-
sh:severity sh:Info
|
|
666
|
-
] ;
|
|
667
|
-
|
|
668
|
-
# INFO: hasBPStatistics (link to BP statistical summary)
|
|
669
|
-
sh:property [
|
|
670
|
-
sh:path health:hasBPStatistics ;
|
|
671
|
-
sh:class health:BPStatistics ;
|
|
672
|
-
sh:maxCount 1 ;
|
|
673
|
-
sh:node health:BPStatisticsShape ;
|
|
674
|
-
sh:name "BP Statistics"@en ;
|
|
675
|
-
sh:message "Consider linking BP statistics for blood pressure summary"@en ;
|
|
676
|
-
sh:severity sh:Info
|
|
677
|
-
] .
|
|
678
|
-
|
|
679
|
-
# ============================================================================
|
|
680
|
-
# Changelog
|
|
681
|
-
# ============================================================================
|
|
682
|
-
#
|
|
683
|
-
# Version 1.0 (2026-02-18)
|
|
684
|
-
# - Initial release of Health & Wellness SHACL shapes (Phase 4)
|
|
685
|
-
# - 8 shapes covering all major health.ttl v2.2 classes:
|
|
686
|
-
# - SelfReportShape: Patient-reported check-in validation (3 required, 2 info)
|
|
687
|
-
# - VO2MaxStatisticsShape: Fitness statistics validation (3 required, 2 warning, 4 info)
|
|
688
|
-
# - HRVStatisticsShape: HRV statistics validation (4 required, 5 info)
|
|
689
|
-
# - BPStatisticsShape: Blood pressure statistics validation (3 required, 1 warning, 4 info)
|
|
690
|
-
# - MetricTrendShape: Wellness trend validation (1 required, 3 warning, 3 info)
|
|
691
|
-
# - ActivitySnapshotShape: Activity metrics validation (1 warning, 3 info)
|
|
692
|
-
# - SleepSnapshotShape: Sleep metrics validation (1 warning, 1 info)
|
|
693
|
-
# - HealthProfileShape: Top-level container validation (1 warning, 10 info)
|
|
694
|
-
# - Severity levels follow established pattern: Violation/Warning/Info
|
|
695
|
-
# - sh:in constraints match enumerated values from health.ttl ontology
|
|
696
|
-
# - Range constraints (minInclusive/maxInclusive) reflect physiological bounds
|
|
697
|
-
#
|