diff --git a/CHANGELOG.md b/CHANGELOG.md index a3cf6ec60..9d4058a8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ stay under for any nutrient on the energy card; the chart draws your number instead of the reference. Targets travel in the full backup and are read and set through `GET` and `PATCH /api/nutrients/targets`. (#1402) -- Lab results from Apple Health's Health Records now land in Labs. An Apple Health export used to skip every clinical record; the lab results among them are now read, matched to your existing markers (by name, alias or LOINC code, with a reading in another unit converted and the printed value kept), and filed under their panel. A result like "<0.5 mg/L" is kept as printed, the report's own reference range comes along, and preliminary or withdrawn results are left out. Importing the same results again writes nothing, a result you delete stays deleted, and a reading you already typed or scanned is not doubled. If you imported an archive before, upload it once more to pick up its lab results. For the iOS app, `POST /api/labs/fhir-batch` takes the same results straight from HealthKit. Thanks to @camiracode for asking for this. (#1400) +- Lab results from Apple Health's Health Records now land in Labs. An Apple Health export used to skip every clinical record; the lab results among them are now read, matched to your existing markers (by name, alias or LOINC code, with a reading in another unit converted and the printed value kept), and filed under their panel. A result like "<0.5 mg/L" is kept as printed, the report's own reference range comes along, and preliminary or withdrawn results are left out. Importing the same results again writes nothing, a result you delete stays deleted (also when you delete its whole marker, long after the deletion, and across a backup restore), and a reading you already typed or scanned is not doubled. If you imported an archive before, upload it once more to pick up its lab results. For the iOS app, `POST /api/labs/fhir-batch` takes the same results straight from HealthKit. Thanks to @camiracode for asking for this. (#1400) ### Changed diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index c624e1756..54c83a460 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -45678,6 +45678,27 @@ components: - readingCount - mergedAt additionalProperties: {} + labResultImportKeys: + default: [] + type: array + items: + type: object + properties: + source: + type: string + minLength: 1 + maxLength: 32 + externalId: + type: string + minLength: 1 + maxLength: 128 + createdAt: + type: string + minLength: 1 + required: + - source + - externalId + additionalProperties: {} illnessEpisodes: default: [] type: array @@ -49012,6 +49033,7 @@ components: - labResults - biomarkers - biomarkerMerges + - labResultImportKeys - illnessEpisodes - symptomDefinitions - lifeEvents diff --git a/prisma/migrations/0501_lab_result_import_keys/migration.sql b/prisma/migrations/0501_lab_result_import_keys/migration.sql new file mode 100644 index 000000000..45d4da4a2 --- /dev/null +++ b/prisma/migrations/0501_lab_result_import_keys/migration.sql @@ -0,0 +1,32 @@ +-- The identities of Health Records lab readings the person deleted, kept once +-- the reading's row is gone (#1400). A deleted reading remembers its identity +-- on its own tombstone; the nightly purge and deleting a whole marker remove +-- the row, and with it the only memory that the person deleted it, so the +-- next Apple Health export wrote the reading again. Those two now move the +-- identity here first. One row per (user, source, identity): the digest, no +-- lab content. +-- +-- A new, empty table; nothing is rewritten. IF NOT EXISTS keeps a replay on a +-- database that already ran a build carrying it harmless. Reversibility: +-- dropping the table forgets the deletions it remembers; readings already +-- purged would be imported again on the next export. +-- +-- @retry-on-lock-timeout + +DO $migration$ +BEGIN + PERFORM set_config('lock_timeout', '5s', true); + CREATE TABLE IF NOT EXISTS "lab_result_import_keys" ( + "id" TEXT NOT NULL, + "user_id" TEXT NOT NULL, + "source" TEXT NOT NULL, + "external_id" TEXT NOT NULL, + "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT "lab_result_import_keys_pkey" PRIMARY KEY ("id"), + CONSTRAINT "lab_result_import_keys_user_id_fkey" FOREIGN KEY ("user_id") + REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE + ); + CREATE UNIQUE INDEX IF NOT EXISTS "lab_result_import_keys_user_id_source_external_id_key" + ON "lab_result_import_keys" ("user_id", "source", "external_id"); +END +$migration$; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 2193f5c4c..7e500fe31 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1083,6 +1083,9 @@ model User { // v1.39.2 — source keys of imported documents that the tombstone purge // removed, so a re-run of an importer cannot bring a deleted document back. documentImportKeys DocumentImportKey[] + // v1.47.7 — identities of Health Records lab readings the person deleted, + // kept once the reading's row is gone. See LabResultImportKey. + labResultImportKeys LabResultImportKey[] // v1.39.2 — further source keys an import answered with an existing // document (same bytes under another key). See DocumentSourceAlias. documentSourceAliases DocumentSourceAlias[] @@ -6666,7 +6669,8 @@ model LabResult { /// it has none). A digest, not the identifier and not ciphertext. NULL for /// every reading typed, scanned or imported from CSV. Read by /// `writeFhirLabReadings` (`src/lib/labs/fhir-import/write.ts`), which treats - /// a reading it already holds under this id, deleted or not, as a duplicate. + /// a reading it already holds under this id, deleted or not, as a duplicate; + /// once a deleted reading's row is gone, `LabResultImportKey` holds the id. externalId String? @map("external_id") /// Optional free-text note, AES-256-GCM encrypted at rest via /// `src/lib/crypto.ts` (Bytes column, `*Encrypted` suffix per convention). @@ -6692,6 +6696,30 @@ model LabResult { @@map("lab_results") } +/// v1.47.7 (#1400) — the identity of a Health Records lab reading the person +/// deleted, once the reading's row is gone. While a deleted reading waits as +/// a tombstone, its own `externalId` is the memory that the person deleted it +/// and the import answers "duplicate". When the row leaves the database (the +/// tombstone purge, or deleting the reading's whole marker) the identity moves +/// here in the same transaction, so an Apple Health export or the phone +/// sending the result again still writes nothing. Read by +/// `writeFhirLabReadings`, carried by the backup. Holds the digest only, no +/// lab content. +model LabResultImportKey { + id String @id @default(cuid()) + userId String @map("user_id") + /// The `LabResult.source` the identity arrived under ("APPLE_HEALTH"). + source String + /// The `LabResult.externalId` digest. + externalId String @map("external_id") + createdAt DateTime @default(now()) @map("created_at") + + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + + @@unique([userId, source, externalId]) + @@map("lab_result_import_keys") +} + // ─── Biomarker catalog ─────────────────────────────────────── /// v1.19.0 — user-scoped catalog of blood/lab biomarkers. Defining a marker diff --git a/src/__tests__/baselines/source-file-lines.json b/src/__tests__/baselines/source-file-lines.json index 3961c8229..8414b6a30 100644 --- a/src/__tests__/baselines/source-file-lines.json +++ b/src/__tests__/baselines/source-file-lines.json @@ -1,7 +1,7 @@ { "$comment": "Production files over 800 lines and their length. Maintained by src/__tests__/source-size-ratchet.test.ts.", "count": 84, - "total": 93813, + "total": 93815, "entries": { "app/medications/page-client.tsx": 842, "components/charts/mood-chart.tsx": 1166, @@ -42,7 +42,7 @@ "lib/dashboard-layout.ts": 977, "lib/dashboard/snapshot.ts": 1548, "lib/day/records.ts": 1172, - "lib/export/backup-plan.ts": 838, + "lib/export/backup-plan.ts": 840, "lib/export/coach-backup.ts": 1070, "lib/export/profile-backup.ts": 1019, "lib/fitbit/client.ts": 1262, diff --git a/src/app/api/biomarkers/[id]/__tests__/delete-record-auth.test.ts b/src/app/api/biomarkers/[id]/__tests__/delete-record-auth.test.ts index 468bb14ea..6280fcca3 100644 --- a/src/app/api/biomarkers/[id]/__tests__/delete-record-auth.test.ts +++ b/src/app/api/biomarkers/[id]/__tests__/delete-record-auth.test.ts @@ -22,13 +22,18 @@ vi.mock("@/lib/api-handler", async (importOriginal) => { }; }); -vi.mock("@/lib/db", () => ({ - prisma: { +vi.mock("@/lib/db", () => { + const prisma = { biomarker: { findFirst: vi.fn(), delete: vi.fn() }, - labResult: { deleteMany: vi.fn() }, - $transaction: vi.fn(async (ops: Promise[]) => Promise.all(ops)), - }, -})); + labResult: { deleteMany: vi.fn(), findMany: vi.fn(async () => []) }, + labResultImportKey: { createMany: vi.fn() }, + $transaction: vi.fn(), + }; + prisma.$transaction.mockImplementation( + async (fn: (tx: typeof prisma) => unknown) => fn(prisma), + ); + return { prisma }; +}); vi.mock("@/lib/auth/audit", () => ({ auditLog: vi.fn().mockResolvedValue(undefined), })); @@ -79,11 +84,20 @@ describe("DELETE /api/biomarkers/[id] record authority", () => { expect(requireAuth).not.toHaveBeenCalled(); }); - it("narrows both delete legs to the resolved record", async () => { + it("narrows every delete leg to the resolved record", async () => { await DELETE(delReq(), params); expect(prisma.labResult.deleteMany).toHaveBeenCalledWith({ where: { userId: "record-1", biomarkerId: "bm-1" }, }); + // The identities the import ledger keeps come from the same rows. + expect(prisma.labResult.findMany).toHaveBeenCalledWith( + expect.objectContaining({ + where: expect.objectContaining({ + userId: "record-1", + biomarkerId: "bm-1", + }), + }), + ); }); it("refuses when the record authority refuses, deleting nothing", async () => { diff --git a/src/app/api/biomarkers/[id]/__tests__/route.test.ts b/src/app/api/biomarkers/[id]/__tests__/route.test.ts index bf781ebbc..2ed97932a 100644 --- a/src/app/api/biomarkers/[id]/__tests__/route.test.ts +++ b/src/app/api/biomarkers/[id]/__tests__/route.test.ts @@ -17,10 +17,11 @@ vi.mock("@/lib/db", () => { }, biomarkerMerge: { findFirst: vi.fn(async () => null) }, labResult: { deleteMany: vi.fn(), findMany: vi.fn(async () => []) }, + labResultImportKey: { createMany: vi.fn() }, auditLog: { create: vi.fn().mockResolvedValue({}) }, }; - // `$transaction` is set in `beforeEach`: the batch form for the delete, the - // callback form for the edit. + // `$transaction` is set in `beforeEach`: the callback form for the delete + // and the edit, the batch form where a caller still uses it. return { prisma: { ...prisma, $transaction: vi.fn() } }; }); @@ -158,6 +159,12 @@ describe("DELETE /api/biomarkers/[id]", () => { vi.mocked(prisma.labResult.deleteMany).mockResolvedValue({ count: 3, } as never); + vi.mocked(prisma.labResult.findMany).mockResolvedValue([ + { source: "APPLE_HEALTH", externalId: "fhir:a" }, + ] as never); + vi.mocked(prisma.labResultImportKey.createMany).mockResolvedValue({ + count: 1, + } as never); vi.mocked(prisma.biomarker.delete).mockResolvedValue(EXISTING as never); const res = await DELETE(delReq(), params("bm-1")); @@ -171,6 +178,13 @@ describe("DELETE /api/biomarkers/[id]", () => { expect(prisma.biomarker.delete).toHaveBeenCalledWith({ where: { id: "bm-1" }, }); + // A Health Records reading's identity outlives it in the import ledger. + expect(prisma.labResultImportKey.createMany).toHaveBeenCalledWith({ + data: [ + { userId: "user-1", source: "APPLE_HEALTH", externalId: "fhir:a" }, + ], + skipDuplicates: true, + }); expect(prisma.$transaction).toHaveBeenCalledTimes(1); }); diff --git a/src/app/api/biomarkers/[id]/route.ts b/src/app/api/biomarkers/[id]/route.ts index 09fc6f6e4..894b9727e 100644 --- a/src/app/api/biomarkers/[id]/route.ts +++ b/src/app/api/biomarkers/[id]/route.ts @@ -27,6 +27,7 @@ import { matchAnalyteKey } from "@/lib/labs/analyte-match"; import { sameLabUnit } from "@/lib/labs/unit-normalise"; import { annotate } from "@/lib/logging/context"; import { computeLabTrend } from "@/lib/labs/lab-trend"; +import { retireLabImportKeys } from "@/lib/labs/fhir-import/import-keys"; /** Upper bound on readings the trend line reads. */ const LAB_TREND_READ_CAP = 2000; @@ -319,14 +320,17 @@ export const DELETE = apiHandler( // Hard delete the marker AND its readings in one transaction. Deleting a // biomarker is a deliberate "remove this and its history" action, so the // readings go with it rather than lingering as orphaned, unlinked rows. - // Both legs are userId-narrowed so a cross-user id can never reach another - // account's data. - const [removedReadings] = await prisma.$transaction([ - prisma.labResult.deleteMany({ - where: { userId: user.id, biomarkerId: id }, - }), - prisma.biomarker.delete({ where: { id } }), - ]); + // Every leg is userId-narrowed so a cross-user id can never reach another + // account's data. A reading imported from Health Records leaves its + // identity in the import ledger first, so the next export or resend does + // not write it again. + const removedReadings = await prisma.$transaction(async (tx) => { + const where = { userId: user.id, biomarkerId: id }; + await retireLabImportKeys(tx, user.id, where); + const removed = await tx.labResult.deleteMany({ where }); + await tx.biomarker.delete({ where: { id } }); + return removed; + }); invalidateUserHealthScore(user.id); await auditLog("biomarker.delete", { diff --git a/src/app/api/export/__tests__/per-type-routes.test.ts b/src/app/api/export/__tests__/per-type-routes.test.ts index f426aaa2e..74aee454f 100644 --- a/src/app/api/export/__tests__/per-type-routes.test.ts +++ b/src/app/api/export/__tests__/per-type-routes.test.ts @@ -95,6 +95,7 @@ vi.mock("@/lib/db", () => ({ biomarker: { findMany: vi.fn() }, biomarkerAlias: { findMany: vi.fn() }, biomarkerMerge: { findMany: vi.fn() }, + labResultImportKey: { findMany: vi.fn(async () => []) }, illnessEpisode: { findMany: vi.fn() }, allergy: { findMany: vi.fn() }, familyHistoryEntry: { findMany: vi.fn() }, diff --git a/src/app/api/export/__tests__/soft-delete-filter.test.ts b/src/app/api/export/__tests__/soft-delete-filter.test.ts index 5b3478183..29fc5e70b 100644 --- a/src/app/api/export/__tests__/soft-delete-filter.test.ts +++ b/src/app/api/export/__tests__/soft-delete-filter.test.ts @@ -69,6 +69,7 @@ vi.mock("@/lib/db", () => ({ biomarker: { findMany: vi.fn() }, biomarkerAlias: { findMany: vi.fn() }, biomarkerMerge: { findMany: vi.fn() }, + labResultImportKey: { findMany: vi.fn(async () => []) }, allergy: { findMany: vi.fn() }, familyHistoryEntry: { findMany: vi.fn() }, workout: { findMany: vi.fn() }, diff --git a/src/app/api/export/encrypted/__tests__/route.test.ts b/src/app/api/export/encrypted/__tests__/route.test.ts index 71db45a35..b734d3b9c 100644 --- a/src/app/api/export/encrypted/__tests__/route.test.ts +++ b/src/app/api/export/encrypted/__tests__/route.test.ts @@ -86,6 +86,7 @@ vi.mock("@/lib/db", () => ({ biomarker: { findMany: vi.fn().mockResolvedValue([]) }, biomarkerAlias: { findMany: vi.fn().mockResolvedValue([]) }, biomarkerMerge: { findMany: vi.fn().mockResolvedValue([]) }, + labResultImportKey: { findMany: vi.fn().mockResolvedValue([]) }, illnessEpisode: { findMany: vi.fn().mockResolvedValue([]) }, allergy: { findMany: vi.fn().mockResolvedValue([]) }, familyHistoryEntry: { findMany: vi.fn().mockResolvedValue([]) }, diff --git a/src/lib/apple-health/clinical-labs-import.ts b/src/lib/apple-health/clinical-labs-import.ts index 1ae8aea72..fd814e598 100644 --- a/src/lib/apple-health/clinical-labs-import.ts +++ b/src/lib/apple-health/clinical-labs-import.ts @@ -81,7 +81,10 @@ export async function importAppleHealthClinicalLabs(input: { userId: string; tz: string; references: readonly ClinicalLabReference[]; - prisma?: Pick; + prisma?: Pick< + PrismaClient, + "labResult" | "biomarker" | "biomarkerAlias" | "labResultImportKey" + >; limits?: AppleHealthClinicalArchiveLimits; }): Promise { const counts = emptyFhirLabCounts(); diff --git a/src/lib/data-wipe/wipe-plan.ts b/src/lib/data-wipe/wipe-plan.ts index f732b8294..f45e70fea 100644 --- a/src/lib/data-wipe/wipe-plan.ts +++ b/src/lib/data-wipe/wipe-plan.ts @@ -136,6 +136,10 @@ export const WIPE_MODELS = [ // ── Clinical record ───────────────────────────────────────────────────── "MentalHealthAssessment", "LabResult", + // The identities of Health Records readings the person deleted (#1400). + // Kept, they would make the first import after the wipe skip results for + // a decision about a record that no longer exists. + "LabResultImportKey", // v1.43 — a marker's other spellings and the merges folded into it. Both // cascade from the marker; named before it so their counts read true. "BiomarkerAlias", diff --git a/src/lib/export/__tests__/full-backup-payload.test.ts b/src/lib/export/__tests__/full-backup-payload.test.ts index 96abb9903..5e68aa4f7 100644 --- a/src/lib/export/__tests__/full-backup-payload.test.ts +++ b/src/lib/export/__tests__/full-backup-payload.test.ts @@ -464,6 +464,7 @@ function makePrisma() { documentConditionLink: { findMany: vi.fn().mockResolvedValue([]) }, extractedFact: { findMany: vi.fn().mockResolvedValue([]) }, documentImportKey: { findMany: vi.fn().mockResolvedValue([]) }, + labResultImportKey: { findMany: vi.fn().mockResolvedValue([]) }, inboundDocument: { findMany: vi.fn().mockResolvedValue([]) }, // The ECG strips. Empty for the same reason as the sections above: // an account whose watch has never taken one is the ordinary case the diff --git a/src/lib/export/__tests__/records-backup.test.ts b/src/lib/export/__tests__/records-backup.test.ts index 406b60bc1..9942416b9 100644 --- a/src/lib/export/__tests__/records-backup.test.ts +++ b/src/lib/export/__tests__/records-backup.test.ts @@ -75,6 +75,7 @@ function buildMockPrisma() { }, biomarkerAlias: { findMany: vi.fn().mockResolvedValue([]) }, biomarkerMerge: { findMany: vi.fn().mockResolvedValue([]) }, + labResultImportKey: { findMany: vi.fn().mockResolvedValue([]) }, illnessEpisode: { findMany: vi.fn().mockResolvedValue([ { @@ -473,6 +474,7 @@ describe("buildRecordsBackupSection", () => { expect(counts).toEqual({ labResults: 1, + labResultImportKeys: 0, biomarkers: 1, illnessEpisodes: 2, illnessDayLogs: 1, diff --git a/src/lib/export/__tests__/restore-backup-round-trip.test.ts b/src/lib/export/__tests__/restore-backup-round-trip.test.ts index 6f06e01ea..81eb16eab 100644 --- a/src/lib/export/__tests__/restore-backup-round-trip.test.ts +++ b/src/lib/export/__tests__/restore-backup-round-trip.test.ts @@ -167,6 +167,7 @@ function sourceClient() { biomarker: empty, biomarkerAlias: empty, biomarkerMerge: empty, + labResultImportKey: empty, illnessEpisode: empty, allergy: empty, familyHistoryEntry: empty, diff --git a/src/lib/export/backup-plan.ts b/src/lib/export/backup-plan.ts index 2ab645657..3e223e421 100644 --- a/src/lib/export/backup-plan.ts +++ b/src/lib/export/backup-plan.ts @@ -101,6 +101,7 @@ export const BACKED_UP_MODELS = [ // ── Clinical record ─────────────────────────────────────────────────────── "MentalHealthAssessment", "LabResult", + "LabResultImportKey", // Deleted Health Records readings: `labs-backup.ts`. "Biomarker", "Allergy", "FamilyHistoryEntry", @@ -365,6 +366,7 @@ export const TWO_ENDED_MODELS = [ "MoodEntryTagLink", "MoodTag", "LabResult", + "LabResultImportKey", "Biomarker", "Allergy", "FamilyHistoryEntry", diff --git a/src/lib/export/backup-preview.ts b/src/lib/export/backup-preview.ts index 84ce9d3ee..cd799369f 100644 --- a/src/lib/export/backup-preview.ts +++ b/src/lib/export/backup-preview.ts @@ -157,6 +157,7 @@ const SUMMARY_COUNTS = [ "cycles", "cycleDayLogs", "labResults", + "labResultImportKeys", "nutrientDays", "biomarkers", "illnessEpisodes", diff --git a/src/lib/export/labs-backup-schema.ts b/src/lib/export/labs-backup-schema.ts index 70aa14023..485262ae9 100644 --- a/src/lib/export/labs-backup-schema.ts +++ b/src/lib/export/labs-backup-schema.ts @@ -117,3 +117,15 @@ export const biomarkerMergeBackupSchema = z mergedAt: isoDateTime, }) .passthrough(); + +/** + * The identity of a Health Records reading the person deleted (the import + * ledger). Bounded like the reading's own `externalId`. + */ +export const labResultImportKeyBackupSchema = z + .object({ + source: z.string().min(1).max(32), + externalId: z.string().min(1).max(128), + createdAt: isoDateTime.optional(), + }) + .passthrough(); diff --git a/src/lib/export/labs-backup.ts b/src/lib/export/labs-backup.ts index 97063e078..1836d9f5b 100644 --- a/src/lib/export/labs-backup.ts +++ b/src/lib/export/labs-backup.ts @@ -145,11 +145,28 @@ export interface BiomarkerMergeBackupEntry { mergedAt: string; } -/** The lab slice of the records section: results, markers, merge ledger. */ +/** + * The identity of a Health Records reading the person deleted (the import + * ledger, `LabResultImportKey`). A digest, no lab content. + */ +export interface LabResultImportKeyBackupEntry { + source: string; + externalId: string; + createdAt: string; +} + +/** + * The lab slice of the records section: results, markers, merge ledger, and + * the identities of the Health Records readings the person deleted. + */ export async function buildLabsBackupSlice( prisma: Pick< PrismaClient, - "labResult" | "biomarker" | "biomarkerAlias" | "biomarkerMerge" + | "labResult" + | "biomarker" + | "biomarkerAlias" + | "biomarkerMerge" + | "labResultImportKey" >, userId: string, disasterRecovery: boolean, @@ -157,35 +174,42 @@ export async function buildLabsBackupSlice( labResults: LabResultBackupEntry[]; biomarkers: BiomarkerBackupEntry[]; biomarkerMerges: BiomarkerMergeBackupEntry[]; + labResultImportKeys: LabResultImportKeyBackupEntry[]; }> { - const [labResultRows, biomarkerRows, biomarkerAliasRows, biomarkerMergeRows] = - await Promise.all([ - prisma.labResult.findMany({ - where: disasterRecovery ? { userId } : { userId, deletedAt: null }, - orderBy: [{ takenAt: "desc" }, { id: "asc" }], - include: { biomarker: { select: { name: true } } }, - }), - prisma.biomarker.findMany({ - where: { userId }, - orderBy: [{ name: "asc" }, { id: "asc" }], - }), - prisma.biomarkerAlias.findMany({ - where: { userId }, - orderBy: [{ biomarkerId: "asc" }, { nameFolded: "asc" }, { id: "asc" }], - select: { - id: true, - biomarkerId: true, - name: true, - source: true, - createdAt: true, - }, - }), - prisma.biomarkerMerge.findMany({ - where: { userId }, - orderBy: [{ mergedAt: "asc" }, { id: "asc" }], - include: { target: { select: { name: true } } }, - }), - ]); + const [ + labResultRows, + biomarkerRows, + biomarkerAliasRows, + biomarkerMergeRows, + labResultImportKeys, + ] = await Promise.all([ + prisma.labResult.findMany({ + where: disasterRecovery ? { userId } : { userId, deletedAt: null }, + orderBy: [{ takenAt: "desc" }, { id: "asc" }], + include: { biomarker: { select: { name: true } } }, + }), + prisma.biomarker.findMany({ + where: { userId }, + orderBy: [{ name: "asc" }, { id: "asc" }], + }), + prisma.biomarkerAlias.findMany({ + where: { userId }, + orderBy: [{ biomarkerId: "asc" }, { nameFolded: "asc" }, { id: "asc" }], + select: { + id: true, + biomarkerId: true, + name: true, + source: true, + createdAt: true, + }, + }), + prisma.biomarkerMerge.findMany({ + where: { userId }, + orderBy: [{ mergedAt: "asc" }, { id: "asc" }], + include: { target: { select: { name: true } } }, + }), + buildDeletedLabImportKeys(prisma, userId, disasterRecovery), + ]); const labResults: LabResultBackupEntry[] = labResultRows.map((r) => ({ ...(disasterRecovery @@ -288,7 +312,56 @@ export async function buildLabsBackupSlice( aliases: aliasesByMarker.get(b.id) ?? [], })); - return { labResults, biomarkers, biomarkerMerges }; + return { labResults, biomarkers, biomarkerMerges, labResultImportKeys }; +} + +/** + * What the person deleted among their Health Records readings, as the import + * ledger would hold it once every deletion is purged: the ledger's own rows, + * then, in a portable file, the identities of the deleted readings still + * waiting as tombstones. A portable file does not carry those readings, as it + * carries no tombstone; without their identities a restore onto a fresh + * instance would let the next import write each one again. A disaster-recovery + * file carries the tombstones themselves. An identity is carried once. + */ +async function buildDeletedLabImportKeys( + prisma: Pick, + userId: string, + disasterRecovery: boolean, +): Promise { + const [ledger, tombstones] = await Promise.all([ + prisma.labResultImportKey.findMany({ + where: { userId }, + orderBy: [{ createdAt: "asc" }, { id: "asc" }], + select: { source: true, externalId: true, createdAt: true }, + }), + disasterRecovery + ? Promise.resolve([]) + : prisma.labResult.findMany({ + where: { + userId, + deletedAt: { not: null }, + externalId: { not: null }, + }, + orderBy: [{ deletedAt: "asc" }, { id: "asc" }], + select: { source: true, externalId: true, deletedAt: true }, + }), + ]); + const out: LabResultImportKeyBackupEntry[] = []; + const seen = new Set(); + const add = (source: string, externalId: string, at: Date) => { + const key = JSON.stringify([source, externalId]); + if (seen.has(key)) return; + seen.add(key); + out.push({ source, externalId, createdAt: at.toISOString() }); + }; + for (const row of ledger) add(row.source, row.externalId, row.createdAt); + for (const row of tombstones) { + if (row.externalId && row.deletedAt) { + add(row.source, row.externalId, row.deletedAt); + } + } + return out; } // ── Restore ────────────────────────────────────────────────────────────────── @@ -298,6 +371,11 @@ export async function clearLabResults(ctx: RestoreContext): Promise { where: { userId: ctx.ownerId }, }); ctx.cleared.labResults = labResults.count; + // The ledger is what the file says was deleted: replaced, like the rest. + const keys = await ctx.tx.labResultImportKey.deleteMany({ + where: { userId: ctx.ownerId }, + }); + ctx.cleared.labResultImportKeys = keys.count; } export async function clearBiomarkers(ctx: RestoreContext): Promise { @@ -487,4 +565,32 @@ export async function restoreLabResults(ctx: RestoreContext): Promise { const labSourceId = lab.id ?? lab.ref; if (labSourceId) labResultIdBySourceId.set(labSourceId, createdLab.id); } + await restoreLabImportKeys(ctx); +} + +/** + * The import ledger, after the results: an identity a restored reading holds + * (live, or a tombstone in a disaster-recovery file) is that reading's, and + * the ledger only remembers identities whose row is gone. + */ +async function restoreLabImportKeys(ctx: RestoreContext): Promise { + const { tx, ownerId, payload } = ctx; + const held = new Set( + payload.labResults.flatMap((lab) => + lab.externalId ? [JSON.stringify([lab.source, lab.externalId])] : [], + ), + ); + const keys = (payload.labResultImportKeys ?? []).filter( + (key) => !held.has(JSON.stringify([key.source, key.externalId])), + ); + if (keys.length === 0) return; + await tx.labResultImportKey.createMany({ + data: keys.map((key) => ({ + userId: ownerId, + source: key.source, + externalId: key.externalId, + ...(key.createdAt ? { createdAt: new Date(key.createdAt) } : {}), + })), + skipDuplicates: true, + }); } diff --git a/src/lib/export/records-backup.ts b/src/lib/export/records-backup.ts index 485aa97fe..55b0ccaab 100644 --- a/src/lib/export/records-backup.ts +++ b/src/lib/export/records-backup.ts @@ -39,6 +39,7 @@ import { type BiomarkerBackupEntry, type BiomarkerMergeBackupEntry, type LabResultBackupEntry, + type LabResultImportKeyBackupEntry, } from "@/lib/export/labs-backup"; import { buildWorkoutsBackupSlice, @@ -71,6 +72,7 @@ export interface RecordsBackupSection { labResults: LabResultBackupEntry[]; biomarkers: BiomarkerBackupEntry[]; biomarkerMerges: BiomarkerMergeBackupEntry[]; + labResultImportKeys: LabResultImportKeyBackupEntry[]; illnessEpisodes: CanonicalIllnessEpisode[]; allergies: CanonicalAllergy[]; familyHistory: FamilyHistoryEntryDTO[]; @@ -87,6 +89,7 @@ export interface RecordsBackupSection { export interface RecordsBackupCounts { labResults: number; + labResultImportKeys: number; biomarkers: number; illnessEpisodes: number; illnessDayLogs: number; @@ -107,6 +110,7 @@ export async function buildRecordsBackupSection( | "biomarker" | "biomarkerAlias" | "biomarkerMerge" + | "labResultImportKey" | "illnessEpisode" | "allergy" | "familyHistoryEntry" @@ -157,6 +161,7 @@ export function countRecordsBackupSection( ): RecordsBackupCounts { return { labResults: section.labResults.length, + labResultImportKeys: section.labResultImportKeys.length, biomarkers: section.biomarkers.length, illnessEpisodes: section.illnessEpisodes.length, illnessDayLogs: section.illnessEpisodes.reduce( diff --git a/src/lib/export/restore-context.ts b/src/lib/export/restore-context.ts index 88598840a..b31e0610a 100644 --- a/src/lib/export/restore-context.ts +++ b/src/lib/export/restore-context.ts @@ -63,6 +63,7 @@ export const RESTORE_CLEARED_KEYS = [ "cycleDayLogs", "cycleProfile", "labResults", + "labResultImportKeys", "biomarkers", "nutrientDays", "illnessEpisodes", diff --git a/src/lib/jobs/soft-delete-retention.ts b/src/lib/jobs/soft-delete-retention.ts index 9d3a38529..8fb97a062 100644 --- a/src/lib/jobs/soft-delete-retention.ts +++ b/src/lib/jobs/soft-delete-retention.ts @@ -34,10 +34,11 @@ * so a new nulling key into a purged model cannot ship without one. */ // account-deletion(file): a retention sweep over rows already deleted, with its own retention clock; it does no work for an account. -import type { PrismaClient } from "@/generated/prisma/client"; +import type { Prisma, PrismaClient } from "@/generated/prisma/client"; import { TOMBSTONE_RETENTION_DAYS } from "@/lib/auth/native-client"; import { getCoachMessageRetentionDays } from "@/lib/jobs/coach-message-cleanup"; import { DOCUMENT_PURGE_GRACE_DAYS } from "@/lib/jobs/document-purge-queue"; +import { retireLabImportKeys } from "@/lib/labs/fhir-import/import-keys"; import { purgeTombstonesByAccount, type TombstonePurgeOutcome, @@ -72,6 +73,15 @@ export type SoftDeleteRetention = keep?: string; /** The live references that hold a tombstone back. */ referencedBy?: readonly LiveReferrer[]; + /** + * Runs in the purge's transaction before the delete, over the rows the + * delete is about to take: for what a tombstone remembers that must + * outlive the row. + */ + beforePurge?: ( + tx: Prisma.TransactionClient, + rows: { ids: string[]; userId: string; cutoff: Date }, + ) => Promise; /** Why the horizon or the condition differs from the default. */ why?: string; }; @@ -129,7 +139,17 @@ export const SOFT_DELETE_RETENTION: Readonly< live("encounters", "reminder_id"), live("vaccination_records", "reminder_id"), ]), - LabResult: standard("lab_results"), + LabResult: { + kind: "purge", + table: "lab_results", + days: () => TOMBSTONE_RETENTION_DAYS, + beforePurge: (tx, { ids, userId, cutoff }) => + retireLabImportKeys(tx, userId, { + id: { in: ids }, + deletedAt: { not: null, lt: cutoff }, + }), + why: "A deleted Health Records reading's identity is what keeps the next import from writing it again; the purge moves it into the import ledger (`LabResultImportKey`) before the row goes.", + }, CustomMetric: standard("custom_metrics"), CustomMetricEntry: standard("custom_metric_entries"), CoachPlan: standard("coach_plans"), @@ -217,15 +237,17 @@ export async function purgeSoftDeletedTable( ), // The row is re-checked inside the delete: a restore between the read and // the delete un-tombstones it, and then it stays. - deleteIds: (tx, ids, userId) => - tx.$executeRawUnsafe( + deleteIds: async (tx, ids, userId) => { + await entry.beforePurge?.(tx, { ids, userId, cutoff }); + return tx.$executeRawUnsafe( `DELETE FROM ${table} t WHERE t."id" = ANY($1::text[]) AND t."user_id" = $2 AND t."deleted_at" IS NOT NULL AND t."deleted_at" < $3 ${keep}`, ids, userId, cutoff, - ), + ); + }, }); return { ...outcome, model, table: entry.table }; } diff --git a/src/lib/labs/fhir-import/import-keys.ts b/src/lib/labs/fhir-import/import-keys.ts new file mode 100644 index 000000000..ad46cd16e --- /dev/null +++ b/src/lib/labs/fhir-import/import-keys.ts @@ -0,0 +1,63 @@ +/** + * The import ledger of Health Records lab readings the person deleted + * (`LabResultImportKey`, #1400). + * + * A deleted reading first waits as a tombstone, and its own `externalId` is + * the memory that the person deleted it: the import finds the row and answers + * "duplicate". Two things remove the row for good, the nightly tombstone purge + * and deleting the reading's whole marker, and both used to take that memory + * with them, so the next Apple Health export (which carries the whole history + * every time) wrote the reading again. Each now calls + * {@link retireLabImportKeys} in the same transaction as the delete, which + * moves the identities of the rows about to go into the ledger. + * + * The ledger holds the digest only, never lab content. It is read by + * {@link heldLabImportKeys} (the import's duplicate check) and carried by the + * backup (`src/lib/export/labs-backup.ts`), together with the identities of + * the deleted readings a portable file leaves out. + */ +import type { Prisma, PrismaClient } from "@/generated/prisma/client"; + +type LedgerClient = Pick; + +/** + * Move the identities of the lab rows `where` selects into the ledger, before + * the caller deletes those rows. Rows without an identity are not imported + * from anywhere and have nothing to remember. Run it inside the delete's + * transaction so the identity and the row never both go missing. + */ +export async function retireLabImportKeys( + tx: LedgerClient, + userId: string, + where: Prisma.LabResultWhereInput, +): Promise { + const rows = await tx.labResult.findMany({ + where: { ...where, userId, externalId: { not: null } }, + select: { source: true, externalId: true }, + }); + if (rows.length === 0) return 0; + const { count } = await tx.labResultImportKey.createMany({ + data: rows.map((row) => ({ + userId, + source: row.source, + externalId: row.externalId!, + })), + skipDuplicates: true, + }); + return count; +} + +/** The identities among `externalIds` the ledger holds as deleted. */ +export async function heldLabImportKeys( + client: Pick, + userId: string, + source: string, + externalIds: readonly string[], +): Promise> { + if (externalIds.length === 0) return new Set(); + const rows = await client.labResultImportKey.findMany({ + where: { userId, source, externalId: { in: [...externalIds] } }, + select: { externalId: true }, + }); + return new Set(rows.map((row) => row.externalId)); +} diff --git a/src/lib/labs/fhir-import/write.ts b/src/lib/labs/fhir-import/write.ts index 0a4e440c1..f335b70ad 100644 --- a/src/lib/labs/fhir-import/write.ts +++ b/src/lib/labs/fhir-import/write.ts @@ -11,8 +11,10 @@ * * Two duplicate checks, in this order: * 1. the identity (`externalId`) under `source = APPLE_HEALTH`, against - * every row including the deleted ones: a result the person deleted - * stays deleted however often the export or the phone sends it again; + * every row including the deleted ones and against the import ledger + * that keeps a deleted reading's identity once its row is gone + * (`./import-keys.ts`): a result the person deleted stays deleted + * however often the export or the phone sends it again; * 2. the reading itself (marker or name, day, value) against the live * record, so a result already typed, scanned or imported from a CSV is * not written a second time. @@ -43,6 +45,7 @@ import { import { readingKeys } from "@/lib/labs/reading-keys"; import { encryptNoteToBytes } from "@/lib/labs/store"; +import { heldLabImportKeys } from "./import-keys"; import { APPLE_HEALTH_LAB_SOURCE, type FhirLabWriteStatus, @@ -53,7 +56,7 @@ const CHUNK = 200; type LabWriteClient = Pick< PrismaClient, - "labResult" | "biomarker" | "biomarkerAlias" + "labResult" | "biomarker" | "biomarkerAlias" | "labResultImportKey" >; export interface FhirLabWriteResult { @@ -118,18 +121,27 @@ export async function writeFhirLabReadings(args: { seenIds.add(reading.externalId); fresh.push({ at, reading }); } - const held = new Set( + const freshIds = fresh.map((f) => f.reading.externalId); + const held = new Set( ( await client.labResult.findMany({ where: { userId, source: APPLE_HEALTH_LAB_SOURCE, - externalId: { in: fresh.map((f) => f.reading.externalId) }, + externalId: { in: freshIds }, }, select: { externalId: true }, }) ).map((row) => row.externalId), ); + for (const id of await heldLabImportKeys( + client, + userId, + APPLE_HEALTH_LAB_SOURCE, + freshIds, + )) { + held.add(id); + } // 2. The marker, and whether the unit fits it. const planned: Pending[] = []; diff --git a/src/lib/validations/backup-summary.ts b/src/lib/validations/backup-summary.ts index 20494c11f..b5a19ee2f 100644 --- a/src/lib/validations/backup-summary.ts +++ b/src/lib/validations/backup-summary.ts @@ -40,6 +40,8 @@ export interface BackupSummary { cycleDayLogs: number; /** Lab results in the backup. */ labResults: number; + /** Identities of Health Records lab readings the person deleted. */ + labResultImportKeys: number; nutrientDays: number; /** User-scoped biomarker catalog entries in the backup. */ biomarkers: number; @@ -146,6 +148,7 @@ export function summarizeBackup(payload: BackupPayload): BackupSummary { cycleDayLogs: payload.cycleDayLogs.length, nutrientDays: payload.nutrientDays.length, labResults: payload.labResults.length, + labResultImportKeys: payload.labResultImportKeys.length, biomarkers: payload.biomarkers.length, illnessEpisodes: payload.illnessEpisodes.length, illnessDayLogs: payload.illnessEpisodes.reduce( diff --git a/src/lib/validations/backup.ts b/src/lib/validations/backup.ts index a1b04288d..72e72f7f0 100644 --- a/src/lib/validations/backup.ts +++ b/src/lib/validations/backup.ts @@ -67,6 +67,7 @@ import { intradayProfileBackupSchema } from "@/lib/export/intraday-profile-backu import { biomarkerBackupSchema, biomarkerMergeBackupSchema, + labResultImportKeyBackupSchema, labResultBackupSchema, } from "@/lib/export/labs-backup-schema"; import { lifeEventBackupSchema } from "@/lib/export/life-events-backup-schema"; @@ -167,6 +168,9 @@ export const backupPayloadSchema = z biomarkers: z.array(biomarkerBackupSchema).default([]), // Defaulted: a file written before v1.43 carries no key. biomarkerMerges: z.array(biomarkerMergeBackupSchema).default([]), + // The identities of Health Records readings the person deleted. + // Defaulted: a file written before the lab import ledger carries no key. + labResultImportKeys: z.array(labResultImportKeyBackupSchema).default([]), illnessEpisodes: z.array(illnessEpisodeBackupSchema).default([]), // Defaulted: a file written before v1.40 carries no key. symptomDefinitions: z.array(symptomDefinitionBackupSchema).default([]), diff --git a/tests/integration/__golden__/backup-parity/export-disaster-recovery.json b/tests/integration/__golden__/backup-parity/export-disaster-recovery.json index e4c9969ce..8f352a1e0 100644 --- a/tests/integration/__golden__/backup-parity/export-disaster-recovery.json +++ b/tests/integration/__golden__/backup-parity/export-disaster-recovery.json @@ -478,13 +478,13 @@ "unitsTotal": "30", "unitsRemaining": "21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { "id": "", @@ -500,8 +500,8 @@ "purchasedAt": null, "manufacturer": null, "doseStrength": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "phaseConfig": { @@ -543,7 +543,7 @@ ], "source": "ARCHIVED", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { "id": "", @@ -558,7 +558,7 @@ ], "source": "ARCHIVED", "supersededByIndex": 2, - "createdAt": "2026-05-06T06:27:02.000Z" + "createdAt": "2026-05-06T08:07:02.000Z" }, { "id": "", @@ -573,14 +573,14 @@ ], "source": "MANUAL", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "efficacyTargets": [ { "id": "", - "createdAt": "2026-05-06T08:05:00.000Z", - "updatedAt": "2026-05-06T08:06:00.000Z", + "createdAt": "2026-05-06T09:45:00.000Z", + "updatedAt": "2026-05-06T09:46:00.000Z", "measurementType": "WEIGHT", "biomarkerName": "Ferritin", "primary": false @@ -735,7 +735,7 @@ "hiddenMoodTags": [ { "key": "grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "customMoodTags": [ @@ -756,8 +756,8 @@ ], "cycleProfile": { "id": "", - "createdAt": "2026-05-03T06:52:00.000Z", - "updatedAt": "2026-05-03T06:53:00.000Z", + "createdAt": "2026-05-03T08:32:00.000Z", + "updatedAt": "2026-05-03T08:33:00.000Z", "goal": "AVOID_PREGNANCY", "cycleTrackingEnabled": true, "typicalCycleLength": 3, @@ -776,8 +776,8 @@ "syncVersion": 0, "deletedAt": "", "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:02.000Z", - "updatedAt": "2026-05-03T08:34:02.000Z", + "createdAt": "2026-05-03T10:13:02.000Z", + "updatedAt": "2026-05-03T10:14:02.000Z", "startDate": "2026-05-04", "endDate": null, "periodEndDate": null, @@ -792,8 +792,8 @@ "syncVersion": 3, "deletedAt": null, "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:00.000Z", - "updatedAt": "2026-05-03T08:34:00.000Z", + "createdAt": "2026-05-03T10:13:00.000Z", + "updatedAt": "2026-05-03T10:14:00.000Z", "startDate": "2026-06-01", "endDate": "rt-MenstrualCycle-endDate", "periodEndDate": "rt-MenstrualCycle-periodEndDate", @@ -808,8 +808,8 @@ "syncVersion": 0, "deletedAt": "2026-06-04T07:00:00.000Z", "absorbedIntoId": "", - "createdAt": "2026-05-03T08:33:01.000Z", - "updatedAt": "2026-05-03T08:34:01.000Z", + "createdAt": "2026-05-03T10:13:01.000Z", + "updatedAt": "2026-05-03T10:14:01.000Z", "startDate": "2026-06-03", "endDate": null, "periodEndDate": null, @@ -825,8 +825,8 @@ "cycleId": "", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-03T10:25:00.000Z", - "updatedAt": "2026-05-03T10:26:00.000Z", + "createdAt": "2026-05-03T12:05:00.000Z", + "updatedAt": "2026-05-03T12:06:00.000Z", "date": "2026-06-02", "flow": "HEAVY", "intermenstrualBleeding": true, @@ -859,7 +859,7 @@ "symptomLinkCreatedAt": [ { "key": "custom:round-trip-cramps", - "createdAt": "2026-05-03T13:23:00.000Z" + "createdAt": "2026-05-03T15:03:00.000Z" } ] }, @@ -868,8 +868,8 @@ "cycleId": "", "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-03T10:25:01.000Z", - "updatedAt": "2026-05-03T10:26:01.000Z", + "createdAt": "2026-05-03T12:05:01.000Z", + "updatedAt": "2026-05-03T12:06:01.000Z", "date": "2026-06-03", "flow": "LIGHT", "intermenstrualBleeding": false, @@ -962,8 +962,8 @@ "biomarkers": [ { "id": "", - "createdAt": "2026-05-02T12:30:00.000Z", - "updatedAt": "2026-05-02T12:31:00.000Z", + "createdAt": "2026-05-02T14:10:00.000Z", + "updatedAt": "2026-05-02T14:11:00.000Z", "name": "Ferritin", "unit": "ng/mL", "lowerBound": 2.5, @@ -978,7 +978,7 @@ "name": "Ferr.", "source": "IMPORT_CHOICE", "id": "", - "createdAt": "2026-05-06T13:06:00.000Z" + "createdAt": "2026-05-06T14:46:00.000Z" } ] } @@ -991,7 +991,14 @@ "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" + } + ], + "labResultImportKeys": [ + { + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" } ], "illnessEpisodes": [ @@ -1008,8 +1015,8 @@ "bodySite": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:03.000Z", - "updatedAt": "2026-05-02T17:32:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "deletedAt": null, "dayLogs": [] }, @@ -1026,8 +1033,8 @@ "bodySite": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:00.000Z", - "updatedAt": "2026-05-02T17:32:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "deletedAt": null, "dayLogs": [ { @@ -1039,14 +1046,14 @@ "note": null, "noteEncrypted": "", "tz": "rt-IllnessDayLog-tz", - "createdAt": "2026-05-02T19:08:00.000Z", - "updatedAt": "2026-05-02T19:09:00.000Z", + "createdAt": "2026-05-02T20:48:00.000Z", + "updatedAt": "2026-05-02T20:49:00.000Z", "deletedAt": null, "symptoms": [ { "key": "round_trip_cough", "severity": 2, - "createdAt": "2026-05-02T20:43:00.000Z" + "createdAt": "2026-05-02T22:23:00.000Z" } ] }, @@ -1059,8 +1066,8 @@ "note": null, "noteEncrypted": null, "tz": null, - "createdAt": "2026-05-02T19:08:01.000Z", - "updatedAt": "2026-05-02T19:09:01.000Z", + "createdAt": "2026-05-02T20:48:01.000Z", + "updatedAt": "2026-05-02T20:49:01.000Z", "deletedAt": "", "symptoms": [] } @@ -1079,8 +1086,8 @@ "bodySite": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:02.000Z", - "updatedAt": "2026-05-02T17:32:02.000Z", + "createdAt": "2026-05-02T19:11:02.000Z", + "updatedAt": "2026-05-02T19:12:02.000Z", "deletedAt": "", "dayLogs": [] }, @@ -1097,8 +1104,8 @@ "bodySite": null, "bodySiteEncrypted": "", "laterality": "BOTH", - "createdAt": "2026-05-02T17:31:01.000Z", - "updatedAt": "2026-05-02T17:32:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "deletedAt": null, "dayLogs": [] } @@ -1116,8 +1123,8 @@ "note": null, "reactionEncrypted": null, "notesEncrypted": null, - "createdAt": "2026-05-02T14:10:01.000Z", - "updatedAt": "2026-05-02T14:11:01.000Z", + "createdAt": "2026-05-02T15:50:01.000Z", + "updatedAt": "2026-05-02T15:51:01.000Z", "deletedAt": "" }, { @@ -1132,8 +1139,8 @@ "note": null, "reactionEncrypted": "", "notesEncrypted": "", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z", + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z", "deletedAt": null } ], @@ -1145,8 +1152,8 @@ "ageAtOnset": null, "note": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:01.000Z", - "updatedAt": "2026-05-02T15:47:01.000Z", + "createdAt": "2026-05-02T17:26:01.000Z", + "updatedAt": "2026-05-02T17:27:01.000Z", "deletedAt": "" }, { @@ -1156,16 +1163,16 @@ "ageAtOnset": 3, "note": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z", + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z", "deletedAt": null } ], "workouts": [ { "id": "", - "createdAt": "2026-05-03T21:58:00.000Z", - "updatedAt": "2026-05-03T21:59:00.000Z", + "createdAt": "2026-05-03T23:38:00.000Z", + "updatedAt": "2026-05-03T23:39:00.000Z", "metadata": { "roundTrip": "rt-Workout-metadata" }, @@ -1200,8 +1207,8 @@ "sourceSystem": "PAPERLESS", "sourceId": "4711", "sourceInstance": "https://paperless.example.test", - "createdAt": "2026-05-04T01:25:00.000Z", - "updatedAt": "2026-05-04T01:26:00.000Z", + "createdAt": "2026-05-04T03:05:00.000Z", + "updatedAt": "2026-05-04T03:06:00.000Z", "contentEncrypted": "", "contentSha256": "0a738470f0945033965858e9895ee721ce981a25f013514d587d0a7a1946be7a", "contentCodec": "binary2", @@ -1260,8 +1267,8 @@ "allergiesEncrypted": "", "coachFocusEncrypted": "", "pendingQuestionsEncrypted": "", - "createdAt": "2026-05-03T03:35:00.000Z", - "updatedAt": "2026-05-03T03:36:00.000Z" + "createdAt": "2026-05-03T05:15:00.000Z", + "updatedAt": "2026-05-03T05:16:00.000Z" }, "healthProfileFacts": [ { @@ -1273,7 +1280,7 @@ "validUntil": "2026-06-30T12:34:56.789Z", "provenance": "USER_CORRECTION", "supersededByRevisionId": "", - "createdAt": "2026-05-03T05:08:00.000Z" + "createdAt": "2026-05-03T06:48:00.000Z" }, { "id": "", @@ -1284,14 +1291,14 @@ "validUntil": null, "provenance": "USER_REPORTED", "supersededByRevisionId": null, - "createdAt": "2026-05-03T05:08:01.000Z" + "createdAt": "2026-05-03T06:48:01.000Z" } ], "customMetrics": [ { "id": "", - "createdAt": "2026-05-03T15:09:00.000Z", - "updatedAt": "2026-05-03T15:10:00.000Z", + "createdAt": "2026-05-03T16:49:00.000Z", + "updatedAt": "2026-05-03T16:50:00.000Z", "deletedAt": null, "name": "Grip strength", "unit": "kg", @@ -1303,7 +1310,7 @@ "entries": [ { "id": "", - "createdAt": "2026-05-03T16:48:02.000Z", + "createdAt": "2026-05-03T18:28:02.000Z", "deletedAt": "", "noteEncrypted": null, "value": 40, @@ -1313,7 +1320,7 @@ }, { "id": "", - "createdAt": "2026-05-03T16:48:00.000Z", + "createdAt": "2026-05-03T18:28:00.000Z", "deletedAt": null, "noteEncrypted": null, "value": 44, @@ -1323,7 +1330,7 @@ }, { "id": "", - "createdAt": "2026-05-03T16:48:01.000Z", + "createdAt": "2026-05-03T18:28:01.000Z", "deletedAt": null, "noteEncrypted": "", "value": 45, @@ -1335,8 +1342,8 @@ }, { "id": "", - "createdAt": "2026-05-03T15:09:01.000Z", - "updatedAt": "2026-05-03T15:10:01.000Z", + "createdAt": "2026-05-03T16:49:01.000Z", + "updatedAt": "2026-05-03T16:50:01.000Z", "deletedAt": "", "name": "Plank (deleted)", "unit": "s", @@ -1351,8 +1358,8 @@ "correlationPatterns": [ { "id": "", - "updatedAt": "2026-05-03T18:39:00.000Z", - "createdAt": "2026-05-03T18:38:00.000Z", + "updatedAt": "2026-05-03T20:19:00.000Z", + "createdAt": "2026-05-03T20:18:00.000Z", "canonicalKey": "p1:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "family": "sleep", "factorKey": "sleep_duration", @@ -1441,7 +1448,7 @@ "healthScoreRecords": [ { "id": "", - "createdAt": "2026-05-03T20:13:00.000Z", + "createdAt": "2026-05-03T21:53:00.000Z", "dayKey": "2026-07-01", "timezone": "Europe/Berlin", "composite": 71, @@ -1458,13 +1465,13 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z" } ], "onboardingRecord": { "id": "", - "createdAt": "2026-05-06T11:27:00.000Z", - "updatedAt": "2026-05-06T11:28:00.000Z", + "createdAt": "2026-05-06T13:07:00.000Z", + "updatedAt": "2026-05-06T13:08:00.000Z", "needs": { "recordTarget": "me", "areas": [ @@ -1538,8 +1545,8 @@ "locationEncrypted": null, "phoneEncrypted": null, "noteEncrypted": null, - "createdAt": "2026-05-04T02:50:01.000Z", - "updatedAt": "2026-05-04T02:51:01.000Z", + "createdAt": "2026-05-04T04:30:01.000Z", + "updatedAt": "2026-05-04T04:31:01.000Z", "deletedAt": "" }, { @@ -1552,8 +1559,8 @@ "locationEncrypted": "", "phoneEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z", + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z", "deletedAt": null } ], @@ -1569,8 +1576,8 @@ "bodySiteEncrypted": "", "laterality": "LEFT", "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z", + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z", "deletedAt": null }, { @@ -1584,8 +1591,8 @@ "bodySiteEncrypted": null, "laterality": null, "reminderId": null, - "createdAt": "2026-05-04T04:31:01.000Z", - "updatedAt": "2026-05-04T04:32:01.000Z", + "createdAt": "2026-05-04T06:11:01.000Z", + "updatedAt": "2026-05-04T06:12:01.000Z", "deletedAt": "" } ], @@ -1593,21 +1600,21 @@ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T06:04:00.000Z" + "createdAt": "2026-05-04T07:44:00.000Z" } ], "encounterLabLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T07:44:00.000Z" + "createdAt": "2026-05-04T09:24:00.000Z" } ], "encounterConditionLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T09:24:00.000Z" + "createdAt": "2026-05-04T11:04:00.000Z" } ], "customVaccines": [ @@ -1619,8 +1626,8 @@ ], "typicalSeriesDoses": null, "boosterIntervalMonths": null, - "createdAt": "2026-05-04T14:27:01.000Z", - "updatedAt": "2026-05-04T14:28:01.000Z", + "createdAt": "2026-05-04T16:07:01.000Z", + "updatedAt": "2026-05-04T16:08:01.000Z", "deletedAt": "" }, { @@ -1632,8 +1639,8 @@ ], "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z", + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z", "deletedAt": null } ], @@ -1652,8 +1659,8 @@ "reminderId": "", "customVaccineId": "", "noteEncrypted": "", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z", + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z", "deletedAt": null }, { @@ -1670,8 +1677,8 @@ "reminderId": null, "customVaccineId": null, "noteEncrypted": null, - "createdAt": "2026-05-04T11:14:01.000Z", - "updatedAt": "2026-05-04T11:15:01.000Z", + "createdAt": "2026-05-04T12:54:01.000Z", + "updatedAt": "2026-05-04T12:55:01.000Z", "deletedAt": "" } ], @@ -1679,7 +1686,7 @@ { "vaccinationId": "", "targetId": "", - "createdAt": "2026-05-04T12:44:00.000Z" + "createdAt": "2026-05-04T14:24:00.000Z" } ], "measurementReminders": [ @@ -1701,8 +1708,8 @@ "snoozedUntil": "2026-07-08T06:00:00.000Z", "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z", + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z", "deletedAt": null }, { @@ -1723,8 +1730,8 @@ "snoozedUntil": null, "lastSkippedAt": null, "skipCount": 0, - "createdAt": "2026-05-04T16:19:01.000Z", - "updatedAt": "2026-05-04T16:20:01.000Z", + "createdAt": "2026-05-04T17:59:01.000Z", + "updatedAt": "2026-05-04T18:00:01.000Z", "deletedAt": "" } ], @@ -1736,7 +1743,7 @@ "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" }, { "id": "", @@ -1745,7 +1752,7 @@ "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" } ], "coachConversations": [ @@ -1756,8 +1763,8 @@ "summaryEncrypted": "", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "messages": [ { "id": "", @@ -1795,8 +1802,8 @@ "summaryEncrypted": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "messages": [ { "id": "", @@ -1831,8 +1838,8 @@ "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", "sourceMessageId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z" + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z" }, { "id": "", @@ -1844,8 +1851,8 @@ "source": "user", "lastUsedAt": null, "sourceMessageId": null, - "createdAt": "2026-05-05T00:26:01.000Z", - "updatedAt": "2026-05-05T00:27:01.000Z" + "createdAt": "2026-05-05T02:06:01.000Z", + "updatedAt": "2026-05-05T02:07:01.000Z" } ], "coachPlans": [ @@ -1860,8 +1867,8 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z" + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z" }, { "id": "", @@ -1874,8 +1881,8 @@ "status": "active", "reviewDate": null, "sourceConversationId": null, - "createdAt": "2026-05-05T02:10:01.000Z", - "updatedAt": "2026-05-05T02:11:01.000Z" + "createdAt": "2026-05-05T03:50:01.000Z", + "updatedAt": "2026-05-05T03:51:01.000Z" } ], "coachReminders": [ @@ -1893,8 +1900,8 @@ "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z" + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z" }, { "id": "", @@ -1910,8 +1917,8 @@ "sourceConversationId": null, "lastSurfacedAt": null, "surfaceCount": 0, - "createdAt": "2026-05-05T03:53:01.000Z", - "updatedAt": "2026-05-05T03:54:01.000Z" + "createdAt": "2026-05-05T05:33:01.000Z", + "updatedAt": "2026-05-05T05:34:01.000Z" } ], "mentalHealthAssessments": [ @@ -1932,8 +1939,8 @@ "externalId": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-05T13:57:01.000Z", - "updatedAt": "2026-05-05T13:58:01.000Z" + "createdAt": "2026-05-05T15:37:01.000Z", + "updatedAt": "2026-05-05T15:38:01.000Z" }, { "id": "", @@ -1952,8 +1959,8 @@ "externalId": "rt-MentalHealthAssessment-externalId", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-05T13:57:00.000Z", - "updatedAt": "2026-05-05T13:58:00.000Z" + "createdAt": "2026-05-05T15:37:00.000Z", + "updatedAt": "2026-05-05T15:38:00.000Z" } ], "consentReceipts": [ @@ -1963,7 +1970,7 @@ "artefact": "JVBERi0xLjQKJWZpeHR1cmU=", "signedAt": "2026-06-01T09:00:00.000Z", "revokedAt": null, - "createdAt": "2026-05-05T15:26:00.000Z" + "createdAt": "2026-05-05T17:06:00.000Z" }, { "id": "", @@ -1971,7 +1978,7 @@ "artefact": "eyJhbGciOiJub25lIn0.e30.", "signedAt": "2026-06-02T09:00:00.000Z", "revokedAt": "2026-07-10T11:00:00.000Z", - "createdAt": "2026-05-05T15:26:01.000Z" + "createdAt": "2026-05-05T17:06:01.000Z" } ], "documentConditionLinks": [ @@ -1993,8 +2000,8 @@ "committedRecordType": "labResult", "dataEncrypted": "", "provenanceEncrypted": "", - "createdAt": "2026-05-05T18:51:00.000Z", - "updatedAt": "2026-05-05T18:52:00.000Z" + "createdAt": "2026-05-05T20:31:00.000Z", + "updatedAt": "2026-05-05T20:32:00.000Z" } ], "documentImportKeys": [ @@ -2016,7 +2023,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { "metricType": "WALKING_RUNNING_DISTANCE", @@ -2028,7 +2035,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { "metricType": "WEIGHT", @@ -2040,19 +2047,19 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "userAchievements": [ { "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" }, { "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" } ], "environmentContexts": [ @@ -2098,8 +2105,8 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { "date": "2026-07-01", @@ -2143,8 +2150,8 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "environmentTravelLocations": [ @@ -2155,8 +2162,8 @@ "lon": null, "label": null, "locationEncrypted": "", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "dawarichDays": [ @@ -2171,8 +2178,8 @@ "countryCodeEncrypted": "", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "ecgRecordings": [ @@ -2189,8 +2196,8 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "symptomDefinitions": [ @@ -2200,8 +2207,8 @@ "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z", + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z", "events": [ { "id": "", @@ -2209,8 +2216,8 @@ "occurredAt": "2026-06-21T09:00:00.000Z", "intensity": 4, "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "id": "", @@ -2218,8 +2225,8 @@ "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ] }, @@ -2229,8 +2236,8 @@ "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z", + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z", "events": [ { "id": "", @@ -2238,8 +2245,8 @@ "occurredAt": "2026-06-21T11:00:00.000Z", "intensity": 8, "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" } ] } @@ -2253,8 +2260,8 @@ "startDate": "2023-09-01", "endDate": null, "precision": "MONTH", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z", + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z", "deletedAt": null }, { @@ -2265,8 +2272,8 @@ "startDate": "2025-12-01", "endDate": null, "precision": "DAY", - "createdAt": "2026-05-03T01:48:02.000Z", - "updatedAt": "2026-05-03T01:49:02.000Z", + "createdAt": "2026-05-03T03:28:02.000Z", + "updatedAt": "2026-05-03T03:29:02.000Z", "deletedAt": "" }, { @@ -2277,8 +2284,8 @@ "startDate": "2026-03-02", "endDate": "2026-05-29", "precision": "DAY", - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z", + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z", "deletedAt": null } ], @@ -2286,35 +2293,35 @@ { "labResultId": "", "documentId": "", - "createdAt": "2026-05-06T16:24:00.000Z" + "createdAt": "2026-05-06T18:04:00.000Z" } ], "encounterMedicationLinks": [ { "encounterId": "", "medicationId": "", - "createdAt": "2026-05-06T18:04:00.000Z" + "createdAt": "2026-05-06T19:44:00.000Z" } ], "encounterVaccinationLinks": [ { "encounterId": "", "vaccinationId": "", - "createdAt": "2026-05-06T19:44:00.000Z" + "createdAt": "2026-05-06T21:24:00.000Z" } ], "medicationDocumentLinks": [ { "medicationId": "", "documentId": "", - "createdAt": "2026-05-06T21:24:00.000Z" + "createdAt": "2026-05-06T23:04:00.000Z" } ], "medicationConditionLinks": [ { "medicationId": "", "episodeId": "", - "createdAt": "2026-05-06T23:04:00.000Z" + "createdAt": "2026-05-07T00:44:00.000Z" } ], "nutrientDays": [ @@ -2325,8 +2332,8 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z", - "updatedAt": "2026-05-03T23:28:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z", + "updatedAt": "2026-05-04T01:08:00.000Z" } ] }, @@ -2349,6 +2356,7 @@ "cycleDayLogs": 2, "nutrientDays": 1, "labResults": 2, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 4, "illnessDayLogs": 2, @@ -2413,6 +2421,7 @@ "cycleDayLogs": 2, "nutrientDays": 1, "labResults": 2, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 4, "illnessDayLogs": 2, @@ -2904,15 +2913,15 @@ "unitsTotal": "30", "unitsRemaining": "21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", "notes": "rt-MedicationInventoryItem-notes", "notesEncrypted": "", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { "id": "", @@ -2928,8 +2937,8 @@ "doseStrength": null, "notes": null, "notesEncrypted": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "inventoryEvents": [ @@ -2963,8 +2972,8 @@ "measurementType": "WEIGHT", "biomarkerName": "Ferritin", "primary": false, - "createdAt": "2026-05-06T08:05:00.000Z", - "updatedAt": "2026-05-06T08:06:00.000Z" + "createdAt": "2026-05-06T09:45:00.000Z", + "updatedAt": "2026-05-06T09:46:00.000Z" } ], "scheduleRevisions": [ @@ -2981,7 +2990,7 @@ ], "source": "ARCHIVED", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { "id": "", @@ -2996,7 +3005,7 @@ ], "source": "ARCHIVED", "supersededByIndex": 2, - "createdAt": "2026-05-06T06:27:02.000Z" + "createdAt": "2026-05-06T08:07:02.000Z" }, { "id": "", @@ -3011,7 +3020,7 @@ ], "source": "MANUAL", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "courses": [ @@ -3192,8 +3201,8 @@ "rawChartMode": true, "discreetNotifications": true, "sensitiveCategoryEncryption": false, - "createdAt": "2026-05-03T06:52:00.000Z", - "updatedAt": "2026-05-03T06:53:00.000Z" + "createdAt": "2026-05-03T08:32:00.000Z", + "updatedAt": "2026-05-03T08:33:00.000Z" }, "cycles": [ { @@ -3209,8 +3218,8 @@ "syncVersion": 0, "deletedAt": "", "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:02.000Z", - "updatedAt": "2026-05-03T08:34:02.000Z" + "createdAt": "2026-05-03T10:13:02.000Z", + "updatedAt": "2026-05-03T10:14:02.000Z" }, { "id": "", @@ -3225,8 +3234,8 @@ "syncVersion": 3, "deletedAt": null, "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:00.000Z", - "updatedAt": "2026-05-03T08:34:00.000Z" + "createdAt": "2026-05-03T10:13:00.000Z", + "updatedAt": "2026-05-03T10:14:00.000Z" }, { "id": "", @@ -3241,8 +3250,8 @@ "syncVersion": 0, "deletedAt": "2026-06-04T07:00:00.000Z", "absorbedIntoId": "", - "createdAt": "2026-05-03T08:33:01.000Z", - "updatedAt": "2026-05-03T08:34:01.000Z" + "createdAt": "2026-05-03T10:13:01.000Z", + "updatedAt": "2026-05-03T10:14:01.000Z" } ], "cycleDayLogs": [ @@ -3271,8 +3280,8 @@ "tz": "rt-CycleDayLog-tz", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-03T10:25:00.000Z", - "updatedAt": "2026-05-03T10:26:00.000Z", + "createdAt": "2026-05-03T12:05:00.000Z", + "updatedAt": "2026-05-03T12:06:00.000Z", "symptomKeys": [ "custom:round-trip-cramps" ], @@ -3285,7 +3294,7 @@ "symptomLinkCreatedAt": [ { "key": "custom:round-trip-cramps", - "createdAt": "2026-05-03T13:23:00.000Z" + "createdAt": "2026-05-03T15:03:00.000Z" } ] }, @@ -3314,8 +3323,8 @@ "tz": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-03T10:25:01.000Z", - "updatedAt": "2026-05-03T10:26:01.000Z", + "createdAt": "2026-05-03T12:05:01.000Z", + "updatedAt": "2026-05-03T12:06:01.000Z", "symptomKeys": [], "symptomSeverities": [], "symptomLinkCreatedAt": [] @@ -3347,7 +3356,7 @@ "hiddenMoodTags": [ { "key": "grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "customMoodTags": [ @@ -3435,11 +3444,11 @@ "id": "", "name": "Ferr.", "source": "IMPORT_CHOICE", - "createdAt": "2026-05-06T13:06:00.000Z" + "createdAt": "2026-05-06T14:46:00.000Z" } ], - "createdAt": "2026-05-02T12:30:00.000Z", - "updatedAt": "2026-05-02T12:31:00.000Z" + "createdAt": "2026-05-02T14:10:00.000Z", + "updatedAt": "2026-05-02T14:11:00.000Z" } ], "biomarkerMerges": [ @@ -3450,7 +3459,14 @@ "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" + } + ], + "labResultImportKeys": [ + { + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" } ], "illnessEpisodes": [ @@ -3463,13 +3479,13 @@ "resolvedAt": null, "parentConditionId": "", "note": null, - "createdAt": "2026-05-02T17:31:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", "noteEncrypted": null, "bodySite": null, "bodySiteEncrypted": null, "laterality": null, "deletedAt": null, - "updatedAt": "2026-05-02T17:32:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "dayLogs": [] }, { @@ -3481,13 +3497,13 @@ "resolvedAt": "2026-06-30T12:34:56.789Z", "parentConditionId": null, "note": null, - "createdAt": "2026-05-02T17:31:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", "noteEncrypted": "", "bodySite": null, "bodySiteEncrypted": null, "laterality": null, "deletedAt": null, - "updatedAt": "2026-05-02T17:32:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "dayLogs": [ { "id": "", @@ -3499,14 +3515,14 @@ { "key": "round_trip_cough", "severity": 2, - "createdAt": "2026-05-02T20:43:00.000Z" + "createdAt": "2026-05-02T22:23:00.000Z" } ], "note": null, - "updatedAt": "2026-05-02T19:09:00.000Z", + "updatedAt": "2026-05-02T20:49:00.000Z", "noteEncrypted": "", "tz": "rt-IllnessDayLog-tz", - "createdAt": "2026-05-02T19:08:00.000Z", + "createdAt": "2026-05-02T20:48:00.000Z", "deletedAt": null }, { @@ -3517,10 +3533,10 @@ "feverC": null, "symptoms": [], "note": null, - "updatedAt": "2026-05-02T19:09:01.000Z", + "updatedAt": "2026-05-02T20:49:01.000Z", "noteEncrypted": null, "tz": null, - "createdAt": "2026-05-02T19:08:01.000Z", + "createdAt": "2026-05-02T20:48:01.000Z", "deletedAt": "" } ] @@ -3534,13 +3550,13 @@ "resolvedAt": null, "parentConditionId": null, "note": null, - "createdAt": "2026-05-02T17:31:02.000Z", + "createdAt": "2026-05-02T19:11:02.000Z", "noteEncrypted": null, "bodySite": null, "bodySiteEncrypted": null, "laterality": null, "deletedAt": "", - "updatedAt": "2026-05-02T17:32:02.000Z", + "updatedAt": "2026-05-02T19:12:02.000Z", "dayLogs": [] }, { @@ -3552,13 +3568,13 @@ "resolvedAt": null, "parentConditionId": null, "note": null, - "createdAt": "2026-05-02T17:31:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", "noteEncrypted": null, "bodySite": null, "bodySiteEncrypted": "", "laterality": "BOTH", "deletedAt": null, - "updatedAt": "2026-05-02T17:32:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "dayLogs": [] } ], @@ -3569,8 +3585,8 @@ "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z", + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z", "events": [ { "id": "", @@ -3578,8 +3594,8 @@ "intensity": 4, "noteEncrypted": null, "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "id": "", @@ -3587,8 +3603,8 @@ "intensity": 2, "noteEncrypted": null, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ] }, @@ -3598,8 +3614,8 @@ "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z", + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z", "events": [ { "id": "", @@ -3607,8 +3623,8 @@ "intensity": 8, "noteEncrypted": "", "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" } ] } @@ -3622,8 +3638,8 @@ "precision": "MONTH", "titleEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z", + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z", "deletedAt": null }, { @@ -3634,8 +3650,8 @@ "precision": "DAY", "titleEncrypted": "", "noteEncrypted": null, - "createdAt": "2026-05-03T01:48:02.000Z", - "updatedAt": "2026-05-03T01:49:02.000Z", + "createdAt": "2026-05-03T03:28:02.000Z", + "updatedAt": "2026-05-03T03:29:02.000Z", "deletedAt": "" }, { @@ -3646,8 +3662,8 @@ "precision": "DAY", "titleEncrypted": "", "noteEncrypted": null, - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z", + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z", "deletedAt": null } ], @@ -3662,11 +3678,11 @@ "onsetAt": null, "reaction": null, "note": null, - "createdAt": "2026-05-02T14:10:01.000Z", + "createdAt": "2026-05-02T15:50:01.000Z", "reactionEncrypted": null, "notesEncrypted": null, "deletedAt": "", - "updatedAt": "2026-05-02T14:11:01.000Z" + "updatedAt": "2026-05-02T15:51:01.000Z" }, { "id": "", @@ -3678,11 +3694,11 @@ "onsetAt": "2026-06-30T12:34:56.789Z", "reaction": null, "note": null, - "createdAt": "2026-05-02T14:10:00.000Z", + "createdAt": "2026-05-02T15:50:00.000Z", "reactionEncrypted": "", "notesEncrypted": "", "deletedAt": null, - "updatedAt": "2026-05-02T14:11:00.000Z" + "updatedAt": "2026-05-02T15:51:00.000Z" } ], "familyHistory": [ @@ -3693,8 +3709,8 @@ "ageAtOnset": null, "note": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:01.000Z", - "updatedAt": "2026-05-02T15:47:01.000Z", + "createdAt": "2026-05-02T17:26:01.000Z", + "updatedAt": "2026-05-02T17:27:01.000Z", "deletedAt": "" }, { @@ -3704,8 +3720,8 @@ "ageAtOnset": 3, "note": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z", + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z", "deletedAt": null } ], @@ -3730,8 +3746,8 @@ "metadata": { "roundTrip": "rt-Workout-metadata" }, - "createdAt": "2026-05-03T21:58:00.000Z", - "updatedAt": "2026-05-03T21:59:00.000Z" + "createdAt": "2026-05-03T23:38:00.000Z", + "updatedAt": "2026-05-03T23:39:00.000Z" } ], "documents": [ @@ -3760,8 +3776,8 @@ "sourceInstance": "https://paperless.example.test", "aiReadDeferred": true, "extractionIncomplete": true, - "createdAt": "2026-05-04T01:25:00.000Z", - "updatedAt": "2026-05-04T01:26:00.000Z" + "createdAt": "2026-05-04T03:05:00.000Z", + "updatedAt": "2026-05-04T03:06:00.000Z" } ], "documentConditionLinks": [ @@ -3783,8 +3799,8 @@ "committedRecordType": "labResult", "dataEncrypted": "", "provenanceEncrypted": "", - "createdAt": "2026-05-05T18:51:00.000Z", - "updatedAt": "2026-05-05T18:52:00.000Z" + "createdAt": "2026-05-05T20:31:00.000Z", + "updatedAt": "2026-05-05T20:32:00.000Z" } ], "documentImportKeys": [ @@ -3803,8 +3819,8 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z", - "updatedAt": "2026-05-03T23:28:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z", + "updatedAt": "2026-05-04T01:08:00.000Z" } ], "healthProfile": { @@ -3833,8 +3849,8 @@ "allergiesEncrypted": "", "coachFocusEncrypted": "", "pendingQuestionsEncrypted": "", - "createdAt": "2026-05-03T03:35:00.000Z", - "updatedAt": "2026-05-03T03:36:00.000Z" + "createdAt": "2026-05-03T05:15:00.000Z", + "updatedAt": "2026-05-03T05:16:00.000Z" }, "healthProfileFacts": [ { @@ -3846,7 +3862,7 @@ "validUntil": "2026-06-30T12:34:56.789Z", "provenance": "USER_CORRECTION", "supersededByRevisionId": "", - "createdAt": "2026-05-03T05:08:00.000Z" + "createdAt": "2026-05-03T06:48:00.000Z" }, { "id": "", @@ -3857,7 +3873,7 @@ "validUntil": null, "provenance": "USER_REPORTED", "supersededByRevisionId": null, - "createdAt": "2026-05-03T05:08:01.000Z" + "createdAt": "2026-05-03T06:48:01.000Z" } ], "customMetrics": [ @@ -3870,8 +3886,8 @@ "decimals": 3, "description": "rt-CustomMetric-description", "correlationEnabled": true, - "createdAt": "2026-05-03T15:09:00.000Z", - "updatedAt": "2026-05-03T15:10:00.000Z", + "createdAt": "2026-05-03T16:49:00.000Z", + "updatedAt": "2026-05-03T16:50:00.000Z", "deletedAt": null, "entries": [ { @@ -3881,7 +3897,7 @@ "measuredAt": "2026-06-28T18:00:00.000Z", "note": null, "noteEncrypted": null, - "createdAt": "2026-05-03T16:48:02.000Z", + "createdAt": "2026-05-03T18:28:02.000Z", "deletedAt": "" }, { @@ -3891,7 +3907,7 @@ "measuredAt": "2026-07-01T18:00:00.000Z", "note": "left hand, after the long ride", "noteEncrypted": null, - "createdAt": "2026-05-03T16:48:00.000Z", + "createdAt": "2026-05-03T18:28:00.000Z", "deletedAt": null }, { @@ -3901,7 +3917,7 @@ "measuredAt": "2026-07-02T18:00:00.000Z", "note": null, "noteEncrypted": "", - "createdAt": "2026-05-03T16:48:01.000Z", + "createdAt": "2026-05-03T18:28:01.000Z", "deletedAt": null } ] @@ -3915,8 +3931,8 @@ "decimals": null, "description": null, "correlationEnabled": false, - "createdAt": "2026-05-03T15:09:01.000Z", - "updatedAt": "2026-05-03T15:10:01.000Z", + "createdAt": "2026-05-03T16:49:01.000Z", + "updatedAt": "2026-05-03T16:50:01.000Z", "deletedAt": "", "entries": [] } @@ -3940,8 +3956,8 @@ "dismissedEvidenceHash": "abababababababababababababababababababababababababababababababab", "dismissedEffectSize": 2.5, "dismissedSampleSize": 3, - "createdAt": "2026-05-03T18:38:00.000Z", - "updatedAt": "2026-05-03T18:39:00.000Z" + "createdAt": "2026-05-03T20:18:00.000Z", + "updatedAt": "2026-05-03T20:19:00.000Z" } ], "intradayProfiles": [ @@ -4029,8 +4045,8 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z", - "createdAt": "2026-05-03T20:13:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z", + "createdAt": "2026-05-03T21:53:00.000Z" } ], "onboardingRecord": { @@ -4096,8 +4112,8 @@ }, "modulesDerivedAt": "2026-07-01T08:00:00.000Z", "completedAt": "2026-07-01T08:00:00.000Z", - "createdAt": "2026-05-06T11:27:00.000Z", - "updatedAt": "2026-05-06T11:28:00.000Z" + "createdAt": "2026-05-06T13:07:00.000Z", + "updatedAt": "2026-05-06T13:08:00.000Z" }, "practitioners": [ { @@ -4110,8 +4126,8 @@ "locationEncrypted": null, "phoneEncrypted": null, "noteEncrypted": null, - "createdAt": "2026-05-04T02:50:01.000Z", - "updatedAt": "2026-05-04T02:51:01.000Z", + "createdAt": "2026-05-04T04:30:01.000Z", + "updatedAt": "2026-05-04T04:31:01.000Z", "deletedAt": "" }, { @@ -4124,8 +4140,8 @@ "locationEncrypted": "", "phoneEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z", + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z", "deletedAt": null } ], @@ -4141,8 +4157,8 @@ "bodySiteEncrypted": "", "laterality": "LEFT", "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z", + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z", "deletedAt": null }, { @@ -4156,8 +4172,8 @@ "bodySiteEncrypted": null, "laterality": null, "reminderId": null, - "createdAt": "2026-05-04T04:31:01.000Z", - "updatedAt": "2026-05-04T04:32:01.000Z", + "createdAt": "2026-05-04T06:11:01.000Z", + "updatedAt": "2026-05-04T06:12:01.000Z", "deletedAt": "" } ], @@ -4165,21 +4181,21 @@ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T06:04:00.000Z" + "createdAt": "2026-05-04T07:44:00.000Z" } ], "encounterLabLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T07:44:00.000Z" + "createdAt": "2026-05-04T09:24:00.000Z" } ], "encounterConditionLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T09:24:00.000Z" + "createdAt": "2026-05-04T11:04:00.000Z" } ], "customVaccines": [ @@ -4191,8 +4207,8 @@ ], "typicalSeriesDoses": null, "boosterIntervalMonths": null, - "createdAt": "2026-05-04T14:27:01.000Z", - "updatedAt": "2026-05-04T14:28:01.000Z", + "createdAt": "2026-05-04T16:07:01.000Z", + "updatedAt": "2026-05-04T16:08:01.000Z", "deletedAt": "" }, { @@ -4204,8 +4220,8 @@ ], "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z", + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z", "deletedAt": null } ], @@ -4224,8 +4240,8 @@ "reminderId": "", "customVaccineId": "", "noteEncrypted": "", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z", + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z", "deletedAt": null }, { @@ -4242,8 +4258,8 @@ "reminderId": null, "customVaccineId": null, "noteEncrypted": null, - "createdAt": "2026-05-04T11:14:01.000Z", - "updatedAt": "2026-05-04T11:15:01.000Z", + "createdAt": "2026-05-04T12:54:01.000Z", + "updatedAt": "2026-05-04T12:55:01.000Z", "deletedAt": "" } ], @@ -4251,42 +4267,42 @@ { "vaccinationId": "", "targetId": "", - "createdAt": "2026-05-04T12:44:00.000Z" + "createdAt": "2026-05-04T14:24:00.000Z" } ], "labResultDocumentLinks": [ { "labResultId": "", "documentId": "", - "createdAt": "2026-05-06T16:24:00.000Z" + "createdAt": "2026-05-06T18:04:00.000Z" } ], "encounterMedicationLinks": [ { "encounterId": "", "medicationId": "", - "createdAt": "2026-05-06T18:04:00.000Z" + "createdAt": "2026-05-06T19:44:00.000Z" } ], "encounterVaccinationLinks": [ { "encounterId": "", "vaccinationId": "", - "createdAt": "2026-05-06T19:44:00.000Z" + "createdAt": "2026-05-06T21:24:00.000Z" } ], "medicationDocumentLinks": [ { "medicationId": "", "documentId": "", - "createdAt": "2026-05-06T21:24:00.000Z" + "createdAt": "2026-05-06T23:04:00.000Z" } ], "medicationConditionLinks": [ { "medicationId": "", "episodeId": "", - "createdAt": "2026-05-06T23:04:00.000Z" + "createdAt": "2026-05-07T00:44:00.000Z" } ], "coachConversations": [ @@ -4297,8 +4313,8 @@ "summaryEncrypted": "", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "messages": [ { "id": "", @@ -4336,8 +4352,8 @@ "summaryEncrypted": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "messages": [ { "id": "", @@ -4379,8 +4395,8 @@ "externalId": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-05T13:57:01.000Z", - "updatedAt": "2026-05-05T13:58:01.000Z" + "createdAt": "2026-05-05T15:37:01.000Z", + "updatedAt": "2026-05-05T15:38:01.000Z" }, { "id": "", @@ -4399,8 +4415,8 @@ "externalId": "rt-MentalHealthAssessment-externalId", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-05T13:57:00.000Z", - "updatedAt": "2026-05-05T13:58:00.000Z" + "createdAt": "2026-05-05T15:37:00.000Z", + "updatedAt": "2026-05-05T15:38:00.000Z" } ], "consentReceipts": [ @@ -4410,7 +4426,7 @@ "artefact": "JVBERi0xLjQKJWZpeHR1cmU=", "signedAt": "2026-06-01T09:00:00.000Z", "revokedAt": null, - "createdAt": "2026-05-05T15:26:00.000Z" + "createdAt": "2026-05-05T17:06:00.000Z" }, { "id": "", @@ -4418,7 +4434,7 @@ "artefact": "eyJhbGciOiJub25lIn0.e30.", "signedAt": "2026-06-02T09:00:00.000Z", "revokedAt": "2026-07-10T11:00:00.000Z", - "createdAt": "2026-05-05T15:26:01.000Z" + "createdAt": "2026-05-05T17:06:01.000Z" } ], "coachFacts": [ @@ -4431,8 +4447,8 @@ "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", "sourceMessageId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z", + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z", "deletedAt": null }, { @@ -4444,8 +4460,8 @@ "source": "user", "lastUsedAt": null, "sourceMessageId": null, - "createdAt": "2026-05-05T00:26:01.000Z", - "updatedAt": "2026-05-05T00:27:01.000Z", + "createdAt": "2026-05-05T02:06:01.000Z", + "updatedAt": "2026-05-05T02:07:01.000Z", "deletedAt": "" } ], @@ -4460,8 +4476,8 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z", + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z", "deletedAt": null }, { @@ -4474,8 +4490,8 @@ "status": "active", "reviewDate": null, "sourceConversationId": null, - "createdAt": "2026-05-05T02:10:01.000Z", - "updatedAt": "2026-05-05T02:11:01.000Z", + "createdAt": "2026-05-05T03:50:01.000Z", + "updatedAt": "2026-05-05T03:51:01.000Z", "deletedAt": "" } ], @@ -4493,8 +4509,8 @@ "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z", + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z", "deletedAt": null }, { @@ -4510,8 +4526,8 @@ "sourceConversationId": null, "lastSurfacedAt": null, "surfaceCount": 0, - "createdAt": "2026-05-05T03:53:01.000Z", - "updatedAt": "2026-05-05T03:54:01.000Z", + "createdAt": "2026-05-05T05:33:01.000Z", + "updatedAt": "2026-05-05T05:34:01.000Z", "deletedAt": "" } ], @@ -4534,8 +4550,8 @@ "snoozedUntil": "2026-07-08T06:00:00.000Z", "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z", + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z", "deletedAt": null }, { @@ -4556,8 +4572,8 @@ "snoozedUntil": null, "lastSkippedAt": null, "skipCount": 0, - "createdAt": "2026-05-04T16:19:01.000Z", - "updatedAt": "2026-05-04T16:20:01.000Z", + "createdAt": "2026-05-04T17:59:01.000Z", + "updatedAt": "2026-05-04T18:00:01.000Z", "deletedAt": "" } ], @@ -4569,7 +4585,7 @@ "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" }, { "id": "", @@ -4578,7 +4594,7 @@ "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" } ], "personalRecords": [ @@ -4592,7 +4608,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { "metricType": "WALKING_RUNNING_DISTANCE", @@ -4604,7 +4620,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { "metricType": "WEIGHT", @@ -4616,19 +4632,19 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "userAchievements": [ { "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" }, { "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" } ], "environmentContexts": [ @@ -4674,8 +4690,8 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { "date": "2026-07-01", @@ -4719,8 +4735,8 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "environmentTravelLocations": [ @@ -4731,8 +4747,8 @@ "lon": null, "label": null, "locationEncrypted": "", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "dawarichDays": [ @@ -4747,8 +4763,8 @@ "countryCodeEncrypted": "", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "ecgRecordings": [ @@ -4765,8 +4781,8 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "manifest": { @@ -4804,6 +4820,7 @@ "cycleDayLogs": 2, "nutrientDays": 1, "labResults": 2, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 4, "illnessDayLogs": 2, @@ -4860,6 +4877,7 @@ "cycles": 3, "cycleDayLogs": 2, "labResults": 2, + "labResultImportKeys": 1, "nutrientDays": 1, "biomarkers": 1, "illnessEpisodes": 4, diff --git a/tests/integration/__golden__/backup-parity/export-portable.json b/tests/integration/__golden__/backup-parity/export-portable.json index 3fe337696..1edab2579 100644 --- a/tests/integration/__golden__/backup-parity/export-portable.json +++ b/tests/integration/__golden__/backup-parity/export-portable.json @@ -294,13 +294,13 @@ "unitsTotal": "30", "unitsRemaining": "21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { "notes": null, @@ -314,8 +314,8 @@ "purchasedAt": null, "manufacturer": null, "doseStrength": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "phaseConfig": { @@ -353,7 +353,7 @@ ], "source": "ARCHIVED", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { "validFrom": "2026-02-01T00:00:00.000Z", @@ -367,7 +367,7 @@ ], "source": "ARCHIVED", "supersededByIndex": 2, - "createdAt": "2026-05-06T06:27:02.000Z" + "createdAt": "2026-05-06T08:07:02.000Z" }, { "validFrom": "2026-03-01T00:00:00.000Z", @@ -381,7 +381,7 @@ ], "source": "MANUAL", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "efficacyTargets": [ @@ -464,7 +464,7 @@ "hiddenMoodTags": [ { "key": "grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "customMoodTags": [ @@ -585,7 +585,14 @@ "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" + } + ], + "labResultImportKeys": [ + { + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" } ], "illnessEpisodes": [ @@ -600,8 +607,8 @@ "note": null, "bodySite": null, "laterality": null, - "createdAt": "2026-05-02T17:31:03.000Z", - "updatedAt": "2026-05-02T17:32:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "dayLogs": [] }, { @@ -615,8 +622,8 @@ "note": "rt-IllnessEpisode-noteEncrypted", "bodySite": null, "laterality": null, - "createdAt": "2026-05-02T17:31:00.000Z", - "updatedAt": "2026-05-02T17:32:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "dayLogs": [ { "id": "", @@ -631,7 +638,7 @@ } ], "note": "rt-IllnessDayLog-noteEncrypted", - "updatedAt": "2026-05-02T19:09:00.000Z" + "updatedAt": "2026-05-02T20:49:00.000Z" } ] }, @@ -646,8 +653,8 @@ "note": null, "bodySite": "Stomach", "laterality": "BOTH", - "createdAt": "2026-05-02T17:31:01.000Z", - "updatedAt": "2026-05-02T17:32:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "dayLogs": [] } ], @@ -662,8 +669,8 @@ "onsetAt": "2026-06-30T12:34:56.789Z", "reaction": "rt-Allergy-reactionEncrypted", "note": "rt-Allergy-notesEncrypted", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z" + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z" } ], "familyHistory": [ @@ -673,8 +680,8 @@ "condition": "Type 2 diabetes", "ageAtOnset": 3, "note": "rt-FamilyHistoryEntry-notesEncrypted", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z" + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z" } ], "workouts": [ @@ -709,7 +716,7 @@ "sourceSystem": "PAPERLESS", "sourceId": "4711", "sourceInstance": "https://paperless.example.test", - "createdAt": "2026-05-04T01:25:00.000Z", + "createdAt": "2026-05-04T03:05:00.000Z", "summary": "rt-InboundDocument-summaryEncrypted" } ], @@ -777,7 +784,7 @@ ], "correlationPatterns": [ { - "createdAt": "2026-05-03T18:38:00.000Z", + "createdAt": "2026-05-03T20:18:00.000Z", "canonicalKey": "p1:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "family": "sleep", "factorKey": "sleep_duration", @@ -878,7 +885,7 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z" } ], "onboardingRecord": { @@ -953,8 +960,8 @@ "location": "rt-Practitioner-locationEncrypted", "phone": "rt-Practitioner-phoneEncrypted", "note": "ring the upper bell", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z" + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z" } ], "encounters": [ @@ -969,29 +976,29 @@ "bodySite": "rt-Encounter-bodySiteEncrypted", "laterality": "LEFT", "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z" + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z" } ], "encounterDocumentLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T06:04:00.000Z" + "createdAt": "2026-05-04T07:44:00.000Z" } ], "encounterLabLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T07:44:00.000Z" + "createdAt": "2026-05-04T09:24:00.000Z" } ], "encounterConditionLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T09:24:00.000Z" + "createdAt": "2026-05-04T11:04:00.000Z" } ], "customVaccines": [ @@ -1004,8 +1011,8 @@ ], "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z" + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z" } ], "vaccinations": [ @@ -1023,15 +1030,15 @@ "reminderId": "", "customVaccineId": "", "note": "sore arm for a day, nothing else", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z" + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z" } ], "vaccinationDocumentLinks": [ { "vaccinationId": "", "targetId": "", - "createdAt": "2026-05-04T12:44:00.000Z" + "createdAt": "2026-05-04T14:24:00.000Z" } ], "measurementReminders": [ @@ -1053,8 +1060,8 @@ "snoozedUntil": "2026-07-08T06:00:00.000Z", "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z" + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z" } ], "measurementReminderEvents": [ @@ -1065,7 +1072,7 @@ "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" }, { "id": "", @@ -1074,7 +1081,7 @@ "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" } ], "coachConversations": [ @@ -1085,8 +1092,8 @@ "summary": "earlier turns: weight trend and evening walks", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "messages": [ { "id": "", @@ -1124,8 +1131,8 @@ "summary": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "messages": [ { "id": "", @@ -1159,8 +1166,8 @@ "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", "sourceMessageId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z" + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z" } ], "coachPlans": [ @@ -1174,8 +1181,8 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z" + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z" } ], "coachReminders": [ @@ -1192,8 +1199,8 @@ "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z" + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z" } ], "mentalHealthAssessments": [], @@ -1233,8 +1240,8 @@ "page": 2, "confidence": 0.94 }, - "createdAt": "2026-05-05T18:51:00.000Z", - "updatedAt": "2026-05-05T18:52:00.000Z" + "createdAt": "2026-05-05T20:31:00.000Z", + "updatedAt": "2026-05-05T20:32:00.000Z" } ], "documentImportKeys": [ @@ -1256,7 +1263,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { "metricType": "WALKING_RUNNING_DISTANCE", @@ -1268,7 +1275,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { "metricType": "WEIGHT", @@ -1280,19 +1287,19 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "userAchievements": [ { "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" }, { "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" } ], "environmentContexts": [ @@ -1337,8 +1344,8 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { "date": "2026-07-01", @@ -1381,8 +1388,8 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "environmentTravelLocations": [ @@ -1392,8 +1399,8 @@ "lat": 41.4, "lon": 2.2, "label": "Barcelona", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "dawarichDays": [ @@ -1407,8 +1414,8 @@ "countryCode": "ES", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "ecgRecordings": [ @@ -1433,8 +1440,8 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "symptomDefinitions": [ @@ -1443,24 +1450,24 @@ "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z", + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z", "events": [ { "note": null, "occurredAt": "2026-06-21T09:00:00.000Z", "intensity": 4, "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "note": null, "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ] }, @@ -1469,16 +1476,16 @@ "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z", + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z", "events": [ { "note": "left side, behind the eye", "occurredAt": "2026-06-21T11:00:00.000Z", "intensity": 8, "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" } ] } @@ -1491,8 +1498,8 @@ "startDate": "2023-09-01", "endDate": null, "precision": "MONTH", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z" + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z" }, { "title": "Parental leave", @@ -1501,43 +1508,43 @@ "startDate": "2026-03-02", "endDate": "2026-05-29", "precision": "DAY", - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z" + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z" } ], "labResultDocumentLinks": [ { "labResultId": "", "documentId": "", - "createdAt": "2026-05-06T16:24:00.000Z" + "createdAt": "2026-05-06T18:04:00.000Z" } ], "encounterMedicationLinks": [ { "encounterId": "", "medicationId": "", - "createdAt": "2026-05-06T18:04:00.000Z" + "createdAt": "2026-05-06T19:44:00.000Z" } ], "encounterVaccinationLinks": [ { "encounterId": "", "vaccinationId": "", - "createdAt": "2026-05-06T19:44:00.000Z" + "createdAt": "2026-05-06T21:24:00.000Z" } ], "medicationDocumentLinks": [ { "medicationId": "", "documentId": "", - "createdAt": "2026-05-06T21:24:00.000Z" + "createdAt": "2026-05-06T23:04:00.000Z" } ], "medicationConditionLinks": [ { "medicationId": "", "episodeId": "", - "createdAt": "2026-05-06T23:04:00.000Z" + "createdAt": "2026-05-07T00:44:00.000Z" } ], "nutrientDays": [ @@ -1548,7 +1555,7 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z" } ] }, @@ -1571,6 +1578,7 @@ "cycleDayLogs": 1, "nutrientDays": 1, "labResults": 1, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 3, "illnessDayLogs": 1, @@ -1635,6 +1643,7 @@ "cycleDayLogs": 1, "nutrientDays": 1, "labResults": 1, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 3, "illnessDayLogs": 1, @@ -1949,14 +1958,14 @@ "unitsTotal": "30", "unitsRemaining": "21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", "notes": "second pack, kept in the kitchen drawer", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { "state": "USED_UP", @@ -1970,8 +1979,8 @@ "manufacturer": null, "doseStrength": null, "notes": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "inventoryEvents": [ @@ -2016,7 +2025,7 @@ ], "source": "ARCHIVED", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { "validFrom": "2026-02-01T00:00:00.000Z", @@ -2030,7 +2039,7 @@ ], "source": "ARCHIVED", "supersededByIndex": 2, - "createdAt": "2026-05-06T06:27:02.000Z" + "createdAt": "2026-05-06T08:07:02.000Z" }, { "validFrom": "2026-03-01T00:00:00.000Z", @@ -2044,7 +2053,7 @@ ], "source": "MANUAL", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "courses": [ @@ -2202,7 +2211,7 @@ "hiddenMoodTags": [ { "key": "grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "customMoodTags": [ @@ -2266,7 +2275,14 @@ "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" + } + ], + "labResultImportKeys": [ + { + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" } ], "illnessEpisodes": [ @@ -2279,10 +2295,10 @@ "resolvedAt": null, "parentConditionId": "", "note": null, - "createdAt": "2026-05-02T17:31:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", "bodySite": null, "laterality": null, - "updatedAt": "2026-05-02T17:32:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "dayLogs": [] }, { @@ -2294,10 +2310,10 @@ "resolvedAt": "2026-06-30T12:34:56.789Z", "parentConditionId": null, "note": "rt-IllnessEpisode-noteEncrypted", - "createdAt": "2026-05-02T17:31:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", "bodySite": null, "laterality": null, - "updatedAt": "2026-05-02T17:32:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "dayLogs": [ { "id": "", @@ -2312,7 +2328,7 @@ } ], "note": "rt-IllnessDayLog-noteEncrypted", - "updatedAt": "2026-05-02T19:09:00.000Z" + "updatedAt": "2026-05-02T20:49:00.000Z" } ] }, @@ -2325,10 +2341,10 @@ "resolvedAt": null, "parentConditionId": null, "note": null, - "createdAt": "2026-05-02T17:31:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", "bodySite": "Stomach", "laterality": "BOTH", - "updatedAt": "2026-05-02T17:32:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "dayLogs": [] } ], @@ -2338,24 +2354,24 @@ "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z", + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z", "events": [ { "occurredAt": "2026-06-21T09:00:00.000Z", "intensity": 4, "note": null, "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "note": null, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ] }, @@ -2364,16 +2380,16 @@ "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z", + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z", "events": [ { "occurredAt": "2026-06-21T11:00:00.000Z", "intensity": 8, "note": "left side, behind the eye", "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" } ] } @@ -2386,8 +2402,8 @@ "precision": "MONTH", "title": "Moved to the coast", "note": "the flat with the long hallway", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z" + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z" }, { "category": "WORK", @@ -2396,8 +2412,8 @@ "precision": "DAY", "title": "Parental leave", "note": null, - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z" + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z" } ], "allergies": [ @@ -2411,8 +2427,8 @@ "onsetAt": "2026-06-30T12:34:56.789Z", "reaction": "rt-Allergy-reactionEncrypted", "note": "rt-Allergy-notesEncrypted", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z" + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z" } ], "familyHistory": [ @@ -2422,8 +2438,8 @@ "condition": "Type 2 diabetes", "ageAtOnset": 3, "note": "rt-FamilyHistoryEntry-notesEncrypted", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z" + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z" } ], "workouts": [ @@ -2459,7 +2475,7 @@ "sourceId": "4711", "sourceInstance": "https://paperless.example.test", "summary": "rt-InboundDocument-summaryEncrypted", - "createdAt": "2026-05-04T01:25:00.000Z" + "createdAt": "2026-05-04T03:05:00.000Z" } ], "documentConditionLinks": [ @@ -2497,8 +2513,8 @@ "page": 2, "confidence": 0.94 }, - "createdAt": "2026-05-05T18:51:00.000Z", - "updatedAt": "2026-05-05T18:52:00.000Z" + "createdAt": "2026-05-05T20:31:00.000Z", + "updatedAt": "2026-05-05T20:32:00.000Z" } ], "documentImportKeys": [ @@ -2517,7 +2533,7 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z" } ], "healthProfile": { @@ -2582,7 +2598,7 @@ "dismissedEvidenceHash": "abababababababababababababababababababababababababababababababab", "dismissedEffectSize": 2.5, "dismissedSampleSize": 3, - "createdAt": "2026-05-03T18:38:00.000Z" + "createdAt": "2026-05-03T20:18:00.000Z" } ], "intradayProfiles": [ @@ -2666,7 +2682,7 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z" } ], "onboardingRecord": { @@ -2741,8 +2757,8 @@ "location": "rt-Practitioner-locationEncrypted", "phone": "rt-Practitioner-phoneEncrypted", "note": "ring the upper bell", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z" + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z" } ], "encounters": [ @@ -2757,29 +2773,29 @@ "bodySite": "rt-Encounter-bodySiteEncrypted", "laterality": "LEFT", "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z" + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z" } ], "encounterDocumentLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T06:04:00.000Z" + "createdAt": "2026-05-04T07:44:00.000Z" } ], "encounterLabLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T07:44:00.000Z" + "createdAt": "2026-05-04T09:24:00.000Z" } ], "encounterConditionLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T09:24:00.000Z" + "createdAt": "2026-05-04T11:04:00.000Z" } ], "customVaccines": [ @@ -2792,8 +2808,8 @@ ], "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z" + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z" } ], "vaccinations": [ @@ -2811,50 +2827,50 @@ "reminderId": "", "customVaccineId": "", "note": "sore arm for a day, nothing else", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z" + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z" } ], "vaccinationDocumentLinks": [ { "vaccinationId": "", "targetId": "", - "createdAt": "2026-05-04T12:44:00.000Z" + "createdAt": "2026-05-04T14:24:00.000Z" } ], "labResultDocumentLinks": [ { "labResultId": "", "documentId": "", - "createdAt": "2026-05-06T16:24:00.000Z" + "createdAt": "2026-05-06T18:04:00.000Z" } ], "encounterMedicationLinks": [ { "encounterId": "", "medicationId": "", - "createdAt": "2026-05-06T18:04:00.000Z" + "createdAt": "2026-05-06T19:44:00.000Z" } ], "encounterVaccinationLinks": [ { "encounterId": "", "vaccinationId": "", - "createdAt": "2026-05-06T19:44:00.000Z" + "createdAt": "2026-05-06T21:24:00.000Z" } ], "medicationDocumentLinks": [ { "medicationId": "", "documentId": "", - "createdAt": "2026-05-06T21:24:00.000Z" + "createdAt": "2026-05-06T23:04:00.000Z" } ], "medicationConditionLinks": [ { "medicationId": "", "episodeId": "", - "createdAt": "2026-05-06T23:04:00.000Z" + "createdAt": "2026-05-07T00:44:00.000Z" } ], "coachConversations": [ @@ -2865,8 +2881,8 @@ "summary": "earlier turns: weight trend and evening walks", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "messages": [ { "id": "", @@ -2904,8 +2920,8 @@ "summary": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "messages": [ { "id": "", @@ -2941,8 +2957,8 @@ "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", "sourceMessageId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z" + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z" } ], "coachPlans": [ @@ -2956,8 +2972,8 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z" + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z" } ], "coachReminders": [ @@ -2974,8 +2990,8 @@ "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z" + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z" } ], "measurementReminders": [ @@ -2997,8 +3013,8 @@ "snoozedUntil": "2026-07-08T06:00:00.000Z", "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z" + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z" } ], "measurementReminderEvents": [ @@ -3009,7 +3025,7 @@ "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" }, { "id": "", @@ -3018,7 +3034,7 @@ "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" } ], "personalRecords": [ @@ -3032,7 +3048,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { "metricType": "WALKING_RUNNING_DISTANCE", @@ -3044,7 +3060,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { "metricType": "WEIGHT", @@ -3056,19 +3072,19 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "userAchievements": [ { "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" }, { "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" } ], "environmentContexts": [ @@ -3113,8 +3129,8 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { "date": "2026-07-01", @@ -3157,8 +3173,8 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "environmentTravelLocations": [ @@ -3168,8 +3184,8 @@ "lat": 41.4, "lon": 2.2, "label": "Barcelona", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "dawarichDays": [ @@ -3183,8 +3199,8 @@ "countryCode": "ES", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "ecgRecordings": [ @@ -3209,8 +3225,8 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "manifest": { @@ -3248,6 +3264,7 @@ "cycleDayLogs": 1, "nutrientDays": 1, "labResults": 1, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 3, "illnessDayLogs": 1, @@ -3304,6 +3321,7 @@ "cycles": 0, "cycleDayLogs": 1, "labResults": 1, + "labResultImportKeys": 1, "nutrientDays": 1, "biomarkers": 1, "illnessEpisodes": 3, diff --git a/tests/integration/__golden__/backup-parity/restore-disaster-recovery-over-live.json b/tests/integration/__golden__/backup-parity/restore-disaster-recovery-over-live.json index 43417f7d6..c3f15168d 100644 --- a/tests/integration/__golden__/backup-parity/restore-disaster-recovery-over-live.json +++ b/tests/integration/__golden__/backup-parity/restore-disaster-recovery-over-live.json @@ -18,6 +18,7 @@ "cycleDayLogs": 2, "nutrientDays": 1, "labResults": 2, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 4, "illnessDayLogs": 2, @@ -75,6 +76,7 @@ "cycleDayLogs": 2, "cycleProfile": 1, "labResults": 2, + "labResultImportKeys": 1, "biomarkers": 1, "nutrientDays": 1, "illnessEpisodes": 4, @@ -292,6 +294,7 @@ "cycleDayLogs": 2, "cycleProfile": 1, "labResults": 2, + "labResultImportKeys": 1, "biomarkers": 1, "nutrientDays": 1, "illnessEpisodes": 4, diff --git a/tests/integration/__golden__/backup-parity/restore-disaster-recovery.json b/tests/integration/__golden__/backup-parity/restore-disaster-recovery.json index 338d1cc35..ca0aefc74 100644 --- a/tests/integration/__golden__/backup-parity/restore-disaster-recovery.json +++ b/tests/integration/__golden__/backup-parity/restore-disaster-recovery.json @@ -18,6 +18,7 @@ "cycleDayLogs": 2, "nutrientDays": 1, "labResults": 2, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 4, "illnessDayLogs": 2, @@ -75,6 +76,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -292,6 +294,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -993,6 +996,15 @@ "deletedAt": "" } ], + "LabResultImportKey": [ + { + "id": "", + "userId": "round-trip-owner", + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" + } + ], "Biomarker": [ { "id": "", @@ -1005,13 +1017,13 @@ "panel": "rt-Biomarker-panel", "hidden": true, "analyteKey": "rt-Biomarker-analyteKey", - "createdAt": "2026-05-02T12:30:00.000Z", - "updatedAt": "2026-05-02T12:31:00.000Z" + "createdAt": "2026-05-02T14:10:00.000Z", + "updatedAt": "2026-05-02T14:11:00.000Z" } ], "Allergy": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "substance": "Latex (deleted)", "category": "OTHER", @@ -1021,12 +1033,12 @@ "onsetAt": null, "reactionEncrypted": null, "notesEncrypted": null, - "createdAt": "2026-05-02T14:10:01.000Z", - "updatedAt": "2026-05-02T14:11:01.000Z", + "createdAt": "2026-05-02T15:50:01.000Z", + "updatedAt": "2026-05-02T15:51:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "substance": "Penicillin", "category": "FOOD", @@ -1036,38 +1048,38 @@ "onsetAt": "2026-06-30T12:34:56.789Z", "reactionEncrypted": "", "notesEncrypted": "", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z", + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z", "deletedAt": null } ], "FamilyHistoryEntry": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "relationship": "FATHER", "condition": "Hypertension (deleted)", "ageAtOnset": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:01.000Z", - "updatedAt": "2026-05-02T15:47:01.000Z", + "createdAt": "2026-05-02T17:26:01.000Z", + "updatedAt": "2026-05-02T17:27:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "relationship": "MOTHER", "condition": "Type 2 diabetes", "ageAtOnset": 3, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z", + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z", "deletedAt": null } ], "IllnessEpisode": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Cold", "type": "INFECTION", @@ -1078,28 +1090,28 @@ "noteEncrypted": "", "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:00.000Z", - "updatedAt": "2026-05-02T17:32:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Iron deficiency flare", "type": "CHRONIC", "lifecycle": "FLARE", "onsetAt": "2026-06-25T00:00:00.000Z", "resolvedAt": null, - "parentConditionId": "", + "parentConditionId": "", "noteEncrypted": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:03.000Z", - "updatedAt": "2026-05-02T17:32:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Iron deficiency", "type": "CHRONIC", @@ -1110,12 +1122,12 @@ "noteEncrypted": null, "bodySiteEncrypted": "", "laterality": "BOTH", - "createdAt": "2026-05-02T17:31:01.000Z", - "updatedAt": "2026-05-02T17:32:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Sprained ankle (deleted)", "type": "INJURY", @@ -1126,107 +1138,107 @@ "noteEncrypted": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:02.000Z", - "updatedAt": "2026-05-02T17:32:02.000Z", + "createdAt": "2026-05-02T19:11:02.000Z", + "updatedAt": "2026-05-02T19:12:02.000Z", "deletedAt": "" } ], "IllnessDayLog": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "episodeId": "", + "episodeId": "", "date": "2026-06-21", "functionalImpact": 3, "feverC": 2.5, "noteEncrypted": "", "tz": "rt-IllnessDayLog-tz", - "createdAt": "2026-05-02T19:08:00.000Z", - "updatedAt": "2026-05-02T19:09:00.000Z", + "createdAt": "2026-05-02T20:48:00.000Z", + "updatedAt": "2026-05-02T20:49:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "episodeId": "", + "episodeId": "", "date": "2026-06-22", "functionalImpact": null, "feverC": null, "noteEncrypted": null, "tz": null, - "createdAt": "2026-05-02T19:08:01.000Z", - "updatedAt": "2026-05-02T19:09:01.000Z", + "createdAt": "2026-05-02T20:48:01.000Z", + "updatedAt": "2026-05-02T20:49:01.000Z", "deletedAt": "" } ], "IllnessSymptomLink": [ { - "dayLogId": "", - "symptomId": "", + "dayLogId": "", + "symptomId": "", "severity": 2, - "createdAt": "2026-05-02T20:43:00.000Z" + "createdAt": "2026-05-02T22:23:00.000Z" } ], "SymptomDefinition": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "labelEncrypted": "", "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z" + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "labelEncrypted": "", "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z" + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z" } ], "SymptomEvent": [ - { - "id": "", - "userId": "round-trip-owner", - "definitionId": "", - "occurredAt": "2026-06-21T09:00:00.000Z", - "intensity": 4, - "noteEncrypted": null, - "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" - }, { "id": "", "userId": "round-trip-owner", "definitionId": "", - "occurredAt": "2026-06-21T11:00:00.000Z", - "intensity": 8, - "noteEncrypted": "", - "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "occurredAt": "2026-06-21T09:00:00.000Z", + "intensity": 4, + "noteEncrypted": null, + "episodeId": "", + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "id": "", "userId": "round-trip-owner", - "definitionId": "", + "definitionId": "", + "occurredAt": "2026-06-21T11:00:00.000Z", + "intensity": 8, + "noteEncrypted": "", + "episodeId": null, + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" + }, + { + "id": "", + "userId": "round-trip-owner", + "definitionId": "", "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "noteEncrypted": null, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ], "LifeEvent": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "HOME", "startDate": "2023-09-01", @@ -1234,12 +1246,12 @@ "precision": "MONTH", "titleEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z", + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "OTHER", "startDate": "2025-12-01", @@ -1247,12 +1259,12 @@ "precision": "DAY", "titleEncrypted": "", "noteEncrypted": null, - "createdAt": "2026-05-03T01:48:02.000Z", - "updatedAt": "2026-05-03T01:49:02.000Z", + "createdAt": "2026-05-03T03:28:02.000Z", + "updatedAt": "2026-05-03T03:29:02.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "WORK", "startDate": "2026-03-02", @@ -1260,14 +1272,14 @@ "precision": "DAY", "titleEncrypted": "", "noteEncrypted": null, - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z", + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z", "deletedAt": null } ], "UserHealthProfile": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "aboutMeEncrypted": "", "conditionsEncrypted": "", @@ -1286,24 +1298,24 @@ "lifeConfirmedJson": { "roundTrip": "rt-UserHealthProfile-lifeConfirmedJson" }, - "createdAt": "2026-05-03T03:35:00.000Z", - "updatedAt": "2026-05-03T03:36:00.000Z" + "createdAt": "2026-05-03T05:15:00.000Z", + "updatedAt": "2026-05-03T05:16:00.000Z" } ], "HealthProfileFactRevision": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "SMOKING_STATUS", "valueEncrypted": "", "validFrom": "2026-01-01T00:00:00.000Z", "validUntil": "2026-06-30T12:34:56.789Z", "provenance": "USER_CORRECTION", - "supersededByRevisionId": "", - "createdAt": "2026-05-03T05:08:00.000Z" + "supersededByRevisionId": "", + "createdAt": "2026-05-03T06:48:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "SMOKING_STATUS", "valueEncrypted": "", @@ -1311,12 +1323,12 @@ "validUntil": null, "provenance": "USER_REPORTED", "supersededByRevisionId": null, - "createdAt": "2026-05-03T05:08:01.000Z" + "createdAt": "2026-05-03T06:48:01.000Z" } ], "CycleProfile": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "goal": "AVOID_PREGNANCY", "cycleTrackingEnabled": true, @@ -1328,13 +1340,13 @@ "rawChartMode": true, "discreetNotifications": true, "sensitiveCategoryEncryption": false, - "createdAt": "2026-05-03T06:52:00.000Z", - "updatedAt": "2026-05-03T06:53:00.000Z" + "createdAt": "2026-05-03T08:32:00.000Z", + "updatedAt": "2026-05-03T08:33:00.000Z" } ], "MenstrualCycle": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-05-04", "endDate": null, @@ -1347,11 +1359,11 @@ "syncVersion": 0, "deletedAt": "", "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:02.000Z", - "updatedAt": "2026-05-03T08:34:02.000Z" + "createdAt": "2026-05-03T10:13:02.000Z", + "updatedAt": "2026-05-03T10:14:02.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-06-01", "endDate": "rt-MenstrualCycle-endDate", @@ -1364,11 +1376,11 @@ "syncVersion": 3, "deletedAt": null, "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:00.000Z", - "updatedAt": "2026-05-03T08:34:00.000Z" + "createdAt": "2026-05-03T10:13:00.000Z", + "updatedAt": "2026-05-03T10:14:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-06-03", "endDate": null, @@ -1380,17 +1392,17 @@ "tz": null, "syncVersion": 0, "deletedAt": "2026-06-04T07:00:00.000Z", - "absorbedIntoId": "", - "createdAt": "2026-05-03T08:33:01.000Z", - "updatedAt": "2026-05-03T08:34:01.000Z" + "absorbedIntoId": "", + "createdAt": "2026-05-03T10:13:01.000Z", + "updatedAt": "2026-05-03T10:14:01.000Z" } ], "CycleDayLog": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-02", - "cycleId": "", + "cycleId": "", "flow": "HEAVY", "intermenstrualBleeding": true, "basalBodyTempC": 2.5, @@ -1412,14 +1424,14 @@ "tz": "rt-CycleDayLog-tz", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-03T10:25:00.000Z", - "updatedAt": "2026-05-03T10:26:00.000Z" + "createdAt": "2026-05-03T12:05:00.000Z", + "updatedAt": "2026-05-03T12:06:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-03", - "cycleId": "", + "cycleId": "", "flow": "LIGHT", "intermenstrualBleeding": false, "basalBodyTempC": null, @@ -1441,13 +1453,13 @@ "tz": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-03T10:25:01.000Z", - "updatedAt": "2026-05-03T10:26:01.000Z" + "createdAt": "2026-05-03T12:05:01.000Z", + "updatedAt": "2026-05-03T12:06:01.000Z" } ], "CycleSymptom": [ { - "id": "", + "id": "", "categoryId": "csc_physical", "key": "custom:round-trip-cramps", "labelKey": "cycle.symptom.custom", @@ -1460,15 +1472,15 @@ ], "CycleSymptomLink": [ { - "dayLogId": "", - "symptomId": "", + "dayLogId": "", + "symptomId": "", "severity": 3, - "createdAt": "2026-05-03T13:23:00.000Z" + "createdAt": "2026-05-03T15:03:00.000Z" } ], "CustomMetric": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Grip strength", "unit": "kg", @@ -1477,12 +1489,12 @@ "decimals": 3, "description": "rt-CustomMetric-description", "correlationEnabled": true, - "createdAt": "2026-05-03T15:09:00.000Z", - "updatedAt": "2026-05-03T15:10:00.000Z", + "createdAt": "2026-05-03T16:49:00.000Z", + "updatedAt": "2026-05-03T16:50:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Plank (deleted)", "unit": "s", @@ -1491,52 +1503,52 @@ "decimals": null, "description": null, "correlationEnabled": false, - "createdAt": "2026-05-03T15:09:01.000Z", - "updatedAt": "2026-05-03T15:10:01.000Z", + "createdAt": "2026-05-03T16:49:01.000Z", + "updatedAt": "2026-05-03T16:50:01.000Z", "deletedAt": "" } ], "CustomMetricEntry": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 40, "unit": "kg", "measuredAt": "2026-06-28T18:00:00.000Z", "note": null, "noteEncrypted": null, - "createdAt": "2026-05-03T16:48:02.000Z", + "createdAt": "2026-05-03T18:28:02.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 44, "unit": "kg", "measuredAt": "2026-07-01T18:00:00.000Z", "note": null, "noteEncrypted": "", - "createdAt": "2026-05-03T16:48:00.000Z", + "createdAt": "2026-05-03T18:28:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 45, "unit": "kg", "measuredAt": "2026-07-02T18:00:00.000Z", "note": null, "noteEncrypted": "", - "createdAt": "2026-05-03T16:48:01.000Z", + "createdAt": "2026-05-03T18:28:01.000Z", "deletedAt": null } ], "CorrelationPattern": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "canonicalKey": "p1:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "family": "sleep", @@ -1554,13 +1566,13 @@ "dismissedEvidenceHash": "abababababababababababababababababababababababababababababababab", "dismissedEffectSize": 2.5, "dismissedSampleSize": 3, - "createdAt": "2026-05-03T18:38:00.000Z", - "updatedAt": "2026-05-03T18:39:00.000Z" + "createdAt": "2026-05-03T20:18:00.000Z", + "updatedAt": "2026-05-03T20:19:00.000Z" } ], "HealthScoreRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "dayKey": "2026-07-01", "timezone": "Europe/Berlin", @@ -1578,13 +1590,13 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z", - "createdAt": "2026-05-03T20:13:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z", + "createdAt": "2026-05-03T21:53:00.000Z" } ], "Workout": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "sportType": "RUNNING", "startedAt": "2026-06-29T06:00:00.000Z", @@ -1604,8 +1616,8 @@ "metadata": { "roundTrip": "rt-Workout-metadata" }, - "createdAt": "2026-05-03T21:58:00.000Z", - "updatedAt": "2026-05-03T21:59:00.000Z" + "createdAt": "2026-05-03T23:38:00.000Z", + "updatedAt": "2026-05-03T23:39:00.000Z" } ], "NutrientIntakeDay": [ @@ -1617,13 +1629,13 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z", - "updatedAt": "2026-05-03T23:28:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z", + "updatedAt": "2026-05-04T01:08:00.000Z" } ], "InboundDocument": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "LAB_RESULT", "title": "June labs", @@ -1648,14 +1660,14 @@ "sourceInstance": "https://paperless.example.test", "aiReadDeferred": true, "extractionIncomplete": true, - "createdAt": "2026-05-04T01:25:00.000Z", - "updatedAt": "2026-05-04T01:26:00.000Z", + "createdAt": "2026-05-04T03:05:00.000Z", + "updatedAt": "2026-05-04T03:06:00.000Z", "deletedAt": null } ], "Practitioner": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Closed practice (deleted)", "specialty": null, @@ -1665,12 +1677,12 @@ "locationEncrypted": null, "phoneEncrypted": null, "noteEncrypted": null, - "createdAt": "2026-05-04T02:50:01.000Z", - "updatedAt": "2026-05-04T02:51:01.000Z", + "createdAt": "2026-05-04T04:30:01.000Z", + "updatedAt": "2026-05-04T04:31:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Round-trip practice", "specialty": "Internal medicine", @@ -1680,75 +1692,75 @@ "locationEncrypted": "", "phoneEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z", + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z", "deletedAt": null } ], "Encounter": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-04-02T08:00:00.000Z", "status": "DONE", "kind": "ROUTINE", - "practitionerId": "", + "practitionerId": "", "reasonEncrypted": null, "outcomeEncrypted": null, "bodySiteEncrypted": null, "laterality": null, "reminderId": null, - "createdAt": "2026-05-04T04:31:01.000Z", - "updatedAt": "2026-05-04T04:32:01.000Z", + "createdAt": "2026-05-04T06:11:01.000Z", + "updatedAt": "2026-05-04T06:12:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-06-30T08:00:00.000Z", "status": "PLANNED", "kind": "ROUTINE", - "practitionerId": "", + "practitionerId": "", "reasonEncrypted": "", "outcomeEncrypted": "", "bodySiteEncrypted": "", "laterality": "LEFT", - "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z", + "reminderId": "", + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z", "deletedAt": null } ], "EncounterDocumentLink": [ - { - "id": "", - "encounterId": "", - "documentId": "", - "userId": "round-trip-owner", - "createdAt": "2026-05-04T06:04:00.000Z" - } - ], - "EncounterLabLink": [ { "id": "", - "encounterId": "", - "labResultId": "", + "encounterId": "", + "documentId": "", "userId": "round-trip-owner", "createdAt": "2026-05-04T07:44:00.000Z" } ], - "EncounterConditionLink": [ + "EncounterLabLink": [ { "id": "", - "encounterId": "", - "episodeId": "", + "encounterId": "", + "labResultId": "", "userId": "round-trip-owner", "createdAt": "2026-05-04T09:24:00.000Z" } ], - "VaccinationRecord": [ + "EncounterConditionLink": [ { "id": "", + "encounterId": "", + "episodeId": "", + "userId": "round-trip-owner", + "createdAt": "2026-05-04T11:04:00.000Z" + } + ], + "VaccinationRecord": [ + { + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-04-14T00:00:00.000Z", "antigenSlug": "influenza", @@ -1762,12 +1774,12 @@ "reminderId": null, "customVaccineId": null, "noteEncrypted": null, - "createdAt": "2026-05-04T11:14:01.000Z", - "updatedAt": "2026-05-04T11:15:01.000Z", + "createdAt": "2026-05-04T12:54:01.000Z", + "updatedAt": "2026-05-04T12:55:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-05-14T00:00:00.000Z", "antigenSlug": "tdap", @@ -1776,28 +1788,28 @@ "seriesDoses": 3, "lotNumber": "RT-4471", "site": "LEFT_ARM", - "practitionerId": "", - "encounterId": "", - "reminderId": "", - "customVaccineId": "", + "practitionerId": "", + "encounterId": "", + "reminderId": "", + "customVaccineId": "", "noteEncrypted": "", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z", + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z", "deletedAt": null } ], "VaccinationDocumentLink": [ { - "id": "", - "vaccinationId": "", - "documentId": "", + "id": "", + "vaccinationId": "", + "documentId": "", "userId": "round-trip-owner", - "createdAt": "2026-05-04T12:44:00.000Z" + "createdAt": "2026-05-04T14:24:00.000Z" } ], "CustomVaccine": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Deleted combo", "components": [ @@ -1806,11 +1818,11 @@ "typicalSeriesDoses": null, "boosterIntervalMonths": null, "deletedAt": "", - "createdAt": "2026-05-04T14:27:01.000Z", - "updatedAt": "2026-05-04T14:28:01.000Z" + "createdAt": "2026-05-04T16:07:01.000Z", + "updatedAt": "2026-05-04T16:08:01.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Round-trip travel combo", "components": [ @@ -1820,13 +1832,13 @@ "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, "deletedAt": null, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z" + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z" } ], "MeasurementReminder": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Blutdruck messen", "measurementType": "BLOOD_PRESSURE_SYS", @@ -1845,12 +1857,12 @@ "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, "lastNotifiedAt": null, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z", + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Gewicht (deleted)", "measurementType": "WEIGHT", @@ -1869,53 +1881,53 @@ "lastSkippedAt": null, "skipCount": 0, "lastNotifiedAt": null, - "createdAt": "2026-05-04T16:19:01.000Z", - "updatedAt": "2026-05-04T16:20:01.000Z", + "createdAt": "2026-05-04T17:59:01.000Z", + "updatedAt": "2026-05-04T18:00:01.000Z", "deletedAt": "" } ], "MeasurementReminderEvent": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "reminderId": "", + "reminderId": "", "kind": "SATISFIED", "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "reminderId": "", + "reminderId": "", "kind": "SKIPPED", "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" } ], "CoachConversation": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "title": null, "titleEncrypted": "", - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "summaryEncrypted": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, "documentScoped": true }, { - "id": "", + "id": "", "userId": "round-trip-owner", "title": null, "titleEncrypted": "", - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "summaryEncrypted": "", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, @@ -1924,8 +1936,8 @@ ], "CoachMessage": [ { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "assistant", "encryptedContent": "", "metricSourceJson": null, @@ -1938,8 +1950,8 @@ "createdAt": "2026-07-20T09:59:00.000Z" }, { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "user", "encryptedContent": "", "metricSourceJson": "rt-CoachMessage-metricSourceJson", @@ -1952,8 +1964,8 @@ "createdAt": "2026-07-20T09:58:00.000Z" }, { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "user", "encryptedContent": "", "metricSourceJson": null, @@ -1968,44 +1980,44 @@ ], "CoachConversationDocument": [ { - "conversationId": "", - "documentId": "", + "conversationId": "", + "documentId": "", "addedAt": "2026-07-21T07:59:00.000Z" } ], "CoachFact": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "factEncrypted": "", "category": "preference", "confidence": 50, - "sourceConversationId": "", - "createdAt": "2026-05-05T00:26:01.000Z", - "updatedAt": "2026-05-05T00:27:01.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T02:06:01.000Z", + "updatedAt": "2026-05-05T02:07:01.000Z", "deletedAt": "", "source": "user", "lastUsedAt": null, "sourceMessageId": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "factEncrypted": "", "category": "constraint", "confidence": 80, - "sourceConversationId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z", "deletedAt": null, "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", - "sourceMessageId": "" + "sourceMessageId": "" } ], "CoachPlan": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "metric": "BLOOD_PRESSURE", "ifCueEncrypted": "", @@ -2014,13 +2026,13 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "outcomeEncrypted": "", - "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metric": "WEIGHT", "ifCueEncrypted": "", @@ -2030,18 +2042,18 @@ "reviewDate": null, "outcomeEncrypted": null, "sourceConversationId": null, - "createdAt": "2026-05-05T02:10:01.000Z", - "updatedAt": "2026-05-05T02:11:01.000Z", + "createdAt": "2026-05-05T03:50:01.000Z", + "updatedAt": "2026-05-05T03:51:01.000Z", "deletedAt": "" } ], "CoachReminder": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "noteEncrypted": "", "metric": null, - "relatedPlanId": "", + "relatedPlanId": "", "triggerKind": "date", "dueAt": "2026-09-15T07:00:00.000Z", "contextCue": null, @@ -2050,32 +2062,32 @@ "sourceConversationId": null, "lastSurfacedAt": null, "surfaceCount": 0, - "createdAt": "2026-05-05T03:53:01.000Z", - "updatedAt": "2026-05-05T03:54:01.000Z", + "createdAt": "2026-05-05T05:33:01.000Z", + "updatedAt": "2026-05-05T05:34:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "noteEncrypted": "", "metric": "BLOOD_PRESSURE", - "relatedPlanId": "", + "relatedPlanId": "", "triggerKind": "rt-CoachReminder-triggerKind", "dueAt": "2026-09-01T07:00:00.000Z", "contextCue": "rt-CoachReminder-contextCue", "status": "rt-CoachReminder-status", "source": "extractor", - "sourceConversationId": "", + "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z", + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z", "deletedAt": null } ], "MedicationInventoryItem": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "medicationId": "", "state": "ACTIVE", @@ -2083,18 +2095,18 @@ "unitsTotal": "decimal:30", "unitsRemaining": "decimal:21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", "notes": null, "notesEncrypted": "", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "medicationId": "", "state": "USED_UP", @@ -2109,20 +2121,20 @@ "doseStrength": null, "notes": null, "notesEncrypted": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "MedicationInventoryEvent": [ { - "id": "", + "id": "", "medicationId": "", "delta": -8, "reason": "consumed", "occurredAt": "2026-07-09T07:00:00.000Z" }, { - "id": "", + "id": "", "medicationId": "", "delta": 30, "reason": "purchased", @@ -2145,12 +2157,12 @@ { "userId": "round-trip-owner", "moodTagId": "mt_grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "ReminderPhaseConfig": [ { - "id": "", + "id": "", "medicationId": "", "greenValue": 45, "greenMode": "PERCENT", @@ -2164,7 +2176,7 @@ ], "MentalHealthAssessment": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "instrument": "GAD7", "locale": "en", @@ -2181,11 +2193,11 @@ "externalId": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-05T13:57:01.000Z", - "updatedAt": "2026-05-05T13:58:01.000Z" + "createdAt": "2026-05-05T15:37:01.000Z", + "updatedAt": "2026-05-05T15:38:01.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "instrument": "PHQ9", "locale": "de", @@ -2202,43 +2214,43 @@ "externalId": "rt-MentalHealthAssessment-externalId", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-05T13:57:00.000Z", - "updatedAt": "2026-05-05T13:58:00.000Z" + "createdAt": "2026-05-05T15:37:00.000Z", + "updatedAt": "2026-05-05T15:38:00.000Z" } ], "ConsentReceipt": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "ai-processing", "artefact": "JVBERi0xLjQKJWZpeHR1cmU=", "signedAt": "2026-06-01T09:00:00.000Z", "revokedAt": null, - "createdAt": "2026-05-05T15:26:00.000Z" + "createdAt": "2026-05-05T17:06:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "research-sharing", "artefact": "eyJhbGciOiJub25lIn0.e30.", "signedAt": "2026-06-02T09:00:00.000Z", "revokedAt": "2026-07-10T11:00:00.000Z", - "createdAt": "2026-05-05T15:26:01.000Z" + "createdAt": "2026-05-05T17:06:01.000Z" } ], "DocumentConditionLink": [ { - "id": "", - "documentId": "", - "episodeId": "", + "id": "", + "documentId": "", + "episodeId": "", "userId": "round-trip-owner", "createdAt": "2026-07-02T09:00:00.000Z" } ], "ExtractedFact": [ { - "id": "", - "documentId": "", + "id": "", + "documentId": "", "userId": "round-trip-owner", "factType": "OBSERVATION", "status": "APPROVED", @@ -2248,13 +2260,13 @@ "provenanceEncrypted": "", "committedRecordId": "", "committedRecordType": "labResult", - "createdAt": "2026-05-05T18:51:00.000Z", - "updatedAt": "2026-05-05T18:52:00.000Z" + "createdAt": "2026-05-05T20:31:00.000Z", + "updatedAt": "2026-05-05T20:32:00.000Z" } ], "DocumentImportKey": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "sourceSystem": "PAPRA", "sourceId": "doc_deleted", @@ -2264,7 +2276,7 @@ ], "PersonalRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WALKING_RUNNING_DISTANCE", "metricSlot": "running_10km_time", @@ -2275,10 +2287,10 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WALKING_RUNNING_DISTANCE", "metricSlot": "running_5km_time", @@ -2289,10 +2301,10 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WEIGHT", "metricSlot": null, @@ -2303,28 +2315,28 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "UserAchievement": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" } ], "EnvironmentContext": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-15", "locationEncrypted": "", @@ -2364,11 +2376,11 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-07-01", "locationEncrypted": "", @@ -2408,24 +2420,24 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "EnvironmentTravelLocation": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-06-10", "endDate": "2026-06-20", "locationEncrypted": "", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "DawarichDay": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-15", "totalDistanceM": 48300, @@ -2436,13 +2448,13 @@ "countryCodeEncrypted": "", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "MedicationScheduleRevision": [ { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-01-01T00:00:00.000Z", "validUntil": "2026-03-01T00:00:00.000Z", @@ -2455,10 +2467,10 @@ ], "source": "ARCHIVED", "supersededByRevisionId": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-02-01T00:00:00.000Z", "validUntil": "2026-03-01T00:00:00.000Z", @@ -2470,11 +2482,11 @@ } ], "source": "ARCHIVED", - "supersededByRevisionId": "", - "createdAt": "2026-05-06T06:27:02.000Z" + "supersededByRevisionId": "", + "createdAt": "2026-05-06T08:07:02.000Z" }, { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-03-01T00:00:00.000Z", "validUntil": "2026-05-01T00:00:00.000Z", @@ -2487,23 +2499,23 @@ ], "source": "MANUAL", "supersededByRevisionId": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "MedicationEfficacyTarget": [ { - "id": "", + "id": "", "medicationId": "", "measurementType": "WEIGHT", "biomarkerId": "", "primary": false, - "createdAt": "2026-05-06T08:05:00.000Z", - "updatedAt": "2026-05-06T08:06:00.000Z" + "createdAt": "2026-05-06T09:45:00.000Z", + "updatedAt": "2026-05-06T09:46:00.000Z" } ], "EcgRecording": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "source": "MANUAL", "externalRecordingId": "round-trip-signal-1", @@ -2516,13 +2528,13 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "OnboardingRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "needsJson": { "areas": [ @@ -2585,80 +2597,80 @@ }, "modulesDerivedAt": "2026-07-01T08:00:00.000Z", "completedAt": "2026-07-01T08:00:00.000Z", - "createdAt": "2026-05-06T11:27:00.000Z", - "updatedAt": "2026-05-06T11:28:00.000Z" + "createdAt": "2026-05-06T13:07:00.000Z", + "updatedAt": "2026-05-06T13:08:00.000Z" } ], "BiomarkerAlias": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "biomarkerId": "", "name": "Ferr.", "nameFolded": "ferr.", "source": "IMPORT_CHOICE", - "createdAt": "2026-05-06T13:06:00.000Z" + "createdAt": "2026-05-06T14:46:00.000Z" } ], "BiomarkerMerge": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "targetBiomarkerId": "", "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" } ], "LabResultDocumentLink": [ - { - "id": "", - "labResultId": "", - "documentId": "", - "userId": "round-trip-owner", - "createdAt": "2026-05-06T16:24:00.000Z" - } - ], - "EncounterMedicationLink": [ { "id": "", - "encounterId": "", - "medicationId": "", + "labResultId": "", + "documentId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T18:04:00.000Z" } ], - "EncounterVaccinationLink": [ + "EncounterMedicationLink": [ { "id": "", - "encounterId": "", - "vaccinationId": "", + "encounterId": "", + "medicationId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T19:44:00.000Z" } ], - "MedicationDocumentLink": [ + "EncounterVaccinationLink": [ { "id": "", - "medicationId": "", - "documentId": "", + "encounterId": "", + "vaccinationId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T21:24:00.000Z" } ], - "MedicationConditionLink": [ + "MedicationDocumentLink": [ { "id": "", "medicationId": "", - "episodeId": "", + "documentId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T23:04:00.000Z" } ], - "AccountGrant": [ + "MedicationConditionLink": [ { "id": "", + "medicationId": "", + "episodeId": "", + "userId": "round-trip-owner", + "createdAt": "2026-05-07T00:44:00.000Z" + } + ], + "AccountGrant": [ + { + "id": "", "grantorId": "round-trip-owner", "granteeId": "parity-delegate", "access": "READ", @@ -3412,13 +3424,13 @@ "unitsTotal": "30", "unitsRemaining": "21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { "id": "", @@ -3434,8 +3446,8 @@ "purchasedAt": null, "manufacturer": null, "doseStrength": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "phaseConfig": { @@ -3477,7 +3489,7 @@ ], "source": "ARCHIVED", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { "id": "", @@ -3492,7 +3504,7 @@ ], "source": "ARCHIVED", "supersededByIndex": 2, - "createdAt": "2026-05-06T06:27:02.000Z" + "createdAt": "2026-05-06T08:07:02.000Z" }, { "id": "", @@ -3507,14 +3519,14 @@ ], "source": "MANUAL", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "efficacyTargets": [ { "id": "", - "createdAt": "2026-05-06T08:05:00.000Z", - "updatedAt": "2026-05-06T08:06:00.000Z", + "createdAt": "2026-05-06T09:45:00.000Z", + "updatedAt": "2026-05-06T09:46:00.000Z", "measurementType": "WEIGHT", "biomarkerName": "Ferritin", "primary": false @@ -3669,7 +3681,7 @@ "hiddenMoodTags": [ { "key": "grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "customMoodTags": [ @@ -3690,8 +3702,8 @@ ], "cycleProfile": { "id": "", - "createdAt": "2026-05-03T06:52:00.000Z", - "updatedAt": "2026-05-03T06:53:00.000Z", + "createdAt": "2026-05-03T08:32:00.000Z", + "updatedAt": "2026-05-03T08:33:00.000Z", "goal": "AVOID_PREGNANCY", "cycleTrackingEnabled": true, "typicalCycleLength": 3, @@ -3710,8 +3722,8 @@ "syncVersion": 0, "deletedAt": "", "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:02.000Z", - "updatedAt": "2026-05-03T08:34:02.000Z", + "createdAt": "2026-05-03T10:13:02.000Z", + "updatedAt": "2026-05-03T10:14:02.000Z", "startDate": "2026-05-04", "endDate": null, "periodEndDate": null, @@ -3726,8 +3738,8 @@ "syncVersion": 3, "deletedAt": null, "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:00.000Z", - "updatedAt": "2026-05-03T08:34:00.000Z", + "createdAt": "2026-05-03T10:13:00.000Z", + "updatedAt": "2026-05-03T10:14:00.000Z", "startDate": "2026-06-01", "endDate": "rt-MenstrualCycle-endDate", "periodEndDate": "rt-MenstrualCycle-periodEndDate", @@ -3742,8 +3754,8 @@ "syncVersion": 0, "deletedAt": "2026-06-04T07:00:00.000Z", "absorbedIntoId": "", - "createdAt": "2026-05-03T08:33:01.000Z", - "updatedAt": "2026-05-03T08:34:01.000Z", + "createdAt": "2026-05-03T10:13:01.000Z", + "updatedAt": "2026-05-03T10:14:01.000Z", "startDate": "2026-06-03", "endDate": null, "periodEndDate": null, @@ -3759,8 +3771,8 @@ "cycleId": "", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-03T10:25:00.000Z", - "updatedAt": "2026-05-03T10:26:00.000Z", + "createdAt": "2026-05-03T12:05:00.000Z", + "updatedAt": "2026-05-03T12:06:00.000Z", "date": "2026-06-02", "flow": "HEAVY", "intermenstrualBleeding": true, @@ -3793,7 +3805,7 @@ "symptomLinkCreatedAt": [ { "key": "custom:round-trip-cramps", - "createdAt": "2026-05-03T13:23:00.000Z" + "createdAt": "2026-05-03T15:03:00.000Z" } ] }, @@ -3802,8 +3814,8 @@ "cycleId": "", "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-03T10:25:01.000Z", - "updatedAt": "2026-05-03T10:26:01.000Z", + "createdAt": "2026-05-03T12:05:01.000Z", + "updatedAt": "2026-05-03T12:06:01.000Z", "date": "2026-06-03", "flow": "LIGHT", "intermenstrualBleeding": false, @@ -3896,8 +3908,8 @@ "biomarkers": [ { "id": "", - "createdAt": "2026-05-02T12:30:00.000Z", - "updatedAt": "2026-05-02T12:31:00.000Z", + "createdAt": "2026-05-02T14:10:00.000Z", + "updatedAt": "2026-05-02T14:11:00.000Z", "name": "Ferritin", "unit": "ng/mL", "lowerBound": 2.5, @@ -3912,7 +3924,7 @@ "name": "Ferr.", "source": "IMPORT_CHOICE", "id": "", - "createdAt": "2026-05-06T13:06:00.000Z" + "createdAt": "2026-05-06T14:46:00.000Z" } ] } @@ -3925,7 +3937,14 @@ "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" + } + ], + "labResultImportKeys": [ + { + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" } ], "illnessEpisodes": [ @@ -3942,8 +3961,8 @@ "bodySite": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:03.000Z", - "updatedAt": "2026-05-02T17:32:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "deletedAt": null, "dayLogs": [] }, @@ -3960,8 +3979,8 @@ "bodySite": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:00.000Z", - "updatedAt": "2026-05-02T17:32:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "deletedAt": null, "dayLogs": [ { @@ -3973,14 +3992,14 @@ "note": null, "noteEncrypted": "", "tz": "rt-IllnessDayLog-tz", - "createdAt": "2026-05-02T19:08:00.000Z", - "updatedAt": "2026-05-02T19:09:00.000Z", + "createdAt": "2026-05-02T20:48:00.000Z", + "updatedAt": "2026-05-02T20:49:00.000Z", "deletedAt": null, "symptoms": [ { "key": "round_trip_cough", "severity": 2, - "createdAt": "2026-05-02T20:43:00.000Z" + "createdAt": "2026-05-02T22:23:00.000Z" } ] }, @@ -3993,8 +4012,8 @@ "note": null, "noteEncrypted": null, "tz": null, - "createdAt": "2026-05-02T19:08:01.000Z", - "updatedAt": "2026-05-02T19:09:01.000Z", + "createdAt": "2026-05-02T20:48:01.000Z", + "updatedAt": "2026-05-02T20:49:01.000Z", "deletedAt": "", "symptoms": [] } @@ -4013,8 +4032,8 @@ "bodySite": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:02.000Z", - "updatedAt": "2026-05-02T17:32:02.000Z", + "createdAt": "2026-05-02T19:11:02.000Z", + "updatedAt": "2026-05-02T19:12:02.000Z", "deletedAt": "", "dayLogs": [] }, @@ -4031,8 +4050,8 @@ "bodySite": null, "bodySiteEncrypted": "", "laterality": "BOTH", - "createdAt": "2026-05-02T17:31:01.000Z", - "updatedAt": "2026-05-02T17:32:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "deletedAt": null, "dayLogs": [] } @@ -4050,8 +4069,8 @@ "note": null, "reactionEncrypted": null, "notesEncrypted": null, - "createdAt": "2026-05-02T14:10:01.000Z", - "updatedAt": "2026-05-02T14:11:01.000Z", + "createdAt": "2026-05-02T15:50:01.000Z", + "updatedAt": "2026-05-02T15:51:01.000Z", "deletedAt": "" }, { @@ -4066,8 +4085,8 @@ "note": null, "reactionEncrypted": "", "notesEncrypted": "", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z", + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z", "deletedAt": null } ], @@ -4079,8 +4098,8 @@ "ageAtOnset": null, "note": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:01.000Z", - "updatedAt": "2026-05-02T15:47:01.000Z", + "createdAt": "2026-05-02T17:26:01.000Z", + "updatedAt": "2026-05-02T17:27:01.000Z", "deletedAt": "" }, { @@ -4090,16 +4109,16 @@ "ageAtOnset": 3, "note": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z", + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z", "deletedAt": null } ], "workouts": [ { "id": "", - "createdAt": "2026-05-03T21:58:00.000Z", - "updatedAt": "2026-05-03T21:59:00.000Z", + "createdAt": "2026-05-03T23:38:00.000Z", + "updatedAt": "2026-05-03T23:39:00.000Z", "metadata": { "roundTrip": "rt-Workout-metadata" }, @@ -4134,8 +4153,8 @@ "sourceSystem": "PAPERLESS", "sourceId": "4711", "sourceInstance": "https://paperless.example.test", - "createdAt": "2026-05-04T01:25:00.000Z", - "updatedAt": "2026-05-04T01:26:00.000Z", + "createdAt": "2026-05-04T03:05:00.000Z", + "updatedAt": "2026-05-04T03:06:00.000Z", "contentEncrypted": "", "contentSha256": "0a738470f0945033965858e9895ee721ce981a25f013514d587d0a7a1946be7a", "contentCodec": "binary2", @@ -4194,8 +4213,8 @@ "allergiesEncrypted": "", "coachFocusEncrypted": "", "pendingQuestionsEncrypted": "", - "createdAt": "2026-05-03T03:35:00.000Z", - "updatedAt": "2026-05-03T03:36:00.000Z" + "createdAt": "2026-05-03T05:15:00.000Z", + "updatedAt": "2026-05-03T05:16:00.000Z" }, "healthProfileFacts": [ { @@ -4207,7 +4226,7 @@ "validUntil": "2026-06-30T12:34:56.789Z", "provenance": "USER_CORRECTION", "supersededByRevisionId": "", - "createdAt": "2026-05-03T05:08:00.000Z" + "createdAt": "2026-05-03T06:48:00.000Z" }, { "id": "", @@ -4218,14 +4237,14 @@ "validUntil": null, "provenance": "USER_REPORTED", "supersededByRevisionId": null, - "createdAt": "2026-05-03T05:08:01.000Z" + "createdAt": "2026-05-03T06:48:01.000Z" } ], "customMetrics": [ { "id": "", - "createdAt": "2026-05-03T15:09:00.000Z", - "updatedAt": "2026-05-03T15:10:00.000Z", + "createdAt": "2026-05-03T16:49:00.000Z", + "updatedAt": "2026-05-03T16:50:00.000Z", "deletedAt": null, "name": "Grip strength", "unit": "kg", @@ -4237,7 +4256,7 @@ "entries": [ { "id": "", - "createdAt": "2026-05-03T16:48:02.000Z", + "createdAt": "2026-05-03T18:28:02.000Z", "deletedAt": "", "noteEncrypted": null, "value": 40, @@ -4247,7 +4266,7 @@ }, { "id": "", - "createdAt": "2026-05-03T16:48:00.000Z", + "createdAt": "2026-05-03T18:28:00.000Z", "deletedAt": null, "noteEncrypted": "", "value": 44, @@ -4257,7 +4276,7 @@ }, { "id": "", - "createdAt": "2026-05-03T16:48:01.000Z", + "createdAt": "2026-05-03T18:28:01.000Z", "deletedAt": null, "noteEncrypted": "", "value": 45, @@ -4269,8 +4288,8 @@ }, { "id": "", - "createdAt": "2026-05-03T15:09:01.000Z", - "updatedAt": "2026-05-03T15:10:01.000Z", + "createdAt": "2026-05-03T16:49:01.000Z", + "updatedAt": "2026-05-03T16:50:01.000Z", "deletedAt": "", "name": "Plank (deleted)", "unit": "s", @@ -4285,8 +4304,8 @@ "correlationPatterns": [ { "id": "", - "updatedAt": "2026-05-03T18:39:00.000Z", - "createdAt": "2026-05-03T18:38:00.000Z", + "updatedAt": "2026-05-03T20:19:00.000Z", + "createdAt": "2026-05-03T20:18:00.000Z", "canonicalKey": "p1:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "family": "sleep", "factorKey": "sleep_duration", @@ -4375,7 +4394,7 @@ "healthScoreRecords": [ { "id": "", - "createdAt": "2026-05-03T20:13:00.000Z", + "createdAt": "2026-05-03T21:53:00.000Z", "dayKey": "2026-07-01", "timezone": "Europe/Berlin", "composite": 71, @@ -4392,13 +4411,13 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z" } ], "onboardingRecord": { "id": "", - "createdAt": "2026-05-06T11:27:00.000Z", - "updatedAt": "2026-05-06T11:28:00.000Z", + "createdAt": "2026-05-06T13:07:00.000Z", + "updatedAt": "2026-05-06T13:08:00.000Z", "needs": { "recordTarget": "me", "areas": [ @@ -4472,8 +4491,8 @@ "locationEncrypted": null, "phoneEncrypted": null, "noteEncrypted": null, - "createdAt": "2026-05-04T02:50:01.000Z", - "updatedAt": "2026-05-04T02:51:01.000Z", + "createdAt": "2026-05-04T04:30:01.000Z", + "updatedAt": "2026-05-04T04:31:01.000Z", "deletedAt": "" }, { @@ -4486,8 +4505,8 @@ "locationEncrypted": "", "phoneEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z", + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z", "deletedAt": null } ], @@ -4503,8 +4522,8 @@ "bodySiteEncrypted": "", "laterality": "LEFT", "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z", + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z", "deletedAt": null }, { @@ -4518,8 +4537,8 @@ "bodySiteEncrypted": null, "laterality": null, "reminderId": null, - "createdAt": "2026-05-04T04:31:01.000Z", - "updatedAt": "2026-05-04T04:32:01.000Z", + "createdAt": "2026-05-04T06:11:01.000Z", + "updatedAt": "2026-05-04T06:12:01.000Z", "deletedAt": "" } ], @@ -4527,21 +4546,21 @@ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T06:04:00.000Z" + "createdAt": "2026-05-04T07:44:00.000Z" } ], "encounterLabLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T07:44:00.000Z" + "createdAt": "2026-05-04T09:24:00.000Z" } ], "encounterConditionLinks": [ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T09:24:00.000Z" + "createdAt": "2026-05-04T11:04:00.000Z" } ], "customVaccines": [ @@ -4553,8 +4572,8 @@ ], "typicalSeriesDoses": null, "boosterIntervalMonths": null, - "createdAt": "2026-05-04T14:27:01.000Z", - "updatedAt": "2026-05-04T14:28:01.000Z", + "createdAt": "2026-05-04T16:07:01.000Z", + "updatedAt": "2026-05-04T16:08:01.000Z", "deletedAt": "" }, { @@ -4566,8 +4585,8 @@ ], "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z", + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z", "deletedAt": null } ], @@ -4586,8 +4605,8 @@ "reminderId": "", "customVaccineId": "", "noteEncrypted": "", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z", + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z", "deletedAt": null }, { @@ -4604,8 +4623,8 @@ "reminderId": null, "customVaccineId": null, "noteEncrypted": null, - "createdAt": "2026-05-04T11:14:01.000Z", - "updatedAt": "2026-05-04T11:15:01.000Z", + "createdAt": "2026-05-04T12:54:01.000Z", + "updatedAt": "2026-05-04T12:55:01.000Z", "deletedAt": "" } ], @@ -4613,7 +4632,7 @@ { "vaccinationId": "", "targetId": "", - "createdAt": "2026-05-04T12:44:00.000Z" + "createdAt": "2026-05-04T14:24:00.000Z" } ], "measurementReminders": [ @@ -4635,8 +4654,8 @@ "snoozedUntil": "2026-07-08T06:00:00.000Z", "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z", + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z", "deletedAt": null }, { @@ -4657,8 +4676,8 @@ "snoozedUntil": null, "lastSkippedAt": null, "skipCount": 0, - "createdAt": "2026-05-04T16:19:01.000Z", - "updatedAt": "2026-05-04T16:20:01.000Z", + "createdAt": "2026-05-04T17:59:01.000Z", + "updatedAt": "2026-05-04T18:00:01.000Z", "deletedAt": "" } ], @@ -4670,7 +4689,7 @@ "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" }, { "id": "", @@ -4679,7 +4698,7 @@ "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" } ], "coachConversations": [ @@ -4690,8 +4709,8 @@ "summaryEncrypted": "", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "messages": [ { "id": "", @@ -4729,8 +4748,8 @@ "summaryEncrypted": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "messages": [ { "id": "", @@ -4765,8 +4784,8 @@ "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", "sourceMessageId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z" + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z" }, { "id": "", @@ -4778,8 +4797,8 @@ "source": "user", "lastUsedAt": null, "sourceMessageId": null, - "createdAt": "2026-05-05T00:26:01.000Z", - "updatedAt": "2026-05-05T00:27:01.000Z" + "createdAt": "2026-05-05T02:06:01.000Z", + "updatedAt": "2026-05-05T02:07:01.000Z" } ], "coachPlans": [ @@ -4794,8 +4813,8 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z" + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z" }, { "id": "", @@ -4808,8 +4827,8 @@ "status": "active", "reviewDate": null, "sourceConversationId": null, - "createdAt": "2026-05-05T02:10:01.000Z", - "updatedAt": "2026-05-05T02:11:01.000Z" + "createdAt": "2026-05-05T03:50:01.000Z", + "updatedAt": "2026-05-05T03:51:01.000Z" } ], "coachReminders": [ @@ -4827,8 +4846,8 @@ "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z" + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z" }, { "id": "", @@ -4844,8 +4863,8 @@ "sourceConversationId": null, "lastSurfacedAt": null, "surfaceCount": 0, - "createdAt": "2026-05-05T03:53:01.000Z", - "updatedAt": "2026-05-05T03:54:01.000Z" + "createdAt": "2026-05-05T05:33:01.000Z", + "updatedAt": "2026-05-05T05:34:01.000Z" } ], "mentalHealthAssessments": [ @@ -4866,8 +4885,8 @@ "externalId": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-05T13:57:01.000Z", - "updatedAt": "2026-05-05T13:58:01.000Z" + "createdAt": "2026-05-05T15:37:01.000Z", + "updatedAt": "2026-05-05T15:38:01.000Z" }, { "id": "", @@ -4886,8 +4905,8 @@ "externalId": "rt-MentalHealthAssessment-externalId", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-05T13:57:00.000Z", - "updatedAt": "2026-05-05T13:58:00.000Z" + "createdAt": "2026-05-05T15:37:00.000Z", + "updatedAt": "2026-05-05T15:38:00.000Z" } ], "consentReceipts": [ @@ -4897,7 +4916,7 @@ "artefact": "JVBERi0xLjQKJWZpeHR1cmU=", "signedAt": "2026-06-01T09:00:00.000Z", "revokedAt": null, - "createdAt": "2026-05-05T15:26:00.000Z" + "createdAt": "2026-05-05T17:06:00.000Z" }, { "id": "", @@ -4905,7 +4924,7 @@ "artefact": "eyJhbGciOiJub25lIn0.e30.", "signedAt": "2026-06-02T09:00:00.000Z", "revokedAt": "2026-07-10T11:00:00.000Z", - "createdAt": "2026-05-05T15:26:01.000Z" + "createdAt": "2026-05-05T17:06:01.000Z" } ], "documentConditionLinks": [ @@ -4927,8 +4946,8 @@ "committedRecordType": "labResult", "dataEncrypted": "", "provenanceEncrypted": "", - "createdAt": "2026-05-05T18:51:00.000Z", - "updatedAt": "2026-05-05T18:52:00.000Z" + "createdAt": "2026-05-05T20:31:00.000Z", + "updatedAt": "2026-05-05T20:32:00.000Z" } ], "documentImportKeys": [ @@ -4950,7 +4969,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { "metricType": "WALKING_RUNNING_DISTANCE", @@ -4962,7 +4981,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { "metricType": "WEIGHT", @@ -4974,19 +4993,19 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "userAchievements": [ { "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" }, { "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" } ], "environmentContexts": [ @@ -5032,8 +5051,8 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { "date": "2026-07-01", @@ -5077,8 +5096,8 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "environmentTravelLocations": [ @@ -5089,8 +5108,8 @@ "lon": null, "label": null, "locationEncrypted": "", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "dawarichDays": [ @@ -5105,8 +5124,8 @@ "countryCodeEncrypted": "", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "ecgRecordings": [ @@ -5123,8 +5142,8 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "symptomDefinitions": [ @@ -5134,8 +5153,8 @@ "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z", + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z", "events": [ { "id": "", @@ -5143,8 +5162,8 @@ "occurredAt": "2026-06-21T09:00:00.000Z", "intensity": 4, "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "id": "", @@ -5152,8 +5171,8 @@ "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ] }, @@ -5163,8 +5182,8 @@ "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z", + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z", "events": [ { "id": "", @@ -5172,8 +5191,8 @@ "occurredAt": "2026-06-21T11:00:00.000Z", "intensity": 8, "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" } ] } @@ -5187,8 +5206,8 @@ "startDate": "2023-09-01", "endDate": null, "precision": "MONTH", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z", + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z", "deletedAt": null }, { @@ -5199,8 +5218,8 @@ "startDate": "2025-12-01", "endDate": null, "precision": "DAY", - "createdAt": "2026-05-03T01:48:02.000Z", - "updatedAt": "2026-05-03T01:49:02.000Z", + "createdAt": "2026-05-03T03:28:02.000Z", + "updatedAt": "2026-05-03T03:29:02.000Z", "deletedAt": "" }, { @@ -5211,8 +5230,8 @@ "startDate": "2026-03-02", "endDate": "2026-05-29", "precision": "DAY", - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z", + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z", "deletedAt": null } ], @@ -5220,35 +5239,35 @@ { "labResultId": "", "documentId": "", - "createdAt": "2026-05-06T16:24:00.000Z" + "createdAt": "2026-05-06T18:04:00.000Z" } ], "encounterMedicationLinks": [ { "encounterId": "", "medicationId": "", - "createdAt": "2026-05-06T18:04:00.000Z" + "createdAt": "2026-05-06T19:44:00.000Z" } ], "encounterVaccinationLinks": [ { "encounterId": "", "vaccinationId": "", - "createdAt": "2026-05-06T19:44:00.000Z" + "createdAt": "2026-05-06T21:24:00.000Z" } ], "medicationDocumentLinks": [ { "medicationId": "", "documentId": "", - "createdAt": "2026-05-06T21:24:00.000Z" + "createdAt": "2026-05-06T23:04:00.000Z" } ], "medicationConditionLinks": [ { "medicationId": "", "episodeId": "", - "createdAt": "2026-05-06T23:04:00.000Z" + "createdAt": "2026-05-07T00:44:00.000Z" } ], "nutrientDays": [ @@ -5259,8 +5278,8 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z", - "updatedAt": "2026-05-03T23:28:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z", + "updatedAt": "2026-05-04T01:08:00.000Z" } ] } diff --git a/tests/integration/__golden__/backup-parity/restore-portable.json b/tests/integration/__golden__/backup-parity/restore-portable.json index aa51b9810..4602f1190 100644 --- a/tests/integration/__golden__/backup-parity/restore-portable.json +++ b/tests/integration/__golden__/backup-parity/restore-portable.json @@ -18,6 +18,7 @@ "cycleDayLogs": 1, "nutrientDays": 1, "labResults": 1, + "labResultImportKeys": 1, "biomarkers": 1, "illnessEpisodes": 3, "illnessDayLogs": 1, @@ -121,6 +122,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -338,6 +340,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -983,6 +986,15 @@ "deletedAt": null } ], + "LabResultImportKey": [ + { + "id": "", + "userId": "round-trip-owner", + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" + } + ], "Biomarker": [ { "id": "", @@ -1001,7 +1013,7 @@ ], "Allergy": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "substance": "Penicillin", "category": "FOOD", @@ -1011,27 +1023,27 @@ "onsetAt": "2026-06-30T12:34:56.789Z", "reactionEncrypted": "", "notesEncrypted": "", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z", + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z", "deletedAt": null } ], "FamilyHistoryEntry": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "relationship": "MOTHER", "condition": "Type 2 diabetes", "ageAtOnset": 3, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z", + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z", "deletedAt": null } ], "IllnessEpisode": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Cold", "type": "INFECTION", @@ -1042,28 +1054,28 @@ "noteEncrypted": "", "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:00.000Z", - "updatedAt": "2026-05-02T17:32:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Iron deficiency flare", "type": "CHRONIC", "lifecycle": "FLARE", "onsetAt": "2026-06-25T00:00:00.000Z", "resolvedAt": null, - "parentConditionId": "", + "parentConditionId": "", "noteEncrypted": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:03.000Z", - "updatedAt": "2026-05-02T17:32:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Iron deficiency", "type": "CHRONIC", @@ -1074,94 +1086,94 @@ "noteEncrypted": null, "bodySiteEncrypted": "", "laterality": "BOTH", - "createdAt": "2026-05-02T17:31:01.000Z", - "updatedAt": "2026-05-02T17:32:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "deletedAt": null } ], "IllnessDayLog": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "episodeId": "", + "episodeId": "", "date": "2026-06-21", "functionalImpact": 3, "feverC": 2.5, "noteEncrypted": "", "tz": null, "createdAt": "", - "updatedAt": "2026-05-02T19:09:00.000Z", + "updatedAt": "2026-05-02T20:49:00.000Z", "deletedAt": null } ], "IllnessSymptomLink": [ { - "dayLogId": "", - "symptomId": "", + "dayLogId": "", + "symptomId": "", "severity": 2, "createdAt": "" } ], "SymptomDefinition": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "labelEncrypted": "", "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z" + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "labelEncrypted": "", "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z" + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z" } ], "SymptomEvent": [ - { - "id": "", - "userId": "round-trip-owner", - "definitionId": "", - "occurredAt": "2026-06-21T09:00:00.000Z", - "intensity": 4, - "noteEncrypted": null, - "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" - }, { "id": "", "userId": "round-trip-owner", "definitionId": "", - "occurredAt": "2026-06-21T11:00:00.000Z", - "intensity": 8, - "noteEncrypted": "", - "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "occurredAt": "2026-06-21T09:00:00.000Z", + "intensity": 4, + "noteEncrypted": null, + "episodeId": "", + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "id": "", "userId": "round-trip-owner", - "definitionId": "", + "definitionId": "", + "occurredAt": "2026-06-21T11:00:00.000Z", + "intensity": 8, + "noteEncrypted": "", + "episodeId": null, + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" + }, + { + "id": "", + "userId": "round-trip-owner", + "definitionId": "", "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "noteEncrypted": null, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ], "LifeEvent": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "HOME", "startDate": "2023-09-01", @@ -1169,12 +1181,12 @@ "precision": "MONTH", "titleEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z", + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "WORK", "startDate": "2026-03-02", @@ -1182,14 +1194,14 @@ "precision": "DAY", "titleEncrypted": "", "noteEncrypted": null, - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z", + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z", "deletedAt": null } ], "UserHealthProfile": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "aboutMeEncrypted": "", "conditionsEncrypted": "", @@ -1215,7 +1227,7 @@ "HealthProfileFactRevision": [], "CycleProfile": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "goal": "AVOID_PREGNANCY", "cycleTrackingEnabled": true, @@ -1234,7 +1246,7 @@ "MenstrualCycle": [], "CycleDayLog": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-02", "cycleId": null, @@ -1265,7 +1277,7 @@ ], "CycleSymptom": [ { - "id": "", + "id": "", "categoryId": "csc_physical", "key": "custom:round-trip-cramps", "labelKey": "cycle.symptom.custom", @@ -1278,15 +1290,15 @@ ], "CycleSymptomLink": [ { - "dayLogId": "", - "symptomId": "", + "dayLogId": "", + "symptomId": "", "severity": 3, "createdAt": "" } ], "CustomMetric": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Grip strength", "unit": "kg", @@ -1302,9 +1314,9 @@ ], "CustomMetricEntry": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 44, "unit": "kg", "measuredAt": "2026-07-01T18:00:00.000Z", @@ -1314,9 +1326,9 @@ "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 45, "unit": "kg", "measuredAt": "2026-07-02T18:00:00.000Z", @@ -1328,7 +1340,7 @@ ], "CorrelationPattern": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "canonicalKey": "p1:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "family": "sleep", @@ -1346,13 +1358,13 @@ "dismissedEvidenceHash": "abababababababababababababababababababababababababababababababab", "dismissedEffectSize": 2.5, "dismissedSampleSize": 3, - "createdAt": "2026-05-03T18:38:00.000Z", + "createdAt": "2026-05-03T20:18:00.000Z", "updatedAt": "" } ], "HealthScoreRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "dayKey": "2026-07-01", "timezone": "Europe/Berlin", @@ -1370,13 +1382,13 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z", + "computedAt": "2026-05-03T21:52:00.000Z", "createdAt": "" } ], "Workout": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "sportType": "RUNNING", "startedAt": "2026-06-29T06:00:00.000Z", @@ -1407,14 +1419,14 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z", + "createdAt": "2026-05-04T01:07:00.000Z", "updatedAt": "" } ], "InboundDocument": [], "Practitioner": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Round-trip practice", "specialty": "Internal medicine", @@ -1424,26 +1436,26 @@ "locationEncrypted": "", "phoneEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z", + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z", "deletedAt": null } ], "Encounter": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-06-30T08:00:00.000Z", "status": "PLANNED", "kind": "ROUTINE", - "practitionerId": "", + "practitionerId": "", "reasonEncrypted": "", "outcomeEncrypted": "", "bodySiteEncrypted": "", "laterality": "LEFT", - "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z", + "reminderId": "", + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z", "deletedAt": null } ], @@ -1451,16 +1463,16 @@ "EncounterLabLink": [], "EncounterConditionLink": [ { - "id": "", - "encounterId": "", - "episodeId": "", + "id": "", + "encounterId": "", + "episodeId": "", "userId": "round-trip-owner", - "createdAt": "2026-05-04T09:24:00.000Z" + "createdAt": "2026-05-04T11:04:00.000Z" } ], "VaccinationRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-05-14T00:00:00.000Z", "antigenSlug": "tdap", @@ -1469,20 +1481,20 @@ "seriesDoses": 3, "lotNumber": "RT-4471", "site": "LEFT_ARM", - "practitionerId": "", - "encounterId": "", - "reminderId": "", - "customVaccineId": "", + "practitionerId": "", + "encounterId": "", + "reminderId": "", + "customVaccineId": "", "noteEncrypted": "", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z", + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z", "deletedAt": null } ], "VaccinationDocumentLink": [], "CustomVaccine": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Round-trip travel combo", "components": [ @@ -1492,13 +1504,13 @@ "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, "deletedAt": null, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z" + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z" } ], "MeasurementReminder": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Blutdruck messen", "measurementType": "BLOOD_PRESSURE_SYS", @@ -1517,53 +1529,53 @@ "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, "lastNotifiedAt": null, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z", + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z", "deletedAt": null } ], "MeasurementReminderEvent": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "reminderId": "", + "reminderId": "", "kind": "SATISFIED", "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "reminderId": "", + "reminderId": "", "kind": "SKIPPED", "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" } ], "CoachConversation": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "title": null, "titleEncrypted": "", - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "summaryEncrypted": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, "documentScoped": true }, { - "id": "", + "id": "", "userId": "round-trip-owner", "title": null, "titleEncrypted": "", - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "summaryEncrypted": "", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, @@ -1572,8 +1584,8 @@ ], "CoachMessage": [ { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "assistant", "encryptedContent": "", "metricSourceJson": null, @@ -1586,8 +1598,8 @@ "createdAt": "2026-07-20T09:59:00.000Z" }, { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "user", "encryptedContent": "", "metricSourceJson": "rt-CoachMessage-metricSourceJson", @@ -1600,8 +1612,8 @@ "createdAt": "2026-07-20T09:58:00.000Z" }, { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "user", "encryptedContent": "", "metricSourceJson": null, @@ -1617,23 +1629,23 @@ "CoachConversationDocument": [], "CoachFact": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "factEncrypted": "", "category": "constraint", "confidence": 80, - "sourceConversationId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z", "deletedAt": null, "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", - "sourceMessageId": "" + "sourceMessageId": "" } ], "CoachPlan": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "metric": "BLOOD_PRESSURE", "ifCueEncrypted": "", @@ -1642,35 +1654,35 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "outcomeEncrypted": "", - "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z", "deletedAt": null } ], "CoachReminder": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "noteEncrypted": "", "metric": "BLOOD_PRESSURE", - "relatedPlanId": "", + "relatedPlanId": "", "triggerKind": "rt-CoachReminder-triggerKind", "dueAt": "2026-09-01T07:00:00.000Z", "contextCue": "rt-CoachReminder-contextCue", "status": "rt-CoachReminder-status", "source": "extractor", - "sourceConversationId": "", + "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z", + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z", "deletedAt": null } ], "MedicationInventoryItem": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "medicationId": "", "state": "ACTIVE", @@ -1678,18 +1690,18 @@ "unitsTotal": "decimal:30", "unitsRemaining": "decimal:21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", "notes": null, "notesEncrypted": "", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "medicationId": "", "state": "USED_UP", @@ -1704,20 +1716,20 @@ "doseStrength": null, "notes": null, "notesEncrypted": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "MedicationInventoryEvent": [ { - "id": "", + "id": "", "medicationId": "", "delta": -8, "reason": "consumed", "occurredAt": "2026-07-09T07:00:00.000Z" }, { - "id": "", + "id": "", "medicationId": "", "delta": 30, "reason": "purchased", @@ -1740,12 +1752,12 @@ { "userId": "round-trip-owner", "moodTagId": "mt_grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "ReminderPhaseConfig": [ { - "id": "", + "id": "", "medicationId": "", "greenValue": 45, "greenMode": "PERCENT", @@ -1763,7 +1775,7 @@ "ExtractedFact": [], "DocumentImportKey": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "sourceSystem": "PAPRA", "sourceId": "doc_deleted", @@ -1773,7 +1785,7 @@ ], "PersonalRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WALKING_RUNNING_DISTANCE", "metricSlot": "running_10km_time", @@ -1784,10 +1796,10 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WALKING_RUNNING_DISTANCE", "metricSlot": "running_5km_time", @@ -1798,10 +1810,10 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WEIGHT", "metricSlot": null, @@ -1812,28 +1824,28 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "UserAchievement": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" } ], "EnvironmentContext": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-15", "locationEncrypted": "", @@ -1873,11 +1885,11 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-07-01", "locationEncrypted": "", @@ -1917,24 +1929,24 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "EnvironmentTravelLocation": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-06-10", "endDate": "2026-06-20", "locationEncrypted": "", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "DawarichDay": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-15", "totalDistanceM": 48300, @@ -1945,13 +1957,13 @@ "countryCodeEncrypted": "", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "MedicationScheduleRevision": [ { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-01-01T00:00:00.000Z", "validUntil": "2026-03-01T00:00:00.000Z", @@ -1964,10 +1976,10 @@ ], "source": "ARCHIVED", "supersededByRevisionId": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-02-01T00:00:00.000Z", "validUntil": "2026-03-01T00:00:00.000Z", @@ -1979,11 +1991,11 @@ } ], "source": "ARCHIVED", - "supersededByRevisionId": "", - "createdAt": "2026-05-06T06:27:02.000Z" + "supersededByRevisionId": "", + "createdAt": "2026-05-06T08:07:02.000Z" }, { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-03-01T00:00:00.000Z", "validUntil": "2026-05-01T00:00:00.000Z", @@ -1996,12 +2008,12 @@ ], "source": "MANUAL", "supersededByRevisionId": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "MedicationEfficacyTarget": [ { - "id": "", + "id": "", "medicationId": "", "measurementType": "WEIGHT", "biomarkerId": "", @@ -2012,7 +2024,7 @@ ], "EcgRecording": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "source": "MANUAL", "externalRecordingId": "round-trip-signal-1", @@ -2025,13 +2037,13 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "OnboardingRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "needsJson": { "areas": [ @@ -2100,7 +2112,7 @@ ], "BiomarkerAlias": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "biomarkerId": "", "name": "Ferr.", @@ -2111,47 +2123,47 @@ ], "BiomarkerMerge": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "targetBiomarkerId": "", "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" } ], "LabResultDocumentLink": [], "EncounterMedicationLink": [ { - "id": "", - "encounterId": "", + "id": "", + "encounterId": "", "medicationId": "", "userId": "round-trip-owner", - "createdAt": "2026-05-06T18:04:00.000Z" + "createdAt": "2026-05-06T19:44:00.000Z" } ], "EncounterVaccinationLink": [ { - "id": "", - "encounterId": "", - "vaccinationId": "", + "id": "", + "encounterId": "", + "vaccinationId": "", "userId": "round-trip-owner", - "createdAt": "2026-05-06T19:44:00.000Z" + "createdAt": "2026-05-06T21:24:00.000Z" } ], "MedicationDocumentLink": [], "MedicationConditionLink": [ { - "id": "", + "id": "", "medicationId": "", - "episodeId": "", + "episodeId": "", "userId": "round-trip-owner", - "createdAt": "2026-05-06T23:04:00.000Z" + "createdAt": "2026-05-07T00:44:00.000Z" } ], "AccountGrant": [ { - "id": "", + "id": "", "grantorId": "round-trip-owner", "granteeId": "parity-delegate", "access": "READ", @@ -2721,13 +2733,13 @@ "unitsTotal": "30", "unitsRemaining": "21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { "notes": null, @@ -2741,8 +2753,8 @@ "purchasedAt": null, "manufacturer": null, "doseStrength": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "phaseConfig": { @@ -2780,7 +2792,7 @@ ], "source": "ARCHIVED", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { "validFrom": "2026-02-01T00:00:00.000Z", @@ -2794,7 +2806,7 @@ ], "source": "ARCHIVED", "supersededByIndex": 2, - "createdAt": "2026-05-06T06:27:02.000Z" + "createdAt": "2026-05-06T08:07:02.000Z" }, { "validFrom": "2026-03-01T00:00:00.000Z", @@ -2808,7 +2820,7 @@ ], "source": "MANUAL", "supersededByIndex": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "efficacyTargets": [ @@ -2891,7 +2903,7 @@ "hiddenMoodTags": [ { "key": "grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "customMoodTags": [ @@ -3012,7 +3024,14 @@ "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" + } + ], + "labResultImportKeys": [ + { + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" } ], "illnessEpisodes": [ @@ -3027,8 +3046,8 @@ "note": null, "bodySite": null, "laterality": null, - "createdAt": "2026-05-02T17:31:03.000Z", - "updatedAt": "2026-05-02T17:32:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "dayLogs": [] }, { @@ -3042,8 +3061,8 @@ "note": "rt-IllnessEpisode-noteEncrypted", "bodySite": null, "laterality": null, - "createdAt": "2026-05-02T17:31:00.000Z", - "updatedAt": "2026-05-02T17:32:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "dayLogs": [ { "id": "", @@ -3058,7 +3077,7 @@ } ], "note": "rt-IllnessDayLog-noteEncrypted", - "updatedAt": "2026-05-02T19:09:00.000Z" + "updatedAt": "2026-05-02T20:49:00.000Z" } ] }, @@ -3073,8 +3092,8 @@ "note": null, "bodySite": "Stomach", "laterality": "BOTH", - "createdAt": "2026-05-02T17:31:01.000Z", - "updatedAt": "2026-05-02T17:32:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "dayLogs": [] } ], @@ -3089,8 +3108,8 @@ "onsetAt": "2026-06-30T12:34:56.789Z", "reaction": "rt-Allergy-reactionEncrypted", "note": "rt-Allergy-notesEncrypted", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z" + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z" } ], "familyHistory": [ @@ -3100,8 +3119,8 @@ "condition": "Type 2 diabetes", "ageAtOnset": 3, "note": "rt-FamilyHistoryEntry-notesEncrypted", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z" + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z" } ], "workouts": [ @@ -3187,7 +3206,7 @@ ], "correlationPatterns": [ { - "createdAt": "2026-05-03T18:38:00.000Z", + "createdAt": "2026-05-03T20:18:00.000Z", "canonicalKey": "p1:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "family": "sleep", "factorKey": "sleep_duration", @@ -3288,7 +3307,7 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z" } ], "onboardingRecord": { @@ -3363,8 +3382,8 @@ "location": "rt-Practitioner-locationEncrypted", "phone": "rt-Practitioner-phoneEncrypted", "note": "ring the upper bell", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z" + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z" } ], "encounters": [ @@ -3379,8 +3398,8 @@ "bodySite": "rt-Encounter-bodySiteEncrypted", "laterality": "LEFT", "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z" + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z" } ], "encounterDocumentLinks": [], @@ -3389,7 +3408,7 @@ { "encounterId": "", "targetId": "", - "createdAt": "2026-05-04T09:24:00.000Z" + "createdAt": "2026-05-04T11:04:00.000Z" } ], "customVaccines": [ @@ -3402,8 +3421,8 @@ ], "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z" + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z" } ], "vaccinations": [ @@ -3421,8 +3440,8 @@ "reminderId": "", "customVaccineId": "", "note": "sore arm for a day, nothing else", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z" + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z" } ], "vaccinationDocumentLinks": [], @@ -3445,8 +3464,8 @@ "snoozedUntil": "2026-07-08T06:00:00.000Z", "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z" + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z" } ], "measurementReminderEvents": [ @@ -3457,7 +3476,7 @@ "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" }, { "id": "", @@ -3466,7 +3485,7 @@ "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" } ], "coachConversations": [ @@ -3477,8 +3496,8 @@ "summary": "earlier turns: weight trend and evening walks", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "messages": [ { "id": "", @@ -3516,8 +3535,8 @@ "summary": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "messages": [ { "id": "", @@ -3546,8 +3565,8 @@ "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", "sourceMessageId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z" + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z" } ], "coachPlans": [ @@ -3561,8 +3580,8 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z" + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z" } ], "coachReminders": [ @@ -3579,8 +3598,8 @@ "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z" + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z" } ], "mentalHealthAssessments": [], @@ -3606,7 +3625,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { "metricType": "WALKING_RUNNING_DISTANCE", @@ -3618,7 +3637,7 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { "metricType": "WEIGHT", @@ -3630,19 +3649,19 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "userAchievements": [ { "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" }, { "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" } ], "environmentContexts": [ @@ -3687,8 +3706,8 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { "date": "2026-07-01", @@ -3731,8 +3750,8 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "environmentTravelLocations": [ @@ -3742,8 +3761,8 @@ "lat": 41.4, "lon": 2.2, "label": "Barcelona", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "dawarichDays": [ @@ -3757,8 +3776,8 @@ "countryCode": "ES", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "ecgRecordings": [ @@ -3783,8 +3802,8 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "symptomDefinitions": [ @@ -3793,24 +3812,24 @@ "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z", + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z", "events": [ { "note": null, "occurredAt": "2026-06-21T09:00:00.000Z", "intensity": 4, "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "note": null, "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ] }, @@ -3819,16 +3838,16 @@ "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z", + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z", "events": [ { "note": "left side, behind the eye", "occurredAt": "2026-06-21T11:00:00.000Z", "intensity": 8, "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" } ] } @@ -3841,8 +3860,8 @@ "startDate": "2023-09-01", "endDate": null, "precision": "MONTH", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z" + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z" }, { "title": "Parental leave", @@ -3851,8 +3870,8 @@ "startDate": "2026-03-02", "endDate": "2026-05-29", "precision": "DAY", - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z" + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z" } ], "labResultDocumentLinks": [], @@ -3860,14 +3879,14 @@ { "encounterId": "", "medicationId": "", - "createdAt": "2026-05-06T18:04:00.000Z" + "createdAt": "2026-05-06T19:44:00.000Z" } ], "encounterVaccinationLinks": [ { "encounterId": "", "vaccinationId": "", - "createdAt": "2026-05-06T19:44:00.000Z" + "createdAt": "2026-05-06T21:24:00.000Z" } ], "medicationDocumentLinks": [], @@ -3875,7 +3894,7 @@ { "medicationId": "", "episodeId": "", - "createdAt": "2026-05-06T23:04:00.000Z" + "createdAt": "2026-05-07T00:44:00.000Z" } ], "nutrientDays": [ @@ -3886,7 +3905,7 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z" } ] } diff --git a/tests/integration/__golden__/backup-parity/restore-skips.json b/tests/integration/__golden__/backup-parity/restore-skips.json index d7803c7f9..bc632d4e5 100644 --- a/tests/integration/__golden__/backup-parity/restore-skips.json +++ b/tests/integration/__golden__/backup-parity/restore-skips.json @@ -18,6 +18,7 @@ "cycleDayLogs": 0, "nutrientDays": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "illnessEpisodes": 1, "illnessDayLogs": 1, @@ -136,6 +137,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -353,6 +355,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -651,6 +654,7 @@ } ], "LabResult": [], + "LabResultImportKey": [], "Biomarker": [], "Allergy": [], "FamilyHistoryEntry": [], diff --git a/tests/integration/__golden__/backup-parity/restore-version-1.json b/tests/integration/__golden__/backup-parity/restore-version-1.json index e74fb05d9..315ba86a5 100644 --- a/tests/integration/__golden__/backup-parity/restore-version-1.json +++ b/tests/integration/__golden__/backup-parity/restore-version-1.json @@ -18,6 +18,7 @@ "cycleDayLogs": 0, "nutrientDays": 1, "labResults": 1, + "labResultImportKeys": 0, "biomarkers": 1, "illnessEpisodes": 2, "illnessDayLogs": 1, @@ -75,6 +76,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -292,6 +294,7 @@ "cycleDayLogs": 0, "cycleProfile": 0, "labResults": 0, + "labResultImportKeys": 0, "biomarkers": 0, "nutrientDays": 0, "illnessEpisodes": 0, @@ -745,6 +748,7 @@ "deletedAt": null } ], + "LabResultImportKey": [], "Biomarker": [ { "id": "", @@ -1660,6 +1664,7 @@ } ], "biomarkerMerges": [], + "labResultImportKeys": [], "illnessEpisodes": [ { "id": "legacy-episode-child", diff --git a/tests/integration/__golden__/backup-parity/seeded-account.json b/tests/integration/__golden__/backup-parity/seeded-account.json index 647d0adb0..95a73fdd0 100644 --- a/tests/integration/__golden__/backup-parity/seeded-account.json +++ b/tests/integration/__golden__/backup-parity/seeded-account.json @@ -588,6 +588,15 @@ "deletedAt": "" } ], + "LabResultImportKey": [ + { + "id": "", + "userId": "round-trip-owner", + "source": "APPLE_HEALTH", + "externalId": "fhir:round-trip-deleted-result", + "createdAt": "2026-07-04T09:00:00.000Z" + } + ], "Biomarker": [ { "id": "", @@ -600,13 +609,13 @@ "panel": "rt-Biomarker-panel", "hidden": true, "analyteKey": "rt-Biomarker-analyteKey", - "createdAt": "2026-05-02T12:30:00.000Z", - "updatedAt": "2026-05-02T12:31:00.000Z" + "createdAt": "2026-05-02T14:10:00.000Z", + "updatedAt": "2026-05-02T14:11:00.000Z" } ], "Allergy": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "substance": "Latex (deleted)", "category": "OTHER", @@ -616,12 +625,12 @@ "onsetAt": null, "reactionEncrypted": null, "notesEncrypted": null, - "createdAt": "2026-05-02T14:10:01.000Z", - "updatedAt": "2026-05-02T14:11:01.000Z", + "createdAt": "2026-05-02T15:50:01.000Z", + "updatedAt": "2026-05-02T15:51:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "substance": "Penicillin", "category": "FOOD", @@ -631,38 +640,38 @@ "onsetAt": "2026-06-30T12:34:56.789Z", "reactionEncrypted": "", "notesEncrypted": "", - "createdAt": "2026-05-02T14:10:00.000Z", - "updatedAt": "2026-05-02T14:11:00.000Z", + "createdAt": "2026-05-02T15:50:00.000Z", + "updatedAt": "2026-05-02T15:51:00.000Z", "deletedAt": null } ], "FamilyHistoryEntry": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "relationship": "FATHER", "condition": "Hypertension (deleted)", "ageAtOnset": null, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:01.000Z", - "updatedAt": "2026-05-02T15:47:01.000Z", + "createdAt": "2026-05-02T17:26:01.000Z", + "updatedAt": "2026-05-02T17:27:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "relationship": "MOTHER", "condition": "Type 2 diabetes", "ageAtOnset": 3, "notesEncrypted": "", - "createdAt": "2026-05-02T15:46:00.000Z", - "updatedAt": "2026-05-02T15:47:00.000Z", + "createdAt": "2026-05-02T17:26:00.000Z", + "updatedAt": "2026-05-02T17:27:00.000Z", "deletedAt": null } ], "IllnessEpisode": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Cold", "type": "INFECTION", @@ -673,28 +682,28 @@ "noteEncrypted": "", "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:00.000Z", - "updatedAt": "2026-05-02T17:32:00.000Z", + "createdAt": "2026-05-02T19:11:00.000Z", + "updatedAt": "2026-05-02T19:12:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Iron deficiency flare", "type": "CHRONIC", "lifecycle": "FLARE", "onsetAt": "2026-06-25T00:00:00.000Z", "resolvedAt": null, - "parentConditionId": "", + "parentConditionId": "", "noteEncrypted": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:03.000Z", - "updatedAt": "2026-05-02T17:32:03.000Z", + "createdAt": "2026-05-02T19:11:03.000Z", + "updatedAt": "2026-05-02T19:12:03.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Iron deficiency", "type": "CHRONIC", @@ -705,12 +714,12 @@ "noteEncrypted": null, "bodySiteEncrypted": "", "laterality": "BOTH", - "createdAt": "2026-05-02T17:31:01.000Z", - "updatedAt": "2026-05-02T17:32:01.000Z", + "createdAt": "2026-05-02T19:11:01.000Z", + "updatedAt": "2026-05-02T19:12:01.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Sprained ankle (deleted)", "type": "INJURY", @@ -721,107 +730,107 @@ "noteEncrypted": null, "bodySiteEncrypted": null, "laterality": null, - "createdAt": "2026-05-02T17:31:02.000Z", - "updatedAt": "2026-05-02T17:32:02.000Z", + "createdAt": "2026-05-02T19:11:02.000Z", + "updatedAt": "2026-05-02T19:12:02.000Z", "deletedAt": "" } ], "IllnessDayLog": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "episodeId": "", + "episodeId": "", "date": "2026-06-21", "functionalImpact": 3, "feverC": 2.5, "noteEncrypted": "", "tz": "rt-IllnessDayLog-tz", - "createdAt": "2026-05-02T19:08:00.000Z", - "updatedAt": "2026-05-02T19:09:00.000Z", + "createdAt": "2026-05-02T20:48:00.000Z", + "updatedAt": "2026-05-02T20:49:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "episodeId": "", + "episodeId": "", "date": "2026-06-22", "functionalImpact": null, "feverC": null, "noteEncrypted": null, "tz": null, - "createdAt": "2026-05-02T19:08:01.000Z", - "updatedAt": "2026-05-02T19:09:01.000Z", + "createdAt": "2026-05-02T20:48:01.000Z", + "updatedAt": "2026-05-02T20:49:01.000Z", "deletedAt": "" } ], "IllnessSymptomLink": [ { - "dayLogId": "", - "symptomId": "", + "dayLogId": "", + "symptomId": "", "severity": 2, - "createdAt": "2026-05-02T20:43:00.000Z" + "createdAt": "2026-05-02T22:23:00.000Z" } ], "SymptomDefinition": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "labelEncrypted": "", "icon": "Zap", "sortOrder": 0, "isActive": true, - "createdAt": "2026-05-02T22:26:00.000Z", - "updatedAt": "2026-05-02T22:27:00.000Z" + "createdAt": "2026-05-03T00:06:00.000Z", + "updatedAt": "2026-05-03T00:07:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "labelEncrypted": "", "icon": "Brain", "sortOrder": 1, "isActive": false, - "createdAt": "2026-05-02T22:26:01.000Z", - "updatedAt": "2026-05-02T22:27:01.000Z" + "createdAt": "2026-05-03T00:06:01.000Z", + "updatedAt": "2026-05-03T00:07:01.000Z" } ], "SymptomEvent": [ - { - "id": "", - "userId": "round-trip-owner", - "definitionId": "", - "occurredAt": "2026-06-21T09:00:00.000Z", - "intensity": 4, - "noteEncrypted": null, - "episodeId": "", - "createdAt": "2026-05-03T00:07:00.000Z", - "updatedAt": "2026-05-03T00:08:00.000Z" - }, { "id": "", "userId": "round-trip-owner", "definitionId": "", - "occurredAt": "2026-06-21T11:00:00.000Z", - "intensity": 8, - "noteEncrypted": "", - "episodeId": null, - "createdAt": "2026-05-03T00:07:01.000Z", - "updatedAt": "2026-05-03T00:08:01.000Z" + "occurredAt": "2026-06-21T09:00:00.000Z", + "intensity": 4, + "noteEncrypted": null, + "episodeId": "", + "createdAt": "2026-05-03T01:47:00.000Z", + "updatedAt": "2026-05-03T01:48:00.000Z" }, { "id": "", "userId": "round-trip-owner", - "definitionId": "", + "definitionId": "", + "occurredAt": "2026-06-21T11:00:00.000Z", + "intensity": 8, + "noteEncrypted": "", + "episodeId": null, + "createdAt": "2026-05-03T01:47:01.000Z", + "updatedAt": "2026-05-03T01:48:01.000Z" + }, + { + "id": "", + "userId": "round-trip-owner", + "definitionId": "", "occurredAt": "2026-07-10T18:30:00.000Z", "intensity": 2, "noteEncrypted": null, "episodeId": null, - "createdAt": "2026-05-03T00:07:02.000Z", - "updatedAt": "2026-05-03T00:08:02.000Z" + "createdAt": "2026-05-03T01:47:02.000Z", + "updatedAt": "2026-05-03T01:48:02.000Z" } ], "LifeEvent": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "HOME", "startDate": "2023-09-01", @@ -829,12 +838,12 @@ "precision": "MONTH", "titleEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-03T01:48:00.000Z", - "updatedAt": "2026-05-03T01:49:00.000Z", + "createdAt": "2026-05-03T03:28:00.000Z", + "updatedAt": "2026-05-03T03:29:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "OTHER", "startDate": "2025-12-01", @@ -842,12 +851,12 @@ "precision": "DAY", "titleEncrypted": "", "noteEncrypted": null, - "createdAt": "2026-05-03T01:48:02.000Z", - "updatedAt": "2026-05-03T01:49:02.000Z", + "createdAt": "2026-05-03T03:28:02.000Z", + "updatedAt": "2026-05-03T03:29:02.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "category": "WORK", "startDate": "2026-03-02", @@ -855,14 +864,14 @@ "precision": "DAY", "titleEncrypted": "", "noteEncrypted": null, - "createdAt": "2026-05-03T01:48:01.000Z", - "updatedAt": "2026-05-03T01:49:01.000Z", + "createdAt": "2026-05-03T03:28:01.000Z", + "updatedAt": "2026-05-03T03:29:01.000Z", "deletedAt": null } ], "UserHealthProfile": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "aboutMeEncrypted": "", "conditionsEncrypted": "", @@ -881,24 +890,24 @@ "lifeConfirmedJson": { "roundTrip": "rt-UserHealthProfile-lifeConfirmedJson" }, - "createdAt": "2026-05-03T03:35:00.000Z", - "updatedAt": "2026-05-03T03:36:00.000Z" + "createdAt": "2026-05-03T05:15:00.000Z", + "updatedAt": "2026-05-03T05:16:00.000Z" } ], "HealthProfileFactRevision": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "SMOKING_STATUS", "valueEncrypted": "", "validFrom": "2026-01-01T00:00:00.000Z", "validUntil": "2026-06-30T12:34:56.789Z", "provenance": "USER_CORRECTION", - "supersededByRevisionId": "", - "createdAt": "2026-05-03T05:08:00.000Z" + "supersededByRevisionId": "", + "createdAt": "2026-05-03T06:48:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "SMOKING_STATUS", "valueEncrypted": "", @@ -906,12 +915,12 @@ "validUntil": null, "provenance": "USER_REPORTED", "supersededByRevisionId": null, - "createdAt": "2026-05-03T05:08:01.000Z" + "createdAt": "2026-05-03T06:48:01.000Z" } ], "CycleProfile": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "goal": "AVOID_PREGNANCY", "cycleTrackingEnabled": true, @@ -923,13 +932,13 @@ "rawChartMode": true, "discreetNotifications": true, "sensitiveCategoryEncryption": false, - "createdAt": "2026-05-03T06:52:00.000Z", - "updatedAt": "2026-05-03T06:53:00.000Z" + "createdAt": "2026-05-03T08:32:00.000Z", + "updatedAt": "2026-05-03T08:33:00.000Z" } ], "MenstrualCycle": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-05-04", "endDate": null, @@ -942,11 +951,11 @@ "syncVersion": 0, "deletedAt": "", "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:02.000Z", - "updatedAt": "2026-05-03T08:34:02.000Z" + "createdAt": "2026-05-03T10:13:02.000Z", + "updatedAt": "2026-05-03T10:14:02.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-06-01", "endDate": "rt-MenstrualCycle-endDate", @@ -959,11 +968,11 @@ "syncVersion": 3, "deletedAt": null, "absorbedIntoId": null, - "createdAt": "2026-05-03T08:33:00.000Z", - "updatedAt": "2026-05-03T08:34:00.000Z" + "createdAt": "2026-05-03T10:13:00.000Z", + "updatedAt": "2026-05-03T10:14:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-06-03", "endDate": null, @@ -975,17 +984,17 @@ "tz": null, "syncVersion": 0, "deletedAt": "2026-06-04T07:00:00.000Z", - "absorbedIntoId": "", - "createdAt": "2026-05-03T08:33:01.000Z", - "updatedAt": "2026-05-03T08:34:01.000Z" + "absorbedIntoId": "", + "createdAt": "2026-05-03T10:13:01.000Z", + "updatedAt": "2026-05-03T10:14:01.000Z" } ], "CycleDayLog": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-02", - "cycleId": "", + "cycleId": "", "flow": "HEAVY", "intermenstrualBleeding": true, "basalBodyTempC": 2.5, @@ -1007,14 +1016,14 @@ "tz": "rt-CycleDayLog-tz", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-03T10:25:00.000Z", - "updatedAt": "2026-05-03T10:26:00.000Z" + "createdAt": "2026-05-03T12:05:00.000Z", + "updatedAt": "2026-05-03T12:06:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-03", - "cycleId": "", + "cycleId": "", "flow": "LIGHT", "intermenstrualBleeding": false, "basalBodyTempC": null, @@ -1036,13 +1045,13 @@ "tz": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-03T10:25:01.000Z", - "updatedAt": "2026-05-03T10:26:01.000Z" + "createdAt": "2026-05-03T12:05:01.000Z", + "updatedAt": "2026-05-03T12:06:01.000Z" } ], "CycleSymptom": [ { - "id": "", + "id": "", "categoryId": "csc_physical", "key": "custom:round-trip-cramps", "labelKey": "cycle.symptom.custom", @@ -1055,15 +1064,15 @@ ], "CycleSymptomLink": [ { - "dayLogId": "", - "symptomId": "", + "dayLogId": "", + "symptomId": "", "severity": 3, - "createdAt": "2026-05-03T13:23:00.000Z" + "createdAt": "2026-05-03T15:03:00.000Z" } ], "CustomMetric": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Grip strength", "unit": "kg", @@ -1072,12 +1081,12 @@ "decimals": 3, "description": "rt-CustomMetric-description", "correlationEnabled": true, - "createdAt": "2026-05-03T15:09:00.000Z", - "updatedAt": "2026-05-03T15:10:00.000Z", + "createdAt": "2026-05-03T16:49:00.000Z", + "updatedAt": "2026-05-03T16:50:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Plank (deleted)", "unit": "s", @@ -1086,52 +1095,52 @@ "decimals": null, "description": null, "correlationEnabled": false, - "createdAt": "2026-05-03T15:09:01.000Z", - "updatedAt": "2026-05-03T15:10:01.000Z", + "createdAt": "2026-05-03T16:49:01.000Z", + "updatedAt": "2026-05-03T16:50:01.000Z", "deletedAt": "" } ], "CustomMetricEntry": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 40, "unit": "kg", "measuredAt": "2026-06-28T18:00:00.000Z", "note": null, "noteEncrypted": null, - "createdAt": "2026-05-03T16:48:02.000Z", + "createdAt": "2026-05-03T18:28:02.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 44, "unit": "kg", "measuredAt": "2026-07-01T18:00:00.000Z", "note": "left hand, after the long ride", "noteEncrypted": null, - "createdAt": "2026-05-03T16:48:00.000Z", + "createdAt": "2026-05-03T18:28:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "customMetricId": "", + "customMetricId": "", "value": 45, "unit": "kg", "measuredAt": "2026-07-02T18:00:00.000Z", "note": null, "noteEncrypted": "", - "createdAt": "2026-05-03T16:48:01.000Z", + "createdAt": "2026-05-03T18:28:01.000Z", "deletedAt": null } ], "CorrelationPattern": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "canonicalKey": "p1:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "family": "sleep", @@ -1149,13 +1158,13 @@ "dismissedEvidenceHash": "abababababababababababababababababababababababababababababababab", "dismissedEffectSize": 2.5, "dismissedSampleSize": 3, - "createdAt": "2026-05-03T18:38:00.000Z", - "updatedAt": "2026-05-03T18:39:00.000Z" + "createdAt": "2026-05-03T20:18:00.000Z", + "updatedAt": "2026-05-03T20:19:00.000Z" } ], "HealthScoreRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "dayKey": "2026-07-01", "timezone": "Europe/Berlin", @@ -1173,13 +1182,13 @@ "inputFingerprint": "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", "configVersion": 3, "configChangedAt": "2026-06-30T12:34:56.789Z", - "computedAt": "2026-05-03T20:12:00.000Z", - "createdAt": "2026-05-03T20:13:00.000Z" + "computedAt": "2026-05-03T21:52:00.000Z", + "createdAt": "2026-05-03T21:53:00.000Z" } ], "Workout": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "sportType": "RUNNING", "startedAt": "2026-06-29T06:00:00.000Z", @@ -1199,8 +1208,8 @@ "metadata": { "roundTrip": "rt-Workout-metadata" }, - "createdAt": "2026-05-03T21:58:00.000Z", - "updatedAt": "2026-05-03T21:59:00.000Z" + "createdAt": "2026-05-03T23:38:00.000Z", + "updatedAt": "2026-05-03T23:39:00.000Z" } ], "NutrientIntakeDay": [ @@ -1212,13 +1221,13 @@ "unit": "ml", "source": "MANUAL", "externalSourceVersion": "rt-NutrientIntakeDay-externalSourceVersion", - "createdAt": "2026-05-03T23:27:00.000Z", - "updatedAt": "2026-05-03T23:28:00.000Z" + "createdAt": "2026-05-04T01:07:00.000Z", + "updatedAt": "2026-05-04T01:08:00.000Z" } ], "InboundDocument": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "LAB_RESULT", "title": "June labs", @@ -1243,12 +1252,12 @@ "sourceInstance": "https://paperless.example.test", "aiReadDeferred": true, "extractionIncomplete": true, - "createdAt": "2026-05-04T01:25:00.000Z", - "updatedAt": "2026-05-04T01:26:00.000Z", + "createdAt": "2026-05-04T03:05:00.000Z", + "updatedAt": "2026-05-04T03:06:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "OTHER", "title": "Deleted scan", @@ -1273,14 +1282,14 @@ "sourceInstance": null, "aiReadDeferred": false, "extractionIncomplete": false, - "createdAt": "2026-05-04T01:25:01.000Z", - "updatedAt": "2026-05-04T01:26:01.000Z", + "createdAt": "2026-05-04T03:05:01.000Z", + "updatedAt": "2026-05-04T03:06:01.000Z", "deletedAt": "" } ], "Practitioner": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Closed practice (deleted)", "specialty": null, @@ -1290,12 +1299,12 @@ "locationEncrypted": null, "phoneEncrypted": null, "noteEncrypted": null, - "createdAt": "2026-05-04T02:50:01.000Z", - "updatedAt": "2026-05-04T02:51:01.000Z", + "createdAt": "2026-05-04T04:30:01.000Z", + "updatedAt": "2026-05-04T04:31:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Round-trip practice", "specialty": "Internal medicine", @@ -1305,75 +1314,75 @@ "locationEncrypted": "", "phoneEncrypted": "", "noteEncrypted": "", - "createdAt": "2026-05-04T02:50:00.000Z", - "updatedAt": "2026-05-04T02:51:00.000Z", + "createdAt": "2026-05-04T04:30:00.000Z", + "updatedAt": "2026-05-04T04:31:00.000Z", "deletedAt": null } ], "Encounter": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-04-02T08:00:00.000Z", "status": "DONE", "kind": "ROUTINE", - "practitionerId": "", + "practitionerId": "", "reasonEncrypted": null, "outcomeEncrypted": null, "bodySiteEncrypted": null, "laterality": null, "reminderId": null, - "createdAt": "2026-05-04T04:31:01.000Z", - "updatedAt": "2026-05-04T04:32:01.000Z", + "createdAt": "2026-05-04T06:11:01.000Z", + "updatedAt": "2026-05-04T06:12:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-06-30T08:00:00.000Z", "status": "PLANNED", "kind": "ROUTINE", - "practitionerId": "", + "practitionerId": "", "reasonEncrypted": "", "outcomeEncrypted": "", "bodySiteEncrypted": "", "laterality": "LEFT", - "reminderId": "", - "createdAt": "2026-05-04T04:31:00.000Z", - "updatedAt": "2026-05-04T04:32:00.000Z", + "reminderId": "", + "createdAt": "2026-05-04T06:11:00.000Z", + "updatedAt": "2026-05-04T06:12:00.000Z", "deletedAt": null } ], "EncounterDocumentLink": [ - { - "id": "", - "encounterId": "", - "documentId": "", - "userId": "round-trip-owner", - "createdAt": "2026-05-04T06:04:00.000Z" - } - ], - "EncounterLabLink": [ { "id": "", - "encounterId": "", - "labResultId": "", + "encounterId": "", + "documentId": "", "userId": "round-trip-owner", "createdAt": "2026-05-04T07:44:00.000Z" } ], - "EncounterConditionLink": [ + "EncounterLabLink": [ { "id": "", - "encounterId": "", - "episodeId": "", + "encounterId": "", + "labResultId": "", "userId": "round-trip-owner", "createdAt": "2026-05-04T09:24:00.000Z" } ], - "VaccinationRecord": [ + "EncounterConditionLink": [ { "id": "", + "encounterId": "", + "episodeId": "", + "userId": "round-trip-owner", + "createdAt": "2026-05-04T11:04:00.000Z" + } + ], + "VaccinationRecord": [ + { + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-04-14T00:00:00.000Z", "antigenSlug": "influenza", @@ -1387,12 +1396,12 @@ "reminderId": null, "customVaccineId": null, "noteEncrypted": null, - "createdAt": "2026-05-04T11:14:01.000Z", - "updatedAt": "2026-05-04T11:15:01.000Z", + "createdAt": "2026-05-04T12:54:01.000Z", + "updatedAt": "2026-05-04T12:55:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "occurredAt": "2026-05-14T00:00:00.000Z", "antigenSlug": "tdap", @@ -1401,28 +1410,28 @@ "seriesDoses": 3, "lotNumber": "RT-4471", "site": "LEFT_ARM", - "practitionerId": "", - "encounterId": "", - "reminderId": "", - "customVaccineId": "", + "practitionerId": "", + "encounterId": "", + "reminderId": "", + "customVaccineId": "", "noteEncrypted": "", - "createdAt": "2026-05-04T11:14:00.000Z", - "updatedAt": "2026-05-04T11:15:00.000Z", + "createdAt": "2026-05-04T12:54:00.000Z", + "updatedAt": "2026-05-04T12:55:00.000Z", "deletedAt": null } ], "VaccinationDocumentLink": [ { - "id": "", - "vaccinationId": "", - "documentId": "", + "id": "", + "vaccinationId": "", + "documentId": "", "userId": "round-trip-owner", - "createdAt": "2026-05-04T12:44:00.000Z" + "createdAt": "2026-05-04T14:24:00.000Z" } ], "CustomVaccine": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Deleted combo", "components": [ @@ -1431,11 +1440,11 @@ "typicalSeriesDoses": null, "boosterIntervalMonths": null, "deletedAt": "", - "createdAt": "2026-05-04T14:27:01.000Z", - "updatedAt": "2026-05-04T14:28:01.000Z" + "createdAt": "2026-05-04T16:07:01.000Z", + "updatedAt": "2026-05-04T16:08:01.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "name": "Round-trip travel combo", "components": [ @@ -1445,13 +1454,13 @@ "typicalSeriesDoses": 2, "boosterIntervalMonths": 36, "deletedAt": null, - "createdAt": "2026-05-04T14:27:00.000Z", - "updatedAt": "2026-05-04T14:28:00.000Z" + "createdAt": "2026-05-04T16:07:00.000Z", + "updatedAt": "2026-05-04T16:08:00.000Z" } ], "MeasurementReminder": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Blutdruck messen", "measurementType": "BLOOD_PRESSURE_SYS", @@ -1470,12 +1479,12 @@ "lastSkippedAt": "2026-06-24T06:00:00.000Z", "skipCount": 2, "lastNotifiedAt": null, - "createdAt": "2026-05-04T16:19:00.000Z", - "updatedAt": "2026-05-04T16:20:00.000Z", + "createdAt": "2026-05-04T17:59:00.000Z", + "updatedAt": "2026-05-04T18:00:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "label": "Gewicht (deleted)", "measurementType": "WEIGHT", @@ -1494,53 +1503,53 @@ "lastSkippedAt": null, "skipCount": 0, "lastNotifiedAt": null, - "createdAt": "2026-05-04T16:19:01.000Z", - "updatedAt": "2026-05-04T16:20:01.000Z", + "createdAt": "2026-05-04T17:59:01.000Z", + "updatedAt": "2026-05-04T18:00:01.000Z", "deletedAt": "" } ], "MeasurementReminderEvent": [ { - "id": "", + "id": "", "userId": "round-trip-owner", - "reminderId": "", + "reminderId": "", "kind": "SATISFIED", "occurredAt": "2026-07-01T06:05:00.000Z", "onTime": true, "source": "manual", - "createdAt": "2026-05-04T17:47:00.000Z" + "createdAt": "2026-05-04T19:27:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", - "reminderId": "", + "reminderId": "", "kind": "SKIPPED", "occurredAt": "2026-06-24T06:00:00.000Z", "onTime": false, "source": "skip", - "createdAt": "2026-05-04T17:47:01.000Z" + "createdAt": "2026-05-04T19:27:01.000Z" } ], "CoachConversation": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "title": "How is my blood pressure trending?", "titleEncrypted": null, - "createdAt": "2026-05-04T19:24:00.000Z", - "updatedAt": "2026-05-04T19:25:00.000Z", + "createdAt": "2026-05-04T21:04:00.000Z", + "updatedAt": "2026-05-04T21:05:00.000Z", "summaryEncrypted": "", "summaryUpdatedAt": "2026-07-20T10:00:00.000Z", "summaryTurnCount": 4, "documentScoped": false }, { - "id": "", + "id": "", "userId": "round-trip-owner", "title": null, "titleEncrypted": "", - "createdAt": "2026-05-04T19:24:01.000Z", - "updatedAt": "2026-05-04T19:25:01.000Z", + "createdAt": "2026-05-04T21:04:01.000Z", + "updatedAt": "2026-05-04T21:05:01.000Z", "summaryEncrypted": null, "summaryUpdatedAt": null, "summaryTurnCount": 0, @@ -1549,8 +1558,8 @@ ], "CoachMessage": [ { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "assistant", "encryptedContent": "", "metricSourceJson": null, @@ -1563,8 +1572,8 @@ "createdAt": "2026-07-20T09:59:00.000Z" }, { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "user", "encryptedContent": "", "metricSourceJson": "rt-CoachMessage-metricSourceJson", @@ -1577,8 +1586,8 @@ "createdAt": "2026-07-20T09:58:00.000Z" }, { - "id": "", - "conversationId": "", + "id": "", + "conversationId": "", "role": "user", "encryptedContent": "", "metricSourceJson": null, @@ -1593,44 +1602,44 @@ ], "CoachConversationDocument": [ { - "conversationId": "", - "documentId": "", + "conversationId": "", + "documentId": "", "addedAt": "2026-07-21T07:59:00.000Z" } ], "CoachFact": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "factEncrypted": "", "category": "preference", "confidence": 50, - "sourceConversationId": "", - "createdAt": "2026-05-05T00:26:01.000Z", - "updatedAt": "2026-05-05T00:27:01.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T02:06:01.000Z", + "updatedAt": "2026-05-05T02:07:01.000Z", "deletedAt": "", "source": "user", "lastUsedAt": null, "sourceMessageId": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "factEncrypted": "", "category": "constraint", "confidence": 80, - "sourceConversationId": "", - "createdAt": "2026-05-05T00:26:00.000Z", - "updatedAt": "2026-05-05T00:27:00.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T02:06:00.000Z", + "updatedAt": "2026-05-05T02:07:00.000Z", "deletedAt": null, "source": "user", "lastUsedAt": "2026-07-20T10:00:00.000Z", - "sourceMessageId": "" + "sourceMessageId": "" } ], "CoachPlan": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "metric": "BLOOD_PRESSURE", "ifCueEncrypted": "", @@ -1639,13 +1648,13 @@ "status": "active", "reviewDate": "2026-10-01T00:00:00.000Z", "outcomeEncrypted": "", - "sourceConversationId": "", - "createdAt": "2026-05-05T02:10:00.000Z", - "updatedAt": "2026-05-05T02:11:00.000Z", + "sourceConversationId": "", + "createdAt": "2026-05-05T03:50:00.000Z", + "updatedAt": "2026-05-05T03:51:00.000Z", "deletedAt": null }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metric": "WEIGHT", "ifCueEncrypted": "", @@ -1655,18 +1664,18 @@ "reviewDate": null, "outcomeEncrypted": null, "sourceConversationId": null, - "createdAt": "2026-05-05T02:10:01.000Z", - "updatedAt": "2026-05-05T02:11:01.000Z", + "createdAt": "2026-05-05T03:50:01.000Z", + "updatedAt": "2026-05-05T03:51:01.000Z", "deletedAt": "" } ], "CoachReminder": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "noteEncrypted": "", "metric": null, - "relatedPlanId": "", + "relatedPlanId": "", "triggerKind": "date", "dueAt": "2026-09-15T07:00:00.000Z", "contextCue": null, @@ -1675,32 +1684,32 @@ "sourceConversationId": null, "lastSurfacedAt": null, "surfaceCount": 0, - "createdAt": "2026-05-05T03:53:01.000Z", - "updatedAt": "2026-05-05T03:54:01.000Z", + "createdAt": "2026-05-05T05:33:01.000Z", + "updatedAt": "2026-05-05T05:34:01.000Z", "deletedAt": "" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "noteEncrypted": "", "metric": "BLOOD_PRESSURE", - "relatedPlanId": "", + "relatedPlanId": "", "triggerKind": "rt-CoachReminder-triggerKind", "dueAt": "2026-09-01T07:00:00.000Z", "contextCue": "rt-CoachReminder-contextCue", "status": "rt-CoachReminder-status", "source": "extractor", - "sourceConversationId": "", + "sourceConversationId": "", "lastSurfacedAt": "2026-06-30T12:34:56.789Z", "surfaceCount": 2, - "createdAt": "2026-05-05T03:53:00.000Z", - "updatedAt": "2026-05-05T03:54:00.000Z", + "createdAt": "2026-05-05T05:33:00.000Z", + "updatedAt": "2026-05-05T05:34:00.000Z", "deletedAt": null } ], "MedicationInventoryItem": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "medicationId": "", "state": "ACTIVE", @@ -1708,18 +1717,18 @@ "unitsTotal": "decimal:30", "unitsRemaining": "decimal:21", "firstUseAt": "2026-07-01T08:00:00.000Z", - "expiresAt": "2026-05-05T05:28:00.000Z", + "expiresAt": "2026-05-05T07:08:00.000Z", "printedExpiry": "2026-06-30T12:34:56.789Z", "purchasedAt": "2026-06-30T12:34:56.789Z", "manufacturer": "Fixture Pharma", "doseStrength": "10 mg", "notes": "rt-MedicationInventoryItem-notes", "notesEncrypted": "", - "createdAt": "2026-05-05T05:35:00.000Z", - "updatedAt": "2026-05-05T05:36:00.000Z" + "createdAt": "2026-05-05T07:15:00.000Z", + "updatedAt": "2026-05-05T07:16:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "medicationId": "", "state": "USED_UP", @@ -1734,20 +1743,20 @@ "doseStrength": null, "notes": null, "notesEncrypted": null, - "createdAt": "2026-05-05T05:35:01.000Z", - "updatedAt": "2026-05-05T05:36:01.000Z" + "createdAt": "2026-05-05T07:15:01.000Z", + "updatedAt": "2026-05-05T07:16:01.000Z" } ], "MedicationInventoryEvent": [ { - "id": "", + "id": "", "medicationId": "", "delta": -8, "reason": "consumed", "occurredAt": "2026-07-09T07:00:00.000Z" }, { - "id": "", + "id": "", "medicationId": "", "delta": 30, "reason": "purchased", @@ -1770,12 +1779,12 @@ { "userId": "round-trip-owner", "moodTagId": "mt_grateful", - "createdAt": "2026-05-05T10:22:00.000Z" + "createdAt": "2026-05-05T12:02:00.000Z" } ], "ReminderPhaseConfig": [ { - "id": "", + "id": "", "medicationId": "", "greenValue": 45, "greenMode": "PERCENT", @@ -1789,7 +1798,7 @@ ], "MentalHealthAssessment": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "instrument": "GAD7", "locale": "en", @@ -1806,11 +1815,11 @@ "externalId": null, "syncVersion": 0, "deletedAt": "", - "createdAt": "2026-05-05T13:57:01.000Z", - "updatedAt": "2026-05-05T13:58:01.000Z" + "createdAt": "2026-05-05T15:37:01.000Z", + "updatedAt": "2026-05-05T15:38:01.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "instrument": "PHQ9", "locale": "de", @@ -1827,43 +1836,43 @@ "externalId": "rt-MentalHealthAssessment-externalId", "syncVersion": 3, "deletedAt": null, - "createdAt": "2026-05-05T13:57:00.000Z", - "updatedAt": "2026-05-05T13:58:00.000Z" + "createdAt": "2026-05-05T15:37:00.000Z", + "updatedAt": "2026-05-05T15:38:00.000Z" } ], "ConsentReceipt": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "ai-processing", "artefact": "JVBERi0xLjQKJWZpeHR1cmU=", "signedAt": "2026-06-01T09:00:00.000Z", "revokedAt": null, - "createdAt": "2026-05-05T15:26:00.000Z" + "createdAt": "2026-05-05T17:06:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "kind": "research-sharing", "artefact": "eyJhbGciOiJub25lIn0.e30.", "signedAt": "2026-06-02T09:00:00.000Z", "revokedAt": "2026-07-10T11:00:00.000Z", - "createdAt": "2026-05-05T15:26:01.000Z" + "createdAt": "2026-05-05T17:06:01.000Z" } ], "DocumentConditionLink": [ { - "id": "", - "documentId": "", - "episodeId": "", + "id": "", + "documentId": "", + "episodeId": "", "userId": "round-trip-owner", "createdAt": "2026-07-02T09:00:00.000Z" } ], "ExtractedFact": [ { - "id": "", - "documentId": "", + "id": "", + "documentId": "", "userId": "round-trip-owner", "factType": "OBSERVATION", "status": "APPROVED", @@ -1873,13 +1882,13 @@ "provenanceEncrypted": "", "committedRecordId": "", "committedRecordType": "labResult", - "createdAt": "2026-05-05T18:51:00.000Z", - "updatedAt": "2026-05-05T18:52:00.000Z" + "createdAt": "2026-05-05T20:31:00.000Z", + "updatedAt": "2026-05-05T20:32:00.000Z" } ], "DocumentImportKey": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "sourceSystem": "PAPRA", "sourceId": "doc_deleted", @@ -1889,7 +1898,7 @@ ], "PersonalRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WALKING_RUNNING_DISTANCE", "metricSlot": "running_10km_time", @@ -1900,10 +1909,10 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-10km", - "createdAt": "2026-05-05T22:11:02.000Z" + "createdAt": "2026-05-05T23:51:02.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WALKING_RUNNING_DISTANCE", "metricSlot": "running_5km_time", @@ -1914,10 +1923,10 @@ "sourceMeasurementId": null, "source": "APPLE_HEALTH", "externalId": "workout-pr-5km", - "createdAt": "2026-05-05T22:11:01.000Z" + "createdAt": "2026-05-05T23:51:01.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "metricType": "WEIGHT", "metricSlot": null, @@ -1928,28 +1937,28 @@ "sourceMeasurementId": "", "source": "MANUAL", "externalId": null, - "createdAt": "2026-05-05T22:11:00.000Z" + "createdAt": "2026-05-05T23:51:00.000Z" } ], "UserAchievement": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "achievementId": "intake-total-10", "unlockedAt": "2026-02-21T10:15:00.000Z", - "createdAt": "2026-05-05T23:44:00.000Z" + "createdAt": "2026-05-06T01:24:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "achievementId": "retired-badge-from-an-older-release", "unlockedAt": "2025-11-05T08:00:00.000Z", - "createdAt": "2026-05-05T23:44:01.000Z" + "createdAt": "2026-05-06T01:24:01.000Z" } ], "EnvironmentContext": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-15", "locationEncrypted": "", @@ -1989,11 +1998,11 @@ "aqHours": 3, "aqFetchedAt": "2026-06-30T12:34:56.789Z", "fetchedAt": "2026-06-16T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:00.000Z", - "updatedAt": "2026-05-06T02:01:00.000Z" + "createdAt": "2026-05-06T03:40:00.000Z", + "updatedAt": "2026-05-06T03:41:00.000Z" }, { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-07-01", "locationEncrypted": "", @@ -2033,24 +2042,24 @@ "aqHours": null, "aqFetchedAt": null, "fetchedAt": "2026-07-02T03:15:00.000Z", - "createdAt": "2026-05-06T02:00:01.000Z", - "updatedAt": "2026-05-06T02:01:01.000Z" + "createdAt": "2026-05-06T03:40:01.000Z", + "updatedAt": "2026-05-06T03:41:01.000Z" } ], "EnvironmentTravelLocation": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "startDate": "2026-06-10", "endDate": "2026-06-20", "locationEncrypted": "", - "createdAt": "2026-05-06T03:05:00.000Z", - "updatedAt": "2026-05-06T03:06:00.000Z" + "createdAt": "2026-05-06T04:45:00.000Z", + "updatedAt": "2026-05-06T04:46:00.000Z" } ], "DawarichDay": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "date": "2026-06-15", "totalDistanceM": 48300, @@ -2061,13 +2070,13 @@ "countryCodeEncrypted": "", "isTravelDay": true, "fetchedAt": "2026-06-16T03:20:00.000Z", - "createdAt": "2026-05-06T04:51:00.000Z", - "updatedAt": "2026-05-06T04:52:00.000Z" + "createdAt": "2026-05-06T06:31:00.000Z", + "updatedAt": "2026-05-06T06:32:00.000Z" } ], "MedicationScheduleRevision": [ { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-01-01T00:00:00.000Z", "validUntil": "2026-03-01T00:00:00.000Z", @@ -2080,10 +2089,10 @@ ], "source": "ARCHIVED", "supersededByRevisionId": null, - "createdAt": "2026-05-06T06:27:00.000Z" + "createdAt": "2026-05-06T08:07:00.000Z" }, { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-02-01T00:00:00.000Z", "validUntil": "2026-03-01T00:00:00.000Z", @@ -2095,11 +2104,11 @@ } ], "source": "ARCHIVED", - "supersededByRevisionId": "", - "createdAt": "2026-05-06T06:27:02.000Z" + "supersededByRevisionId": "", + "createdAt": "2026-05-06T08:07:02.000Z" }, { - "id": "", + "id": "", "medicationId": "", "validFrom": "2026-03-01T00:00:00.000Z", "validUntil": "2026-05-01T00:00:00.000Z", @@ -2112,23 +2121,23 @@ ], "source": "MANUAL", "supersededByRevisionId": null, - "createdAt": "2026-05-06T06:27:01.000Z" + "createdAt": "2026-05-06T08:07:01.000Z" } ], "MedicationEfficacyTarget": [ { - "id": "", + "id": "", "medicationId": "", "measurementType": "WEIGHT", "biomarkerId": "", "primary": false, - "createdAt": "2026-05-06T08:05:00.000Z", - "updatedAt": "2026-05-06T08:06:00.000Z" + "createdAt": "2026-05-06T09:45:00.000Z", + "updatedAt": "2026-05-06T09:46:00.000Z" } ], "EcgRecording": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "source": "MANUAL", "externalRecordingId": "round-trip-signal-1", @@ -2141,13 +2150,13 @@ "averageHeartRate": 88, "rhythmClassification": "IRREGULAR", "measurementId": "", - "createdAt": "2026-05-06T09:53:00.000Z", - "updatedAt": "2026-05-06T09:54:00.000Z" + "createdAt": "2026-05-06T11:33:00.000Z", + "updatedAt": "2026-05-06T11:34:00.000Z" } ], "OnboardingRecord": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "needsJson": { "areas": [ @@ -2186,80 +2195,80 @@ }, "modulesDerivedAt": "2026-07-01T08:00:00.000Z", "completedAt": "2026-07-01T08:00:00.000Z", - "createdAt": "2026-05-06T11:27:00.000Z", - "updatedAt": "2026-05-06T11:28:00.000Z" + "createdAt": "2026-05-06T13:07:00.000Z", + "updatedAt": "2026-05-06T13:08:00.000Z" } ], "BiomarkerAlias": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "biomarkerId": "", "name": "Ferr.", "nameFolded": "ferr.", "source": "IMPORT_CHOICE", - "createdAt": "2026-05-06T13:06:00.000Z" + "createdAt": "2026-05-06T14:46:00.000Z" } ], "BiomarkerMerge": [ { - "id": "", + "id": "", "userId": "round-trip-owner", "targetBiomarkerId": "", "sourceBiomarkerId": "merged-away-marker", "sourceName": "Ferritin (Serum)", "readingCount": 3, - "mergedAt": "2026-05-06T14:46:00.000Z" + "mergedAt": "2026-05-06T16:26:00.000Z" } ], "LabResultDocumentLink": [ - { - "id": "", - "labResultId": "", - "documentId": "", - "userId": "round-trip-owner", - "createdAt": "2026-05-06T16:24:00.000Z" - } - ], - "EncounterMedicationLink": [ { "id": "", - "encounterId": "", - "medicationId": "", + "labResultId": "", + "documentId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T18:04:00.000Z" } ], - "EncounterVaccinationLink": [ + "EncounterMedicationLink": [ { "id": "", - "encounterId": "", - "vaccinationId": "", + "encounterId": "", + "medicationId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T19:44:00.000Z" } ], - "MedicationDocumentLink": [ + "EncounterVaccinationLink": [ { "id": "", - "medicationId": "", - "documentId": "", + "encounterId": "", + "vaccinationId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T21:24:00.000Z" } ], - "MedicationConditionLink": [ + "MedicationDocumentLink": [ { "id": "", "medicationId": "", - "episodeId": "", + "documentId": "", "userId": "round-trip-owner", "createdAt": "2026-05-06T23:04:00.000Z" } ], - "AccountGrant": [ + "MedicationConditionLink": [ { "id": "", + "medicationId": "", + "episodeId": "", + "userId": "round-trip-owner", + "createdAt": "2026-05-07T00:44:00.000Z" + } + ], + "AccountGrant": [ + { + "id": "", "grantorId": "round-trip-owner", "granteeId": "parity-delegate", "access": "WRITE", @@ -2268,13 +2277,13 @@ "measurements" ] }, - "invitedAt": "2026-05-07T04:05:00.000Z", + "invitedAt": "2026-05-07T05:45:00.000Z", "acceptedAt": "2026-07-02T09:00:00.000Z", "revokedAt": null, "revokedBy": null, "expiresAt": null, "lastUsedAt": null, - "createdAt": "2026-05-07T04:11:00.000Z" + "createdAt": "2026-05-07T05:51:00.000Z" } ], "User": { @@ -2286,7 +2295,7 @@ "oidcIssuer": "rt-User-oidcIssuer", "oidcSub": "rt-User-oidcSub", "createdAt": "2026-06-30T12:34:56.789Z", - "updatedAt": "2026-05-07T00:48:00.000Z", + "updatedAt": "2026-05-07T02:28:00.000Z", "managedProfileAt": "2026-06-30T12:34:56.789Z", "deletionRequestedAt": "2026-06-30T12:34:56.789Z", "deletionPurgeAt": "2026-06-30T12:34:56.789Z", diff --git a/tests/integration/backup-fixture.ts b/tests/integration/backup-fixture.ts index 08749cb20..db89a2563 100644 --- a/tests/integration/backup-fixture.ts +++ b/tests/integration/backup-fixture.ts @@ -551,6 +551,17 @@ export async function seedEveryTwoEndedModel( takenAt: AT("2026-06-30T09:00:00.000Z"), }, }); + // A Health Records reading the person deleted and the purge then removed: + // only the import ledger remembers it, and a restore that dropped the row + // would let the next Apple Health import write it again. + await prisma.labResultImportKey.create({ + data: { + userId: OWNER_ID, + source: "APPLE_HEALTH", + externalId: "fhir:round-trip-deleted-result", + createdAt: AT("2026-07-04T09:00:00.000Z"), + }, + }); // What the drug above is FOR, pinned to the analyte just created. The two // rows are seeded at opposite ends of this fixture on purpose: the drug is // restored hundreds of lines before the analyte, so this pairing is what diff --git a/tests/integration/backup-round-trip.test.ts b/tests/integration/backup-round-trip.test.ts index ffe7c5641..e5a551da9 100644 --- a/tests/integration/backup-round-trip.test.ts +++ b/tests/integration/backup-round-trip.test.ts @@ -192,6 +192,8 @@ const COUNT_BACK: Record< p.moodEntryTagLink.count({ where: { moodEntry: { userId } } }), MoodTag: (p, userId) => p.moodTag.count({ where: { userId } }), LabResult: (p, userId) => p.labResult.count({ where: { userId } }), + LabResultImportKey: (p, userId) => + p.labResultImportKey.count({ where: { userId } }), Biomarker: (p, userId) => p.biomarker.count({ where: { userId } }), BiomarkerAlias: (p, userId) => p.biomarkerAlias.count({ where: { userId } }), BiomarkerMerge: (p, userId) => p.biomarkerMerge.count({ where: { userId } }), diff --git a/tests/integration/lab-health-records-deleted-stay-deleted.test.ts b/tests/integration/lab-health-records-deleted-stay-deleted.test.ts new file mode 100644 index 000000000..00a9c2c22 --- /dev/null +++ b/tests/integration/lab-health-records-deleted-stay-deleted.test.ts @@ -0,0 +1,254 @@ +/** + * A Health Records lab result the person deleted stays deleted. + * + * The Apple Health export carries the whole clinical history every time, and + * the phone resends what it holds, so the import recognises a reading by the + * identity it arrived under. That memory lived only on the reading's own row, + * and three ways of losing the row brought the reading back on the next + * import: + * + * - deleting the whole marker, which removes its readings outright; + * - the nightly purge, which removes a deleted reading for good once its + * tombstone has aged out; + * - a portable backup, which leaves deleted readings out, restored onto an + * instance that has never seen the account. + * + * The identity of a deleted reading is now kept in the import ledger + * (`LabResultImportKey`) the moment it is deleted, and taken out again when + * the deletion is undone. Against Postgres, through the real routes. + */ +import { NextRequest } from "next/server"; +import { beforeEach, describe, expect, it, vi } from "vitest"; + +process.env.ENCRYPTION_KEY ??= + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"; + +import { encrypt } from "@/lib/crypto"; +import { buildFullBackupPayload } from "@/lib/export/full-backup-payload"; +import { purgeSoftDeletedTable } from "@/lib/jobs/soft-delete-retention"; +import { writeFhirLabReadings } from "@/lib/labs/fhir-import/write"; +import type { MappedFhirLab } from "@/lib/labs/fhir-import/types"; +import { parseBackupPayload } from "@/lib/validations/backup"; +import { POST as RESTORE } from "./restore-job-driver"; + +import { cookieJar, headerJar } from "./mock-next-headers"; +import { getPrismaClient, truncateAllTables } from "./setup"; + +vi.mock("next/headers", async () => { + const { cookieJar, headerJar } = await import("./mock-next-headers"); + return { + headers: vi.fn(async () => ({ + get: (name: string) => headerJar.get(name.toLowerCase()) ?? null, + })), + cookies: vi.fn(async () => ({ + get: (name: string) => { + const value = cookieJar.get(name); + return value ? { name, value } : undefined; + }, + set: (name: string, value: string) => cookieJar.set(name, value), + delete: (name: string) => cookieJar.delete(name), + })), + }; +}); +vi.mock("@/lib/cache/invalidate", async (importOriginal) => { + const actual = + await importOriginal(); + return { ...actual, invalidateUserData: vi.fn() }; +}); + +const prisma = getPrismaClient(); +let USER = ""; + +beforeEach(async () => { + await truncateAllTables(prisma); + cookieJar.clear(); + headerJar.clear(); + const user = await prisma.user.create({ + data: { + username: "deleted-stays-deleted", + email: "deleted-stays-deleted@example.test", + role: "ADMIN", + timezone: "UTC", + modulePreferencesJson: { labs: true }, + }, + }); + USER = user.id; + await signIn(); +}); + +async function signIn() { + const session = await prisma.session.create({ + data: { userId: USER, expiresAt: new Date(Date.now() + 600_000) }, + }); + cookieJar.set("healthlog_session", session.id); +} + +function reading(n: number, over: Partial = {}): MappedFhirLab { + return { + externalId: `fhir:clinic:obs-${n}`, + analyte: "Ferritin", + loinc: null, + catalogKey: null, + value: 80 + n, + valueText: null, + unit: "ng/mL", + takenAt: new Date(Date.UTC(2026, 5, n, 7)), + sourceReferenceLow: 30, + sourceReferenceHigh: 400, + sourceReferenceText: null, + panel: null, + note: null, + ...over, + }; +} + +const BATCH = [reading(1), reading(2), reading(3, { analyte: "Glucose" })]; + +async function importBatch() { + return writeFhirLabReadings({ + userId: USER, + tz: "UTC", + readings: BATCH, + prisma, + }); +} + +async function liveReadings() { + return prisma.labResult.findMany({ + where: { userId: USER, deletedAt: null }, + select: { analyte: true, externalId: true }, + orderBy: { externalId: "asc" }, + }); +} + +async function deleteMarker(name: string) { + const marker = await prisma.biomarker.findFirstOrThrow({ + where: { userId: USER, name }, + }); + const { DELETE } = await import("@/app/api/biomarkers/[id]/route"); + const res = await DELETE( + new NextRequest(`http://localhost/api/biomarkers/${marker.id}`, { + method: "DELETE", + }), + { params: Promise.resolve({ id: marker.id }) }, + ); + expect(res.status).toBe(200); +} + +async function deleteReading(externalId: string) { + const row = await prisma.labResult.findFirstOrThrow({ + where: { userId: USER, externalId }, + }); + const { DELETE } = await import("@/app/api/labs/[id]/route"); + const res = await DELETE( + new NextRequest(`http://localhost/api/labs/${row.id}`, { + method: "DELETE", + }), + { params: Promise.resolve({ id: row.id }) }, + ); + expect(res.status).toBe(200); + return row.id; +} + +describe("a deleted Health Records reading", () => { + it("does not come back after its whole marker is deleted", async () => { + expect((await importBatch()).inserted).toBe(3); + await deleteMarker("Ferritin"); + expect(await liveReadings()).toEqual([ + { analyte: "Glucose", externalId: "fhir:clinic:obs-3" }, + ]); + + const again = await importBatch(); + expect(again.inserted).toBe(0); + expect(again.duplicate).toBe(3); + expect(await liveReadings()).toHaveLength(1); + expect( + await prisma.biomarker.count({ + where: { userId: USER, name: "Ferritin" }, + }), + ).toBe(0); + }); + + it("does not come back once the purge has removed its tombstone", async () => { + await importBatch(); + await deleteReading("fhir:clinic:obs-1"); + // Long past the retention horizon. + const later = new Date(Date.now() + 400 * 86_400_000); + const purged = await purgeSoftDeletedTable(prisma, "LabResult", later); + expect(purged.deleted).toBe(1); + expect( + await prisma.labResult.count({ + where: { userId: USER, externalId: "fhir:clinic:obs-1" }, + }), + ).toBe(0); + + const again = await importBatch(); + expect(again.inserted).toBe(0); + expect(await liveReadings()).toHaveLength(2); + }); + + it("comes back to life only through its own undo", async () => { + await importBatch(); + const id = await deleteReading("fhir:clinic:obs-1"); + const { POST } = await import("@/app/api/labs/restore/route"); + const res = await POST( + new NextRequest("http://localhost/api/labs/restore", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ ids: [id] }), + }), + ); + expect(res.status).toBe(200); + expect(await liveReadings()).toHaveLength(3); + + // Deleted again later, it stays deleted again, purge or not. + await deleteReading("fhir:clinic:obs-1"); + await purgeSoftDeletedTable( + prisma, + "LabResult", + new Date(Date.now() + 400 * 86_400_000), + ); + expect((await importBatch()).inserted).toBe(0); + expect(await liveReadings()).toHaveLength(2); + }); + + it("stays deleted through a portable backup restored onto a fresh instance", async () => { + await importBatch(); + await deleteReading("fhir:clinic:obs-1"); + await deleteMarker("Glucose"); + + const { payload: built } = await buildFullBackupPayload(prisma, USER, { + purpose: "portable-export", + }); + const parsed = parseBackupPayload(JSON.stringify(built)); + + // The fresh instance: the account as the file brings it, nothing else. + await prisma.labResult.deleteMany({ where: { userId: USER } }); + await prisma.biomarker.deleteMany({ where: { userId: USER } }); + await prisma.labResultImportKey.deleteMany({ where: { userId: USER } }); + const backup = await prisma.dataBackup.create({ + data: { + userId: USER, + type: "LAB_IMPORT_LEDGER_ROUND_TRIP", + data: encrypt(JSON.stringify(parsed)), + }, + }); + await signIn(); + const response = await RESTORE( + new Request(`http://localhost/api/admin/backups/${backup.id}/restore`, { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify({ confirm: "RESTORE" }), + }) as unknown as Parameters[0], + { params: Promise.resolve({ id: backup.id }) }, + ); + expect(response.status).toBe(200); + expect(await liveReadings()).toEqual([ + { analyte: "Ferritin", externalId: "fhir:clinic:obs-2" }, + ]); + + const again = await importBatch(); + expect(again.inserted).toBe(0); + expect(await liveReadings()).toHaveLength(1); + }); +});