-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pather_diagram.puml
More file actions
247 lines (216 loc) · 8.01 KB
/
Copy pather_diagram.puml
File metadata and controls
247 lines (216 loc) · 8.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
@startuml er_diagram
title DiagFlow — Entity-Relationship Diagram
skinparam backgroundColor #FEFEFE
skinparam defaultFontName Inter
skinparam shadowing false
skinparam linetype ortho
hide circle
' ─────────────────────────────────────────────
' diagflow.db — Config & State
' ─────────────────────────────────────────────
package "diagflow.db" as db1 #E3F2FD {
entity "diagnosticians" as diag {
* id : INTEGER <<PK, autoincrement>>
--
name : TEXT <<NOT NULL>>
active : INTEGER <<NOT NULL, default 1>>
can_ct : INTEGER <<default 1>>
can_mri : INTEGER <<default 1>>
quota_monday : INTEGER <<default 15>>
quota_tuesday : INTEGER <<default 15>>
quota_wednesday : INTEGER <<default 15>>
quota_thursday : INTEGER <<default 15>>
quota_friday : INTEGER <<default 15>>
quota_saturday : INTEGER <<default 0>>
quota_sunday : INTEGER <<default 0>>
preferred_lab_id : INTEGER <<nullable>>
}
entity "diagnostician_skills" as skills {
* id : INTEGER <<PK, autoincrement>>
--
diagnostician_id : INTEGER <<FK, NOT NULL>>
exam_code : TEXT <<NOT NULL>>
is_preferred : INTEGER <<default 0>>
..
<<UNIQUE(diagnostician_id, exam_code)>>
}
entity "partnerships" as partners {
* id : INTEGER <<PK, autoincrement>>
--
issuing_doctor_id : TEXT <<FK, NOT NULL>>
issuing_doctor_name : TEXT <<NOT NULL>>
preferred_diagnostician_id : INTEGER <<FK, NOT NULL>>
priority : INTEGER <<default 1>>
exclusive : INTEGER <<default 0>>
is_active : INTEGER <<default 1>>
}
entity "availability" as avail {
* id : INTEGER <<PK, autoincrement>>
--
diagnostician_id : INTEGER <<FK, NOT NULL>>
date : TEXT <<NOT NULL>> (ISO-8601)
status : TEXT <<NOT NULL, default 'available'>>
is_pamakristos_oncall : INTEGER <<default 0>>
notes : TEXT
..
<<UNIQUE(diagnostician_id, date)>>
}
entity "doctors" as docs {
* id : TEXT <<PK>>
--
name : TEXT <<NOT NULL>>
}
entity "local_assignments" as local {
* exammoreid : INTEGER <<PK>>
--
diagnostician_id : INTEGER <<NOT NULL>>
diagnostician_name : TEXT <<NOT NULL>>
assigned_at : TEXT <<NOT NULL>> (ISO-8601)
is_auto : INTEGER <<NOT NULL, default 0>>
rule_desc : TEXT
}
entity "assignment_log" as log {
* exammoreid : INTEGER <<PK>>
--
diagnostician_id : INTEGER <<NOT NULL>>
assigned_at : TEXT <<NOT NULL>> (ISO-8601)
modality : TEXT
extracode : TEXT
}
entity "pamakristos_schedule" as pam {
* weekday : INTEGER <<PK>> (0=Mon..6=Sun)
--
diagnostician_id : INTEGER <<FK, NOT NULL>>
}
entity "exam_routing_rules" as route {
* id : INTEGER <<PK, autoincrement>>
--
lab_id : INTEGER <<nullable>>
is_pamakristos : INTEGER <<NOT NULL, default 0>>
exam_codes : TEXT <<NOT NULL>>
diagnostician_id : INTEGER <<FK, NOT NULL>>
description : TEXT
issuing_doctor_id : INTEGER <<nullable>>
issuing_doctor_name : TEXT <<nullable>>
is_active : INTEGER <<NOT NULL, default 1>>
}
entity "exclusive_lab_rules" as ex_lab {
* id : INTEGER <<PK, autoincrement>>
--
diagnostician_id : INTEGER <<FK, NOT NULL>>
lab_id : INTEGER <<NOT NULL>>
lab_name : TEXT
is_active : INTEGER <<NOT NULL, default 1>>
}
entity "modality_quotas" as mod_q {
* id : INTEGER <<PK, autoincrement>>
--
diagnostician_id : INTEGER <<FK, NOT NULL>>
modality : TEXT <<NOT NULL>> (CT|MRI)
max_count : INTEGER <<NOT NULL>>
is_active : INTEGER <<NOT NULL, default 1>>
}
entity "system_settings" as sys {
* key : TEXT <<PK>>
--
value : TEXT <<NOT NULL>>
}
entity "exam_dictionary" as exam_dict {
* code : TEXT <<PK>>
--
name : TEXT <<NOT NULL>>
category : TEXT
}
entity "admin_users" as admin_users {
* id : INTEGER <<PK, autoincrement>>
--
username : TEXT <<UNIQUE, NOT NULL>>
password_hash : TEXT <<NOT NULL>>
role : TEXT <<NOT NULL, default 'admin'>>
is_active : INTEGER <<NOT NULL, default 1>>
}
}
' ─────────────────────────────────────────────
' mock_slis.db — Slis Mirror
' ─────────────────────────────────────────────
package "mock_slis.db" as db2 #FFF3E0 {
entity "exam_categories" as cats {
* examnumcode : INTEGER <<PK>>
--
name : TEXT <<NOT NULL>>
category : TEXT <<NOT NULL>> (CT|MRI|MRA)
}
entity "slis_exams" as exams {
* exammoreid : INTEGER <<PK>>
--
extracode : INTEGER
visitid : INTEGER
demogid : INTEGER
fname : TEXT
lname : TEXT
age : INTEGER
examid : INTEGER
examnumcode : INTEGER <<FK>>
examname : TEXT
visitdate : TEXT (ISO-8601)
labcodeid : INTEGER
laboratoryname : TEXT
wardid : INTEGER
wcode : TEXT
wname : TEXT
diagnostis : INTEGER <<nullable>>
personelid : INTEGER
code : TEXT
name : TEXT
notes : TEXT
category : TEXT
oldpers : INTEGER <<nullable>>
slis_synced_at : TEXT <<nullable>>
}
entity "diagnosticians\n(Slis personnel)" as slis_diag {
* PERSONELID : INTEGER <<PK>>
--
DOCNAME : TEXT
}
entity "doctors\n(Slis doctors)" as slis_docs {
* CODE : INTEGER <<PK>>
--
DOCNAME : TEXT
}
}
' ─────────────────────────────────────────────
' Relationships — Central DB / diagflow.db
' ─────────────────────────────────────────────
diag ||--o{ skills : "1:N"
diag ||--o{ avail : "1:N"
diag ||--o{ partners : "1:N\n(preferred_diagnostician_id)"
diag ||--o{ pam : "1:N"
diag ||--o{ local : "1:N\n(diagnostician_id)"
diag ||--o{ log : "1:N\n(diagnostician_id)"
diag ||--o{ route : "1:N\n(diagnostician_id)"
diag ||--o{ ex_lab : "1:N\n(diagnostician_id)"
diag ||--o{ mod_q : "1:N\n(diagnostician_id)"
partners }o--|| docs : "N:1\n(issuing_doctor_id)"
' ─────────────────────────────────────────────
' Relationships — mock_slis.db
' ─────────────────────────────────────────────
exams }o--|| cats : "N:1\n(examnumcode)"
' ─────────────────────────────────────────────
' Cross-database references & Master Data Sync
' ─────────────────────────────────────────────
local ..> exams : "references\nexammoreid"
log ..> exams : "references\nexammoreid"
slis_diag ..> diag : "syncs personnel\n(id, name)"
slis_docs ..> docs : "syncs doctors\n(id, name)"
note bottom of db2
In **production**, mock_slis.db is replaced
by the real Slis MSSQL database.
DiagFlow executes stored procedures directly.
end note
note bottom of db1
In **production**, all DiagFlow tables are
prefixed with **df_*** (e.g. df_diagnosticians)
and reside within the central MSSQL server.
In **development**, local SQLite is used.
end note
@enduml