forked from nightscout/cgm-remote-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreconciliation.schema.json
More file actions
117 lines (117 loc) · 3.41 KB
/
reconciliation.schema.json
File metadata and controls
117 lines (117 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://nightscout.github.io/schemas/reconciliation.schema.json",
"title": "Reconciliation",
"description": "Matching of DeliveryRequest to DeliveryObservation - intent vs reality",
"type": "object",
"required": ["reconciliationId", "outcome", "reconciledAt"],
"properties": {
"reconciliationId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for this reconciliation"
},
"requestId": {
"type": ["string", "null"],
"format": "uuid",
"description": "The DeliveryRequest being reconciled (null for spontaneous observations)"
},
"observationId": {
"type": ["string", "null"],
"format": "uuid",
"description": "The DeliveryObservation (null for unobserved requests)"
},
"outcome": {
"type": "string",
"enum": ["matched", "partial", "blocked", "failed", "expired", "unknown", "spontaneous"],
"description": "Result of reconciliation"
},
"discrepancy": {
"type": "object",
"description": "Details of any mismatch between request and observation",
"properties": {
"requestedUnits": {
"type": "number",
"description": "What was requested"
},
"deliveredUnits": {
"type": "number",
"description": "What was actually delivered"
},
"delta": {
"type": "number",
"description": "Difference (delivered - requested)"
},
"requestedRate": {
"type": "number",
"description": "Requested rate for temp basal"
},
"deliveredRate": {
"type": "number",
"description": "Actual rate delivered"
},
"requestedDuration": {
"type": "integer",
"description": "Requested duration in seconds"
},
"actualDuration": {
"type": "integer",
"description": "Actual duration in seconds"
},
"reason": {
"type": "string",
"enum": [
"capped_by_max_basal",
"capped_by_max_iob",
"capped_by_max_bolus",
"comm_failure",
"pump_error",
"user_canceled",
"pump_busy",
"reservoir_low",
"battery_low",
"occlusion",
"expired",
"unknown"
],
"description": "Reason for discrepancy"
},
"reasonDetails": {
"type": "string",
"description": "Additional details about the discrepancy"
}
}
},
"reconciledAt": {
"type": "string",
"format": "date-time",
"description": "When this reconciliation was performed"
},
"reconciledBy": {
"type": "object",
"properties": {
"issuerType": {
"type": "string",
"enum": ["controller", "agent", "system"]
},
"issuerId": {
"type": "string"
}
}
},
"latency": {
"type": "object",
"description": "Timing metrics",
"properties": {
"requestToObservationMs": {
"type": "integer",
"description": "Time from request to observation in milliseconds"
},
"requestToReconciliationMs": {
"type": "integer",
"description": "Time from request to reconciliation in milliseconds"
}
}
}
}
}