@omniradiology/omnirad 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +438 -0
  2. package/app/api/ai-config/route.ts +131 -0
  3. package/app/api/ai-config/test/route.ts +49 -0
  4. package/app/api/auth/auto-login/route.ts +66 -0
  5. package/app/api/auth/check/route.ts +17 -0
  6. package/app/api/auth/login/route.ts +72 -0
  7. package/app/api/auth/logout/route.ts +25 -0
  8. package/app/api/auth/me/route.ts +75 -0
  9. package/app/api/auth/password/route.ts +49 -0
  10. package/app/api/auth/setup/route.ts +63 -0
  11. package/app/api/auth/users/route.ts +100 -0
  12. package/app/api/auth/wipe/route.ts +27 -0
  13. package/app/api/compliance/anonymize/patient/[id]/route.ts +104 -0
  14. package/app/api/compliance/audit/route.ts +110 -0
  15. package/app/api/compliance/export/patient/[id]/route.ts +108 -0
  16. package/app/api/compliance/restrict/patient/[id]/route.ts +59 -0
  17. package/app/api/compliance/settings/route.ts +93 -0
  18. package/app/api/copilot/annotate/route.ts +94 -0
  19. package/app/api/copilot/chat/route.ts +238 -0
  20. package/app/api/copilot/history/route.ts +95 -0
  21. package/app/api/copilot/reports/route.ts +81 -0
  22. package/app/api/fhir/Bundle/report/[id]/route.ts +85 -0
  23. package/app/api/fhir/DiagnosticReport/[id]/route.ts +45 -0
  24. package/app/api/fhir/ImagingStudy/[id]/route.ts +57 -0
  25. package/app/api/fhir/Patient/[id]/route.ts +26 -0
  26. package/app/api/fhir/ServiceRequest/route.ts +85 -0
  27. package/app/api/fhir/config/route.ts +102 -0
  28. package/app/api/fhir/config/test-connection/route.ts +49 -0
  29. package/app/api/fhir/metadata/route.ts +51 -0
  30. package/app/api/pacs/metadata/route.ts +32 -0
  31. package/app/api/pacs/qido/instances/route.ts +39 -0
  32. package/app/api/pacs/qido/series/route.ts +38 -0
  33. package/app/api/pacs/qido/studies/route.ts +37 -0
  34. package/app/api/pacs/test/route.ts +30 -0
  35. package/app/api/pacs/wado/render/route.ts +51 -0
  36. package/app/api/patients/[id]/reports/route.ts +18 -0
  37. package/app/api/patients/[id]/route.ts +43 -0
  38. package/app/api/patients/merge/route.ts +57 -0
  39. package/app/api/patients/route.ts +67 -0
  40. package/app/api/patients/search/route.ts +25 -0
  41. package/app/api/reports/[id]/route.ts +84 -0
  42. package/app/api/reports/[id]/status/route.ts +87 -0
  43. package/app/api/reports/clear/route.ts +16 -0
  44. package/app/api/reports/route.ts +112 -0
  45. package/app/api/segmentation-config/route.ts +238 -0
  46. package/app/api/settings/route.ts +245 -0
  47. package/app/api/settings/test-supabase/route.ts +103 -0
  48. package/app/api/upload/route.ts +48 -0
  49. package/app/copilot/page.tsx +30 -0
  50. package/app/globals.css +141 -0
  51. package/app/history/page.tsx +242 -0
  52. package/app/icon.svg +3 -0
  53. package/app/layout.tsx +47 -0
  54. package/app/login/page.tsx +175 -0
  55. package/app/pacs/page.tsx +78 -0
  56. package/app/page.tsx +125 -0
  57. package/app/patients/[id]/page.tsx +315 -0
  58. package/app/patients/page.tsx +110 -0
  59. package/app/profile/page.tsx +208 -0
  60. package/app/reports/page.tsx +432 -0
  61. package/app/settings/page.tsx +454 -0
  62. package/app/setup/page.tsx +199 -0
  63. package/components/admin/AuditLogTable.tsx +293 -0
  64. package/components/copilot/ActivityIndicator.tsx +215 -0
  65. package/components/copilot/ChatHistoryPanel.tsx +140 -0
  66. package/components/copilot/ChatMessage.tsx +251 -0
  67. package/components/copilot/ClickableReference.tsx +40 -0
  68. package/components/copilot/CopilotCornerstoneViewer.tsx +562 -0
  69. package/components/copilot/CopilotPanel.tsx +311 -0
  70. package/components/copilot/FindingsList.tsx +75 -0
  71. package/components/copilot/ViewerPanel.tsx +460 -0
  72. package/components/copilot/WorkspaceLayout.tsx +398 -0
  73. package/components/dashboard/AIConfigPanel.tsx +339 -0
  74. package/components/dashboard/AppearancePanel.tsx +491 -0
  75. package/components/dashboard/ApprovalModal.tsx +163 -0
  76. package/components/dashboard/CollaborationPanel.tsx +134 -0
  77. package/components/dashboard/CopilotConfigPanel.tsx +337 -0
  78. package/components/dashboard/DicomViewer.tsx +645 -0
  79. package/components/dashboard/FhirIntegrationPanel.tsx +331 -0
  80. package/components/dashboard/FullReportOverlay.tsx +269 -0
  81. package/components/dashboard/ImageViewer.tsx +541 -0
  82. package/components/dashboard/PatientForm.tsx +597 -0
  83. package/components/dashboard/RejectionModal.tsx +74 -0
  84. package/components/dashboard/ReportEditor.tsx +160 -0
  85. package/components/dashboard/ReportTemplates.tsx +729 -0
  86. package/components/dashboard/ReportView.tsx +539 -0
  87. package/components/dashboard/SegmentationConfigPanel.tsx +490 -0
  88. package/components/dashboard/StudyPlaceholder.tsx +17 -0
  89. package/components/dashboard/SupabaseIntegrationPanel.tsx +345 -0
  90. package/components/dashboard/UserManagementPanel.tsx +272 -0
  91. package/components/layout/ClientLayout.tsx +39 -0
  92. package/components/layout/Header.tsx +20 -0
  93. package/components/layout/Sidebar.tsx +119 -0
  94. package/components/pacs/PacsImageViewerModal.tsx +121 -0
  95. package/components/pacs/PacsSearchFilters.tsx +117 -0
  96. package/components/pacs/PacsSeriesViewer.tsx +190 -0
  97. package/components/pacs/PacsStudyTable.tsx +113 -0
  98. package/components/patients/patient-card.tsx +117 -0
  99. package/components/patients/patient-header.tsx +122 -0
  100. package/components/patients/patient-search.tsx +137 -0
  101. package/components/patients/patient-timeline.tsx +153 -0
  102. package/components/settings/ComplianceSettingsPanel.tsx +278 -0
  103. package/components/settings/SecurityPanel.tsx +418 -0
  104. package/components/ui/badge.tsx +19 -0
  105. package/components/ui/basic.tsx +156 -0
  106. package/db/index.ts +350 -0
  107. package/db/migrations/0000_odd_quasimodo.sql +117 -0
  108. package/db/migrations/meta/0000_snapshot.json +778 -0
  109. package/db/migrations/meta/_journal.json +13 -0
  110. package/db/schema.ts +239 -0
  111. package/drizzle.config.ts +10 -0
  112. package/lib/api.ts +689 -0
  113. package/lib/auth.ts +22 -0
  114. package/lib/copilot/action-executor.ts +94 -0
  115. package/lib/copilot/action-types.ts +72 -0
  116. package/lib/copilot/coordinate-mapper.ts +84 -0
  117. package/lib/dicomImageExtractor.ts +103 -0
  118. package/lib/dicomMetadataParser.ts +111 -0
  119. package/lib/fhir/client.ts +25 -0
  120. package/lib/fhir/constants.ts +21 -0
  121. package/lib/fhir/diagnostic-report.ts +88 -0
  122. package/lib/fhir/helpers.ts +73 -0
  123. package/lib/fhir/imaging-study.ts +49 -0
  124. package/lib/fhir/patient.ts +55 -0
  125. package/lib/fhir/service-request.ts +85 -0
  126. package/lib/fhir.ts +6 -0
  127. package/lib/pacs/dicom-utils.ts +72 -0
  128. package/lib/pacs/dicomweb.ts +72 -0
  129. package/lib/pacs/server-utils.ts +37 -0
  130. package/lib/patients.ts +25 -0
  131. package/lib/pdfHelper.ts +119 -0
  132. package/lib/reportHtmlGenerator.ts +581 -0
  133. package/lib/security/audit.ts +180 -0
  134. package/lib/security/authz.ts +246 -0
  135. package/lib/security/phi-redaction.ts +156 -0
  136. package/lib/security/rate-limit.ts +106 -0
  137. package/lib/security/secrets.ts +179 -0
  138. package/lib/supabase.ts +72 -0
  139. package/lib/utils.ts +6 -0
  140. package/next.config.ts +35 -0
  141. package/package.json +76 -0
  142. package/public/file.svg +1 -0
  143. package/public/globe.svg +1 -0
  144. package/public/logo.svg +8 -0
  145. package/public/next.svg +1 -0
  146. package/public/omnirad-favicon.svg +8 -0
  147. package/public/vercel.svg +1 -0
  148. package/public/window.svg +1 -0
  149. package/tsconfig.json +34 -0
  150. package/types/copilot-viewer.ts +155 -0
  151. package/types/copilot.ts +105 -0
  152. package/types/fhir.ts +21 -0
  153. package/types/html2pdf.d.ts +20 -0
  154. package/types/index.ts +139 -0
  155. package/types/pacs.ts +41 -0
@@ -0,0 +1,778 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "7bf796c1-05f8-4a4c-b01b-3cfdc2116d49",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "ai_configurations": {
8
+ "name": "ai_configurations",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "provider_type": {
18
+ "name": "provider_type",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "provider_name": {
25
+ "name": "provider_name",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "api_endpoint_url": {
32
+ "name": "api_endpoint_url",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "api_secret_key": {
39
+ "name": "api_secret_key",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "model_name": {
46
+ "name": "model_name",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": true,
50
+ "autoincrement": false
51
+ },
52
+ "is_active": {
53
+ "name": "is_active",
54
+ "type": "integer",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false,
58
+ "default": false
59
+ },
60
+ "is_vision_capable": {
61
+ "name": "is_vision_capable",
62
+ "type": "integer",
63
+ "primaryKey": false,
64
+ "notNull": false,
65
+ "autoincrement": false,
66
+ "default": false
67
+ },
68
+ "max_tokens": {
69
+ "name": "max_tokens",
70
+ "type": "integer",
71
+ "primaryKey": false,
72
+ "notNull": false,
73
+ "autoincrement": false,
74
+ "default": 4096
75
+ },
76
+ "temperature": {
77
+ "name": "temperature",
78
+ "type": "real",
79
+ "primaryKey": false,
80
+ "notNull": false,
81
+ "autoincrement": false,
82
+ "default": 0.3
83
+ },
84
+ "timeout_seconds": {
85
+ "name": "timeout_seconds",
86
+ "type": "integer",
87
+ "primaryKey": false,
88
+ "notNull": false,
89
+ "autoincrement": false,
90
+ "default": 120
91
+ },
92
+ "created_at": {
93
+ "name": "created_at",
94
+ "type": "text",
95
+ "primaryKey": false,
96
+ "notNull": true,
97
+ "autoincrement": false
98
+ },
99
+ "updated_at": {
100
+ "name": "updated_at",
101
+ "type": "text",
102
+ "primaryKey": false,
103
+ "notNull": false,
104
+ "autoincrement": false
105
+ }
106
+ },
107
+ "indexes": {},
108
+ "foreignKeys": {},
109
+ "compositePrimaryKeys": {},
110
+ "uniqueConstraints": {},
111
+ "checkConstraints": {}
112
+ },
113
+ "appearance": {
114
+ "name": "appearance",
115
+ "columns": {
116
+ "id": {
117
+ "name": "id",
118
+ "type": "integer",
119
+ "primaryKey": true,
120
+ "notNull": true,
121
+ "autoincrement": false,
122
+ "default": 1
123
+ },
124
+ "theme": {
125
+ "name": "theme",
126
+ "type": "text",
127
+ "primaryKey": false,
128
+ "notNull": false,
129
+ "autoincrement": false,
130
+ "default": "'dark'"
131
+ },
132
+ "template": {
133
+ "name": "template",
134
+ "type": "text",
135
+ "primaryKey": false,
136
+ "notNull": false,
137
+ "autoincrement": false,
138
+ "default": "'standard'"
139
+ },
140
+ "hospital_name": {
141
+ "name": "hospital_name",
142
+ "type": "text",
143
+ "primaryKey": false,
144
+ "notNull": false,
145
+ "autoincrement": false,
146
+ "default": "''"
147
+ },
148
+ "logo": {
149
+ "name": "logo",
150
+ "type": "text",
151
+ "primaryKey": false,
152
+ "notNull": false,
153
+ "autoincrement": false,
154
+ "default": "''"
155
+ }
156
+ },
157
+ "indexes": {},
158
+ "foreignKeys": {},
159
+ "compositePrimaryKeys": {},
160
+ "uniqueConstraints": {},
161
+ "checkConstraints": {}
162
+ },
163
+ "config": {
164
+ "name": "config",
165
+ "columns": {
166
+ "id": {
167
+ "name": "id",
168
+ "type": "integer",
169
+ "primaryKey": true,
170
+ "notNull": true,
171
+ "autoincrement": false,
172
+ "default": 1
173
+ },
174
+ "n8n_webhook_url": {
175
+ "name": "n8n_webhook_url",
176
+ "type": "text",
177
+ "primaryKey": false,
178
+ "notNull": false,
179
+ "autoincrement": false,
180
+ "default": "''"
181
+ },
182
+ "supabase_url": {
183
+ "name": "supabase_url",
184
+ "type": "text",
185
+ "primaryKey": false,
186
+ "notNull": false,
187
+ "autoincrement": false,
188
+ "default": "''"
189
+ },
190
+ "supabase_anon_key": {
191
+ "name": "supabase_anon_key",
192
+ "type": "text",
193
+ "primaryKey": false,
194
+ "notNull": false,
195
+ "autoincrement": false,
196
+ "default": "''"
197
+ },
198
+ "pacs_orthanc_url": {
199
+ "name": "pacs_orthanc_url",
200
+ "type": "text",
201
+ "primaryKey": false,
202
+ "notNull": false,
203
+ "autoincrement": false,
204
+ "default": "''"
205
+ },
206
+ "pacs_auth_type": {
207
+ "name": "pacs_auth_type",
208
+ "type": "text",
209
+ "primaryKey": false,
210
+ "notNull": false,
211
+ "autoincrement": false,
212
+ "default": "'none'"
213
+ },
214
+ "pacs_username": {
215
+ "name": "pacs_username",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": false,
219
+ "autoincrement": false,
220
+ "default": "''"
221
+ },
222
+ "pacs_password": {
223
+ "name": "pacs_password",
224
+ "type": "text",
225
+ "primaryKey": false,
226
+ "notNull": false,
227
+ "autoincrement": false,
228
+ "default": "''"
229
+ },
230
+ "pacs_bearer_token": {
231
+ "name": "pacs_bearer_token",
232
+ "type": "text",
233
+ "primaryKey": false,
234
+ "notNull": false,
235
+ "autoincrement": false,
236
+ "default": "''"
237
+ },
238
+ "pacs_ae_title": {
239
+ "name": "pacs_ae_title",
240
+ "type": "text",
241
+ "primaryKey": false,
242
+ "notNull": false,
243
+ "autoincrement": false,
244
+ "default": "''"
245
+ }
246
+ },
247
+ "indexes": {},
248
+ "foreignKeys": {},
249
+ "compositePrimaryKeys": {},
250
+ "uniqueConstraints": {},
251
+ "checkConstraints": {}
252
+ },
253
+ "patients": {
254
+ "name": "patients",
255
+ "columns": {
256
+ "id": {
257
+ "name": "id",
258
+ "type": "text",
259
+ "primaryKey": true,
260
+ "notNull": true,
261
+ "autoincrement": false
262
+ },
263
+ "patient_id_number": {
264
+ "name": "patient_id_number",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": false,
268
+ "autoincrement": false
269
+ },
270
+ "patient_name": {
271
+ "name": "patient_name",
272
+ "type": "text",
273
+ "primaryKey": false,
274
+ "notNull": true,
275
+ "autoincrement": false
276
+ },
277
+ "date_of_birth": {
278
+ "name": "date_of_birth",
279
+ "type": "text",
280
+ "primaryKey": false,
281
+ "notNull": false,
282
+ "autoincrement": false
283
+ },
284
+ "gender": {
285
+ "name": "gender",
286
+ "type": "text",
287
+ "primaryKey": false,
288
+ "notNull": false,
289
+ "autoincrement": false
290
+ },
291
+ "contact_info": {
292
+ "name": "contact_info",
293
+ "type": "text",
294
+ "primaryKey": false,
295
+ "notNull": false,
296
+ "autoincrement": false
297
+ },
298
+ "notes": {
299
+ "name": "notes",
300
+ "type": "text",
301
+ "primaryKey": false,
302
+ "notNull": false,
303
+ "autoincrement": false
304
+ },
305
+ "created_at": {
306
+ "name": "created_at",
307
+ "type": "text",
308
+ "primaryKey": false,
309
+ "notNull": true,
310
+ "autoincrement": false
311
+ },
312
+ "updated_at": {
313
+ "name": "updated_at",
314
+ "type": "text",
315
+ "primaryKey": false,
316
+ "notNull": false,
317
+ "autoincrement": false
318
+ }
319
+ },
320
+ "indexes": {},
321
+ "foreignKeys": {},
322
+ "compositePrimaryKeys": {},
323
+ "uniqueConstraints": {},
324
+ "checkConstraints": {}
325
+ },
326
+ "profile": {
327
+ "name": "profile",
328
+ "columns": {
329
+ "id": {
330
+ "name": "id",
331
+ "type": "integer",
332
+ "primaryKey": true,
333
+ "notNull": true,
334
+ "autoincrement": false,
335
+ "default": 1
336
+ },
337
+ "full_name": {
338
+ "name": "full_name",
339
+ "type": "text",
340
+ "primaryKey": false,
341
+ "notNull": false,
342
+ "autoincrement": false,
343
+ "default": "''"
344
+ },
345
+ "role": {
346
+ "name": "role",
347
+ "type": "text",
348
+ "primaryKey": false,
349
+ "notNull": false,
350
+ "autoincrement": false,
351
+ "default": "''"
352
+ },
353
+ "hospital_name": {
354
+ "name": "hospital_name",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": false,
358
+ "autoincrement": false,
359
+ "default": "''"
360
+ },
361
+ "department": {
362
+ "name": "department",
363
+ "type": "text",
364
+ "primaryKey": false,
365
+ "notNull": false,
366
+ "autoincrement": false,
367
+ "default": "''"
368
+ }
369
+ },
370
+ "indexes": {},
371
+ "foreignKeys": {},
372
+ "compositePrimaryKeys": {},
373
+ "uniqueConstraints": {},
374
+ "checkConstraints": {}
375
+ },
376
+ "prompt_templates": {
377
+ "name": "prompt_templates",
378
+ "columns": {
379
+ "id": {
380
+ "name": "id",
381
+ "type": "text",
382
+ "primaryKey": true,
383
+ "notNull": true,
384
+ "autoincrement": false
385
+ },
386
+ "name": {
387
+ "name": "name",
388
+ "type": "text",
389
+ "primaryKey": false,
390
+ "notNull": true,
391
+ "autoincrement": false
392
+ },
393
+ "template": {
394
+ "name": "template",
395
+ "type": "text",
396
+ "primaryKey": false,
397
+ "notNull": true,
398
+ "autoincrement": false
399
+ },
400
+ "is_active": {
401
+ "name": "is_active",
402
+ "type": "integer",
403
+ "primaryKey": false,
404
+ "notNull": false,
405
+ "autoincrement": false,
406
+ "default": false
407
+ },
408
+ "created_at": {
409
+ "name": "created_at",
410
+ "type": "text",
411
+ "primaryKey": false,
412
+ "notNull": true,
413
+ "autoincrement": false
414
+ },
415
+ "updated_at": {
416
+ "name": "updated_at",
417
+ "type": "text",
418
+ "primaryKey": false,
419
+ "notNull": false,
420
+ "autoincrement": false
421
+ }
422
+ },
423
+ "indexes": {},
424
+ "foreignKeys": {},
425
+ "compositePrimaryKeys": {},
426
+ "uniqueConstraints": {},
427
+ "checkConstraints": {}
428
+ },
429
+ "report_generation_logs": {
430
+ "name": "report_generation_logs",
431
+ "columns": {
432
+ "id": {
433
+ "name": "id",
434
+ "type": "text",
435
+ "primaryKey": true,
436
+ "notNull": true,
437
+ "autoincrement": false
438
+ },
439
+ "report_id": {
440
+ "name": "report_id",
441
+ "type": "text",
442
+ "primaryKey": false,
443
+ "notNull": false,
444
+ "autoincrement": false
445
+ },
446
+ "ai_config_id": {
447
+ "name": "ai_config_id",
448
+ "type": "text",
449
+ "primaryKey": false,
450
+ "notNull": false,
451
+ "autoincrement": false
452
+ },
453
+ "model_used": {
454
+ "name": "model_used",
455
+ "type": "text",
456
+ "primaryKey": false,
457
+ "notNull": false,
458
+ "autoincrement": false
459
+ },
460
+ "prompt_template_id": {
461
+ "name": "prompt_template_id",
462
+ "type": "text",
463
+ "primaryKey": false,
464
+ "notNull": false,
465
+ "autoincrement": false
466
+ },
467
+ "raw_llm_response": {
468
+ "name": "raw_llm_response",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": false,
472
+ "autoincrement": false
473
+ },
474
+ "parsed_successfully": {
475
+ "name": "parsed_successfully",
476
+ "type": "integer",
477
+ "primaryKey": false,
478
+ "notNull": false,
479
+ "autoincrement": false
480
+ },
481
+ "retry_count": {
482
+ "name": "retry_count",
483
+ "type": "integer",
484
+ "primaryKey": false,
485
+ "notNull": false,
486
+ "autoincrement": false
487
+ },
488
+ "generation_time_ms": {
489
+ "name": "generation_time_ms",
490
+ "type": "integer",
491
+ "primaryKey": false,
492
+ "notNull": false,
493
+ "autoincrement": false
494
+ },
495
+ "error_message": {
496
+ "name": "error_message",
497
+ "type": "text",
498
+ "primaryKey": false,
499
+ "notNull": false,
500
+ "autoincrement": false
501
+ },
502
+ "created_at": {
503
+ "name": "created_at",
504
+ "type": "text",
505
+ "primaryKey": false,
506
+ "notNull": true,
507
+ "autoincrement": false
508
+ }
509
+ },
510
+ "indexes": {},
511
+ "foreignKeys": {
512
+ "report_generation_logs_ai_config_id_ai_configurations_id_fk": {
513
+ "name": "report_generation_logs_ai_config_id_ai_configurations_id_fk",
514
+ "tableFrom": "report_generation_logs",
515
+ "tableTo": "ai_configurations",
516
+ "columnsFrom": [
517
+ "ai_config_id"
518
+ ],
519
+ "columnsTo": [
520
+ "id"
521
+ ],
522
+ "onDelete": "no action",
523
+ "onUpdate": "no action"
524
+ }
525
+ },
526
+ "compositePrimaryKeys": {},
527
+ "uniqueConstraints": {},
528
+ "checkConstraints": {}
529
+ },
530
+ "reports": {
531
+ "name": "reports",
532
+ "columns": {
533
+ "id": {
534
+ "name": "id",
535
+ "type": "text",
536
+ "primaryKey": true,
537
+ "notNull": true,
538
+ "autoincrement": false
539
+ },
540
+ "patient_id": {
541
+ "name": "patient_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": false,
545
+ "autoincrement": false
546
+ },
547
+ "patient_name": {
548
+ "name": "patient_name",
549
+ "type": "text",
550
+ "primaryKey": false,
551
+ "notNull": false,
552
+ "autoincrement": false
553
+ },
554
+ "modality": {
555
+ "name": "modality",
556
+ "type": "text",
557
+ "primaryKey": false,
558
+ "notNull": false,
559
+ "autoincrement": false
560
+ },
561
+ "urgency": {
562
+ "name": "urgency",
563
+ "type": "text",
564
+ "primaryKey": false,
565
+ "notNull": false,
566
+ "autoincrement": false
567
+ },
568
+ "report_status": {
569
+ "name": "report_status",
570
+ "type": "text",
571
+ "primaryKey": false,
572
+ "notNull": false,
573
+ "autoincrement": false,
574
+ "default": "'Pending'"
575
+ },
576
+ "report_data": {
577
+ "name": "report_data",
578
+ "type": "text",
579
+ "primaryKey": false,
580
+ "notNull": true,
581
+ "autoincrement": false
582
+ },
583
+ "image_data": {
584
+ "name": "image_data",
585
+ "type": "text",
586
+ "primaryKey": false,
587
+ "notNull": false,
588
+ "autoincrement": false
589
+ },
590
+ "pacs_study_uid": {
591
+ "name": "pacs_study_uid",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": false,
595
+ "autoincrement": false
596
+ },
597
+ "pacs_series_uid": {
598
+ "name": "pacs_series_uid",
599
+ "type": "text",
600
+ "primaryKey": false,
601
+ "notNull": false,
602
+ "autoincrement": false
603
+ },
604
+ "pacs_source": {
605
+ "name": "pacs_source",
606
+ "type": "text",
607
+ "primaryKey": false,
608
+ "notNull": false,
609
+ "autoincrement": false
610
+ },
611
+ "created_at": {
612
+ "name": "created_at",
613
+ "type": "text",
614
+ "primaryKey": false,
615
+ "notNull": true,
616
+ "autoincrement": false
617
+ }
618
+ },
619
+ "indexes": {},
620
+ "foreignKeys": {
621
+ "reports_patient_id_patients_id_fk": {
622
+ "name": "reports_patient_id_patients_id_fk",
623
+ "tableFrom": "reports",
624
+ "tableTo": "patients",
625
+ "columnsFrom": [
626
+ "patient_id"
627
+ ],
628
+ "columnsTo": [
629
+ "id"
630
+ ],
631
+ "onDelete": "cascade",
632
+ "onUpdate": "no action"
633
+ }
634
+ },
635
+ "compositePrimaryKeys": {},
636
+ "uniqueConstraints": {},
637
+ "checkConstraints": {}
638
+ },
639
+ "sessions": {
640
+ "name": "sessions",
641
+ "columns": {
642
+ "id": {
643
+ "name": "id",
644
+ "type": "text",
645
+ "primaryKey": true,
646
+ "notNull": true,
647
+ "autoincrement": false
648
+ },
649
+ "user_id": {
650
+ "name": "user_id",
651
+ "type": "text",
652
+ "primaryKey": false,
653
+ "notNull": true,
654
+ "autoincrement": false
655
+ },
656
+ "expires_at": {
657
+ "name": "expires_at",
658
+ "type": "integer",
659
+ "primaryKey": false,
660
+ "notNull": true,
661
+ "autoincrement": false
662
+ }
663
+ },
664
+ "indexes": {},
665
+ "foreignKeys": {
666
+ "sessions_user_id_users_id_fk": {
667
+ "name": "sessions_user_id_users_id_fk",
668
+ "tableFrom": "sessions",
669
+ "tableTo": "users",
670
+ "columnsFrom": [
671
+ "user_id"
672
+ ],
673
+ "columnsTo": [
674
+ "id"
675
+ ],
676
+ "onDelete": "no action",
677
+ "onUpdate": "no action"
678
+ }
679
+ },
680
+ "compositePrimaryKeys": {},
681
+ "uniqueConstraints": {},
682
+ "checkConstraints": {}
683
+ },
684
+ "users": {
685
+ "name": "users",
686
+ "columns": {
687
+ "id": {
688
+ "name": "id",
689
+ "type": "text",
690
+ "primaryKey": true,
691
+ "notNull": true,
692
+ "autoincrement": false
693
+ },
694
+ "full_name": {
695
+ "name": "full_name",
696
+ "type": "text",
697
+ "primaryKey": false,
698
+ "notNull": true,
699
+ "autoincrement": false
700
+ },
701
+ "username": {
702
+ "name": "username",
703
+ "type": "text",
704
+ "primaryKey": false,
705
+ "notNull": true,
706
+ "autoincrement": false
707
+ },
708
+ "email": {
709
+ "name": "email",
710
+ "type": "text",
711
+ "primaryKey": false,
712
+ "notNull": true,
713
+ "autoincrement": false
714
+ },
715
+ "password_hash": {
716
+ "name": "password_hash",
717
+ "type": "text",
718
+ "primaryKey": false,
719
+ "notNull": true,
720
+ "autoincrement": false
721
+ },
722
+ "role": {
723
+ "name": "role",
724
+ "type": "text",
725
+ "primaryKey": false,
726
+ "notNull": false,
727
+ "autoincrement": false,
728
+ "default": "'User'"
729
+ },
730
+ "position": {
731
+ "name": "position",
732
+ "type": "text",
733
+ "primaryKey": false,
734
+ "notNull": false,
735
+ "autoincrement": false,
736
+ "default": "''"
737
+ },
738
+ "created_at": {
739
+ "name": "created_at",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": true,
743
+ "autoincrement": false
744
+ }
745
+ },
746
+ "indexes": {
747
+ "users_username_unique": {
748
+ "name": "users_username_unique",
749
+ "columns": [
750
+ "username"
751
+ ],
752
+ "isUnique": true
753
+ },
754
+ "users_email_unique": {
755
+ "name": "users_email_unique",
756
+ "columns": [
757
+ "email"
758
+ ],
759
+ "isUnique": true
760
+ }
761
+ },
762
+ "foreignKeys": {},
763
+ "compositePrimaryKeys": {},
764
+ "uniqueConstraints": {},
765
+ "checkConstraints": {}
766
+ }
767
+ },
768
+ "views": {},
769
+ "enums": {},
770
+ "_meta": {
771
+ "schemas": {},
772
+ "tables": {},
773
+ "columns": {}
774
+ },
775
+ "internal": {
776
+ "indexes": {}
777
+ }
778
+ }