@murphai/contracts 0.1.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 (89) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +24 -0
  3. package/dist/bank-entities.d.ts +35 -0
  4. package/dist/bank-entities.d.ts.map +1 -0
  5. package/dist/bank-entities.js +164 -0
  6. package/dist/bank-entities.js.map +1 -0
  7. package/dist/command-capabilities.d.ts +50 -0
  8. package/dist/command-capabilities.d.ts.map +1 -0
  9. package/dist/command-capabilities.js +149 -0
  10. package/dist/command-capabilities.js.map +1 -0
  11. package/dist/constants.d.ts +149 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/constants.js +232 -0
  14. package/dist/constants.js.map +1 -0
  15. package/dist/examples.d.ts +31 -0
  16. package/dist/examples.d.ts.map +1 -0
  17. package/dist/examples.js +943 -0
  18. package/dist/examples.js.map +1 -0
  19. package/dist/frontmatter.d.ts +28 -0
  20. package/dist/frontmatter.d.ts.map +1 -0
  21. package/dist/frontmatter.js +272 -0
  22. package/dist/frontmatter.js.map +1 -0
  23. package/dist/health-entities.d.ts +87 -0
  24. package/dist/health-entities.d.ts.map +1 -0
  25. package/dist/health-entities.js +349 -0
  26. package/dist/health-entities.js.map +1 -0
  27. package/dist/ids.d.ts +10 -0
  28. package/dist/ids.d.ts.map +1 -0
  29. package/dist/ids.js +27 -0
  30. package/dist/ids.js.map +1 -0
  31. package/dist/index.d.ts +16 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +16 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/registry-helpers.d.ts +31 -0
  36. package/dist/registry-helpers.d.ts.map +1 -0
  37. package/dist/registry-helpers.js +53 -0
  38. package/dist/registry-helpers.js.map +1 -0
  39. package/dist/schemas.d.ts +47 -0
  40. package/dist/schemas.d.ts.map +1 -0
  41. package/dist/schemas.js +50 -0
  42. package/dist/schemas.js.map +1 -0
  43. package/dist/scripts/generate-json-schema.js +13 -0
  44. package/dist/scripts/generate-json-schema.js.map +1 -0
  45. package/dist/scripts/verify.js +230 -0
  46. package/dist/scripts/verify.js.map +1 -0
  47. package/dist/shares.d.ts +715 -0
  48. package/dist/shares.d.ts.map +1 -0
  49. package/dist/shares.js +469 -0
  50. package/dist/shares.js.map +1 -0
  51. package/dist/time.d.ts +25 -0
  52. package/dist/time.d.ts.map +1 -0
  53. package/dist/time.js +241 -0
  54. package/dist/time.js.map +1 -0
  55. package/dist/tsconfig.build.tsbuildinfo +1 -0
  56. package/dist/types.d.ts +34 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/dist/types.js +2 -0
  59. package/dist/types.js.map +1 -0
  60. package/dist/validate.d.ts +18 -0
  61. package/dist/validate.d.ts.map +1 -0
  62. package/dist/validate.js +129 -0
  63. package/dist/validate.js.map +1 -0
  64. package/dist/zod.d.ts +1626 -0
  65. package/dist/zod.d.ts.map +1 -0
  66. package/dist/zod.js +834 -0
  67. package/dist/zod.js.map +1 -0
  68. package/generated/assessment-response.schema.json +101 -0
  69. package/generated/audit-record.schema.json +141 -0
  70. package/generated/event-record.schema.json +2708 -0
  71. package/generated/frontmatter-allergy.schema.json +82 -0
  72. package/generated/frontmatter-condition.schema.json +101 -0
  73. package/generated/frontmatter-core.schema.json +51 -0
  74. package/generated/frontmatter-experiment.schema.json +70 -0
  75. package/generated/frontmatter-family-member.schema.json +68 -0
  76. package/generated/frontmatter-food.schema.json +128 -0
  77. package/generated/frontmatter-genetic-variant.schema.json +81 -0
  78. package/generated/frontmatter-goal.schema.json +116 -0
  79. package/generated/frontmatter-journal-day.schema.json +52 -0
  80. package/generated/frontmatter-profile-current.schema.json +55 -0
  81. package/generated/frontmatter-protocol.schema.json +153 -0
  82. package/generated/frontmatter-provider.schema.json +81 -0
  83. package/generated/frontmatter-recipe.schema.json +124 -0
  84. package/generated/frontmatter-workout-format.schema.json +163 -0
  85. package/generated/inbox-capture-record.schema.json +332 -0
  86. package/generated/profile-snapshot.schema.json +131 -0
  87. package/generated/sample-record.schema.json +726 -0
  88. package/generated/vault-metadata.schema.json +324 -0
  89. package/package.json +69 -0
@@ -0,0 +1,2708 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "oneOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "schemaVersion": {
8
+ "type": "string",
9
+ "const": "murph.event.v1"
10
+ },
11
+ "id": {
12
+ "type": "string",
13
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
14
+ },
15
+ "occurredAt": {
16
+ "type": "string",
17
+ "format": "date-time"
18
+ },
19
+ "recordedAt": {
20
+ "type": "string",
21
+ "format": "date-time"
22
+ },
23
+ "dayKey": {
24
+ "type": "string",
25
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
26
+ },
27
+ "source": {
28
+ "type": "string",
29
+ "enum": [
30
+ "manual",
31
+ "import",
32
+ "device",
33
+ "derived"
34
+ ]
35
+ },
36
+ "title": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "maxLength": 160
40
+ },
41
+ "kind": {
42
+ "type": "string",
43
+ "const": "document"
44
+ },
45
+ "note": {
46
+ "type": "string",
47
+ "minLength": 1,
48
+ "maxLength": 4000
49
+ },
50
+ "tags": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string",
54
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
55
+ },
56
+ "uniqueItems": true
57
+ },
58
+ "relatedIds": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "string",
62
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
63
+ },
64
+ "uniqueItems": true
65
+ },
66
+ "rawRefs": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "string",
70
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
71
+ },
72
+ "uniqueItems": true
73
+ },
74
+ "externalRef": {
75
+ "type": "object",
76
+ "properties": {
77
+ "system": {
78
+ "type": "string",
79
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
80
+ },
81
+ "resourceType": {
82
+ "type": "string",
83
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
84
+ },
85
+ "resourceId": {
86
+ "type": "string",
87
+ "minLength": 1,
88
+ "maxLength": 200
89
+ },
90
+ "version": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "maxLength": 200
94
+ },
95
+ "facet": {
96
+ "type": "string",
97
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
98
+ }
99
+ },
100
+ "required": [
101
+ "system",
102
+ "resourceType",
103
+ "resourceId"
104
+ ],
105
+ "additionalProperties": false
106
+ },
107
+ "lifecycle": {
108
+ "type": "object",
109
+ "properties": {
110
+ "revision": {
111
+ "type": "integer",
112
+ "minimum": 1
113
+ },
114
+ "state": {
115
+ "type": "string",
116
+ "enum": [
117
+ "deleted"
118
+ ]
119
+ }
120
+ },
121
+ "required": [
122
+ "revision"
123
+ ],
124
+ "additionalProperties": false
125
+ },
126
+ "timeZone": {
127
+ "type": "string",
128
+ "minLength": 3,
129
+ "maxLength": 64
130
+ },
131
+ "documentId": {
132
+ "type": "string",
133
+ "pattern": "^doc_[0-9A-HJKMNP-TV-Z]{26}$"
134
+ },
135
+ "documentPath": {
136
+ "type": "string",
137
+ "pattern": "^raw\\/documents\\/[A-Za-z0-9._/-]+$"
138
+ },
139
+ "mimeType": {
140
+ "type": "string",
141
+ "minLength": 3,
142
+ "maxLength": 120
143
+ },
144
+ "providerId": {
145
+ "type": "string",
146
+ "pattern": "^prov_[0-9A-HJKMNP-TV-Z]{26}$"
147
+ }
148
+ },
149
+ "required": [
150
+ "schemaVersion",
151
+ "id",
152
+ "occurredAt",
153
+ "recordedAt",
154
+ "dayKey",
155
+ "source",
156
+ "title",
157
+ "kind",
158
+ "documentId",
159
+ "documentPath",
160
+ "mimeType"
161
+ ],
162
+ "additionalProperties": false
163
+ },
164
+ {
165
+ "type": "object",
166
+ "properties": {
167
+ "schemaVersion": {
168
+ "type": "string",
169
+ "const": "murph.event.v1"
170
+ },
171
+ "id": {
172
+ "type": "string",
173
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
174
+ },
175
+ "occurredAt": {
176
+ "type": "string",
177
+ "format": "date-time"
178
+ },
179
+ "recordedAt": {
180
+ "type": "string",
181
+ "format": "date-time"
182
+ },
183
+ "dayKey": {
184
+ "type": "string",
185
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
186
+ },
187
+ "source": {
188
+ "type": "string",
189
+ "enum": [
190
+ "manual",
191
+ "import",
192
+ "device",
193
+ "derived"
194
+ ]
195
+ },
196
+ "title": {
197
+ "type": "string",
198
+ "minLength": 1,
199
+ "maxLength": 160
200
+ },
201
+ "kind": {
202
+ "type": "string",
203
+ "const": "encounter"
204
+ },
205
+ "note": {
206
+ "type": "string",
207
+ "minLength": 1,
208
+ "maxLength": 4000
209
+ },
210
+ "tags": {
211
+ "type": "array",
212
+ "items": {
213
+ "type": "string",
214
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
215
+ },
216
+ "uniqueItems": true
217
+ },
218
+ "relatedIds": {
219
+ "type": "array",
220
+ "items": {
221
+ "type": "string",
222
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
223
+ },
224
+ "uniqueItems": true
225
+ },
226
+ "rawRefs": {
227
+ "type": "array",
228
+ "items": {
229
+ "type": "string",
230
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
231
+ },
232
+ "uniqueItems": true
233
+ },
234
+ "externalRef": {
235
+ "type": "object",
236
+ "properties": {
237
+ "system": {
238
+ "type": "string",
239
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
240
+ },
241
+ "resourceType": {
242
+ "type": "string",
243
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
244
+ },
245
+ "resourceId": {
246
+ "type": "string",
247
+ "minLength": 1,
248
+ "maxLength": 200
249
+ },
250
+ "version": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "maxLength": 200
254
+ },
255
+ "facet": {
256
+ "type": "string",
257
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
258
+ }
259
+ },
260
+ "required": [
261
+ "system",
262
+ "resourceType",
263
+ "resourceId"
264
+ ],
265
+ "additionalProperties": false
266
+ },
267
+ "lifecycle": {
268
+ "type": "object",
269
+ "properties": {
270
+ "revision": {
271
+ "type": "integer",
272
+ "minimum": 1
273
+ },
274
+ "state": {
275
+ "type": "string",
276
+ "enum": [
277
+ "deleted"
278
+ ]
279
+ }
280
+ },
281
+ "required": [
282
+ "revision"
283
+ ],
284
+ "additionalProperties": false
285
+ },
286
+ "timeZone": {
287
+ "type": "string",
288
+ "minLength": 3,
289
+ "maxLength": 64
290
+ },
291
+ "encounterType": {
292
+ "type": "string",
293
+ "minLength": 1,
294
+ "maxLength": 160
295
+ },
296
+ "location": {
297
+ "type": "string",
298
+ "minLength": 1,
299
+ "maxLength": 160
300
+ },
301
+ "providerId": {
302
+ "type": "string",
303
+ "pattern": "^prov_[0-9A-HJKMNP-TV-Z]{26}$"
304
+ }
305
+ },
306
+ "required": [
307
+ "schemaVersion",
308
+ "id",
309
+ "occurredAt",
310
+ "recordedAt",
311
+ "dayKey",
312
+ "source",
313
+ "title",
314
+ "kind",
315
+ "encounterType"
316
+ ],
317
+ "additionalProperties": false
318
+ },
319
+ {
320
+ "type": "object",
321
+ "properties": {
322
+ "schemaVersion": {
323
+ "type": "string",
324
+ "const": "murph.event.v1"
325
+ },
326
+ "id": {
327
+ "type": "string",
328
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
329
+ },
330
+ "occurredAt": {
331
+ "type": "string",
332
+ "format": "date-time"
333
+ },
334
+ "recordedAt": {
335
+ "type": "string",
336
+ "format": "date-time"
337
+ },
338
+ "dayKey": {
339
+ "type": "string",
340
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
341
+ },
342
+ "source": {
343
+ "type": "string",
344
+ "enum": [
345
+ "manual",
346
+ "import",
347
+ "device",
348
+ "derived"
349
+ ]
350
+ },
351
+ "title": {
352
+ "type": "string",
353
+ "minLength": 1,
354
+ "maxLength": 160
355
+ },
356
+ "kind": {
357
+ "type": "string",
358
+ "const": "meal"
359
+ },
360
+ "note": {
361
+ "type": "string",
362
+ "minLength": 1,
363
+ "maxLength": 4000
364
+ },
365
+ "tags": {
366
+ "type": "array",
367
+ "items": {
368
+ "type": "string",
369
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
370
+ },
371
+ "uniqueItems": true
372
+ },
373
+ "relatedIds": {
374
+ "type": "array",
375
+ "items": {
376
+ "type": "string",
377
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
378
+ },
379
+ "uniqueItems": true
380
+ },
381
+ "rawRefs": {
382
+ "type": "array",
383
+ "items": {
384
+ "type": "string",
385
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
386
+ },
387
+ "uniqueItems": true
388
+ },
389
+ "externalRef": {
390
+ "type": "object",
391
+ "properties": {
392
+ "system": {
393
+ "type": "string",
394
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
395
+ },
396
+ "resourceType": {
397
+ "type": "string",
398
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
399
+ },
400
+ "resourceId": {
401
+ "type": "string",
402
+ "minLength": 1,
403
+ "maxLength": 200
404
+ },
405
+ "version": {
406
+ "type": "string",
407
+ "minLength": 1,
408
+ "maxLength": 200
409
+ },
410
+ "facet": {
411
+ "type": "string",
412
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
413
+ }
414
+ },
415
+ "required": [
416
+ "system",
417
+ "resourceType",
418
+ "resourceId"
419
+ ],
420
+ "additionalProperties": false
421
+ },
422
+ "lifecycle": {
423
+ "type": "object",
424
+ "properties": {
425
+ "revision": {
426
+ "type": "integer",
427
+ "minimum": 1
428
+ },
429
+ "state": {
430
+ "type": "string",
431
+ "enum": [
432
+ "deleted"
433
+ ]
434
+ }
435
+ },
436
+ "required": [
437
+ "revision"
438
+ ],
439
+ "additionalProperties": false
440
+ },
441
+ "timeZone": {
442
+ "type": "string",
443
+ "minLength": 3,
444
+ "maxLength": 64
445
+ },
446
+ "mealId": {
447
+ "type": "string",
448
+ "pattern": "^meal_[0-9A-HJKMNP-TV-Z]{26}$"
449
+ },
450
+ "photoPaths": {
451
+ "type": "array",
452
+ "items": {
453
+ "type": "string",
454
+ "pattern": "^raw\\/meals\\/[A-Za-z0-9._/-]+$"
455
+ },
456
+ "uniqueItems": true
457
+ },
458
+ "audioPaths": {
459
+ "type": "array",
460
+ "items": {
461
+ "type": "string",
462
+ "pattern": "^raw\\/meals\\/[A-Za-z0-9._/-]+$"
463
+ }
464
+ },
465
+ "ingredients": {
466
+ "maxItems": 100,
467
+ "type": "array",
468
+ "items": {
469
+ "type": "string",
470
+ "minLength": 1,
471
+ "maxLength": 4000
472
+ }
473
+ }
474
+ },
475
+ "required": [
476
+ "schemaVersion",
477
+ "id",
478
+ "occurredAt",
479
+ "recordedAt",
480
+ "dayKey",
481
+ "source",
482
+ "title",
483
+ "kind",
484
+ "mealId",
485
+ "photoPaths",
486
+ "audioPaths"
487
+ ],
488
+ "additionalProperties": false
489
+ },
490
+ {
491
+ "type": "object",
492
+ "properties": {
493
+ "schemaVersion": {
494
+ "type": "string",
495
+ "const": "murph.event.v1"
496
+ },
497
+ "id": {
498
+ "type": "string",
499
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
500
+ },
501
+ "occurredAt": {
502
+ "type": "string",
503
+ "format": "date-time"
504
+ },
505
+ "recordedAt": {
506
+ "type": "string",
507
+ "format": "date-time"
508
+ },
509
+ "dayKey": {
510
+ "type": "string",
511
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
512
+ },
513
+ "source": {
514
+ "type": "string",
515
+ "enum": [
516
+ "manual",
517
+ "import",
518
+ "device",
519
+ "derived"
520
+ ]
521
+ },
522
+ "title": {
523
+ "type": "string",
524
+ "minLength": 1,
525
+ "maxLength": 160
526
+ },
527
+ "kind": {
528
+ "type": "string",
529
+ "const": "symptom"
530
+ },
531
+ "note": {
532
+ "type": "string",
533
+ "minLength": 1,
534
+ "maxLength": 4000
535
+ },
536
+ "tags": {
537
+ "type": "array",
538
+ "items": {
539
+ "type": "string",
540
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
541
+ },
542
+ "uniqueItems": true
543
+ },
544
+ "relatedIds": {
545
+ "type": "array",
546
+ "items": {
547
+ "type": "string",
548
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
549
+ },
550
+ "uniqueItems": true
551
+ },
552
+ "rawRefs": {
553
+ "type": "array",
554
+ "items": {
555
+ "type": "string",
556
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
557
+ },
558
+ "uniqueItems": true
559
+ },
560
+ "externalRef": {
561
+ "type": "object",
562
+ "properties": {
563
+ "system": {
564
+ "type": "string",
565
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
566
+ },
567
+ "resourceType": {
568
+ "type": "string",
569
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
570
+ },
571
+ "resourceId": {
572
+ "type": "string",
573
+ "minLength": 1,
574
+ "maxLength": 200
575
+ },
576
+ "version": {
577
+ "type": "string",
578
+ "minLength": 1,
579
+ "maxLength": 200
580
+ },
581
+ "facet": {
582
+ "type": "string",
583
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
584
+ }
585
+ },
586
+ "required": [
587
+ "system",
588
+ "resourceType",
589
+ "resourceId"
590
+ ],
591
+ "additionalProperties": false
592
+ },
593
+ "lifecycle": {
594
+ "type": "object",
595
+ "properties": {
596
+ "revision": {
597
+ "type": "integer",
598
+ "minimum": 1
599
+ },
600
+ "state": {
601
+ "type": "string",
602
+ "enum": [
603
+ "deleted"
604
+ ]
605
+ }
606
+ },
607
+ "required": [
608
+ "revision"
609
+ ],
610
+ "additionalProperties": false
611
+ },
612
+ "timeZone": {
613
+ "type": "string",
614
+ "minLength": 3,
615
+ "maxLength": 64
616
+ },
617
+ "symptom": {
618
+ "type": "string",
619
+ "minLength": 1,
620
+ "maxLength": 120
621
+ },
622
+ "intensity": {
623
+ "type": "integer",
624
+ "minimum": 0,
625
+ "maximum": 10
626
+ },
627
+ "bodySite": {
628
+ "type": "string",
629
+ "minLength": 1,
630
+ "maxLength": 120
631
+ }
632
+ },
633
+ "required": [
634
+ "schemaVersion",
635
+ "id",
636
+ "occurredAt",
637
+ "recordedAt",
638
+ "dayKey",
639
+ "source",
640
+ "title",
641
+ "kind",
642
+ "symptom",
643
+ "intensity"
644
+ ],
645
+ "additionalProperties": false
646
+ },
647
+ {
648
+ "type": "object",
649
+ "properties": {
650
+ "schemaVersion": {
651
+ "type": "string",
652
+ "const": "murph.event.v1"
653
+ },
654
+ "id": {
655
+ "type": "string",
656
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
657
+ },
658
+ "occurredAt": {
659
+ "type": "string",
660
+ "format": "date-time"
661
+ },
662
+ "recordedAt": {
663
+ "type": "string",
664
+ "format": "date-time"
665
+ },
666
+ "dayKey": {
667
+ "type": "string",
668
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
669
+ },
670
+ "source": {
671
+ "type": "string",
672
+ "enum": [
673
+ "manual",
674
+ "import",
675
+ "device",
676
+ "derived"
677
+ ]
678
+ },
679
+ "title": {
680
+ "type": "string",
681
+ "minLength": 1,
682
+ "maxLength": 160
683
+ },
684
+ "kind": {
685
+ "type": "string",
686
+ "const": "note"
687
+ },
688
+ "tags": {
689
+ "type": "array",
690
+ "items": {
691
+ "type": "string",
692
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
693
+ },
694
+ "uniqueItems": true
695
+ },
696
+ "relatedIds": {
697
+ "type": "array",
698
+ "items": {
699
+ "type": "string",
700
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
701
+ },
702
+ "uniqueItems": true
703
+ },
704
+ "rawRefs": {
705
+ "type": "array",
706
+ "items": {
707
+ "type": "string",
708
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
709
+ },
710
+ "uniqueItems": true
711
+ },
712
+ "externalRef": {
713
+ "type": "object",
714
+ "properties": {
715
+ "system": {
716
+ "type": "string",
717
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
718
+ },
719
+ "resourceType": {
720
+ "type": "string",
721
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
722
+ },
723
+ "resourceId": {
724
+ "type": "string",
725
+ "minLength": 1,
726
+ "maxLength": 200
727
+ },
728
+ "version": {
729
+ "type": "string",
730
+ "minLength": 1,
731
+ "maxLength": 200
732
+ },
733
+ "facet": {
734
+ "type": "string",
735
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
736
+ }
737
+ },
738
+ "required": [
739
+ "system",
740
+ "resourceType",
741
+ "resourceId"
742
+ ],
743
+ "additionalProperties": false
744
+ },
745
+ "lifecycle": {
746
+ "type": "object",
747
+ "properties": {
748
+ "revision": {
749
+ "type": "integer",
750
+ "minimum": 1
751
+ },
752
+ "state": {
753
+ "type": "string",
754
+ "enum": [
755
+ "deleted"
756
+ ]
757
+ }
758
+ },
759
+ "required": [
760
+ "revision"
761
+ ],
762
+ "additionalProperties": false
763
+ },
764
+ "timeZone": {
765
+ "type": "string",
766
+ "minLength": 3,
767
+ "maxLength": 64
768
+ },
769
+ "note": {
770
+ "type": "string",
771
+ "minLength": 1,
772
+ "maxLength": 4000
773
+ }
774
+ },
775
+ "required": [
776
+ "schemaVersion",
777
+ "id",
778
+ "occurredAt",
779
+ "recordedAt",
780
+ "dayKey",
781
+ "source",
782
+ "title",
783
+ "kind",
784
+ "note"
785
+ ],
786
+ "additionalProperties": false
787
+ },
788
+ {
789
+ "type": "object",
790
+ "properties": {
791
+ "schemaVersion": {
792
+ "type": "string",
793
+ "const": "murph.event.v1"
794
+ },
795
+ "id": {
796
+ "type": "string",
797
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
798
+ },
799
+ "occurredAt": {
800
+ "type": "string",
801
+ "format": "date-time"
802
+ },
803
+ "recordedAt": {
804
+ "type": "string",
805
+ "format": "date-time"
806
+ },
807
+ "dayKey": {
808
+ "type": "string",
809
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
810
+ },
811
+ "source": {
812
+ "type": "string",
813
+ "enum": [
814
+ "manual",
815
+ "import",
816
+ "device",
817
+ "derived"
818
+ ]
819
+ },
820
+ "title": {
821
+ "type": "string",
822
+ "minLength": 1,
823
+ "maxLength": 160
824
+ },
825
+ "kind": {
826
+ "type": "string",
827
+ "const": "observation"
828
+ },
829
+ "note": {
830
+ "type": "string",
831
+ "minLength": 1,
832
+ "maxLength": 4000
833
+ },
834
+ "tags": {
835
+ "type": "array",
836
+ "items": {
837
+ "type": "string",
838
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
839
+ },
840
+ "uniqueItems": true
841
+ },
842
+ "relatedIds": {
843
+ "type": "array",
844
+ "items": {
845
+ "type": "string",
846
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
847
+ },
848
+ "uniqueItems": true
849
+ },
850
+ "rawRefs": {
851
+ "type": "array",
852
+ "items": {
853
+ "type": "string",
854
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
855
+ },
856
+ "uniqueItems": true
857
+ },
858
+ "externalRef": {
859
+ "type": "object",
860
+ "properties": {
861
+ "system": {
862
+ "type": "string",
863
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
864
+ },
865
+ "resourceType": {
866
+ "type": "string",
867
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
868
+ },
869
+ "resourceId": {
870
+ "type": "string",
871
+ "minLength": 1,
872
+ "maxLength": 200
873
+ },
874
+ "version": {
875
+ "type": "string",
876
+ "minLength": 1,
877
+ "maxLength": 200
878
+ },
879
+ "facet": {
880
+ "type": "string",
881
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
882
+ }
883
+ },
884
+ "required": [
885
+ "system",
886
+ "resourceType",
887
+ "resourceId"
888
+ ],
889
+ "additionalProperties": false
890
+ },
891
+ "lifecycle": {
892
+ "type": "object",
893
+ "properties": {
894
+ "revision": {
895
+ "type": "integer",
896
+ "minimum": 1
897
+ },
898
+ "state": {
899
+ "type": "string",
900
+ "enum": [
901
+ "deleted"
902
+ ]
903
+ }
904
+ },
905
+ "required": [
906
+ "revision"
907
+ ],
908
+ "additionalProperties": false
909
+ },
910
+ "timeZone": {
911
+ "type": "string",
912
+ "minLength": 3,
913
+ "maxLength": 64
914
+ },
915
+ "metric": {
916
+ "type": "string",
917
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
918
+ },
919
+ "value": {
920
+ "type": "number"
921
+ },
922
+ "unit": {
923
+ "type": "string",
924
+ "pattern": "^[A-Za-z0-9._/%-]+$"
925
+ }
926
+ },
927
+ "required": [
928
+ "schemaVersion",
929
+ "id",
930
+ "occurredAt",
931
+ "recordedAt",
932
+ "dayKey",
933
+ "source",
934
+ "title",
935
+ "kind",
936
+ "metric",
937
+ "value",
938
+ "unit"
939
+ ],
940
+ "additionalProperties": false
941
+ },
942
+ {
943
+ "type": "object",
944
+ "properties": {
945
+ "schemaVersion": {
946
+ "type": "string",
947
+ "const": "murph.event.v1"
948
+ },
949
+ "id": {
950
+ "type": "string",
951
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
952
+ },
953
+ "occurredAt": {
954
+ "type": "string",
955
+ "format": "date-time"
956
+ },
957
+ "recordedAt": {
958
+ "type": "string",
959
+ "format": "date-time"
960
+ },
961
+ "dayKey": {
962
+ "type": "string",
963
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
964
+ },
965
+ "source": {
966
+ "type": "string",
967
+ "enum": [
968
+ "manual",
969
+ "import",
970
+ "device",
971
+ "derived"
972
+ ]
973
+ },
974
+ "title": {
975
+ "type": "string",
976
+ "minLength": 1,
977
+ "maxLength": 160
978
+ },
979
+ "kind": {
980
+ "type": "string",
981
+ "const": "experiment_event"
982
+ },
983
+ "note": {
984
+ "type": "string",
985
+ "minLength": 1,
986
+ "maxLength": 4000
987
+ },
988
+ "tags": {
989
+ "type": "array",
990
+ "items": {
991
+ "type": "string",
992
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
993
+ },
994
+ "uniqueItems": true
995
+ },
996
+ "relatedIds": {
997
+ "type": "array",
998
+ "items": {
999
+ "type": "string",
1000
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
1001
+ },
1002
+ "uniqueItems": true
1003
+ },
1004
+ "rawRefs": {
1005
+ "type": "array",
1006
+ "items": {
1007
+ "type": "string",
1008
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
1009
+ },
1010
+ "uniqueItems": true
1011
+ },
1012
+ "externalRef": {
1013
+ "type": "object",
1014
+ "properties": {
1015
+ "system": {
1016
+ "type": "string",
1017
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1018
+ },
1019
+ "resourceType": {
1020
+ "type": "string",
1021
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1022
+ },
1023
+ "resourceId": {
1024
+ "type": "string",
1025
+ "minLength": 1,
1026
+ "maxLength": 200
1027
+ },
1028
+ "version": {
1029
+ "type": "string",
1030
+ "minLength": 1,
1031
+ "maxLength": 200
1032
+ },
1033
+ "facet": {
1034
+ "type": "string",
1035
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1036
+ }
1037
+ },
1038
+ "required": [
1039
+ "system",
1040
+ "resourceType",
1041
+ "resourceId"
1042
+ ],
1043
+ "additionalProperties": false
1044
+ },
1045
+ "lifecycle": {
1046
+ "type": "object",
1047
+ "properties": {
1048
+ "revision": {
1049
+ "type": "integer",
1050
+ "minimum": 1
1051
+ },
1052
+ "state": {
1053
+ "type": "string",
1054
+ "enum": [
1055
+ "deleted"
1056
+ ]
1057
+ }
1058
+ },
1059
+ "required": [
1060
+ "revision"
1061
+ ],
1062
+ "additionalProperties": false
1063
+ },
1064
+ "timeZone": {
1065
+ "type": "string",
1066
+ "minLength": 3,
1067
+ "maxLength": 64
1068
+ },
1069
+ "experimentId": {
1070
+ "type": "string",
1071
+ "pattern": "^exp_[0-9A-HJKMNP-TV-Z]{26}$"
1072
+ },
1073
+ "experimentSlug": {
1074
+ "type": "string",
1075
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1076
+ },
1077
+ "phase": {
1078
+ "type": "string",
1079
+ "enum": [
1080
+ "start",
1081
+ "checkpoint",
1082
+ "stop"
1083
+ ]
1084
+ }
1085
+ },
1086
+ "required": [
1087
+ "schemaVersion",
1088
+ "id",
1089
+ "occurredAt",
1090
+ "recordedAt",
1091
+ "dayKey",
1092
+ "source",
1093
+ "title",
1094
+ "kind",
1095
+ "experimentId",
1096
+ "experimentSlug",
1097
+ "phase"
1098
+ ],
1099
+ "additionalProperties": false
1100
+ },
1101
+ {
1102
+ "type": "object",
1103
+ "properties": {
1104
+ "schemaVersion": {
1105
+ "type": "string",
1106
+ "const": "murph.event.v1"
1107
+ },
1108
+ "id": {
1109
+ "type": "string",
1110
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
1111
+ },
1112
+ "occurredAt": {
1113
+ "type": "string",
1114
+ "format": "date-time"
1115
+ },
1116
+ "recordedAt": {
1117
+ "type": "string",
1118
+ "format": "date-time"
1119
+ },
1120
+ "dayKey": {
1121
+ "type": "string",
1122
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
1123
+ },
1124
+ "source": {
1125
+ "type": "string",
1126
+ "enum": [
1127
+ "manual",
1128
+ "import",
1129
+ "device",
1130
+ "derived"
1131
+ ]
1132
+ },
1133
+ "title": {
1134
+ "type": "string",
1135
+ "minLength": 1,
1136
+ "maxLength": 160
1137
+ },
1138
+ "kind": {
1139
+ "type": "string",
1140
+ "const": "medication_intake"
1141
+ },
1142
+ "note": {
1143
+ "type": "string",
1144
+ "minLength": 1,
1145
+ "maxLength": 4000
1146
+ },
1147
+ "tags": {
1148
+ "type": "array",
1149
+ "items": {
1150
+ "type": "string",
1151
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1152
+ },
1153
+ "uniqueItems": true
1154
+ },
1155
+ "relatedIds": {
1156
+ "type": "array",
1157
+ "items": {
1158
+ "type": "string",
1159
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
1160
+ },
1161
+ "uniqueItems": true
1162
+ },
1163
+ "rawRefs": {
1164
+ "type": "array",
1165
+ "items": {
1166
+ "type": "string",
1167
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
1168
+ },
1169
+ "uniqueItems": true
1170
+ },
1171
+ "externalRef": {
1172
+ "type": "object",
1173
+ "properties": {
1174
+ "system": {
1175
+ "type": "string",
1176
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1177
+ },
1178
+ "resourceType": {
1179
+ "type": "string",
1180
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1181
+ },
1182
+ "resourceId": {
1183
+ "type": "string",
1184
+ "minLength": 1,
1185
+ "maxLength": 200
1186
+ },
1187
+ "version": {
1188
+ "type": "string",
1189
+ "minLength": 1,
1190
+ "maxLength": 200
1191
+ },
1192
+ "facet": {
1193
+ "type": "string",
1194
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1195
+ }
1196
+ },
1197
+ "required": [
1198
+ "system",
1199
+ "resourceType",
1200
+ "resourceId"
1201
+ ],
1202
+ "additionalProperties": false
1203
+ },
1204
+ "lifecycle": {
1205
+ "type": "object",
1206
+ "properties": {
1207
+ "revision": {
1208
+ "type": "integer",
1209
+ "minimum": 1
1210
+ },
1211
+ "state": {
1212
+ "type": "string",
1213
+ "enum": [
1214
+ "deleted"
1215
+ ]
1216
+ }
1217
+ },
1218
+ "required": [
1219
+ "revision"
1220
+ ],
1221
+ "additionalProperties": false
1222
+ },
1223
+ "timeZone": {
1224
+ "type": "string",
1225
+ "minLength": 3,
1226
+ "maxLength": 64
1227
+ },
1228
+ "medicationName": {
1229
+ "type": "string",
1230
+ "minLength": 1,
1231
+ "maxLength": 160
1232
+ },
1233
+ "dose": {
1234
+ "type": "number",
1235
+ "minimum": 0
1236
+ },
1237
+ "unit": {
1238
+ "type": "string",
1239
+ "pattern": "^[A-Za-z0-9._/%-]+$"
1240
+ }
1241
+ },
1242
+ "required": [
1243
+ "schemaVersion",
1244
+ "id",
1245
+ "occurredAt",
1246
+ "recordedAt",
1247
+ "dayKey",
1248
+ "source",
1249
+ "title",
1250
+ "kind",
1251
+ "medicationName",
1252
+ "dose",
1253
+ "unit"
1254
+ ],
1255
+ "additionalProperties": false
1256
+ },
1257
+ {
1258
+ "type": "object",
1259
+ "properties": {
1260
+ "schemaVersion": {
1261
+ "type": "string",
1262
+ "const": "murph.event.v1"
1263
+ },
1264
+ "id": {
1265
+ "type": "string",
1266
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
1267
+ },
1268
+ "occurredAt": {
1269
+ "type": "string",
1270
+ "format": "date-time"
1271
+ },
1272
+ "recordedAt": {
1273
+ "type": "string",
1274
+ "format": "date-time"
1275
+ },
1276
+ "dayKey": {
1277
+ "type": "string",
1278
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
1279
+ },
1280
+ "source": {
1281
+ "type": "string",
1282
+ "enum": [
1283
+ "manual",
1284
+ "import",
1285
+ "device",
1286
+ "derived"
1287
+ ]
1288
+ },
1289
+ "title": {
1290
+ "type": "string",
1291
+ "minLength": 1,
1292
+ "maxLength": 160
1293
+ },
1294
+ "kind": {
1295
+ "type": "string",
1296
+ "const": "procedure"
1297
+ },
1298
+ "note": {
1299
+ "type": "string",
1300
+ "minLength": 1,
1301
+ "maxLength": 4000
1302
+ },
1303
+ "tags": {
1304
+ "type": "array",
1305
+ "items": {
1306
+ "type": "string",
1307
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1308
+ },
1309
+ "uniqueItems": true
1310
+ },
1311
+ "relatedIds": {
1312
+ "type": "array",
1313
+ "items": {
1314
+ "type": "string",
1315
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
1316
+ },
1317
+ "uniqueItems": true
1318
+ },
1319
+ "rawRefs": {
1320
+ "type": "array",
1321
+ "items": {
1322
+ "type": "string",
1323
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
1324
+ },
1325
+ "uniqueItems": true
1326
+ },
1327
+ "externalRef": {
1328
+ "type": "object",
1329
+ "properties": {
1330
+ "system": {
1331
+ "type": "string",
1332
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1333
+ },
1334
+ "resourceType": {
1335
+ "type": "string",
1336
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1337
+ },
1338
+ "resourceId": {
1339
+ "type": "string",
1340
+ "minLength": 1,
1341
+ "maxLength": 200
1342
+ },
1343
+ "version": {
1344
+ "type": "string",
1345
+ "minLength": 1,
1346
+ "maxLength": 200
1347
+ },
1348
+ "facet": {
1349
+ "type": "string",
1350
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1351
+ }
1352
+ },
1353
+ "required": [
1354
+ "system",
1355
+ "resourceType",
1356
+ "resourceId"
1357
+ ],
1358
+ "additionalProperties": false
1359
+ },
1360
+ "lifecycle": {
1361
+ "type": "object",
1362
+ "properties": {
1363
+ "revision": {
1364
+ "type": "integer",
1365
+ "minimum": 1
1366
+ },
1367
+ "state": {
1368
+ "type": "string",
1369
+ "enum": [
1370
+ "deleted"
1371
+ ]
1372
+ }
1373
+ },
1374
+ "required": [
1375
+ "revision"
1376
+ ],
1377
+ "additionalProperties": false
1378
+ },
1379
+ "timeZone": {
1380
+ "type": "string",
1381
+ "minLength": 3,
1382
+ "maxLength": 64
1383
+ },
1384
+ "procedure": {
1385
+ "type": "string",
1386
+ "minLength": 1,
1387
+ "maxLength": 160
1388
+ },
1389
+ "status": {
1390
+ "type": "string",
1391
+ "minLength": 1,
1392
+ "maxLength": 64
1393
+ }
1394
+ },
1395
+ "required": [
1396
+ "schemaVersion",
1397
+ "id",
1398
+ "occurredAt",
1399
+ "recordedAt",
1400
+ "dayKey",
1401
+ "source",
1402
+ "title",
1403
+ "kind",
1404
+ "procedure",
1405
+ "status"
1406
+ ],
1407
+ "additionalProperties": false
1408
+ },
1409
+ {
1410
+ "type": "object",
1411
+ "properties": {
1412
+ "schemaVersion": {
1413
+ "type": "string",
1414
+ "const": "murph.event.v1"
1415
+ },
1416
+ "id": {
1417
+ "type": "string",
1418
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
1419
+ },
1420
+ "occurredAt": {
1421
+ "type": "string",
1422
+ "format": "date-time"
1423
+ },
1424
+ "recordedAt": {
1425
+ "type": "string",
1426
+ "format": "date-time"
1427
+ },
1428
+ "dayKey": {
1429
+ "type": "string",
1430
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
1431
+ },
1432
+ "source": {
1433
+ "type": "string",
1434
+ "enum": [
1435
+ "manual",
1436
+ "import",
1437
+ "device",
1438
+ "derived"
1439
+ ]
1440
+ },
1441
+ "title": {
1442
+ "type": "string",
1443
+ "minLength": 1,
1444
+ "maxLength": 160
1445
+ },
1446
+ "kind": {
1447
+ "type": "string",
1448
+ "const": "supplement_intake"
1449
+ },
1450
+ "note": {
1451
+ "type": "string",
1452
+ "minLength": 1,
1453
+ "maxLength": 4000
1454
+ },
1455
+ "tags": {
1456
+ "type": "array",
1457
+ "items": {
1458
+ "type": "string",
1459
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1460
+ },
1461
+ "uniqueItems": true
1462
+ },
1463
+ "relatedIds": {
1464
+ "type": "array",
1465
+ "items": {
1466
+ "type": "string",
1467
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
1468
+ },
1469
+ "uniqueItems": true
1470
+ },
1471
+ "rawRefs": {
1472
+ "type": "array",
1473
+ "items": {
1474
+ "type": "string",
1475
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
1476
+ },
1477
+ "uniqueItems": true
1478
+ },
1479
+ "externalRef": {
1480
+ "type": "object",
1481
+ "properties": {
1482
+ "system": {
1483
+ "type": "string",
1484
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1485
+ },
1486
+ "resourceType": {
1487
+ "type": "string",
1488
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1489
+ },
1490
+ "resourceId": {
1491
+ "type": "string",
1492
+ "minLength": 1,
1493
+ "maxLength": 200
1494
+ },
1495
+ "version": {
1496
+ "type": "string",
1497
+ "minLength": 1,
1498
+ "maxLength": 200
1499
+ },
1500
+ "facet": {
1501
+ "type": "string",
1502
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1503
+ }
1504
+ },
1505
+ "required": [
1506
+ "system",
1507
+ "resourceType",
1508
+ "resourceId"
1509
+ ],
1510
+ "additionalProperties": false
1511
+ },
1512
+ "lifecycle": {
1513
+ "type": "object",
1514
+ "properties": {
1515
+ "revision": {
1516
+ "type": "integer",
1517
+ "minimum": 1
1518
+ },
1519
+ "state": {
1520
+ "type": "string",
1521
+ "enum": [
1522
+ "deleted"
1523
+ ]
1524
+ }
1525
+ },
1526
+ "required": [
1527
+ "revision"
1528
+ ],
1529
+ "additionalProperties": false
1530
+ },
1531
+ "timeZone": {
1532
+ "type": "string",
1533
+ "minLength": 3,
1534
+ "maxLength": 64
1535
+ },
1536
+ "supplementName": {
1537
+ "type": "string",
1538
+ "minLength": 1,
1539
+ "maxLength": 160
1540
+ },
1541
+ "dose": {
1542
+ "type": "number",
1543
+ "minimum": 0
1544
+ },
1545
+ "unit": {
1546
+ "type": "string",
1547
+ "pattern": "^[A-Za-z0-9._/%-]+$"
1548
+ }
1549
+ },
1550
+ "required": [
1551
+ "schemaVersion",
1552
+ "id",
1553
+ "occurredAt",
1554
+ "recordedAt",
1555
+ "dayKey",
1556
+ "source",
1557
+ "title",
1558
+ "kind",
1559
+ "supplementName",
1560
+ "dose",
1561
+ "unit"
1562
+ ],
1563
+ "additionalProperties": false
1564
+ },
1565
+ {
1566
+ "type": "object",
1567
+ "properties": {
1568
+ "schemaVersion": {
1569
+ "type": "string",
1570
+ "const": "murph.event.v1"
1571
+ },
1572
+ "id": {
1573
+ "type": "string",
1574
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
1575
+ },
1576
+ "occurredAt": {
1577
+ "type": "string",
1578
+ "format": "date-time"
1579
+ },
1580
+ "recordedAt": {
1581
+ "type": "string",
1582
+ "format": "date-time"
1583
+ },
1584
+ "dayKey": {
1585
+ "type": "string",
1586
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
1587
+ },
1588
+ "source": {
1589
+ "type": "string",
1590
+ "enum": [
1591
+ "manual",
1592
+ "import",
1593
+ "device",
1594
+ "derived"
1595
+ ]
1596
+ },
1597
+ "title": {
1598
+ "type": "string",
1599
+ "minLength": 1,
1600
+ "maxLength": 160
1601
+ },
1602
+ "kind": {
1603
+ "type": "string",
1604
+ "const": "test"
1605
+ },
1606
+ "note": {
1607
+ "type": "string",
1608
+ "minLength": 1,
1609
+ "maxLength": 4000
1610
+ },
1611
+ "tags": {
1612
+ "type": "array",
1613
+ "items": {
1614
+ "type": "string",
1615
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1616
+ },
1617
+ "uniqueItems": true
1618
+ },
1619
+ "relatedIds": {
1620
+ "type": "array",
1621
+ "items": {
1622
+ "type": "string",
1623
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
1624
+ },
1625
+ "uniqueItems": true
1626
+ },
1627
+ "rawRefs": {
1628
+ "type": "array",
1629
+ "items": {
1630
+ "type": "string",
1631
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
1632
+ },
1633
+ "uniqueItems": true
1634
+ },
1635
+ "externalRef": {
1636
+ "type": "object",
1637
+ "properties": {
1638
+ "system": {
1639
+ "type": "string",
1640
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1641
+ },
1642
+ "resourceType": {
1643
+ "type": "string",
1644
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1645
+ },
1646
+ "resourceId": {
1647
+ "type": "string",
1648
+ "minLength": 1,
1649
+ "maxLength": 200
1650
+ },
1651
+ "version": {
1652
+ "type": "string",
1653
+ "minLength": 1,
1654
+ "maxLength": 200
1655
+ },
1656
+ "facet": {
1657
+ "type": "string",
1658
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1659
+ }
1660
+ },
1661
+ "required": [
1662
+ "system",
1663
+ "resourceType",
1664
+ "resourceId"
1665
+ ],
1666
+ "additionalProperties": false
1667
+ },
1668
+ "lifecycle": {
1669
+ "type": "object",
1670
+ "properties": {
1671
+ "revision": {
1672
+ "type": "integer",
1673
+ "minimum": 1
1674
+ },
1675
+ "state": {
1676
+ "type": "string",
1677
+ "enum": [
1678
+ "deleted"
1679
+ ]
1680
+ }
1681
+ },
1682
+ "required": [
1683
+ "revision"
1684
+ ],
1685
+ "additionalProperties": false
1686
+ },
1687
+ "timeZone": {
1688
+ "type": "string",
1689
+ "minLength": 3,
1690
+ "maxLength": 64
1691
+ },
1692
+ "testName": {
1693
+ "type": "string",
1694
+ "minLength": 1,
1695
+ "maxLength": 160
1696
+ },
1697
+ "resultStatus": {
1698
+ "type": "string",
1699
+ "enum": [
1700
+ "pending",
1701
+ "normal",
1702
+ "abnormal",
1703
+ "mixed",
1704
+ "unknown"
1705
+ ]
1706
+ },
1707
+ "summary": {
1708
+ "type": "string",
1709
+ "minLength": 1,
1710
+ "maxLength": 4000
1711
+ },
1712
+ "testCategory": {
1713
+ "type": "string",
1714
+ "minLength": 1,
1715
+ "maxLength": 64
1716
+ },
1717
+ "specimenType": {
1718
+ "type": "string",
1719
+ "minLength": 1,
1720
+ "maxLength": 64
1721
+ },
1722
+ "labName": {
1723
+ "type": "string",
1724
+ "minLength": 1,
1725
+ "maxLength": 160
1726
+ },
1727
+ "labPanelId": {
1728
+ "type": "string",
1729
+ "minLength": 1,
1730
+ "maxLength": 120
1731
+ },
1732
+ "collectedAt": {
1733
+ "type": "string",
1734
+ "format": "date-time"
1735
+ },
1736
+ "reportedAt": {
1737
+ "type": "string",
1738
+ "format": "date-time"
1739
+ },
1740
+ "fastingStatus": {
1741
+ "type": "string",
1742
+ "enum": [
1743
+ "fasting",
1744
+ "non_fasting",
1745
+ "unknown"
1746
+ ]
1747
+ },
1748
+ "results": {
1749
+ "minItems": 1,
1750
+ "maxItems": 500,
1751
+ "type": "array",
1752
+ "items": {
1753
+ "type": "object",
1754
+ "properties": {
1755
+ "analyte": {
1756
+ "type": "string",
1757
+ "minLength": 1,
1758
+ "maxLength": 160
1759
+ },
1760
+ "slug": {
1761
+ "type": "string",
1762
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1763
+ },
1764
+ "value": {
1765
+ "type": "number"
1766
+ },
1767
+ "textValue": {
1768
+ "type": "string",
1769
+ "minLength": 1,
1770
+ "maxLength": 160
1771
+ },
1772
+ "comparator": {
1773
+ "type": "string",
1774
+ "enum": [
1775
+ "<",
1776
+ "<=",
1777
+ ">",
1778
+ ">="
1779
+ ]
1780
+ },
1781
+ "unit": {
1782
+ "type": "string",
1783
+ "minLength": 1,
1784
+ "maxLength": 64
1785
+ },
1786
+ "flag": {
1787
+ "type": "string",
1788
+ "enum": [
1789
+ "low",
1790
+ "normal",
1791
+ "high",
1792
+ "abnormal",
1793
+ "critical",
1794
+ "unknown"
1795
+ ]
1796
+ },
1797
+ "biomarkerSlug": {
1798
+ "type": "string",
1799
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1800
+ },
1801
+ "referenceRange": {
1802
+ "type": "object",
1803
+ "properties": {
1804
+ "low": {
1805
+ "type": "number"
1806
+ },
1807
+ "high": {
1808
+ "type": "number"
1809
+ },
1810
+ "text": {
1811
+ "type": "string",
1812
+ "minLength": 1,
1813
+ "maxLength": 160
1814
+ }
1815
+ },
1816
+ "additionalProperties": false
1817
+ },
1818
+ "note": {
1819
+ "type": "string",
1820
+ "minLength": 1,
1821
+ "maxLength": 240
1822
+ }
1823
+ },
1824
+ "required": [
1825
+ "analyte"
1826
+ ],
1827
+ "additionalProperties": false
1828
+ }
1829
+ }
1830
+ },
1831
+ "required": [
1832
+ "schemaVersion",
1833
+ "id",
1834
+ "occurredAt",
1835
+ "recordedAt",
1836
+ "dayKey",
1837
+ "source",
1838
+ "title",
1839
+ "kind",
1840
+ "testName",
1841
+ "resultStatus"
1842
+ ],
1843
+ "additionalProperties": false
1844
+ },
1845
+ {
1846
+ "type": "object",
1847
+ "properties": {
1848
+ "schemaVersion": {
1849
+ "type": "string",
1850
+ "const": "murph.event.v1"
1851
+ },
1852
+ "id": {
1853
+ "type": "string",
1854
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
1855
+ },
1856
+ "occurredAt": {
1857
+ "type": "string",
1858
+ "format": "date-time"
1859
+ },
1860
+ "recordedAt": {
1861
+ "type": "string",
1862
+ "format": "date-time"
1863
+ },
1864
+ "dayKey": {
1865
+ "type": "string",
1866
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
1867
+ },
1868
+ "source": {
1869
+ "type": "string",
1870
+ "enum": [
1871
+ "manual",
1872
+ "import",
1873
+ "device",
1874
+ "derived"
1875
+ ]
1876
+ },
1877
+ "title": {
1878
+ "type": "string",
1879
+ "minLength": 1,
1880
+ "maxLength": 160
1881
+ },
1882
+ "kind": {
1883
+ "type": "string",
1884
+ "const": "activity_session"
1885
+ },
1886
+ "note": {
1887
+ "type": "string",
1888
+ "minLength": 1,
1889
+ "maxLength": 4000
1890
+ },
1891
+ "tags": {
1892
+ "type": "array",
1893
+ "items": {
1894
+ "type": "string",
1895
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1896
+ },
1897
+ "uniqueItems": true
1898
+ },
1899
+ "relatedIds": {
1900
+ "type": "array",
1901
+ "items": {
1902
+ "type": "string",
1903
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
1904
+ },
1905
+ "uniqueItems": true
1906
+ },
1907
+ "rawRefs": {
1908
+ "type": "array",
1909
+ "items": {
1910
+ "type": "string",
1911
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
1912
+ },
1913
+ "uniqueItems": true
1914
+ },
1915
+ "externalRef": {
1916
+ "type": "object",
1917
+ "properties": {
1918
+ "system": {
1919
+ "type": "string",
1920
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1921
+ },
1922
+ "resourceType": {
1923
+ "type": "string",
1924
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1925
+ },
1926
+ "resourceId": {
1927
+ "type": "string",
1928
+ "minLength": 1,
1929
+ "maxLength": 200
1930
+ },
1931
+ "version": {
1932
+ "type": "string",
1933
+ "minLength": 1,
1934
+ "maxLength": 200
1935
+ },
1936
+ "facet": {
1937
+ "type": "string",
1938
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1939
+ }
1940
+ },
1941
+ "required": [
1942
+ "system",
1943
+ "resourceType",
1944
+ "resourceId"
1945
+ ],
1946
+ "additionalProperties": false
1947
+ },
1948
+ "lifecycle": {
1949
+ "type": "object",
1950
+ "properties": {
1951
+ "revision": {
1952
+ "type": "integer",
1953
+ "minimum": 1
1954
+ },
1955
+ "state": {
1956
+ "type": "string",
1957
+ "enum": [
1958
+ "deleted"
1959
+ ]
1960
+ }
1961
+ },
1962
+ "required": [
1963
+ "revision"
1964
+ ],
1965
+ "additionalProperties": false
1966
+ },
1967
+ "timeZone": {
1968
+ "type": "string",
1969
+ "minLength": 3,
1970
+ "maxLength": 64
1971
+ },
1972
+ "activityType": {
1973
+ "type": "string",
1974
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
1975
+ },
1976
+ "durationMinutes": {
1977
+ "type": "integer",
1978
+ "minimum": 1
1979
+ },
1980
+ "distanceKm": {
1981
+ "type": "number",
1982
+ "minimum": 0
1983
+ },
1984
+ "strengthExercises": {
1985
+ "minItems": 1,
1986
+ "maxItems": 50,
1987
+ "type": "array",
1988
+ "items": {
1989
+ "anyOf": [
1990
+ {
1991
+ "type": "object",
1992
+ "properties": {
1993
+ "exercise": {
1994
+ "type": "string",
1995
+ "minLength": 1,
1996
+ "maxLength": 160
1997
+ },
1998
+ "setCount": {
1999
+ "type": "integer",
2000
+ "minimum": 1
2001
+ },
2002
+ "repsPerSet": {
2003
+ "type": "integer",
2004
+ "minimum": 1
2005
+ },
2006
+ "loadDescription": {
2007
+ "type": "string",
2008
+ "minLength": 1,
2009
+ "maxLength": 240
2010
+ }
2011
+ },
2012
+ "required": [
2013
+ "exercise",
2014
+ "setCount",
2015
+ "repsPerSet"
2016
+ ],
2017
+ "additionalProperties": false
2018
+ },
2019
+ {
2020
+ "type": "object",
2021
+ "properties": {
2022
+ "exercise": {
2023
+ "type": "string",
2024
+ "minLength": 1,
2025
+ "maxLength": 160
2026
+ },
2027
+ "setCount": {
2028
+ "type": "integer",
2029
+ "minimum": 1
2030
+ },
2031
+ "repsPerSet": {
2032
+ "type": "integer",
2033
+ "minimum": 1
2034
+ },
2035
+ "loadDescription": {
2036
+ "type": "string",
2037
+ "minLength": 1,
2038
+ "maxLength": 240
2039
+ },
2040
+ "load": {
2041
+ "type": "number",
2042
+ "minimum": 0
2043
+ },
2044
+ "loadUnit": {
2045
+ "type": "string",
2046
+ "enum": [
2047
+ "lb",
2048
+ "kg"
2049
+ ]
2050
+ }
2051
+ },
2052
+ "required": [
2053
+ "exercise",
2054
+ "setCount",
2055
+ "repsPerSet",
2056
+ "load",
2057
+ "loadUnit"
2058
+ ],
2059
+ "additionalProperties": false
2060
+ }
2061
+ ]
2062
+ }
2063
+ }
2064
+ },
2065
+ "required": [
2066
+ "schemaVersion",
2067
+ "id",
2068
+ "occurredAt",
2069
+ "recordedAt",
2070
+ "dayKey",
2071
+ "source",
2072
+ "title",
2073
+ "kind",
2074
+ "activityType",
2075
+ "durationMinutes"
2076
+ ],
2077
+ "additionalProperties": false
2078
+ },
2079
+ {
2080
+ "type": "object",
2081
+ "properties": {
2082
+ "schemaVersion": {
2083
+ "type": "string",
2084
+ "const": "murph.event.v1"
2085
+ },
2086
+ "id": {
2087
+ "type": "string",
2088
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
2089
+ },
2090
+ "occurredAt": {
2091
+ "type": "string",
2092
+ "format": "date-time"
2093
+ },
2094
+ "recordedAt": {
2095
+ "type": "string",
2096
+ "format": "date-time"
2097
+ },
2098
+ "dayKey": {
2099
+ "type": "string",
2100
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
2101
+ },
2102
+ "source": {
2103
+ "type": "string",
2104
+ "enum": [
2105
+ "manual",
2106
+ "import",
2107
+ "device",
2108
+ "derived"
2109
+ ]
2110
+ },
2111
+ "title": {
2112
+ "type": "string",
2113
+ "minLength": 1,
2114
+ "maxLength": 160
2115
+ },
2116
+ "kind": {
2117
+ "type": "string",
2118
+ "const": "sleep_session"
2119
+ },
2120
+ "note": {
2121
+ "type": "string",
2122
+ "minLength": 1,
2123
+ "maxLength": 4000
2124
+ },
2125
+ "tags": {
2126
+ "type": "array",
2127
+ "items": {
2128
+ "type": "string",
2129
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2130
+ },
2131
+ "uniqueItems": true
2132
+ },
2133
+ "relatedIds": {
2134
+ "type": "array",
2135
+ "items": {
2136
+ "type": "string",
2137
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
2138
+ },
2139
+ "uniqueItems": true
2140
+ },
2141
+ "rawRefs": {
2142
+ "type": "array",
2143
+ "items": {
2144
+ "type": "string",
2145
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
2146
+ },
2147
+ "uniqueItems": true
2148
+ },
2149
+ "externalRef": {
2150
+ "type": "object",
2151
+ "properties": {
2152
+ "system": {
2153
+ "type": "string",
2154
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2155
+ },
2156
+ "resourceType": {
2157
+ "type": "string",
2158
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2159
+ },
2160
+ "resourceId": {
2161
+ "type": "string",
2162
+ "minLength": 1,
2163
+ "maxLength": 200
2164
+ },
2165
+ "version": {
2166
+ "type": "string",
2167
+ "minLength": 1,
2168
+ "maxLength": 200
2169
+ },
2170
+ "facet": {
2171
+ "type": "string",
2172
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2173
+ }
2174
+ },
2175
+ "required": [
2176
+ "system",
2177
+ "resourceType",
2178
+ "resourceId"
2179
+ ],
2180
+ "additionalProperties": false
2181
+ },
2182
+ "lifecycle": {
2183
+ "type": "object",
2184
+ "properties": {
2185
+ "revision": {
2186
+ "type": "integer",
2187
+ "minimum": 1
2188
+ },
2189
+ "state": {
2190
+ "type": "string",
2191
+ "enum": [
2192
+ "deleted"
2193
+ ]
2194
+ }
2195
+ },
2196
+ "required": [
2197
+ "revision"
2198
+ ],
2199
+ "additionalProperties": false
2200
+ },
2201
+ "timeZone": {
2202
+ "type": "string",
2203
+ "minLength": 3,
2204
+ "maxLength": 64
2205
+ },
2206
+ "startAt": {
2207
+ "type": "string",
2208
+ "format": "date-time"
2209
+ },
2210
+ "endAt": {
2211
+ "type": "string",
2212
+ "format": "date-time"
2213
+ },
2214
+ "durationMinutes": {
2215
+ "type": "integer",
2216
+ "minimum": 1
2217
+ }
2218
+ },
2219
+ "required": [
2220
+ "schemaVersion",
2221
+ "id",
2222
+ "occurredAt",
2223
+ "recordedAt",
2224
+ "dayKey",
2225
+ "source",
2226
+ "title",
2227
+ "kind",
2228
+ "startAt",
2229
+ "endAt",
2230
+ "durationMinutes"
2231
+ ],
2232
+ "additionalProperties": false
2233
+ },
2234
+ {
2235
+ "type": "object",
2236
+ "properties": {
2237
+ "schemaVersion": {
2238
+ "type": "string",
2239
+ "const": "murph.event.v1"
2240
+ },
2241
+ "id": {
2242
+ "type": "string",
2243
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
2244
+ },
2245
+ "occurredAt": {
2246
+ "type": "string",
2247
+ "format": "date-time"
2248
+ },
2249
+ "recordedAt": {
2250
+ "type": "string",
2251
+ "format": "date-time"
2252
+ },
2253
+ "dayKey": {
2254
+ "type": "string",
2255
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
2256
+ },
2257
+ "source": {
2258
+ "type": "string",
2259
+ "enum": [
2260
+ "manual",
2261
+ "import",
2262
+ "device",
2263
+ "derived"
2264
+ ]
2265
+ },
2266
+ "title": {
2267
+ "type": "string",
2268
+ "minLength": 1,
2269
+ "maxLength": 160
2270
+ },
2271
+ "kind": {
2272
+ "type": "string",
2273
+ "const": "intervention_session"
2274
+ },
2275
+ "note": {
2276
+ "type": "string",
2277
+ "minLength": 1,
2278
+ "maxLength": 4000
2279
+ },
2280
+ "tags": {
2281
+ "type": "array",
2282
+ "items": {
2283
+ "type": "string",
2284
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2285
+ },
2286
+ "uniqueItems": true
2287
+ },
2288
+ "relatedIds": {
2289
+ "type": "array",
2290
+ "items": {
2291
+ "type": "string",
2292
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
2293
+ },
2294
+ "uniqueItems": true
2295
+ },
2296
+ "rawRefs": {
2297
+ "type": "array",
2298
+ "items": {
2299
+ "type": "string",
2300
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
2301
+ },
2302
+ "uniqueItems": true
2303
+ },
2304
+ "externalRef": {
2305
+ "type": "object",
2306
+ "properties": {
2307
+ "system": {
2308
+ "type": "string",
2309
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2310
+ },
2311
+ "resourceType": {
2312
+ "type": "string",
2313
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2314
+ },
2315
+ "resourceId": {
2316
+ "type": "string",
2317
+ "minLength": 1,
2318
+ "maxLength": 200
2319
+ },
2320
+ "version": {
2321
+ "type": "string",
2322
+ "minLength": 1,
2323
+ "maxLength": 200
2324
+ },
2325
+ "facet": {
2326
+ "type": "string",
2327
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2328
+ }
2329
+ },
2330
+ "required": [
2331
+ "system",
2332
+ "resourceType",
2333
+ "resourceId"
2334
+ ],
2335
+ "additionalProperties": false
2336
+ },
2337
+ "lifecycle": {
2338
+ "type": "object",
2339
+ "properties": {
2340
+ "revision": {
2341
+ "type": "integer",
2342
+ "minimum": 1
2343
+ },
2344
+ "state": {
2345
+ "type": "string",
2346
+ "enum": [
2347
+ "deleted"
2348
+ ]
2349
+ }
2350
+ },
2351
+ "required": [
2352
+ "revision"
2353
+ ],
2354
+ "additionalProperties": false
2355
+ },
2356
+ "timeZone": {
2357
+ "type": "string",
2358
+ "minLength": 3,
2359
+ "maxLength": 64
2360
+ },
2361
+ "interventionType": {
2362
+ "type": "string",
2363
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2364
+ },
2365
+ "durationMinutes": {
2366
+ "type": "integer",
2367
+ "minimum": 1
2368
+ },
2369
+ "protocolId": {
2370
+ "type": "string",
2371
+ "pattern": "^prot_[0-9A-HJKMNP-TV-Z]{26}$"
2372
+ }
2373
+ },
2374
+ "required": [
2375
+ "schemaVersion",
2376
+ "id",
2377
+ "occurredAt",
2378
+ "recordedAt",
2379
+ "dayKey",
2380
+ "source",
2381
+ "title",
2382
+ "kind",
2383
+ "interventionType"
2384
+ ],
2385
+ "additionalProperties": false
2386
+ },
2387
+ {
2388
+ "type": "object",
2389
+ "properties": {
2390
+ "schemaVersion": {
2391
+ "type": "string",
2392
+ "const": "murph.event.v1"
2393
+ },
2394
+ "id": {
2395
+ "type": "string",
2396
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
2397
+ },
2398
+ "occurredAt": {
2399
+ "type": "string",
2400
+ "format": "date-time"
2401
+ },
2402
+ "recordedAt": {
2403
+ "type": "string",
2404
+ "format": "date-time"
2405
+ },
2406
+ "dayKey": {
2407
+ "type": "string",
2408
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
2409
+ },
2410
+ "source": {
2411
+ "type": "string",
2412
+ "enum": [
2413
+ "manual",
2414
+ "import",
2415
+ "device",
2416
+ "derived"
2417
+ ]
2418
+ },
2419
+ "title": {
2420
+ "type": "string",
2421
+ "minLength": 1,
2422
+ "maxLength": 160
2423
+ },
2424
+ "kind": {
2425
+ "type": "string",
2426
+ "const": "adverse_effect"
2427
+ },
2428
+ "note": {
2429
+ "type": "string",
2430
+ "minLength": 1,
2431
+ "maxLength": 4000
2432
+ },
2433
+ "tags": {
2434
+ "type": "array",
2435
+ "items": {
2436
+ "type": "string",
2437
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2438
+ },
2439
+ "uniqueItems": true
2440
+ },
2441
+ "relatedIds": {
2442
+ "type": "array",
2443
+ "items": {
2444
+ "type": "string",
2445
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
2446
+ },
2447
+ "uniqueItems": true
2448
+ },
2449
+ "rawRefs": {
2450
+ "type": "array",
2451
+ "items": {
2452
+ "type": "string",
2453
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
2454
+ },
2455
+ "uniqueItems": true
2456
+ },
2457
+ "externalRef": {
2458
+ "type": "object",
2459
+ "properties": {
2460
+ "system": {
2461
+ "type": "string",
2462
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2463
+ },
2464
+ "resourceType": {
2465
+ "type": "string",
2466
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2467
+ },
2468
+ "resourceId": {
2469
+ "type": "string",
2470
+ "minLength": 1,
2471
+ "maxLength": 200
2472
+ },
2473
+ "version": {
2474
+ "type": "string",
2475
+ "minLength": 1,
2476
+ "maxLength": 200
2477
+ },
2478
+ "facet": {
2479
+ "type": "string",
2480
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2481
+ }
2482
+ },
2483
+ "required": [
2484
+ "system",
2485
+ "resourceType",
2486
+ "resourceId"
2487
+ ],
2488
+ "additionalProperties": false
2489
+ },
2490
+ "lifecycle": {
2491
+ "type": "object",
2492
+ "properties": {
2493
+ "revision": {
2494
+ "type": "integer",
2495
+ "minimum": 1
2496
+ },
2497
+ "state": {
2498
+ "type": "string",
2499
+ "enum": [
2500
+ "deleted"
2501
+ ]
2502
+ }
2503
+ },
2504
+ "required": [
2505
+ "revision"
2506
+ ],
2507
+ "additionalProperties": false
2508
+ },
2509
+ "timeZone": {
2510
+ "type": "string",
2511
+ "minLength": 3,
2512
+ "maxLength": 64
2513
+ },
2514
+ "substance": {
2515
+ "type": "string",
2516
+ "minLength": 1,
2517
+ "maxLength": 160
2518
+ },
2519
+ "effect": {
2520
+ "type": "string",
2521
+ "minLength": 1,
2522
+ "maxLength": 160
2523
+ },
2524
+ "severity": {
2525
+ "type": "string",
2526
+ "enum": [
2527
+ "mild",
2528
+ "moderate",
2529
+ "severe"
2530
+ ]
2531
+ }
2532
+ },
2533
+ "required": [
2534
+ "schemaVersion",
2535
+ "id",
2536
+ "occurredAt",
2537
+ "recordedAt",
2538
+ "dayKey",
2539
+ "source",
2540
+ "title",
2541
+ "kind",
2542
+ "substance",
2543
+ "effect",
2544
+ "severity"
2545
+ ],
2546
+ "additionalProperties": false
2547
+ },
2548
+ {
2549
+ "type": "object",
2550
+ "properties": {
2551
+ "schemaVersion": {
2552
+ "type": "string",
2553
+ "const": "murph.event.v1"
2554
+ },
2555
+ "id": {
2556
+ "type": "string",
2557
+ "pattern": "^evt_[0-9A-HJKMNP-TV-Z]{26}$"
2558
+ },
2559
+ "occurredAt": {
2560
+ "type": "string",
2561
+ "format": "date-time"
2562
+ },
2563
+ "recordedAt": {
2564
+ "type": "string",
2565
+ "format": "date-time"
2566
+ },
2567
+ "dayKey": {
2568
+ "type": "string",
2569
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
2570
+ },
2571
+ "source": {
2572
+ "type": "string",
2573
+ "enum": [
2574
+ "manual",
2575
+ "import",
2576
+ "device",
2577
+ "derived"
2578
+ ]
2579
+ },
2580
+ "title": {
2581
+ "type": "string",
2582
+ "minLength": 1,
2583
+ "maxLength": 160
2584
+ },
2585
+ "kind": {
2586
+ "type": "string",
2587
+ "const": "exposure"
2588
+ },
2589
+ "note": {
2590
+ "type": "string",
2591
+ "minLength": 1,
2592
+ "maxLength": 4000
2593
+ },
2594
+ "tags": {
2595
+ "type": "array",
2596
+ "items": {
2597
+ "type": "string",
2598
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2599
+ },
2600
+ "uniqueItems": true
2601
+ },
2602
+ "relatedIds": {
2603
+ "type": "array",
2604
+ "items": {
2605
+ "type": "string",
2606
+ "pattern": "^(?:alg|asmt|aud|cond|doc|evt|exp|fam|food|goal|meal|pack|psnap|prov|rcp|prot|smp|xfm|var|vault|wfmt)_[0-9A-HJKMNP-TV-Z]{26}$"
2607
+ },
2608
+ "uniqueItems": true
2609
+ },
2610
+ "rawRefs": {
2611
+ "type": "array",
2612
+ "items": {
2613
+ "type": "string",
2614
+ "pattern": "^raw\\/[A-Za-z0-9._/-]+$"
2615
+ },
2616
+ "uniqueItems": true
2617
+ },
2618
+ "externalRef": {
2619
+ "type": "object",
2620
+ "properties": {
2621
+ "system": {
2622
+ "type": "string",
2623
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2624
+ },
2625
+ "resourceType": {
2626
+ "type": "string",
2627
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2628
+ },
2629
+ "resourceId": {
2630
+ "type": "string",
2631
+ "minLength": 1,
2632
+ "maxLength": 200
2633
+ },
2634
+ "version": {
2635
+ "type": "string",
2636
+ "minLength": 1,
2637
+ "maxLength": 200
2638
+ },
2639
+ "facet": {
2640
+ "type": "string",
2641
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
2642
+ }
2643
+ },
2644
+ "required": [
2645
+ "system",
2646
+ "resourceType",
2647
+ "resourceId"
2648
+ ],
2649
+ "additionalProperties": false
2650
+ },
2651
+ "lifecycle": {
2652
+ "type": "object",
2653
+ "properties": {
2654
+ "revision": {
2655
+ "type": "integer",
2656
+ "minimum": 1
2657
+ },
2658
+ "state": {
2659
+ "type": "string",
2660
+ "enum": [
2661
+ "deleted"
2662
+ ]
2663
+ }
2664
+ },
2665
+ "required": [
2666
+ "revision"
2667
+ ],
2668
+ "additionalProperties": false
2669
+ },
2670
+ "timeZone": {
2671
+ "type": "string",
2672
+ "minLength": 3,
2673
+ "maxLength": 64
2674
+ },
2675
+ "exposureType": {
2676
+ "type": "string",
2677
+ "minLength": 1,
2678
+ "maxLength": 160
2679
+ },
2680
+ "substance": {
2681
+ "type": "string",
2682
+ "minLength": 1,
2683
+ "maxLength": 160
2684
+ },
2685
+ "duration": {
2686
+ "type": "string",
2687
+ "minLength": 1,
2688
+ "maxLength": 120
2689
+ }
2690
+ },
2691
+ "required": [
2692
+ "schemaVersion",
2693
+ "id",
2694
+ "occurredAt",
2695
+ "recordedAt",
2696
+ "dayKey",
2697
+ "source",
2698
+ "title",
2699
+ "kind",
2700
+ "exposureType",
2701
+ "substance"
2702
+ ],
2703
+ "additionalProperties": false
2704
+ }
2705
+ ],
2706
+ "$id": "@murphai/contracts/event-record.schema.json",
2707
+ "title": "Murph Event Record"
2708
+ }