@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,1350 +0,0 @@
1
- @prefix sh: <http://www.w3.org/ns/shacl#> .
2
- @prefix clinical: <https://ns.cascadeprotocol.org/clinical/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
- # SHACL Shapes for Cascade Protocol Clinical Documents
9
- # ============================================================================
10
- #
11
- # These shapes validate clinical documents imported from EHR systems via
12
- # Apple HealthKit. Shapes accept multiple provenance values to support
13
- # different data sources (EHR, device, patient-reported).
14
- #
15
- # ============================================================================
16
-
17
- # ============================================================================
18
- # Shape: Clinical Document (Base)
19
- # ============================================================================
20
-
21
- clinical:ClinicalDocumentShape a sh:NodeShape ;
22
- sh:targetClass clinical:ClinicalDocument ;
23
- rdfs:label "Clinical Document Shape"@en ;
24
- rdfs:comment "Validation constraints for clinical documents imported from EHR"@en ;
25
-
26
- # Required: importedAt timestamp
27
- sh:property [
28
- sh:path clinical:importedAt ;
29
- sh:datatype xsd:dateTime ;
30
- sh:minCount 1 ;
31
- sh:maxCount 1 ;
32
- sh:name "Imported At"@en ;
33
- sh:message "Clinical document must have exactly one importedAt timestamp"@en
34
- ] ;
35
-
36
- # Required: sourceEHR name
37
- sh:property [
38
- sh:path clinical:sourceEHR ;
39
- sh:datatype xsd:string ;
40
- sh:minCount 1 ;
41
- sh:maxCount 1 ;
42
- sh:minLength 1 ;
43
- sh:maxLength 100 ;
44
- sh:name "Source EHR"@en ;
45
- sh:message "Clinical document must specify the source EHR system"@en
46
- ] ;
47
-
48
- # Optional: sourceBundleId (iOS bundle identifier pattern)
49
- sh:property [
50
- sh:path clinical:sourceBundleId ;
51
- sh:datatype xsd:string ;
52
- sh:maxCount 1 ;
53
- sh:pattern "^[a-zA-Z][a-zA-Z0-9.-]*$" ;
54
- sh:name "Source Bundle ID"@en ;
55
- sh:message "Bundle ID must be a valid iOS bundle identifier"@en
56
- ] ;
57
-
58
- # Required: fhirResourceId
59
- sh:property [
60
- sh:path clinical:fhirResourceId ;
61
- sh:datatype xsd:string ;
62
- sh:minCount 1 ;
63
- sh:maxCount 1 ;
64
- sh:name "FHIR Resource ID"@en ;
65
- sh:message "Clinical document must have a FHIR resource ID"@en
66
- ] ;
67
-
68
- # Required: fhirResourceType
69
- sh:property [
70
- sh:path clinical:fhirResourceType ;
71
- sh:datatype xsd:string ;
72
- sh:minCount 1 ;
73
- sh:maxCount 1 ;
74
- sh:name "FHIR Resource Type"@en ;
75
- sh:message "Clinical document must specify FHIR resource type"@en
76
- ] ;
77
-
78
- # Optional: displayName
79
- sh:property [
80
- sh:path clinical:displayName ;
81
- sh:datatype xsd:string ;
82
- sh:maxCount 1 ;
83
- sh:maxLength 500 ;
84
- sh:name "Display Name"@en
85
- ] ;
86
-
87
- # Optional: narrativeText (unbounded length for clinical notes)
88
- sh:property [
89
- sh:path clinical:narrativeText ;
90
- sh:datatype xsd:string ;
91
- sh:maxCount 1 ;
92
- sh:name "Narrative Text"@en ;
93
- sh:description "Plain text content extracted from FHIR narrative"@en
94
- ] ;
95
-
96
- # Optional: narrativeXHTML
97
- sh:property [
98
- sh:path clinical:narrativeXHTML ;
99
- sh:datatype xsd:string ;
100
- sh:maxCount 1 ;
101
- sh:name "Narrative XHTML"@en
102
- ] ;
103
-
104
- # Optional: rawFHIRData (base64 encoded)
105
- sh:property [
106
- sh:path clinical:rawFHIRData ;
107
- sh:datatype xsd:base64Binary ;
108
- sh:maxCount 1 ;
109
- sh:name "Raw FHIR Data"@en
110
- ] ;
111
-
112
- # Required: provenance (accepts multiple valid sources)
113
- sh:property [
114
- sh:path cascade:dataProvenance ;
115
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
116
- sh:minCount 1 ;
117
- sh:maxCount 1 ;
118
- sh:name "Data Provenance"@en ;
119
- sh:message "Clinical documents must have valid provenance"@en
120
- ] ;
121
-
122
- # Required: schemaVersion
123
- sh:property [
124
- sh:path cascade:schemaVersion ;
125
- sh:datatype xsd:string ;
126
- sh:minCount 1 ;
127
- sh:maxCount 1 ;
128
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
129
- sh:name "Schema Version"@en ;
130
- sh:message "Schema version must be in format major.minor"@en
131
- ] ;
132
-
133
- # Optional: sections
134
- sh:property [
135
- sh:path clinical:hasSection ;
136
- sh:class clinical:ClinicalSection ;
137
- sh:name "Sections"@en
138
- ] .
139
-
140
- # ============================================================================
141
- # Shape: Clinical Section
142
- # ============================================================================
143
-
144
- clinical:ClinicalSectionShape a sh:NodeShape ;
145
- sh:targetClass clinical:ClinicalSection ;
146
- rdfs:label "Clinical Section Shape"@en ;
147
- rdfs:comment "Validation constraints for clinical document sections"@en ;
148
-
149
- # Required: sectionTitle
150
- sh:property [
151
- sh:path clinical:sectionTitle ;
152
- sh:datatype xsd:string ;
153
- sh:minCount 1 ;
154
- sh:maxCount 1 ;
155
- sh:minLength 1 ;
156
- sh:maxLength 200 ;
157
- sh:name "Section Title"@en ;
158
- sh:message "Section must have a title"@en
159
- ] ;
160
-
161
- # Required: sectionContent
162
- sh:property [
163
- sh:path clinical:sectionContent ;
164
- sh:datatype xsd:string ;
165
- sh:minCount 1 ;
166
- sh:name "Section Content"@en ;
167
- sh:message "Section must have content"@en
168
- ] ;
169
-
170
- # Optional: sectionCode (LOINC format: 5 digits, dash, 1 digit)
171
- sh:property [
172
- sh:path clinical:sectionCode ;
173
- sh:datatype xsd:string ;
174
- sh:maxCount 1 ;
175
- sh:pattern "^[0-9]{4,5}-[0-9]$" ;
176
- sh:name "Section Code"@en ;
177
- sh:message "Section code must be a valid LOINC code (e.g., 10154-3)"@en
178
- ] ;
179
-
180
- # Optional: sectionOrder
181
- sh:property [
182
- sh:path clinical:sectionOrder ;
183
- sh:datatype xsd:integer ;
184
- sh:maxCount 1 ;
185
- sh:minInclusive 0 ;
186
- sh:name "Section Order"@en
187
- ] .
188
-
189
- # ============================================================================
190
- # Shape: Progress Note (extends ClinicalDocument)
191
- # ============================================================================
192
-
193
- clinical:ProgressNoteShape a sh:NodeShape ;
194
- sh:targetClass clinical:ProgressNote ;
195
- rdfs:label "Progress Note Shape"@en ;
196
- rdfs:comment "Additional constraints for progress notes"@en ;
197
-
198
- # Inherits all ClinicalDocument constraints
199
- sh:node clinical:ClinicalDocumentShape ;
200
-
201
- # Progress notes should have encounterDate
202
- sh:property [
203
- sh:path clinical:encounterDate ;
204
- sh:datatype xsd:dateTime ;
205
- sh:minCount 1 ;
206
- sh:maxCount 1 ;
207
- sh:name "Encounter Date"@en ;
208
- sh:message "Progress notes must specify the encounter date"@en
209
- ] .
210
-
211
- # ============================================================================
212
- # Shape: Discharge Summary
213
- # ============================================================================
214
-
215
- clinical:DischargeSummaryShape a sh:NodeShape ;
216
- sh:targetClass clinical:DischargeSummary ;
217
- rdfs:label "Discharge Summary Shape"@en ;
218
- rdfs:comment "Additional constraints for discharge summaries"@en ;
219
-
220
- # Inherits ClinicalDocument constraints
221
- sh:node clinical:ClinicalDocumentShape ;
222
-
223
- # Discharge summaries should have document date
224
- sh:property [
225
- sh:path clinical:documentDate ;
226
- sh:datatype xsd:dateTime ;
227
- sh:minCount 1 ;
228
- sh:maxCount 1 ;
229
- sh:name "Document Date"@en ;
230
- sh:message "Discharge summary must have a document date"@en
231
- ] .
232
-
233
- # ============================================================================
234
- # Shape: Laboratory Report
235
- # ============================================================================
236
-
237
- clinical:LaboratoryReportShape a sh:NodeShape ;
238
- sh:targetClass clinical:LaboratoryReport ;
239
- rdfs:label "Laboratory Report Shape"@en ;
240
- rdfs:comment "Additional constraints for laboratory reports"@en ;
241
-
242
- # Inherits ClinicalDocument constraints
243
- sh:node clinical:ClinicalDocumentShape ;
244
-
245
- # Lab reports should have documentDate (when results were finalized)
246
- sh:property [
247
- sh:path clinical:documentDate ;
248
- sh:datatype xsd:dateTime ;
249
- sh:minCount 1 ;
250
- sh:name "Document Date"@en ;
251
- sh:message "Lab reports must have a document date"@en
252
- ] .
253
-
254
- # ============================================================================
255
- # Shape: Imaging Report
256
- # ============================================================================
257
-
258
- clinical:ImagingReportShape a sh:NodeShape ;
259
- sh:targetClass clinical:ImagingReport ;
260
- rdfs:label "Imaging Report Shape"@en ;
261
- rdfs:comment "Additional constraints for imaging/radiology reports"@en ;
262
-
263
- # Inherits ClinicalDocument constraints
264
- sh:node clinical:ClinicalDocumentShape ;
265
-
266
- # Imaging reports should have document date
267
- sh:property [
268
- sh:path clinical:documentDate ;
269
- sh:datatype xsd:dateTime ;
270
- sh:minCount 1 ;
271
- sh:name "Document Date"@en ;
272
- sh:message "Imaging reports must have a document date"@en
273
- ] .
274
-
275
- # ============================================================================
276
- # Shape: Visit Summary
277
- # ============================================================================
278
-
279
- clinical:VisitSummaryShape a sh:NodeShape ;
280
- sh:targetClass clinical:VisitSummary ;
281
- rdfs:label "Visit Summary Shape"@en ;
282
- rdfs:comment "Additional constraints for after-visit summaries"@en ;
283
-
284
- # Inherits ClinicalDocument constraints
285
- sh:node clinical:ClinicalDocumentShape ;
286
-
287
- # Visit summaries should have encounter date
288
- sh:property [
289
- sh:path clinical:encounterDate ;
290
- sh:datatype xsd:dateTime ;
291
- sh:minCount 1 ;
292
- sh:maxCount 1 ;
293
- sh:name "Encounter Date"@en ;
294
- sh:message "Visit summary must specify the encounter date"@en
295
- ] .
296
-
297
- # ============================================================================
298
- # Structured Record Shapes
299
- # ============================================================================
300
-
301
- # ============================================================================
302
- # Shape: Medication
303
- # ============================================================================
304
-
305
- clinical:MedicationShape a sh:NodeShape ;
306
- sh:targetClass clinical:Medication ;
307
- rdfs:label "Medication Shape"@en ;
308
- rdfs:comment "Validation constraints for medication records"@en ;
309
-
310
- # Required: drugName
311
- sh:property [
312
- sh:path clinical:drugName ;
313
- sh:datatype xsd:string ;
314
- sh:minCount 1 ;
315
- sh:maxCount 1 ;
316
- sh:minLength 1 ;
317
- sh:name "Drug Name"@en ;
318
- sh:message "Medication must have a drug name"@en
319
- ] ;
320
-
321
- # Optional: dosage
322
- sh:property [
323
- sh:path clinical:dosage ;
324
- sh:datatype xsd:string ;
325
- sh:maxCount 1 ;
326
- sh:name "Dosage"@en
327
- ] ;
328
-
329
- # Optional: route
330
- sh:property [
331
- sh:path clinical:route ;
332
- sh:datatype xsd:string ;
333
- sh:maxCount 1 ;
334
- sh:name "Route"@en
335
- ] ;
336
-
337
- # Optional: frequency
338
- sh:property [
339
- sh:path clinical:frequency ;
340
- sh:datatype xsd:string ;
341
- sh:maxCount 1 ;
342
- sh:name "Frequency"@en
343
- ] ;
344
-
345
- # Optional: status
346
- sh:property [
347
- sh:path clinical:status ;
348
- sh:datatype xsd:string ;
349
- sh:maxCount 1 ;
350
- sh:name "Status"@en
351
- ] ;
352
-
353
- # Optional: rxNormCode (can be string or URI reference)
354
- sh:property [
355
- sh:path clinical:rxNormCode ;
356
- sh:maxCount 1 ;
357
- sh:name "RxNorm Code"@en
358
- ] ;
359
-
360
- # Optional: snomedCode (can be string or URI reference)
361
- sh:property [
362
- sh:path clinical:snomedCode ;
363
- sh:maxCount 1 ;
364
- sh:name "SNOMED Code"@en
365
- ] ;
366
-
367
- # Required: provenance (accepts multiple valid sources)
368
- sh:property [
369
- sh:path cascade:dataProvenance ;
370
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
371
- sh:minCount 1 ;
372
- sh:maxCount 1 ;
373
- sh:name "Data Provenance"@en ;
374
- sh:message "Medication records must have valid provenance"@en
375
- ] ;
376
-
377
- # Required: schemaVersion
378
- sh:property [
379
- sh:path cascade:schemaVersion ;
380
- sh:datatype xsd:string ;
381
- sh:minCount 1 ;
382
- sh:maxCount 1 ;
383
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
384
- sh:name "Schema Version"@en
385
- ] ;
386
-
387
- # Optional: prescriber
388
- sh:property [
389
- sh:path clinical:prescriber ;
390
- sh:datatype xsd:string ;
391
- sh:maxCount 1 ;
392
- sh:name "Prescriber"@en
393
- ] ;
394
-
395
- # Optional: indication
396
- sh:property [
397
- sh:path clinical:indication ;
398
- sh:datatype xsd:string ;
399
- sh:maxCount 1 ;
400
- sh:name "Indication"@en
401
- ] ;
402
-
403
- # Optional: courseOfTherapyType
404
- sh:property [
405
- sh:path clinical:courseOfTherapyType ;
406
- sh:datatype xsd:string ;
407
- sh:maxCount 1 ;
408
- sh:in ("acute" "continuous" "unknown") ;
409
- sh:severity sh:Warning ;
410
- sh:name "Course of Therapy Type"@en ;
411
- sh:message "courseOfTherapyType should be acute, continuous, or unknown"@en
412
- ] ;
413
-
414
- # Optional: asNeeded (PRN)
415
- sh:property [
416
- sh:path clinical:asNeeded ;
417
- sh:datatype xsd:boolean ;
418
- sh:maxCount 1 ;
419
- sh:name "As Needed (PRN)"@en
420
- ] ;
421
-
422
- # Optional: medicationForm
423
- sh:property [
424
- sh:path clinical:medicationForm ;
425
- sh:datatype xsd:string ;
426
- sh:maxCount 1 ;
427
- sh:name "Medication Form"@en
428
- ] ;
429
-
430
- # Optional: activeIngredient
431
- sh:property [
432
- sh:path clinical:activeIngredient ;
433
- sh:datatype xsd:string ;
434
- sh:maxCount 1 ;
435
- sh:name "Active Ingredient"@en
436
- ] ;
437
-
438
- # Optional: ingredientStrength
439
- sh:property [
440
- sh:path clinical:ingredientStrength ;
441
- sh:datatype xsd:string ;
442
- sh:maxCount 1 ;
443
- sh:name "Ingredient Strength"@en
444
- ] ;
445
-
446
- # Optional: provenanceClass
447
- sh:property [
448
- sh:path clinical:provenanceClass ;
449
- sh:datatype xsd:string ;
450
- sh:maxCount 1 ;
451
- sh:in ("healthKitFHIR" "userTracked" "pharmacyClaim" "imported") ;
452
- sh:name "Provenance Class"@en
453
- ] ;
454
-
455
- # Optional: sourceFhirResourceType
456
- sh:property [
457
- sh:path clinical:sourceFhirResourceType ;
458
- sh:datatype xsd:string ;
459
- sh:maxCount 1 ;
460
- sh:in ("MedicationRequest" "MedicationStatement" "MedicationDispense" "MedicationAdministration") ;
461
- sh:name "Source FHIR Resource Type"@en
462
- ] ;
463
-
464
- # Optional: clinicalIntent
465
- sh:property [
466
- sh:path clinical:clinicalIntent ;
467
- sh:datatype xsd:string ;
468
- sh:maxCount 1 ;
469
- sh:in ("reportedUse" "prescribed" "dispensed" "administered") ;
470
- sh:name "Clinical Intent"@en
471
- ] ;
472
-
473
- # Optional: refillsAllowed
474
- sh:property [
475
- sh:path clinical:refillsAllowed ;
476
- sh:datatype xsd:integer ;
477
- sh:maxCount 1 ;
478
- sh:minInclusive 0 ;
479
- sh:name "Refills Allowed"@en
480
- ] ;
481
-
482
- # Optional: supplyDurationDays
483
- sh:property [
484
- sh:path clinical:supplyDurationDays ;
485
- sh:datatype xsd:integer ;
486
- sh:maxCount 1 ;
487
- sh:minInclusive 0 ;
488
- sh:name "Supply Duration Days"@en
489
- ] ;
490
-
491
- # Optional: dispensedQuantity
492
- sh:property [
493
- sh:path clinical:dispensedQuantity ;
494
- sh:datatype xsd:string ;
495
- sh:maxCount 1 ;
496
- sh:name "Dispensed Quantity"@en
497
- ] ;
498
-
499
- # Optional: prescriptionCategory
500
- sh:property [
501
- sh:path clinical:prescriptionCategory ;
502
- sh:datatype xsd:string ;
503
- sh:maxCount 1 ;
504
- sh:in ("community" "inpatient" "discharge") ;
505
- sh:name "Prescription Category"@en
506
- ] .
507
-
508
- # ============================================================================
509
- # Shape: Allergy
510
- # ============================================================================
511
-
512
- clinical:AllergyShape a sh:NodeShape ;
513
- sh:targetClass clinical:Allergy ;
514
- rdfs:label "Allergy Shape"@en ;
515
- rdfs:comment "Validation constraints for allergy/intolerance records"@en ;
516
-
517
- # Required: allergen
518
- sh:property [
519
- sh:path clinical:allergen ;
520
- sh:datatype xsd:string ;
521
- sh:minCount 1 ;
522
- sh:maxCount 1 ;
523
- sh:minLength 1 ;
524
- sh:name "Allergen"@en ;
525
- sh:message "Allergy must specify the allergen"@en
526
- ] ;
527
-
528
- # Optional: reaction
529
- sh:property [
530
- sh:path clinical:reaction ;
531
- sh:datatype xsd:string ;
532
- sh:name "Reaction"@en
533
- ] ;
534
-
535
- # Optional: severity (constrained values)
536
- sh:property [
537
- sh:path clinical:severity ;
538
- sh:datatype xsd:string ;
539
- sh:maxCount 1 ;
540
- sh:in ("mild" "moderate" "severe") ;
541
- sh:name "Severity"@en ;
542
- sh:message "Severity must be mild, moderate, or severe"@en
543
- ] ;
544
-
545
- # Optional: criticality
546
- sh:property [
547
- sh:path clinical:criticality ;
548
- sh:datatype xsd:string ;
549
- sh:maxCount 1 ;
550
- sh:in ("low" "high" "unable-to-assess") ;
551
- sh:name "Criticality"@en
552
- ] ;
553
-
554
- # Optional: category (allergy category)
555
- sh:property [
556
- sh:path clinical:category ;
557
- sh:datatype xsd:string ;
558
- sh:maxCount 1 ;
559
- sh:in ("food" "medication" "environment" "biologic") ;
560
- sh:name "Allergy Category"@en
561
- ] ;
562
-
563
- # Optional: snomedCode (can be string or URI reference)
564
- sh:property [
565
- sh:path clinical:snomedCode ;
566
- sh:maxCount 1 ;
567
- sh:name "SNOMED Code"@en
568
- ] ;
569
-
570
- # Required: provenance (accepts multiple valid sources)
571
- sh:property [
572
- sh:path cascade:dataProvenance ;
573
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
574
- sh:minCount 1 ;
575
- sh:maxCount 1 ;
576
- sh:name "Data Provenance"@en
577
- ] ;
578
-
579
- # Required: schemaVersion
580
- sh:property [
581
- sh:path cascade:schemaVersion ;
582
- sh:datatype xsd:string ;
583
- sh:minCount 1 ;
584
- sh:maxCount 1 ;
585
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
586
- sh:name "Schema Version"@en
587
- ] .
588
-
589
- # ============================================================================
590
- # Shape: Lab Result
591
- # ============================================================================
592
-
593
- clinical:LabResultShape a sh:NodeShape ;
594
- sh:targetClass clinical:LabResult ;
595
- rdfs:label "Lab Result Shape"@en ;
596
- rdfs:comment "Validation constraints for laboratory result records"@en ;
597
-
598
- # Required: testName
599
- sh:property [
600
- sh:path clinical:testName ;
601
- sh:datatype xsd:string ;
602
- sh:minCount 1 ;
603
- sh:maxCount 1 ;
604
- sh:minLength 1 ;
605
- sh:name "Test Name"@en ;
606
- sh:message "Lab result must have a test name"@en
607
- ] ;
608
-
609
- # Optional: value (can be string or numeric)
610
- sh:property [
611
- sh:path clinical:value ;
612
- sh:maxCount 1 ;
613
- sh:name "Value"@en
614
- ] ;
615
-
616
- # Optional: unit
617
- sh:property [
618
- sh:path clinical:unit ;
619
- sh:datatype xsd:string ;
620
- sh:maxCount 1 ;
621
- sh:name "Unit"@en
622
- ] ;
623
-
624
- # Optional: referenceRange
625
- sh:property [
626
- sh:path clinical:referenceRange ;
627
- sh:datatype xsd:string ;
628
- sh:maxCount 1 ;
629
- sh:name "Reference Range"@en
630
- ] ;
631
-
632
- # Optional: interpretation (accepts both cases)
633
- sh:property [
634
- sh:path clinical:interpretation ;
635
- sh:datatype xsd:string ;
636
- sh:maxCount 1 ;
637
- sh:in ("normal" "high" "low" "abnormal" "critical" "Normal" "High" "Low" "Abnormal" "Critical") ;
638
- sh:name "Interpretation"@en
639
- ] ;
640
-
641
- # Optional: loincCode (can be string or URI reference)
642
- sh:property [
643
- sh:path clinical:loincCode ;
644
- sh:maxCount 1 ;
645
- sh:name "LOINC Code"@en
646
- ] ;
647
-
648
- # Required: provenance (accepts multiple valid sources)
649
- sh:property [
650
- sh:path cascade:dataProvenance ;
651
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
652
- sh:minCount 1 ;
653
- sh:maxCount 1 ;
654
- sh:name "Data Provenance"@en
655
- ] ;
656
-
657
- # Required: schemaVersion
658
- sh:property [
659
- sh:path cascade:schemaVersion ;
660
- sh:datatype xsd:string ;
661
- sh:minCount 1 ;
662
- sh:maxCount 1 ;
663
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
664
- sh:name "Schema Version"@en
665
- ] .
666
-
667
- # ============================================================================
668
- # Shape: Condition
669
- # ============================================================================
670
-
671
- clinical:ConditionShape a sh:NodeShape ;
672
- sh:targetClass clinical:Condition ;
673
- rdfs:label "Condition Shape"@en ;
674
- rdfs:comment "Validation constraints for condition/diagnosis records"@en ;
675
-
676
- # Required: conditionName
677
- sh:property [
678
- sh:path clinical:conditionName ;
679
- sh:datatype xsd:string ;
680
- sh:minCount 1 ;
681
- sh:maxCount 1 ;
682
- sh:minLength 1 ;
683
- sh:name "Condition Name"@en ;
684
- sh:message "Condition must have a name"@en
685
- ] ;
686
-
687
- # Optional: clinicalStatus
688
- sh:property [
689
- sh:path clinical:clinicalStatus ;
690
- sh:datatype xsd:string ;
691
- sh:maxCount 1 ;
692
- sh:in ("active" "recurrence" "relapse" "inactive" "remission" "resolved") ;
693
- sh:name "Clinical Status"@en
694
- ] ;
695
-
696
- # Optional: verificationStatus
697
- sh:property [
698
- sh:path clinical:verificationStatus ;
699
- sh:datatype xsd:string ;
700
- sh:maxCount 1 ;
701
- sh:in ("unconfirmed" "provisional" "differential" "confirmed" "refuted" "entered-in-error") ;
702
- sh:name "Verification Status"@en
703
- ] ;
704
-
705
- # Optional: onsetDate
706
- sh:property [
707
- sh:path clinical:onsetDate ;
708
- sh:datatype xsd:dateTime ;
709
- sh:maxCount 1 ;
710
- sh:name "Onset Date"@en
711
- ] ;
712
-
713
- # Optional: snomedCode (can be string or URI reference)
714
- sh:property [
715
- sh:path clinical:snomedCode ;
716
- sh:maxCount 1 ;
717
- sh:name "SNOMED Code"@en
718
- ] ;
719
-
720
- # Optional: icd10Code (can be string or URI reference)
721
- sh:property [
722
- sh:path clinical:icd10Code ;
723
- sh:maxCount 1 ;
724
- sh:name "ICD-10 Code"@en
725
- ] ;
726
-
727
- # Required: provenance (accepts multiple valid sources)
728
- sh:property [
729
- sh:path cascade:dataProvenance ;
730
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
731
- sh:minCount 1 ;
732
- sh:maxCount 1 ;
733
- sh:name "Data Provenance"@en
734
- ] ;
735
-
736
- # Required: schemaVersion
737
- sh:property [
738
- sh:path cascade:schemaVersion ;
739
- sh:datatype xsd:string ;
740
- sh:minCount 1 ;
741
- sh:maxCount 1 ;
742
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
743
- sh:name "Schema Version"@en
744
- ] .
745
-
746
- # ============================================================================
747
- # Shape: Immunization
748
- # ============================================================================
749
-
750
- clinical:ImmunizationShape a sh:NodeShape ;
751
- sh:targetClass clinical:Immunization ;
752
- rdfs:label "Immunization Shape"@en ;
753
- rdfs:comment "Validation constraints for immunization records"@en ;
754
-
755
- # Required: vaccineName
756
- sh:property [
757
- sh:path clinical:vaccineName ;
758
- sh:datatype xsd:string ;
759
- sh:minCount 1 ;
760
- sh:maxCount 1 ;
761
- sh:minLength 1 ;
762
- sh:name "Vaccine Name"@en ;
763
- sh:message "Immunization must have a vaccine name"@en
764
- ] ;
765
-
766
- # Optional: cvxCode (can be string or URI reference)
767
- sh:property [
768
- sh:path clinical:cvxCode ;
769
- sh:maxCount 1 ;
770
- sh:name "CVX Code"@en
771
- ] ;
772
-
773
- # Optional: lotNumber
774
- sh:property [
775
- sh:path clinical:lotNumber ;
776
- sh:datatype xsd:string ;
777
- sh:maxCount 1 ;
778
- sh:name "Lot Number"@en
779
- ] ;
780
-
781
- # Optional: site
782
- sh:property [
783
- sh:path clinical:site ;
784
- sh:datatype xsd:string ;
785
- sh:maxCount 1 ;
786
- sh:name "Site"@en
787
- ] ;
788
-
789
- # Optional: doseQuantity
790
- sh:property [
791
- sh:path clinical:doseQuantity ;
792
- sh:datatype xsd:string ;
793
- sh:maxCount 1 ;
794
- sh:name "Dose Quantity"@en
795
- ] ;
796
-
797
- # Optional: manufacturer
798
- sh:property [
799
- sh:path clinical:manufacturer ;
800
- sh:datatype xsd:string ;
801
- sh:maxCount 1 ;
802
- sh:name "Manufacturer"@en
803
- ] ;
804
-
805
- # Optional: status
806
- sh:property [
807
- sh:path clinical:status ;
808
- sh:datatype xsd:string ;
809
- sh:maxCount 1 ;
810
- sh:in ("completed" "entered-in-error" "not-done") ;
811
- sh:name "Status"@en
812
- ] ;
813
-
814
- # Required: provenance (accepts multiple valid sources)
815
- sh:property [
816
- sh:path cascade:dataProvenance ;
817
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
818
- sh:minCount 1 ;
819
- sh:maxCount 1 ;
820
- sh:name "Data Provenance"@en
821
- ] ;
822
-
823
- # Required: schemaVersion
824
- sh:property [
825
- sh:path cascade:schemaVersion ;
826
- sh:datatype xsd:string ;
827
- sh:minCount 1 ;
828
- sh:maxCount 1 ;
829
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
830
- sh:name "Schema Version"@en
831
- ] .
832
-
833
- # ============================================================================
834
- # Shape: Procedure
835
- # ============================================================================
836
-
837
- clinical:ProcedureShape a sh:NodeShape ;
838
- sh:targetClass clinical:Procedure ;
839
- rdfs:label "Procedure Shape"@en ;
840
- rdfs:comment "Validation constraints for procedure records"@en ;
841
-
842
- # Required: procedureName
843
- sh:property [
844
- sh:path clinical:procedureName ;
845
- sh:datatype xsd:string ;
846
- sh:minCount 1 ;
847
- sh:maxCount 1 ;
848
- sh:minLength 1 ;
849
- sh:name "Procedure Name"@en ;
850
- sh:message "Procedure must have a name"@en
851
- ] ;
852
-
853
- # Optional: procedureDate
854
- sh:property [
855
- sh:path clinical:procedureDate ;
856
- sh:datatype xsd:dateTime ;
857
- sh:maxCount 1 ;
858
- sh:name "Procedure Date"@en
859
- ] ;
860
-
861
- # Optional: bodySite
862
- sh:property [
863
- sh:path clinical:bodySite ;
864
- sh:datatype xsd:string ;
865
- sh:maxCount 1 ;
866
- sh:name "Body Site"@en
867
- ] ;
868
-
869
- # Optional: performer
870
- sh:property [
871
- sh:path clinical:performer ;
872
- sh:datatype xsd:string ;
873
- sh:maxCount 1 ;
874
- sh:name "Performer"@en
875
- ] ;
876
-
877
- # Optional: status
878
- sh:property [
879
- sh:path clinical:status ;
880
- sh:datatype xsd:string ;
881
- sh:maxCount 1 ;
882
- sh:in ("preparation" "in-progress" "not-done" "on-hold" "stopped" "completed" "entered-in-error" "unknown") ;
883
- sh:name "Status"@en
884
- ] ;
885
-
886
- # Optional: cptCode
887
- sh:property [
888
- sh:path clinical:cptCode ;
889
- sh:datatype xsd:string ;
890
- sh:maxCount 1 ;
891
- sh:pattern "^[0-9]{5}$" ;
892
- sh:name "CPT Code"@en ;
893
- sh:message "CPT code must be 5 digits"@en
894
- ] ;
895
-
896
- # Optional: snomedCode (can be string or URI reference)
897
- sh:property [
898
- sh:path clinical:snomedCode ;
899
- sh:maxCount 1 ;
900
- sh:name "SNOMED Code"@en
901
- ] ;
902
-
903
- # Required: provenance (accepts multiple valid sources)
904
- sh:property [
905
- sh:path cascade:dataProvenance ;
906
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
907
- sh:minCount 1 ;
908
- sh:maxCount 1 ;
909
- sh:name "Data Provenance"@en
910
- ] ;
911
-
912
- # Required: schemaVersion
913
- sh:property [
914
- sh:path cascade:schemaVersion ;
915
- sh:datatype xsd:string ;
916
- sh:minCount 1 ;
917
- sh:maxCount 1 ;
918
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
919
- sh:name "Schema Version"@en
920
- ] .
921
-
922
- # ============================================================================
923
- # Shape: Vital Sign
924
- # ============================================================================
925
-
926
- clinical:VitalSignShape a sh:NodeShape ;
927
- sh:targetClass clinical:VitalSign ;
928
- rdfs:label "Vital Sign Shape"@en ;
929
- rdfs:comment "Validation constraints for vital sign observations"@en ;
930
-
931
- # Required: vitalType (accepts display names, snake_case, and camelCase)
932
- sh:property [
933
- sh:path clinical:vitalType ;
934
- sh:datatype xsd:string ;
935
- sh:minCount 1 ;
936
- sh:maxCount 1 ;
937
- sh:in ("Heart Rate" "Blood Pressure" "Respiratory Rate" "Body Temperature" "Oxygen Saturation" "Body Weight" "Body Height" "BMI" "heart_rate" "blood_pressure" "respiratory_rate" "body_temperature" "oxygen_saturation" "body_weight" "body_height" "bmi" "heartRate" "bloodPressure" "bloodPressureSystolic" "bloodPressureDiastolic" "respiratoryRate" "temperature" "oxygenSaturation" "bodyWeight" "bodyHeight" "bodyMassIndex") ;
938
- sh:name "Vital Type"@en ;
939
- sh:message "Vital sign must have a valid type"@en
940
- ] ;
941
-
942
- # Optional: value (can be string or numeric)
943
- sh:property [
944
- sh:path clinical:value ;
945
- sh:maxCount 1 ;
946
- sh:name "Value"@en
947
- ] ;
948
-
949
- # Optional: unit
950
- sh:property [
951
- sh:path clinical:unit ;
952
- sh:datatype xsd:string ;
953
- sh:maxCount 1 ;
954
- sh:name "Unit"@en
955
- ] ;
956
-
957
- # Optional: component values (for blood pressure, etc.)
958
- sh:property [
959
- sh:path clinical:component1Value ;
960
- sh:maxCount 1 ;
961
- sh:name "Component 1 Value"@en
962
- ] ;
963
-
964
- sh:property [
965
- sh:path clinical:component2Value ;
966
- sh:maxCount 1 ;
967
- sh:name "Component 2 Value"@en
968
- ] ;
969
-
970
- # Optional: interpretation
971
- sh:property [
972
- sh:path clinical:interpretation ;
973
- sh:datatype xsd:string ;
974
- sh:maxCount 1 ;
975
- sh:name "Interpretation"@en
976
- ] ;
977
-
978
- # Optional: deviceName
979
- sh:property [
980
- sh:path clinical:deviceName ;
981
- sh:datatype xsd:string ;
982
- sh:maxCount 1 ;
983
- sh:name "Device Name"@en
984
- ] ;
985
-
986
- # Optional: loincCode (can be string or URI reference)
987
- sh:property [
988
- sh:path clinical:loincCode ;
989
- sh:maxCount 1 ;
990
- sh:name "LOINC Code"@en
991
- ] ;
992
-
993
- # Required: provenance (accepts multiple valid sources)
994
- sh:property [
995
- sh:path cascade:dataProvenance ;
996
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
997
- sh:minCount 1 ;
998
- sh:maxCount 1 ;
999
- sh:name "Data Provenance"@en
1000
- ] ;
1001
-
1002
- # Required: schemaVersion
1003
- sh:property [
1004
- sh:path cascade:schemaVersion ;
1005
- sh:datatype xsd:string ;
1006
- sh:minCount 1 ;
1007
- sh:maxCount 1 ;
1008
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
1009
- sh:name "Schema Version"@en
1010
- ] .
1011
-
1012
- # ============================================================================
1013
- # Longitudinal Record Shapes (v1.2)
1014
- # ============================================================================
1015
-
1016
- # ============================================================================
1017
- # Shape: Medication Use Episode
1018
- # ============================================================================
1019
-
1020
- clinical:MedicationUseEpisodeShape a sh:NodeShape ;
1021
- sh:targetClass clinical:MedicationUseEpisode ;
1022
- rdfs:label "Medication Use Episode Shape"@en ;
1023
- rdfs:comment "Validation constraints for longitudinal medication episodes. Ensures source linkage and explainable status inference per Cascade Protocol requirements."@en ;
1024
-
1025
- # REQUIRED: canonicalName (normalized drug name)
1026
- sh:property [
1027
- sh:path clinical:canonicalName ;
1028
- sh:datatype xsd:string ;
1029
- sh:minCount 1 ;
1030
- sh:maxCount 1 ;
1031
- sh:minLength 1 ;
1032
- sh:name "Canonical Name"@en ;
1033
- sh:message "Episode must have a canonical drug name"@en ;
1034
- sh:severity sh:Violation
1035
- ] ;
1036
-
1037
- # REQUIRED: episodeFirstSeenDate (earliest CLINICAL date from sources)
1038
- sh:property [
1039
- sh:path clinical:episodeFirstSeenDate ;
1040
- sh:datatype xsd:dateTime ;
1041
- sh:minCount 1 ;
1042
- sh:maxCount 1 ;
1043
- sh:name "First Seen Date"@en ;
1044
- sh:message "Episode must have a first seen date (earliest clinical date from source records)"@en ;
1045
- sh:severity sh:Violation
1046
- ] ;
1047
-
1048
- # REQUIRED: episodeLastSeenDate (most recent CLINICAL date from sources)
1049
- sh:property [
1050
- sh:path clinical:episodeLastSeenDate ;
1051
- sh:datatype xsd:dateTime ;
1052
- sh:minCount 1 ;
1053
- sh:maxCount 1 ;
1054
- sh:name "Last Seen Date"@en ;
1055
- sh:message "Episode must have a last seen date (most recent clinical date from source records)"@en ;
1056
- sh:severity sh:Violation
1057
- ] ;
1058
-
1059
- # REQUIRED: sourceRecordIds (Task 7.3 - must link to all contributing records)
1060
- sh:property [
1061
- sh:path clinical:derivedFromRecord ;
1062
- sh:minCount 1 ;
1063
- sh:name "Derived From Record"@en ;
1064
- sh:message "Episode MUST link to at least one source MedicationRecord (sourceRecordIds required per Cascade Protocol)"@en ;
1065
- sh:description "Every episode must trace back to its source records for explainability"@en ;
1066
- sh:severity sh:Violation
1067
- ] ;
1068
-
1069
- # REQUIRED: inferredStatus (Task 7.4 - must have explainable status)
1070
- sh:property [
1071
- sh:path clinical:inferredStatus ;
1072
- sh:datatype xsd:string ;
1073
- sh:minCount 1 ;
1074
- sh:maxCount 1 ;
1075
- sh:in ("active" "inactive") ;
1076
- sh:name "Inferred Status"@en ;
1077
- sh:message "Episode MUST have an inferred status (active or inactive)"@en ;
1078
- sh:severity sh:Violation
1079
- ] ;
1080
-
1081
- # REQUIRED: statusReason (Task 7.4 - must explain why we think this status)
1082
- sh:property [
1083
- sh:path clinical:statusReason ;
1084
- sh:datatype xsd:string ;
1085
- sh:minCount 1 ;
1086
- sh:maxCount 1 ;
1087
- sh:in ("explicitStatus" "hasRecentEndDate" "noRecentActivity" "inferredFromRefills" "userOverride") ;
1088
- sh:name "Status Reason"@en ;
1089
- sh:message "Episode MUST have a status reason explaining WHY system thinks this status (per No Silent Inference policy)"@en ;
1090
- sh:description "Enables answering: 'Why does system think this medication is active?'"@en ;
1091
- sh:severity sh:Violation
1092
- ] ;
1093
-
1094
- # REQUIRED: statusConfidence
1095
- sh:property [
1096
- sh:path clinical:statusConfidence ;
1097
- sh:datatype xsd:string ;
1098
- sh:minCount 1 ;
1099
- sh:maxCount 1 ;
1100
- sh:in ("high" "medium" "low") ;
1101
- sh:name "Status Confidence"@en ;
1102
- sh:message "Episode must declare confidence level for status inference"@en ;
1103
- sh:severity sh:Violation
1104
- ] ;
1105
-
1106
- # Optional: conceptUri (stable URI for the medication concept)
1107
- sh:property [
1108
- sh:path clinical:conceptUri ;
1109
- sh:maxCount 1 ;
1110
- sh:name "Concept URI"@en ;
1111
- sh:description "Stable URI for the medication concept (RxNorm URI or minted Cascade URI)"@en
1112
- ] ;
1113
-
1114
- # Optional: currentDose
1115
- sh:property [
1116
- sh:path clinical:currentDose ;
1117
- sh:datatype xsd:string ;
1118
- sh:maxCount 1 ;
1119
- sh:name "Current Dose"@en
1120
- ] ;
1121
-
1122
- # Optional: currentFrequency
1123
- sh:property [
1124
- sh:path clinical:currentFrequency ;
1125
- sh:datatype xsd:string ;
1126
- sh:maxCount 1 ;
1127
- sh:name "Current Frequency"@en
1128
- ] ;
1129
-
1130
- # Optional: currentRoute
1131
- sh:property [
1132
- sh:path clinical:currentRoute ;
1133
- sh:datatype xsd:string ;
1134
- sh:maxCount 1 ;
1135
- sh:name "Current Route"@en
1136
- ] ;
1137
-
1138
- # Optional: usePattern
1139
- sh:property [
1140
- sh:path clinical:usePattern ;
1141
- sh:datatype xsd:string ;
1142
- sh:maxCount 1 ;
1143
- sh:in ("chronic" "shortCourse" "oneTime" "asNeeded" "unknown") ;
1144
- sh:name "Use Pattern"@en
1145
- ] ;
1146
-
1147
- # Optional: therapeuticClass
1148
- sh:property [
1149
- sh:path clinical:therapeuticClass ;
1150
- sh:datatype xsd:string ;
1151
- sh:maxCount 1 ;
1152
- sh:name "Therapeutic Class"@en
1153
- ] ;
1154
-
1155
- # Optional: hasUnresolvedConflicts flag
1156
- sh:property [
1157
- sh:path clinical:hasUnresolvedConflicts ;
1158
- sh:datatype xsd:boolean ;
1159
- sh:maxCount 1 ;
1160
- sh:name "Has Unresolved Conflicts"@en ;
1161
- sh:description "Flag indicating episode has data conflicts requiring user attention"@en
1162
- ] ;
1163
-
1164
- # Optional: durationDays
1165
- sh:property [
1166
- sh:path clinical:durationDays ;
1167
- sh:datatype xsd:integer ;
1168
- sh:maxCount 1 ;
1169
- sh:minInclusive 0 ;
1170
- sh:name "Duration Days"@en
1171
- ] ;
1172
-
1173
- # Required: provenance
1174
- sh:property [
1175
- sh:path cascade:dataProvenance ;
1176
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:Reconciled) ;
1177
- sh:minCount 1 ;
1178
- sh:maxCount 1 ;
1179
- sh:name "Data Provenance"@en ;
1180
- sh:message "Episode must have valid provenance (typically Reconciled for derived episodes)"@en
1181
- ] ;
1182
-
1183
- # Required: schemaVersion
1184
- sh:property [
1185
- sh:path cascade:schemaVersion ;
1186
- sh:datatype xsd:string ;
1187
- sh:minCount 1 ;
1188
- sh:maxCount 1 ;
1189
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
1190
- sh:name "Schema Version"@en
1191
- ] .
1192
-
1193
- # ============================================================================
1194
- # Shape: Supplement (SDK-level)
1195
- # ============================================================================
1196
-
1197
- clinical:SupplementShape a sh:NodeShape ;
1198
- sh:targetClass clinical:Supplement ;
1199
- rdfs:label "Supplement Shape"@en ;
1200
- rdfs:comment "Validation constraints for supplement records. Ensures regulatory status is always explicit per Cascade Protocol requirements."@en ;
1201
-
1202
- # REQUIRED: supplementName
1203
- sh:property [
1204
- sh:path clinical:supplementName ;
1205
- sh:datatype xsd:string ;
1206
- sh:minCount 1 ;
1207
- sh:maxCount 1 ;
1208
- sh:minLength 1 ;
1209
- sh:name "Supplement Name"@en ;
1210
- sh:message "Supplement must have a name"@en ;
1211
- sh:severity sh:Violation
1212
- ] ;
1213
-
1214
- # REQUIRED: regulatoryStatus (Task 7.5 - explicit regulatory distinction)
1215
- sh:property [
1216
- sh:path clinical:regulatoryStatus ;
1217
- sh:datatype xsd:string ;
1218
- sh:minCount 1 ;
1219
- sh:maxCount 1 ;
1220
- sh:in ("dietarySupplement" "otcDrug" "homeopathic" "herbalRemedy" "unknown") ;
1221
- sh:name "Regulatory Status"@en ;
1222
- sh:message "Supplement MUST have explicit regulatory status to distinguish from FDA-approved medications"@en ;
1223
- sh:description "Required per Cascade Protocol to avoid implying clinical equivalence with prescription medications"@en ;
1224
- sh:severity sh:Violation
1225
- ] ;
1226
-
1227
- # Optional: dose
1228
- sh:property [
1229
- sh:path clinical:dose ;
1230
- sh:datatype xsd:string ;
1231
- sh:maxCount 1 ;
1232
- sh:name "Dose"@en
1233
- ] ;
1234
-
1235
- # Optional: frequency
1236
- sh:property [
1237
- sh:path clinical:frequency ;
1238
- sh:datatype xsd:string ;
1239
- sh:maxCount 1 ;
1240
- sh:name "Frequency"@en
1241
- ] ;
1242
-
1243
- # Optional: brand
1244
- sh:property [
1245
- sh:path clinical:brand ;
1246
- sh:datatype xsd:string ;
1247
- sh:maxCount 1 ;
1248
- sh:name "Brand"@en
1249
- ] ;
1250
-
1251
- # Optional: form
1252
- sh:property [
1253
- sh:path clinical:form ;
1254
- sh:datatype xsd:string ;
1255
- sh:maxCount 1 ;
1256
- sh:in ("capsule" "tablet" "softgel" "liquid" "powder" "gummy" "spray" "patch" "tea" "tincture" "other") ;
1257
- sh:name "Form"@en
1258
- ] ;
1259
-
1260
- # Optional: evidenceStrength
1261
- sh:property [
1262
- sh:path clinical:evidenceStrength ;
1263
- sh:datatype xsd:string ;
1264
- sh:maxCount 1 ;
1265
- sh:in ("strongEvidence" "moderateEvidence" "limitedEvidence" "traditionalUse" "noEvidence" "unknown") ;
1266
- sh:name "Evidence Strength"@en ;
1267
- sh:description "Level of clinical evidence supporting supplement use"@en
1268
- ] ;
1269
-
1270
- # Optional: isActive
1271
- sh:property [
1272
- sh:path clinical:isActive ;
1273
- sh:datatype xsd:boolean ;
1274
- sh:maxCount 1 ;
1275
- sh:name "Is Active"@en
1276
- ] ;
1277
-
1278
- # Optional: dsldId (NIH Dietary Supplement Label Database)
1279
- sh:property [
1280
- sh:path clinical:dsldId ;
1281
- sh:datatype xsd:string ;
1282
- sh:maxCount 1 ;
1283
- sh:name "DSLD ID"@en ;
1284
- sh:description "NIH Dietary Supplement Label Database identifier"@en
1285
- ] ;
1286
-
1287
- # Optional: upc (barcode)
1288
- sh:property [
1289
- sh:path clinical:upc ;
1290
- sh:datatype xsd:string ;
1291
- sh:maxCount 1 ;
1292
- sh:name "UPC"@en
1293
- ] ;
1294
-
1295
- # Optional: cascadeUri (stable identifier)
1296
- sh:property [
1297
- sh:path clinical:cascadeUri ;
1298
- sh:maxCount 1 ;
1299
- sh:name "Cascade URI"@en ;
1300
- sh:description "Stable Cascade Protocol identifier (minted when no external ID exists)"@en
1301
- ] ;
1302
-
1303
- # Optional: reasonForUse
1304
- sh:property [
1305
- sh:path clinical:reasonForUse ;
1306
- sh:datatype xsd:string ;
1307
- sh:maxCount 1 ;
1308
- sh:name "Reason For Use"@en
1309
- ] ;
1310
-
1311
- # Required: provenance
1312
- sh:property [
1313
- sh:path cascade:dataProvenance ;
1314
- sh:in (cascade:ClinicalGenerated cascade:EHRVerified cascade:DeviceGenerated cascade:PatientReported cascade:SelfReported) ;
1315
- sh:minCount 1 ;
1316
- sh:maxCount 1 ;
1317
- sh:name "Data Provenance"@en
1318
- ] ;
1319
-
1320
- # Required: schemaVersion
1321
- sh:property [
1322
- sh:path cascade:schemaVersion ;
1323
- sh:datatype xsd:string ;
1324
- sh:minCount 1 ;
1325
- sh:maxCount 1 ;
1326
- sh:pattern "^[0-9]+\\.[0-9]+$" ;
1327
- sh:name "Schema Version"@en
1328
- ] .
1329
-
1330
- # ============================================================================
1331
- # Changelog
1332
- # ============================================================================
1333
- #
1334
- # Version 1.2 (2026-01-15)
1335
- # - Added MedicationUseEpisodeShape for longitudinal medication tracking
1336
- # - REQUIRED: canonicalName, episodeFirstSeenDate, episodeLastSeenDate
1337
- # - REQUIRED: derivedFromRecord (sourceRecordIds) for source linkage (Task 7.3)
1338
- # - REQUIRED: inferredStatus, statusReason, statusConfidence (Task 7.4)
1339
- # - Ensures every episode answers "why does system think this?"
1340
- # - Added SupplementShape for dietary supplements and OTC products
1341
- # - REQUIRED: supplementName, regulatoryStatus (Task 7.5)
1342
- # - Explicit regulatory distinction from medications
1343
- # - Added cascade:Reconciled to valid provenance values for derived episodes
1344
- #
1345
- # Version 1.1 (2026-01-01)
1346
- # - Added shapes for all structured clinical record types
1347
- #
1348
- # Version 1.0 (2025-12-26)
1349
- # - Initial release with document shapes
1350
- #