mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
test(medications): pin the per-medication dose write and history before they move
One walk through POST and GET /api/medications/{id}/intake: band, standalone, named-slot, pinned and backfilled doses, skips onto slots and onto a standalone dose, the dedup window, both idempotency forms and their replays, the delegated refusal on both write paths, the injection-site and pin refusals, a one-shot dose, the schema refusals, and the history list in its filters. The parity step can now rewrite an id carried inside a longer string, and a refusal's unawaited audit row is waited for on the real timer so the pinned clock does not move.
This commit is contained in:
1 parent
967fa2c56b
commit
af53d3d6f0
37 files changed
+26361
-2
No files matched your search
+488
@@ -0,0 +1,488 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-15T08:30:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"source": "REMINDER",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"auto_opened": 1,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T08:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "29",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+530
@@ -0,0 +1,530 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:3>",
|
||||
"units": 0,
|
||||
"item_ids": [],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:2>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:2>",
|
||||
"actorId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T08:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "29",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+481
@@ -0,0 +1,481 @@
|
||||
{
|
||||
"status": 200,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 200,
|
||||
"action": null,
|
||||
"meta": null,
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T08:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "29",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+547
@@ -0,0 +1,547 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"skipped": true
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:3>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:3>",
|
||||
"actorId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "skipped"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T08:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "29",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+557
@@ -0,0 +1,557 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"source": "REMINDER",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"skipped": true
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "skipped"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "30",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+517
@@ -0,0 +1,517 @@
|
||||
{
|
||||
"status": 403,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Changing a dose that is already recorded is not part of shared access",
|
||||
"meta": {
|
||||
"errorCode": "sharing.not_permitted",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 403,
|
||||
"action": {
|
||||
"name": "medications.intake.update.refused"
|
||||
},
|
||||
"meta": {
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "30",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:19>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+574
@@ -0,0 +1,574 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"skipped": true
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:3>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:3>",
|
||||
"actorId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "skipped"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "30",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:19>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,616 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "29",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:20>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+565
@@ -0,0 +1,565 @@
|
||||
{
|
||||
"status": 422,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "forceSlotInstant is not a scheduled slot of this medication",
|
||||
"meta": {
|
||||
"errorCode": "medications.intake.force_slot.invalid",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 422,
|
||||
"action": {
|
||||
"name": "medication.intake.force_slot.invalid"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:1>"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:15>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "29",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:20>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+565
@@ -0,0 +1,565 @@
|
||||
{
|
||||
"status": 422,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "forceSlotInstant already carries a recorded dose action",
|
||||
"meta": {
|
||||
"errorCode": "medications.intake.force_slot.occupied",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 422,
|
||||
"action": {
|
||||
"name": "medication.intake.force_slot.occupied"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:1>"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:15>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "29",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:20>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+632
@@ -0,0 +1,632 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"source": "REMINDER",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "28",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:20>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+669
@@ -0,0 +1,669 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "27",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:21>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+635
@@ -0,0 +1,635 @@
|
||||
{
|
||||
"status": 200,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 200,
|
||||
"action": null,
|
||||
"meta": null,
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "27",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:21>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": []
|
||||
}
|
||||
}
|
||||
+715
@@ -0,0 +1,715 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "26",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:22>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"key": "<id:23>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+669
@@ -0,0 +1,669 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "idempotency.replay"
|
||||
},
|
||||
"meta": {
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "26",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:22>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"key": "<id:23>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,752 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"source": "API",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "25",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:23>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"key": "<id:24>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+711
@@ -0,0 +1,711 @@
|
||||
{
|
||||
"status": 403,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Changing a dose that is already recorded is not part of shared access",
|
||||
"meta": {
|
||||
"errorCode": "sharing.not_permitted",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 403,
|
||||
"action": {
|
||||
"name": "medications.intake.update.refused"
|
||||
},
|
||||
"meta": {
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": "2026-10-14T20:05:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "25",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:23>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:23>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:24>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+768
@@ -0,0 +1,768 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"skipped": true
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:3>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:3>",
|
||||
"actorId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "skipped"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "25",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:13>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:23>",
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:23>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"key": "<id:24>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+810
@@ -0,0 +1,810 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 1,
|
||||
"item_ids": [
|
||||
"<id:3>"
|
||||
],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:4>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:4>",
|
||||
"actorId": "<id:5>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:4>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"userId": "<id:4>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:9>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:3>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:4>",
|
||||
"medicationId": "<id:2>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:5>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:5>",
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:4>",
|
||||
"actorUserId": "<id:5>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:4>",
|
||||
"key": "<id:25>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,760 @@
|
||||
{
|
||||
"status": 403,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Account access denied",
|
||||
"meta": {
|
||||
"errorCode": "sharing.access.denied",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 403,
|
||||
"action": null,
|
||||
"meta": {
|
||||
"sharing_refusal": "insufficient_access"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": {
|
||||
"type": "SharingAccessDeniedError",
|
||||
"message": "Account access denied"
|
||||
}
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:25>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+758
@@ -0,0 +1,758 @@
|
||||
{
|
||||
"status": 401,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Not authenticated",
|
||||
"meta": {
|
||||
"errorCode": "auth.missing",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 401,
|
||||
"action": null,
|
||||
"meta": null,
|
||||
"warnings": null,
|
||||
"error": {
|
||||
"type": "HttpError",
|
||||
"message": "Not authenticated"
|
||||
}
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:25>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+760
@@ -0,0 +1,760 @@
|
||||
{
|
||||
"status": 422,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Injection site is not allowed for this medication",
|
||||
"meta": {
|
||||
"errorCode": "medications.intake.injection_site.disallowed",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 422,
|
||||
"action": {
|
||||
"name": "medication.intake.injection_site.disallowed"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:1>",
|
||||
"site": "ABDOMEN_RIGHT"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:24>",
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"key": "<id:25>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+840
@@ -0,0 +1,840 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.intake",
|
||||
"entity_type": "intake_event",
|
||||
"entity_id": "<id:1>"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 0,
|
||||
"item_ids": [],
|
||||
"auto_opened": 0,
|
||||
"skipped": false
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:3>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:3>",
|
||||
"actorId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:25>",
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:13>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:25>",
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:25>",
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"key": "<id:26>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+881
@@ -0,0 +1,881 @@
|
||||
{
|
||||
"status": 201,
|
||||
"body": {
|
||||
"data": {
|
||||
"id": "<id:1>",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"idempotencyKey": null,
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"source": "WEB",
|
||||
"createdAt": "<createdAt>"
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 201,
|
||||
"action": {
|
||||
"name": "medication.oneShot.reconciled"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:2>",
|
||||
"units": 0,
|
||||
"item_ids": [],
|
||||
"auto_opened": 0,
|
||||
"skipped": false,
|
||||
"action": "deactivate"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [
|
||||
{
|
||||
"effect": "queueMedicationIntakeSync",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"originDeviceToken": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "countOutstandingDosesToday",
|
||||
"args": [
|
||||
"<id:3>",
|
||||
"UTC"
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "notifyDelegatedIntake",
|
||||
"args": [
|
||||
{
|
||||
"ownerId": "<id:3>",
|
||||
"actorId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"status": "taken"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"effect": "dispatchMedicationIntakeWebClear",
|
||||
"args": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"badgeCount": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:7>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:2>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:14>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:13>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,852 @@
|
||||
{
|
||||
"status": 422,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Validation failed",
|
||||
"details": {
|
||||
"issues": [
|
||||
{
|
||||
"path": "takenAt",
|
||||
"code": "invalid_format",
|
||||
"message": "Invalid ISO datetime"
|
||||
},
|
||||
{
|
||||
"path": "idempotencyKey",
|
||||
"code": "custom",
|
||||
"message": "idempotency key must be stable across app restarts; received an object description (<Class: 0x…>), which embeds a memory address and is a new value on every launch — serialise the identity itself, not the object's description"
|
||||
}
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"errorCode": "http.invalid",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 422,
|
||||
"action": {
|
||||
"name": "medications.intake.create.validation-failed"
|
||||
},
|
||||
"meta": {
|
||||
"issue_count": 2,
|
||||
"medication_id": "<id:1>",
|
||||
"external_id_rejected": 1,
|
||||
"external_id_shapes": "object_description",
|
||||
"external_id_surface": "medication.intake.create",
|
||||
"rejected_attempt": "medications.intake.create.validation-failed"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+829
@@ -0,0 +1,829 @@
|
||||
{
|
||||
"status": 404,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Medication not found",
|
||||
"meta": {
|
||||
"errorCode": "http.not_found",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 404,
|
||||
"action": null,
|
||||
"meta": null,
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+829
@@ -0,0 +1,829 @@
|
||||
{
|
||||
"status": 422,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "This medication is kept as a record; its intake is not tracked",
|
||||
"meta": {
|
||||
"errorCode": "medication.intake.notTracked",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 422,
|
||||
"action": null,
|
||||
"meta": null,
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+1079
File diff suppressed because it is too large.
Load diff
+917
@@ -0,0 +1,917 @@
|
||||
{
|
||||
"status": 200,
|
||||
"body": {
|
||||
"data": {
|
||||
"events": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"total": 10,
|
||||
"limit": 3,
|
||||
"offset": 1
|
||||
}
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 200,
|
||||
"action": {
|
||||
"name": "medication.intake.list"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:3>",
|
||||
"total": 10,
|
||||
"status": "completed"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:10>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"medicationId": "<id:9>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:10>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:9>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:6>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:5>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:10>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:9>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:9>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+923
@@ -0,0 +1,923 @@
|
||||
{
|
||||
"status": 200,
|
||||
"body": {
|
||||
"data": {
|
||||
"events": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"total": 4,
|
||||
"limit": 25,
|
||||
"offset": 0
|
||||
}
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 200,
|
||||
"action": {
|
||||
"name": "medication.intake.list"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:3>",
|
||||
"total": 4,
|
||||
"status": "skipped"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:8>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"medicationId": "<id:10>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"medicationId": "<id:9>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:17>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:10>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:9>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:7>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:16>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:4>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:10>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:9>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:4>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:5>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:9>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:7>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,995 @@
|
||||
{
|
||||
"status": 200,
|
||||
"body": {
|
||||
"data": {
|
||||
"events": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"total": 6,
|
||||
"limit": 25,
|
||||
"offset": 0
|
||||
}
|
||||
},
|
||||
"error": null
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 200,
|
||||
"action": {
|
||||
"name": "medication.intake.list"
|
||||
},
|
||||
"meta": {
|
||||
"medication_id": "<id:3>",
|
||||
"total": 6,
|
||||
"status": "taken"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"medicationId": "<id:11>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"medicationId": "<id:13>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"medicationId": "<id:12>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:4>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:13>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:12>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:10>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:3>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:1>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:10>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:9>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:7>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:8>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:6>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:5>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:13>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:12>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:10>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:12>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:10>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:3>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,849 @@
|
||||
{
|
||||
"status": 422,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Validation failed",
|
||||
"details": {
|
||||
"issues": [
|
||||
{
|
||||
"path": "limit",
|
||||
"code": "invalid_type",
|
||||
"message": "Invalid input: expected number, received NaN"
|
||||
},
|
||||
{
|
||||
"path": "status",
|
||||
"code": "invalid_value",
|
||||
"message": "Invalid option: expected one of \"all\"|\"taken\"|\"skipped\"|\"completed\""
|
||||
}
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"errorCode": "http.invalid",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 422,
|
||||
"action": {
|
||||
"name": "medications.intake.list.validation-failed"
|
||||
},
|
||||
"meta": {
|
||||
"issue_count": 2,
|
||||
"medication_id": "<id:1>",
|
||||
"rejected_attempt": "medications.intake.list.validation-failed"
|
||||
},
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:2>",
|
||||
"userId": "<id:3>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:3>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:1>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:2>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:3>",
|
||||
"medicationId": "<id:1>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:2>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:3>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:3>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+829
@@ -0,0 +1,829 @@
|
||||
{
|
||||
"status": 404,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Medication not found",
|
||||
"meta": {
|
||||
"errorCode": "http.not_found",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 404,
|
||||
"action": null,
|
||||
"meta": null,
|
||||
"warnings": null,
|
||||
"error": null
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+1079
File diff suppressed because it is too large.
Load diff
+832
@@ -0,0 +1,832 @@
|
||||
{
|
||||
"status": 401,
|
||||
"body": {
|
||||
"data": null,
|
||||
"error": "Not authenticated",
|
||||
"meta": {
|
||||
"errorCode": "auth.missing",
|
||||
"requestId": "<requestId>"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"status": 401,
|
||||
"action": null,
|
||||
"meta": null,
|
||||
"warnings": null,
|
||||
"error": {
|
||||
"type": "HttpError",
|
||||
"message": "Not authenticated"
|
||||
}
|
||||
}
|
||||
],
|
||||
"effects": [],
|
||||
"stored": {
|
||||
"medications": [
|
||||
{
|
||||
"id": "<id:1>",
|
||||
"userId": "<id:2>",
|
||||
"name": "As needed",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": true,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:3>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Record only",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": null,
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": false,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:4>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Single shot",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": false,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-15T00:00:00.000Z",
|
||||
"endsOn": "2026-10-15T00:00:00.000Z",
|
||||
"oneShot": true,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:5>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Twice daily",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "ORAL",
|
||||
"trackInjectionSites": false,
|
||||
"allowedInjectionSites": [],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
},
|
||||
{
|
||||
"id": "<id:6>",
|
||||
"userId": "<id:2>",
|
||||
"name": "Weekly pen",
|
||||
"dose": "10mg",
|
||||
"treatmentClass": "GENERIC",
|
||||
"dosesPerUnit": null,
|
||||
"unitsPerDose": "1",
|
||||
"active": true,
|
||||
"notificationsEnabled": true,
|
||||
"pausedAt": null,
|
||||
"snoozedUntil": null,
|
||||
"startsOn": "2026-10-01T00:00:00.000Z",
|
||||
"endsOn": null,
|
||||
"oneShot": false,
|
||||
"asNeeded": false,
|
||||
"trackIntake": true,
|
||||
"autoMarkTaken": false,
|
||||
"autoMarkTakenSince": null,
|
||||
"deliveryForm": "INJECTION",
|
||||
"trackInjectionSites": true,
|
||||
"allowedInjectionSites": [
|
||||
"ABDOMEN_LEFT",
|
||||
"ABDOMEN_RIGHT"
|
||||
],
|
||||
"liveActivityEnabled": false,
|
||||
"criticalAlarmEnabled": false,
|
||||
"atcCode": null,
|
||||
"rxNormCode": null,
|
||||
"lowStockNotifiedAt": null,
|
||||
"lowStockNotifiedThresholdDays": null,
|
||||
"reorderLeadDays": null,
|
||||
"externalSource": null,
|
||||
"externalId": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"schedules": [
|
||||
{
|
||||
"id": "<id:7>",
|
||||
"medicationId": "<id:3>",
|
||||
"windowStart": "07:00",
|
||||
"windowEnd": "08:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"07:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:8>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "08:00",
|
||||
"windowEnd": "10:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"08:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:9>",
|
||||
"medicationId": "<id:6>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:10>",
|
||||
"medicationId": "<id:4>",
|
||||
"windowStart": "09:00",
|
||||
"windowEnd": "11:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"09:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": null,
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
},
|
||||
{
|
||||
"id": "<id:11>",
|
||||
"medicationId": "<id:5>",
|
||||
"windowStart": "20:00",
|
||||
"windowEnd": "22:00",
|
||||
"label": null,
|
||||
"dose": null,
|
||||
"unitsPerDose": null,
|
||||
"daysOfWeek": null,
|
||||
"timesOfDay": [
|
||||
"20:00"
|
||||
],
|
||||
"reminderGraceMinutes": null,
|
||||
"rrule": "FREQ=DAILY",
|
||||
"rollingIntervalDays": null,
|
||||
"scheduleType": "SCHEDULED",
|
||||
"cyclicOnWeeks": null,
|
||||
"cyclicOffWeeks": null,
|
||||
"doseWindows": null
|
||||
}
|
||||
],
|
||||
"revisions": [],
|
||||
"pauseEras": [],
|
||||
"courses": [],
|
||||
"intakes": [
|
||||
{
|
||||
"id": "<id:12>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T08:00:00.000Z",
|
||||
"takenAt": "2026-10-11T08:20:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:14>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-11T20:00:00.000Z",
|
||||
"takenAt": "2026-10-11T20:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "API",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:15>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T08:00:00.000Z",
|
||||
"takenAt": "2026-10-12T08:15:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:16>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-12T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:17>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T08:00:00.000Z",
|
||||
"takenAt": "2026-10-15T11:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:18>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-13T20:00:00.000Z",
|
||||
"takenAt": "2026-10-13T20:30:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": "dose-key-0001",
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:19>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T08:00:00.000Z",
|
||||
"takenAt": "2026-10-14T11:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "USER_PIN",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [
|
||||
{
|
||||
"units": 1,
|
||||
"itemId": "<id:13>"
|
||||
}
|
||||
],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:20>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-14T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:21>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T08:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "REMINDER",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:22>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:6>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T09:10:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": "ABDOMEN_LEFT",
|
||||
"doseTaken": "0.5 pen",
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:23>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:4>",
|
||||
"scheduledFor": "2026-10-15T09:00:00.000Z",
|
||||
"takenAt": "2026-10-15T10:00:00.000Z",
|
||||
"skipped": false,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": [],
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:24>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:1>",
|
||||
"scheduledFor": "2026-10-15T11:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
},
|
||||
{
|
||||
"id": "<id:25>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"scheduledFor": "2026-10-15T20:00:00.000Z",
|
||||
"takenAt": null,
|
||||
"skipped": true,
|
||||
"autoMissed": false,
|
||||
"autoRecorded": false,
|
||||
"attributionSource": "AUTO",
|
||||
"source": "WEB",
|
||||
"idempotencyKey": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"injectionSite": null,
|
||||
"doseTaken": null,
|
||||
"inventoryConsumption": null,
|
||||
"externalId": null,
|
||||
"updatedAt": "<updatedAt>",
|
||||
"syncVersion": "<syncVersion>",
|
||||
"deletedAt": null
|
||||
}
|
||||
],
|
||||
"doseChanges": [],
|
||||
"inventoryItems": [
|
||||
{
|
||||
"id": "<id:13>",
|
||||
"userId": "<id:2>",
|
||||
"medicationId": "<id:5>",
|
||||
"state": "IN_USE",
|
||||
"containerType": "OTHER",
|
||||
"unitsTotal": "30",
|
||||
"unitsRemaining": "24",
|
||||
"firstUseAt": "2026-10-15T08:30:00.000Z",
|
||||
"expiresAt": null,
|
||||
"printedExpiry": null,
|
||||
"purchasedAt": "2026-10-01T06:00:00.000Z",
|
||||
"manufacturer": null,
|
||||
"doseStrength": null,
|
||||
"notes": null,
|
||||
"notesEncrypted": null,
|
||||
"createdAt": "<createdAt>",
|
||||
"updatedAt": "<updatedAt>"
|
||||
}
|
||||
],
|
||||
"inventoryEvents": [],
|
||||
"categories": [],
|
||||
"ingredients": [],
|
||||
"audit": [
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:12>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:19>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:17>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:18>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:15>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:14>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:6>",
|
||||
"eventId": "<id:22>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"eventId": "<id:23>",
|
||||
"skipped": false
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:25>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:21>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"eventId": "<id:24>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.intake",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"eventId": "<id:20>",
|
||||
"skipped": true
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medication.oneShot.reconciled",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": null,
|
||||
"details": {
|
||||
"medicationId": "<id:4>",
|
||||
"action": "deactivate"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:1>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
},
|
||||
{
|
||||
"action": "medications.intake.update.refused",
|
||||
"userId": "<id:2>",
|
||||
"actorUserId": "<id:26>",
|
||||
"details": {
|
||||
"medicationId": "<id:5>",
|
||||
"reason": "resolved_event"
|
||||
},
|
||||
"ipAddress": null
|
||||
}
|
||||
],
|
||||
"idempotency": [
|
||||
{
|
||||
"userId": "<id:2>",
|
||||
"key": "<id:27>",
|
||||
"method": "POST",
|
||||
"path": "/api/medications/<daily>/intake",
|
||||
"responseStatus": 201,
|
||||
"expiresAt": "2026-10-16T12:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,541 @@
|
||||
/**
|
||||
* Parity for `POST` and `GET /api/medications/{id}/intake` while the dose
|
||||
* write and the history list move into `src/lib/medications/`.
|
||||
*
|
||||
* One record walks through the cases the route tells apart, in order, each
|
||||
* request seeing what the earlier ones stored. The writes: a take inside a
|
||||
* band that converges onto the pending reminder row, an as-needed take
|
||||
* recorded standalone and its repeat inside the dedup window, a skip on a
|
||||
* named slot, a slot-less skip, a skip onto the standalone dose by a
|
||||
* delegate (refused) and by the owner, a pinned take and the two pin refusals, a
|
||||
* backfill onto a named earlier slot, a body idempotency key and its replay,
|
||||
* an Idempotency-Key header and its replay, a native take, the owner's skip
|
||||
* over a recorded dose and a delegate's refused one, a delegate's take on an
|
||||
* open slot, a reading delegate and nobody, the injection-site refusal and a
|
||||
* site with a dose override, a one-shot dose, a body the schema refuses, and
|
||||
* the not-found and record-only answers. The reads: the default list, a
|
||||
* completed page sorted by take time, the skips, a query the schema refuses,
|
||||
* the not-found answer, a reading delegate and nobody.
|
||||
*
|
||||
* After each request the snapshot holds the response, the wide event, the
|
||||
* recorded tails and every medication row of the accounts. The clock is
|
||||
* pinned (`Date` only), so the snapshot is the same on every day it runs.
|
||||
*/
|
||||
import { afterAll, beforeAll, describe, it, vi } from "vitest";
|
||||
|
||||
import { GET, POST } from "@/app/api/medications/[id]/intake/route";
|
||||
|
||||
import { anonymous, type RouteAuth } from "../../../kit/call-route";
|
||||
import {
|
||||
makeMedication,
|
||||
makeSession,
|
||||
makeToken,
|
||||
makeUser,
|
||||
} from "../../../kit/factories";
|
||||
import { getPrismaClient, truncateAllTables } from "../../setup";
|
||||
import { delegateOf, parityStep } from "./medication-state";
|
||||
|
||||
vi.mock("@/lib/logging/transports", async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<typeof import("@/lib/logging/transports")>();
|
||||
const { wideEventRecorder: recorder } = await import("../../../kit/parity");
|
||||
return {
|
||||
...actual,
|
||||
emitIfSampled: (event: (typeof recorder.events)[number]) => {
|
||||
recorder.events.push(event);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
// The tails the route starts without awaiting them (the cross-device push,
|
||||
// the web-push dose clear with its badge count, the owner's notification of a
|
||||
// delegated dose), recorded instead of run (see `effectRecorder`).
|
||||
vi.mock(
|
||||
"@/lib/notifications/medication-intake-sync",
|
||||
async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<
|
||||
typeof import("@/lib/notifications/medication-intake-sync")
|
||||
>();
|
||||
const { effectRecorder } = await import("../../../kit/parity");
|
||||
return {
|
||||
...actual,
|
||||
queueMedicationIntakeSync: (...args: unknown[]) => {
|
||||
effectRecorder.record("queueMedicationIntakeSync", args);
|
||||
},
|
||||
};
|
||||
},
|
||||
);
|
||||
vi.mock("@/lib/notifications/web-push-clear", async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<typeof import("@/lib/notifications/web-push-clear")>();
|
||||
const { effectRecorder } = await import("../../../kit/parity");
|
||||
return {
|
||||
...actual,
|
||||
dispatchMedicationIntakeWebClear: async (...args: unknown[]) => {
|
||||
effectRecorder.record("dispatchMedicationIntakeWebClear", args);
|
||||
},
|
||||
};
|
||||
});
|
||||
vi.mock("@/lib/medications/outstanding-doses", async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<
|
||||
typeof import("@/lib/medications/outstanding-doses")
|
||||
>();
|
||||
const { effectRecorder } = await import("../../../kit/parity");
|
||||
return {
|
||||
...actual,
|
||||
countOutstandingDosesToday: async (...args: unknown[]) => {
|
||||
effectRecorder.record("countOutstandingDosesToday", args);
|
||||
return 2;
|
||||
},
|
||||
};
|
||||
});
|
||||
vi.mock("@/lib/notifications/delegated-intake", async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<
|
||||
typeof import("@/lib/notifications/delegated-intake")
|
||||
>();
|
||||
const { effectRecorder } = await import("../../../kit/parity");
|
||||
return {
|
||||
...actual,
|
||||
notifyDelegatedIntake: async (...args: unknown[]) => {
|
||||
effectRecorder.record("notifyDelegatedIntake", args);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
const prisma = getPrismaClient();
|
||||
const NOW = new Date("2026-10-15T12:00:00.000Z");
|
||||
const ROUTE = "/api/medications/{id}/intake";
|
||||
/**
|
||||
* A dose that converges onto a slot answers with the row the shared slot
|
||||
* write returns, which carries fewer fields than the registered event
|
||||
* resource. The parity snapshot pins that answer as it is; the contract check
|
||||
* is the route's own tests' business.
|
||||
*/
|
||||
const DOSE_ANSWER = {
|
||||
skip: "a slot write answers with the narrower slot-write row",
|
||||
};
|
||||
const REFUSED = "medications.intake.update.refused";
|
||||
|
||||
let ownerId: string;
|
||||
let userIds: string[];
|
||||
let owner: RouteAuth;
|
||||
let ownerBearer: RouteAuth;
|
||||
let writer: { auth: RouteAuth; headers: Record<string, string> };
|
||||
let reader: { auth: RouteAuth; headers: Record<string, string> };
|
||||
const med: Record<string, string> = {};
|
||||
|
||||
type Caller = { auth?: RouteAuth; headers?: Record<string, string> };
|
||||
|
||||
/** The refusal's audit row is written without awaiting it. */
|
||||
async function refusalRows(count: number): Promise<void> {
|
||||
// Polled on the real timer: `vi.waitFor` would advance the pinned clock by
|
||||
// its interval on every poll, and the clock stamps the rows read back.
|
||||
for (let attempt = 0; attempt < 250; attempt += 1) {
|
||||
const rows = await prisma.auditLog.count({ where: { action: REFUSED } });
|
||||
if (rows >= count) return;
|
||||
await new Promise((resolve) => setTimeout(resolve, 20));
|
||||
}
|
||||
throw new Error(`fewer than ${count} refusal rows landed`);
|
||||
}
|
||||
|
||||
async function post(
|
||||
name: string,
|
||||
body: unknown,
|
||||
options: Caller & {
|
||||
medicationId?: string;
|
||||
settle?: () => Promise<void>;
|
||||
} = {},
|
||||
) {
|
||||
await parityStep({
|
||||
name: `medication-intake.${name}`,
|
||||
handler: POST,
|
||||
options: {
|
||||
method: "POST",
|
||||
route: ROUTE,
|
||||
params: { id: options.medicationId ?? med.daily },
|
||||
body,
|
||||
auth: options.auth ?? owner,
|
||||
headers: options.headers,
|
||||
contract: DOSE_ANSWER,
|
||||
},
|
||||
userIds,
|
||||
now: NOW,
|
||||
settle: options.settle,
|
||||
rewrite: withoutIdsInPaths,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The idempotency cache keys its rows on the request path, which carries the
|
||||
* medication's generated id, and the replay's wide event names that path. A
|
||||
* path reads with the fixture's name instead. The row's fingerprint, a hash
|
||||
* over the path and so over the generated id, is dropped, because no
|
||||
* placeholder can make it the same on two runs.
|
||||
*/
|
||||
function withoutIdsInPaths(value: unknown): unknown {
|
||||
if (typeof value === "string") {
|
||||
let out = value;
|
||||
for (const [label, id] of Object.entries(med)) {
|
||||
if (out !== id) out = out.replace(id, `<${label}>`);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
if (Array.isArray(value)) return value.map(withoutIdsInPaths);
|
||||
if (value && typeof value === "object" && !(value instanceof Date)) {
|
||||
const out: Record<string, unknown> = {};
|
||||
for (const [k, v] of Object.entries(value)) {
|
||||
if (k === "requestFingerprint") continue;
|
||||
out[k] = withoutIdsInPaths(v);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
async function list(
|
||||
name: string,
|
||||
query: Record<string, string> = {},
|
||||
options: Caller & { medicationId?: string } = {},
|
||||
) {
|
||||
await parityStep({
|
||||
name: `medication-intake.${name}`,
|
||||
handler: GET,
|
||||
options: {
|
||||
method: "GET",
|
||||
route: ROUTE,
|
||||
params: { id: options.medicationId ?? med.daily },
|
||||
query,
|
||||
auth: options.auth ?? owner,
|
||||
headers: options.headers,
|
||||
},
|
||||
userIds,
|
||||
now: NOW,
|
||||
rewrite: withoutIdsInPaths,
|
||||
});
|
||||
}
|
||||
|
||||
async function intake(
|
||||
medicationId: string,
|
||||
data: {
|
||||
scheduledFor: string;
|
||||
takenAt?: string;
|
||||
skipped?: boolean;
|
||||
source?: "REMINDER" | "WEB";
|
||||
},
|
||||
) {
|
||||
await prisma.medicationIntakeEvent.create({
|
||||
data: {
|
||||
userId: ownerId,
|
||||
medicationId,
|
||||
scheduledFor: new Date(data.scheduledFor),
|
||||
takenAt: data.takenAt ? new Date(data.takenAt) : null,
|
||||
skipped: data.skipped ?? false,
|
||||
source: data.source ?? "WEB",
|
||||
createdAt: new Date("2026-10-01T06:00:00.000Z"),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const daily = (time: string, windowEnd: string) => ({
|
||||
windowStart: time,
|
||||
windowEnd,
|
||||
timesOfDay: [time],
|
||||
rrule: "FREQ=DAILY",
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
vi.useFakeTimers({ toFake: ["Date"], now: NOW });
|
||||
await truncateAllTables(prisma);
|
||||
const user = await makeUser({ timezone: "UTC" });
|
||||
ownerId = user.id;
|
||||
owner = await makeSession(user);
|
||||
ownerBearer = await makeToken(user, { name: "kit-phone" });
|
||||
const created = new Date("2026-10-01T06:00:00.000Z");
|
||||
|
||||
const dailyMed = await makeMedication(
|
||||
user,
|
||||
{
|
||||
name: "Twice daily",
|
||||
startsOn: new Date("2026-10-01"),
|
||||
createdAt: created,
|
||||
unitsPerDose: 1,
|
||||
snoozedUntil: new Date("2026-10-15T12:30:00.000Z"),
|
||||
},
|
||||
[daily("08:00", "10:00"), daily("20:00", "22:00")],
|
||||
);
|
||||
med.daily = dailyMed.id;
|
||||
await prisma.medicationInventoryItem.create({
|
||||
data: {
|
||||
userId: ownerId,
|
||||
medicationId: dailyMed.id,
|
||||
unitsTotal: 30,
|
||||
unitsRemaining: 30,
|
||||
purchasedAt: created,
|
||||
},
|
||||
});
|
||||
await intake(dailyMed.id, {
|
||||
scheduledFor: "2026-10-15T08:00:00.000Z",
|
||||
source: "REMINDER",
|
||||
});
|
||||
await intake(dailyMed.id, {
|
||||
scheduledFor: "2026-10-14T20:00:00.000Z",
|
||||
takenAt: "2026-10-14T20:05:00.000Z",
|
||||
});
|
||||
await intake(dailyMed.id, {
|
||||
scheduledFor: "2026-10-13T08:00:00.000Z",
|
||||
source: "REMINDER",
|
||||
});
|
||||
await intake(dailyMed.id, {
|
||||
scheduledFor: "2026-10-12T20:00:00.000Z",
|
||||
skipped: true,
|
||||
});
|
||||
|
||||
const pen = await makeMedication(
|
||||
user,
|
||||
{
|
||||
name: "Weekly pen",
|
||||
startsOn: new Date("2026-10-01"),
|
||||
createdAt: created,
|
||||
deliveryForm: "INJECTION",
|
||||
trackInjectionSites: true,
|
||||
allowedInjectionSites: ["ABDOMEN_LEFT", "ABDOMEN_RIGHT"],
|
||||
},
|
||||
[daily("09:00", "11:00")],
|
||||
);
|
||||
med.pen = pen.id;
|
||||
await prisma.user.update({
|
||||
where: { id: ownerId },
|
||||
data: { globalExcludedInjectionSites: ["ABDOMEN_RIGHT"] },
|
||||
});
|
||||
|
||||
const oneShot = await makeMedication(
|
||||
user,
|
||||
{
|
||||
name: "Single shot",
|
||||
startsOn: new Date("2026-10-15"),
|
||||
endsOn: new Date("2026-10-15"),
|
||||
oneShot: true,
|
||||
createdAt: created,
|
||||
},
|
||||
[{ windowStart: "09:00", windowEnd: "11:00", timesOfDay: ["09:00"] }],
|
||||
);
|
||||
med.oneShot = oneShot.id;
|
||||
|
||||
med.asNeeded = (
|
||||
await makeMedication(
|
||||
user,
|
||||
{ name: "As needed", createdAt: created, asNeeded: true },
|
||||
[],
|
||||
)
|
||||
).id;
|
||||
|
||||
const recordOnly = await makeMedication(
|
||||
user,
|
||||
{ name: "Record only", createdAt: created, trackIntake: false },
|
||||
[daily("07:00", "08:00")],
|
||||
);
|
||||
med.recordOnly = recordOnly.id;
|
||||
|
||||
const stranger = await makeUser({ timezone: "UTC" });
|
||||
med.foreign = (await makeMedication(stranger, { name: "Not yours" })).id;
|
||||
|
||||
const w = await delegateOf(prisma, user, "WRITE");
|
||||
const r = await delegateOf(prisma, user, "READ");
|
||||
writer = { auth: w.auth, headers: w.headers };
|
||||
reader = { auth: r.auth, headers: r.headers };
|
||||
userIds = [ownerId, w.delegate.id, r.delegate.id];
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
describe("POST /api/medications/{id}/intake parity", () => {
|
||||
it("01 a take inside its band, onto the pending reminder row", async () => {
|
||||
await post("01-take-in-band", { takenAt: "2026-10-15T08:30:00.000Z" });
|
||||
});
|
||||
|
||||
it("02 an as-needed take recorded standalone, and its repeat inside the dedup window", async () => {
|
||||
await post(
|
||||
"02a-take-standalone",
|
||||
{ takenAt: "2026-10-15T11:00:00.000Z" },
|
||||
{ medicationId: med.asNeeded },
|
||||
);
|
||||
await post(
|
||||
"02b-take-standalone-repeat",
|
||||
{ takenAt: "2026-10-15T11:00:00.000Z" },
|
||||
{ medicationId: med.asNeeded },
|
||||
);
|
||||
});
|
||||
|
||||
it("03 a skip on a named slot, a slot-less skip, and a skip onto a standalone dose", async () => {
|
||||
await post("03a-skip-named-slot", {
|
||||
skipped: true,
|
||||
scheduledFor: "2026-10-15T20:00:00.000Z",
|
||||
});
|
||||
await post("03b-skip-slotless", { skipped: true });
|
||||
await post(
|
||||
"03c-delegate-skip-standalone-refused",
|
||||
{ skipped: true, scheduledFor: "2026-10-15T11:00:00.000Z" },
|
||||
{ ...writer, medicationId: med.asNeeded, settle: () => refusalRows(1) },
|
||||
);
|
||||
await post(
|
||||
"03d-owner-skip-standalone",
|
||||
{ skipped: true, scheduledFor: "2026-10-15T11:00:00.000Z" },
|
||||
{ medicationId: med.asNeeded },
|
||||
);
|
||||
});
|
||||
|
||||
it("04 a pinned take and the two pin refusals", async () => {
|
||||
await post("04a-pin", {
|
||||
takenAt: "2026-10-14T11:00:00.000Z",
|
||||
forceSlotInstant: "2026-10-14T08:00:00.000Z",
|
||||
});
|
||||
await post("04b-pin-not-a-slot", {
|
||||
takenAt: "2026-10-14T16:00:00.000Z",
|
||||
forceSlotInstant: "2026-10-14T15:00:00.000Z",
|
||||
});
|
||||
await post("04c-pin-occupied", {
|
||||
takenAt: "2026-10-14T23:00:00.000Z",
|
||||
forceSlotInstant: "2026-10-14T20:00:00.000Z",
|
||||
});
|
||||
});
|
||||
|
||||
it("05 a backfill onto a named earlier slot", async () => {
|
||||
await post("05-named-backfill", {
|
||||
takenAt: "2026-10-15T11:30:00.000Z",
|
||||
scheduledFor: "2026-10-13T08:00:00.000Z",
|
||||
});
|
||||
});
|
||||
|
||||
it("06 a body idempotency key and its replay", async () => {
|
||||
const body = {
|
||||
takenAt: "2026-10-13T20:30:00.000Z",
|
||||
idempotencyKey: "dose-key-0001",
|
||||
};
|
||||
await post("06a-body-key", body);
|
||||
await post("06b-body-key-replay", body);
|
||||
});
|
||||
|
||||
it("07 an Idempotency-Key header and its replay", async () => {
|
||||
const headers = {
|
||||
"idempotency-key": "4b7e1c9a-2d3f-4a5b-8c6d-7e8f9a0b1c2d",
|
||||
};
|
||||
const body = { takenAt: "2026-10-12T08:15:00.000Z" };
|
||||
await post("07a-header-key", body, { headers });
|
||||
await post("07b-header-key-replay", body, { headers });
|
||||
});
|
||||
|
||||
it("08 a native take", async () => {
|
||||
await post(
|
||||
"08-native",
|
||||
{ takenAt: "2026-10-11T20:10:00.000Z" },
|
||||
{ auth: ownerBearer },
|
||||
);
|
||||
});
|
||||
|
||||
it("09 a skip over a recorded dose, by the owner and by a delegate", async () => {
|
||||
await post(
|
||||
"09a-delegate-skip-refused",
|
||||
{ skipped: true, scheduledFor: "2026-10-14T20:00:00.000Z" },
|
||||
{ ...writer, settle: () => refusalRows(2) },
|
||||
);
|
||||
await post("09b-owner-skip-flip", {
|
||||
skipped: true,
|
||||
scheduledFor: "2026-10-14T20:00:00.000Z",
|
||||
});
|
||||
});
|
||||
|
||||
it("10 a delegate's take on an open slot, a reader, and nobody", async () => {
|
||||
await post(
|
||||
"10a-writer-take",
|
||||
{ takenAt: "2026-10-11T08:20:00.000Z" },
|
||||
writer,
|
||||
);
|
||||
await post("10b-reader", { takenAt: "2026-10-10T08:20:00.000Z" }, reader);
|
||||
await post(
|
||||
"10c-anonymous",
|
||||
{ takenAt: "2026-10-10T08:20:00.000Z" },
|
||||
{ auth: anonymous },
|
||||
);
|
||||
});
|
||||
|
||||
it("11 the injection-site refusal, and a site with a dose override", async () => {
|
||||
await post(
|
||||
"11a-site-not-allowed",
|
||||
{ takenAt: "2026-10-15T09:10:00.000Z", injectionSite: "ABDOMEN_RIGHT" },
|
||||
{ medicationId: med.pen },
|
||||
);
|
||||
await post(
|
||||
"11b-site-and-dose",
|
||||
{
|
||||
takenAt: "2026-10-15T09:10:00.000Z",
|
||||
injectionSite: "ABDOMEN_LEFT",
|
||||
doseTaken: "0.5 pen",
|
||||
},
|
||||
{ medicationId: med.pen },
|
||||
);
|
||||
});
|
||||
|
||||
it("12 a one-shot dose", async () => {
|
||||
await post(
|
||||
"12-one-shot",
|
||||
{ takenAt: "2026-10-15T10:00:00.000Z" },
|
||||
{ medicationId: med.oneShot },
|
||||
);
|
||||
});
|
||||
|
||||
it("13 a body the schema refuses", async () => {
|
||||
await post("13-invalid", {
|
||||
takenAt: "yesterday",
|
||||
idempotencyKey: "<HKDoseEvent: 0x600003a1c0c0>",
|
||||
});
|
||||
});
|
||||
|
||||
it("14 another account's medication, and a record-only one", async () => {
|
||||
await post(
|
||||
"14a-not-found",
|
||||
{ takenAt: "2026-10-15T08:30:00.000Z" },
|
||||
{ medicationId: med.foreign },
|
||||
);
|
||||
await post(
|
||||
"14b-record-only",
|
||||
{ takenAt: "2026-10-15T07:10:00.000Z" },
|
||||
{ medicationId: med.recordOnly },
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("GET /api/medications/{id}/intake parity", () => {
|
||||
it("21 the default list", async () => {
|
||||
await list("21-default");
|
||||
});
|
||||
|
||||
it("22 a completed page sorted by take time", async () => {
|
||||
await list("22-completed-page", {
|
||||
status: "completed",
|
||||
sortBy: "takenAt",
|
||||
sortDir: "asc",
|
||||
limit: "3",
|
||||
offset: "1",
|
||||
});
|
||||
});
|
||||
|
||||
it("23 the skips, and the takes", async () => {
|
||||
await list("23a-skipped", { status: "skipped" });
|
||||
await list("23b-taken", { status: "taken", sortDir: "asc" });
|
||||
});
|
||||
|
||||
it("24 a query the schema refuses", async () => {
|
||||
await list("24-invalid", { limit: "lots", status: "maybe" });
|
||||
});
|
||||
|
||||
it("25 another account's medication, a reading delegate, and nobody", async () => {
|
||||
await list("25a-not-found", {}, { medicationId: med.foreign });
|
||||
await list("25b-reader", {}, reader);
|
||||
await list("25c-anonymous", {}, { auth: anonymous });
|
||||
});
|
||||
});
|
||||
@@ -218,6 +218,11 @@ export interface ParityCall {
|
||||
settle?: () => Promise<void>;
|
||||
/** Further state the route writes outside the medication tables. */
|
||||
extra?: () => Promise<unknown>;
|
||||
/**
|
||||
* Rewrites what the snapshot holds before the placeholders are applied,
|
||||
* for a value that carries a generated id inside a longer string.
|
||||
*/
|
||||
rewrite?: (value: unknown) => unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,14 +241,14 @@ export async function parityStep(call: ParityCall) {
|
||||
await expectParity(
|
||||
call.name,
|
||||
stable(
|
||||
{
|
||||
(call.rewrite ?? ((value: unknown) => value))({
|
||||
status: res.status,
|
||||
body: res.body,
|
||||
events: events.map(eventFacts).map(withoutCacheKeyHashes),
|
||||
effects: effectRecorder.take(),
|
||||
stored: await medicationState(getPrismaClient(), call.userIds),
|
||||
...(call.extra ? { extra: await call.extra() } : {}),
|
||||
},
|
||||
}),
|
||||
{ since: call.now },
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user