mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Create a new RFC document and associated JSON schemas defining an agentic control plane for automated insulin delivery systems, including event envelopes, capabilities models, delivery tracking, and conflict rules. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 06715f81-f852-4156-8ab0-cf9e0aa3564d Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 010cdc4a-2c86-4d2e-9768-bf2769a89953 Replit-Helium-Checkpoint-Created: true
101 lines
3.0 KiB
JSON
101 lines
3.0 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://nightscout.github.io/schemas/delivery-request.schema.json",
|
|
"title": "DeliveryRequest",
|
|
"description": "Intent to deliver insulin - the command sent to the pump",
|
|
"type": "object",
|
|
"required": ["requestId", "requestType", "requestedBy", "requestedAt"],
|
|
"properties": {
|
|
"requestId": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Unique identifier for this delivery request"
|
|
},
|
|
"requestType": {
|
|
"type": "string",
|
|
"enum": ["tempBasal", "scheduledBasal", "bolus", "microBolus", "suspend", "resume", "cancelTemp"],
|
|
"description": "Type of delivery action requested"
|
|
},
|
|
"parameters": {
|
|
"type": "object",
|
|
"description": "Request parameters (varies by requestType)",
|
|
"properties": {
|
|
"rate": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"description": "Rate in U/hr for basal requests"
|
|
},
|
|
"units": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"description": "Units for bolus requests"
|
|
},
|
|
"duration": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"description": "Duration in seconds for temp basal"
|
|
},
|
|
"bolusType": {
|
|
"type": "string",
|
|
"enum": ["normal", "square", "dual", "micro"],
|
|
"description": "Type of bolus if applicable"
|
|
}
|
|
}
|
|
},
|
|
"requestedBy": {
|
|
"type": "object",
|
|
"required": ["issuerType", "issuerId"],
|
|
"properties": {
|
|
"issuerType": {
|
|
"type": "string",
|
|
"enum": ["human", "controller", "agent", "caregiver"]
|
|
},
|
|
"issuerId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"basedOn": {
|
|
"type": "object",
|
|
"description": "What informed this request",
|
|
"properties": {
|
|
"policyCompositionId": {
|
|
"type": "string",
|
|
"description": "PolicyComposition that was in force"
|
|
},
|
|
"algorithmSuggestion": {
|
|
"type": "object",
|
|
"description": "Algorithm output that led to this request",
|
|
"properties": {
|
|
"suggestedAt": { "type": "string", "format": "date-time" },
|
|
"reason": { "type": "string" },
|
|
"predictedBG": {
|
|
"type": "array",
|
|
"items": { "type": "number" }
|
|
},
|
|
"iob": { "type": "number" },
|
|
"cob": { "type": "number" },
|
|
"eventualBG": { "type": "number" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestedAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "When this request was created"
|
|
},
|
|
"expiresAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Request is stale/invalid after this time"
|
|
},
|
|
"priority": {
|
|
"type": "string",
|
|
"enum": ["normal", "high", "urgent"],
|
|
"default": "normal",
|
|
"description": "Request priority for queuing"
|
|
}
|
|
}
|
|
}
|