@almadar/std 3.1.0 → 3.1.1

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 (176) hide show
  1. package/dist/behaviors/exports/atoms/std-async.orb +420 -0
  2. package/dist/behaviors/exports/atoms/std-browse.orb +173 -0
  3. package/dist/behaviors/exports/atoms/std-cache-aside.orb +881 -0
  4. package/dist/behaviors/exports/atoms/std-circuit-breaker.orb +501 -0
  5. package/dist/behaviors/exports/atoms/std-collision.orb +616 -0
  6. package/dist/behaviors/exports/atoms/std-combat-log.orb +145 -0
  7. package/dist/behaviors/exports/atoms/std-combat.orb +410 -0
  8. package/dist/behaviors/exports/atoms/std-confirmation.orb +282 -0
  9. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +238 -0
  10. package/dist/behaviors/exports/atoms/std-display.orb +842 -0
  11. package/dist/behaviors/exports/atoms/std-drawer.orb +316 -0
  12. package/dist/behaviors/exports/atoms/std-filter.orb +442 -0
  13. package/dist/behaviors/exports/atoms/std-game-audio.orb +113 -0
  14. package/dist/behaviors/exports/atoms/std-game-canvas-2d.orb +135 -0
  15. package/dist/behaviors/exports/atoms/std-game-canvas-3d.orb +224 -0
  16. package/dist/behaviors/exports/atoms/std-game-hud.orb +151 -0
  17. package/dist/behaviors/exports/atoms/std-game-menu.orb +211 -0
  18. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +195 -0
  19. package/dist/behaviors/exports/atoms/std-gameflow.orb +318 -0
  20. package/dist/behaviors/exports/atoms/std-input.orb +629 -0
  21. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +255 -0
  22. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +631 -0
  23. package/dist/behaviors/exports/atoms/std-loading.orb +511 -0
  24. package/dist/behaviors/exports/atoms/std-modal.orb +270 -0
  25. package/dist/behaviors/exports/atoms/std-movement.orb +1037 -0
  26. package/dist/behaviors/exports/atoms/std-notification.orb +418 -0
  27. package/dist/behaviors/exports/atoms/std-overworld.orb +483 -0
  28. package/dist/behaviors/exports/atoms/std-pagination.orb +331 -0
  29. package/dist/behaviors/exports/atoms/std-physics2d.orb +419 -0
  30. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +257 -0
  31. package/dist/behaviors/exports/atoms/std-quest.orb +980 -0
  32. package/dist/behaviors/exports/atoms/std-rate-limiter.orb +638 -0
  33. package/dist/behaviors/exports/atoms/std-score-board.orb +238 -0
  34. package/dist/behaviors/exports/atoms/std-score.orb +466 -0
  35. package/dist/behaviors/exports/atoms/std-search.orb +373 -0
  36. package/dist/behaviors/exports/atoms/std-selection.orb +759 -0
  37. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +183 -0
  38. package/dist/behaviors/exports/atoms/std-sort.orb +578 -0
  39. package/dist/behaviors/exports/atoms/std-sprite.orb +156 -0
  40. package/dist/behaviors/exports/atoms/std-tabs.orb +274 -0
  41. package/dist/behaviors/exports/atoms/std-timer.orb +1030 -0
  42. package/dist/behaviors/exports/atoms/std-undo.orb +694 -0
  43. package/dist/behaviors/exports/atoms/std-wizard.orb +666 -0
  44. package/dist/behaviors/exports/molecules/std-builder-game.orb +183 -0
  45. package/dist/behaviors/exports/molecules/std-cart.orb +591 -0
  46. package/dist/behaviors/exports/molecules/std-classifier-game.orb +183 -0
  47. package/dist/behaviors/exports/molecules/std-debugger-game.orb +183 -0
  48. package/dist/behaviors/exports/molecules/std-detail.orb +589 -0
  49. package/dist/behaviors/exports/molecules/std-event-handler-game.orb +183 -0
  50. package/dist/behaviors/exports/molecules/std-geospatial.orb +649 -0
  51. package/dist/behaviors/exports/molecules/std-inventory.orb +853 -0
  52. package/dist/behaviors/exports/molecules/std-list.orb +954 -0
  53. package/dist/behaviors/exports/molecules/std-messaging.orb +585 -0
  54. package/dist/behaviors/exports/molecules/std-negotiator-game.orb +183 -0
  55. package/dist/behaviors/exports/molecules/std-platformer-game.orb +496 -0
  56. package/dist/behaviors/exports/molecules/std-puzzle-game.orb +527 -0
  57. package/dist/behaviors/exports/molecules/std-sequencer-game.orb +183 -0
  58. package/dist/behaviors/exports/molecules/std-simulator-game.orb +183 -0
  59. package/dist/behaviors/exports/molecules/std-turn-based-battle.orb +443 -0
  60. package/dist/behaviors/exports/organisms/std-api-gateway.orb +2296 -0
  61. package/dist/behaviors/exports/organisms/std-arcade-game.orb +833 -0
  62. package/dist/behaviors/exports/organisms/std-booking-system.orb +3977 -0
  63. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +2214 -0
  64. package/dist/behaviors/exports/organisms/std-cms.orb +2644 -0
  65. package/dist/behaviors/exports/organisms/std-coding-academy.orb +1394 -0
  66. package/dist/behaviors/exports/organisms/std-crm.orb +3541 -0
  67. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +3134 -0
  68. package/dist/behaviors/exports/organisms/std-ecommerce.orb +3743 -0
  69. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +2385 -0
  70. package/dist/behaviors/exports/organisms/std-healthcare.orb +4679 -0
  71. package/dist/behaviors/exports/organisms/std-helpdesk.orb +2564 -0
  72. package/dist/behaviors/exports/organisms/std-hr-portal.orb +4029 -0
  73. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +2297 -0
  74. package/dist/behaviors/exports/organisms/std-lms.orb +2854 -0
  75. package/dist/behaviors/exports/organisms/std-logic-training.orb +598 -0
  76. package/dist/behaviors/exports/organisms/std-platformer-app.orb +1569 -0
  77. package/dist/behaviors/exports/organisms/std-project-manager.orb +3021 -0
  78. package/dist/behaviors/exports/organisms/std-puzzle-app.orb +743 -0
  79. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +2380 -0
  80. package/dist/behaviors/exports/organisms/std-rpg-game.orb +2804 -0
  81. package/dist/behaviors/exports/organisms/std-social-feed.orb +1221 -0
  82. package/dist/behaviors/exports/organisms/std-stem-lab.orb +1210 -0
  83. package/dist/behaviors/exports/organisms/std-strategy-game.orb +1761 -0
  84. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +2217 -0
  85. package/dist/behaviors/exports-reader.d.ts +2 -0
  86. package/dist/behaviors/exports-reader.js +5 -3
  87. package/dist/behaviors/exports-reader.js.map +1 -1
  88. package/dist/behaviors/index.js +5 -3
  89. package/dist/behaviors/index.js.map +1 -1
  90. package/dist/exports/atoms/std-async.orb +420 -0
  91. package/dist/exports/atoms/std-browse.orb +173 -0
  92. package/dist/exports/atoms/std-cache-aside.orb +881 -0
  93. package/dist/exports/atoms/std-circuit-breaker.orb +501 -0
  94. package/dist/exports/atoms/std-collision.orb +616 -0
  95. package/dist/exports/atoms/std-combat-log.orb +145 -0
  96. package/dist/exports/atoms/std-combat.orb +410 -0
  97. package/dist/exports/atoms/std-confirmation.orb +282 -0
  98. package/dist/exports/atoms/std-dialogue-box.orb +238 -0
  99. package/dist/exports/atoms/std-display.orb +842 -0
  100. package/dist/exports/atoms/std-drawer.orb +316 -0
  101. package/dist/exports/atoms/std-filter.orb +442 -0
  102. package/dist/exports/atoms/std-game-audio.orb +113 -0
  103. package/dist/exports/atoms/std-game-canvas-2d.orb +135 -0
  104. package/dist/exports/atoms/std-game-canvas-3d.orb +224 -0
  105. package/dist/exports/atoms/std-game-hud.orb +151 -0
  106. package/dist/exports/atoms/std-game-menu.orb +211 -0
  107. package/dist/exports/atoms/std-game-over-screen.orb +195 -0
  108. package/dist/exports/atoms/std-gameflow.orb +318 -0
  109. package/dist/exports/atoms/std-input.orb +629 -0
  110. package/dist/exports/atoms/std-inventory-panel.orb +255 -0
  111. package/dist/exports/atoms/std-isometric-canvas.orb +631 -0
  112. package/dist/exports/atoms/std-loading.orb +511 -0
  113. package/dist/exports/atoms/std-modal.orb +270 -0
  114. package/dist/exports/atoms/std-movement.orb +1037 -0
  115. package/dist/exports/atoms/std-notification.orb +418 -0
  116. package/dist/exports/atoms/std-overworld.orb +483 -0
  117. package/dist/exports/atoms/std-pagination.orb +331 -0
  118. package/dist/exports/atoms/std-physics2d.orb +419 -0
  119. package/dist/exports/atoms/std-platformer-canvas.orb +257 -0
  120. package/dist/exports/atoms/std-quest.orb +980 -0
  121. package/dist/exports/atoms/std-rate-limiter.orb +638 -0
  122. package/dist/exports/atoms/std-score-board.orb +238 -0
  123. package/dist/exports/atoms/std-score.orb +466 -0
  124. package/dist/exports/atoms/std-search.orb +373 -0
  125. package/dist/exports/atoms/std-selection.orb +759 -0
  126. package/dist/exports/atoms/std-simulation-canvas.orb +183 -0
  127. package/dist/exports/atoms/std-sort.orb +578 -0
  128. package/dist/exports/atoms/std-sprite.orb +156 -0
  129. package/dist/exports/atoms/std-tabs.orb +274 -0
  130. package/dist/exports/atoms/std-timer.orb +1030 -0
  131. package/dist/exports/atoms/std-undo.orb +694 -0
  132. package/dist/exports/atoms/std-wizard.orb +666 -0
  133. package/dist/exports/molecules/std-builder-game.orb +183 -0
  134. package/dist/exports/molecules/std-cart.orb +591 -0
  135. package/dist/exports/molecules/std-classifier-game.orb +183 -0
  136. package/dist/exports/molecules/std-debugger-game.orb +183 -0
  137. package/dist/exports/molecules/std-detail.orb +589 -0
  138. package/dist/exports/molecules/std-event-handler-game.orb +183 -0
  139. package/dist/exports/molecules/std-geospatial.orb +649 -0
  140. package/dist/exports/molecules/std-inventory.orb +853 -0
  141. package/dist/exports/molecules/std-list.orb +954 -0
  142. package/dist/exports/molecules/std-messaging.orb +585 -0
  143. package/dist/exports/molecules/std-negotiator-game.orb +183 -0
  144. package/dist/exports/molecules/std-platformer-game.orb +496 -0
  145. package/dist/exports/molecules/std-puzzle-game.orb +527 -0
  146. package/dist/exports/molecules/std-sequencer-game.orb +183 -0
  147. package/dist/exports/molecules/std-simulator-game.orb +183 -0
  148. package/dist/exports/molecules/std-turn-based-battle.orb +443 -0
  149. package/dist/exports/organisms/std-api-gateway.orb +2296 -0
  150. package/dist/exports/organisms/std-arcade-game.orb +833 -0
  151. package/dist/exports/organisms/std-booking-system.orb +3977 -0
  152. package/dist/exports/organisms/std-cicd-pipeline.orb +2214 -0
  153. package/dist/exports/organisms/std-cms.orb +2644 -0
  154. package/dist/exports/organisms/std-coding-academy.orb +1394 -0
  155. package/dist/exports/organisms/std-crm.orb +3541 -0
  156. package/dist/exports/organisms/std-devops-dashboard.orb +3134 -0
  157. package/dist/exports/organisms/std-ecommerce.orb +3743 -0
  158. package/dist/exports/organisms/std-finance-tracker.orb +2385 -0
  159. package/dist/exports/organisms/std-healthcare.orb +4679 -0
  160. package/dist/exports/organisms/std-helpdesk.orb +2564 -0
  161. package/dist/exports/organisms/std-hr-portal.orb +4029 -0
  162. package/dist/exports/organisms/std-iot-dashboard.orb +2297 -0
  163. package/dist/exports/organisms/std-lms.orb +2854 -0
  164. package/dist/exports/organisms/std-logic-training.orb +598 -0
  165. package/dist/exports/organisms/std-platformer-app.orb +1569 -0
  166. package/dist/exports/organisms/std-project-manager.orb +3021 -0
  167. package/dist/exports/organisms/std-puzzle-app.orb +743 -0
  168. package/dist/exports/organisms/std-realtime-chat.orb +2380 -0
  169. package/dist/exports/organisms/std-rpg-game.orb +2804 -0
  170. package/dist/exports/organisms/std-social-feed.orb +1221 -0
  171. package/dist/exports/organisms/std-stem-lab.orb +1210 -0
  172. package/dist/exports/organisms/std-strategy-game.orb +1761 -0
  173. package/dist/exports/organisms/std-trading-dashboard.orb +2217 -0
  174. package/dist/index.js +5 -3
  175. package/dist/index.js.map +1 -1
  176. package/package.json +1 -1
@@ -0,0 +1,4679 @@
1
+ {
2
+ "name": "HealthcareApp",
3
+ "version": "1.0.0",
4
+ "orbitals": [
5
+ {
6
+ "name": "PatientOrbital",
7
+ "entity": {
8
+ "name": "Patient",
9
+ "persistence": "runtime",
10
+ "fields": [
11
+ {
12
+ "name": "id",
13
+ "type": "string",
14
+ "required": true
15
+ },
16
+ {
17
+ "name": "firstName",
18
+ "type": "string",
19
+ "required": true
20
+ },
21
+ {
22
+ "name": "lastName",
23
+ "type": "string",
24
+ "required": true
25
+ },
26
+ {
27
+ "name": "dateOfBirth",
28
+ "type": "string",
29
+ "required": true
30
+ },
31
+ {
32
+ "name": "phone",
33
+ "type": "string"
34
+ },
35
+ {
36
+ "name": "insuranceId",
37
+ "type": "string"
38
+ },
39
+ {
40
+ "name": "status",
41
+ "type": "string",
42
+ "default": "active"
43
+ }
44
+ ]
45
+ },
46
+ "traits": [
47
+ {
48
+ "name": "PatientBrowse",
49
+ "linkedEntity": "Patient",
50
+ "category": "interaction",
51
+ "listens": [
52
+ {
53
+ "event": "PATIENT_CREATED",
54
+ "triggers": "PATIENT_CREATED"
55
+ },
56
+ {
57
+ "event": "PATIENT_UPDATED",
58
+ "triggers": "PATIENT_UPDATED"
59
+ },
60
+ {
61
+ "event": "INTAKE_COMPLETE",
62
+ "triggers": "INIT",
63
+ "scope": "external"
64
+ }
65
+ ],
66
+ "stateMachine": {
67
+ "states": [
68
+ {
69
+ "name": "browsing",
70
+ "isInitial": true
71
+ },
72
+ {
73
+ "name": "deleting"
74
+ }
75
+ ],
76
+ "events": [
77
+ {
78
+ "key": "INIT",
79
+ "name": "Initialize"
80
+ },
81
+ {
82
+ "key": "CREATE",
83
+ "name": "CREATE"
84
+ },
85
+ {
86
+ "key": "VIEW",
87
+ "name": "VIEW",
88
+ "payload": [
89
+ {
90
+ "name": "id",
91
+ "type": "string",
92
+ "required": true
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "key": "EDIT",
98
+ "name": "EDIT",
99
+ "payload": [
100
+ {
101
+ "name": "id",
102
+ "type": "string",
103
+ "required": true
104
+ }
105
+ ]
106
+ },
107
+ {
108
+ "key": "DELETE",
109
+ "name": "DELETE",
110
+ "payload": [
111
+ {
112
+ "name": "id",
113
+ "type": "string",
114
+ "required": true
115
+ }
116
+ ]
117
+ },
118
+ {
119
+ "key": "PATIENT_CREATED",
120
+ "name": "PATIENT_CREATED",
121
+ "payload": [
122
+ {
123
+ "name": "data",
124
+ "type": "object",
125
+ "required": true
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "key": "PATIENT_UPDATED",
131
+ "name": "PATIENT_UPDATED",
132
+ "payload": [
133
+ {
134
+ "name": "data",
135
+ "type": "object",
136
+ "required": true
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "key": "CONFIRM_DELETE",
142
+ "name": "Confirm Delete"
143
+ },
144
+ {
145
+ "key": "CANCEL",
146
+ "name": "Cancel"
147
+ },
148
+ {
149
+ "key": "CLOSE",
150
+ "name": "Close"
151
+ }
152
+ ],
153
+ "transitions": [
154
+ {
155
+ "from": "browsing",
156
+ "to": "browsing",
157
+ "event": "INIT",
158
+ "effects": [
159
+ [
160
+ "fetch",
161
+ "Patient"
162
+ ],
163
+ [
164
+ "render-ui",
165
+ "main",
166
+ {
167
+ "type": "stack",
168
+ "direction": "vertical",
169
+ "gap": "lg",
170
+ "children": [
171
+ {
172
+ "type": "stack",
173
+ "direction": "horizontal",
174
+ "gap": "md",
175
+ "justify": "space-between",
176
+ "children": [
177
+ {
178
+ "type": "stack",
179
+ "direction": "horizontal",
180
+ "gap": "sm",
181
+ "align": "center",
182
+ "children": [
183
+ {
184
+ "type": "icon",
185
+ "name": "users",
186
+ "size": "lg"
187
+ },
188
+ {
189
+ "type": "typography",
190
+ "content": "Patients",
191
+ "variant": "h2"
192
+ }
193
+ ]
194
+ },
195
+ {
196
+ "type": "stack",
197
+ "direction": "horizontal",
198
+ "gap": "sm",
199
+ "children": [
200
+ {
201
+ "type": "button",
202
+ "label": "Create Patient",
203
+ "event": "CREATE",
204
+ "variant": "primary",
205
+ "icon": "plus"
206
+ }
207
+ ]
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "type": "divider"
213
+ },
214
+ {
215
+ "type": "data-grid",
216
+ "entity": "Patient",
217
+ "emptyIcon": "inbox",
218
+ "emptyTitle": "No patients yet",
219
+ "emptyDescription": "Create your first patient to get started.",
220
+ "itemActions": [
221
+ {
222
+ "label": "View",
223
+ "event": "VIEW"
224
+ },
225
+ {
226
+ "label": "Edit",
227
+ "event": "EDIT"
228
+ },
229
+ {
230
+ "label": "Delete",
231
+ "event": "DELETE",
232
+ "variant": "danger"
233
+ }
234
+ ],
235
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
236
+ "children": [
237
+ {
238
+ "type": "stack",
239
+ "direction": "vertical",
240
+ "gap": "sm",
241
+ "children": [
242
+ {
243
+ "type": "stack",
244
+ "direction": "horizontal",
245
+ "justify": "space-between",
246
+ "align": "center",
247
+ "children": [
248
+ {
249
+ "type": "stack",
250
+ "direction": "horizontal",
251
+ "gap": "sm",
252
+ "align": "center",
253
+ "children": [
254
+ {
255
+ "type": "icon",
256
+ "name": "users",
257
+ "size": "sm"
258
+ },
259
+ {
260
+ "type": "typography",
261
+ "variant": "h4",
262
+ "content": "@entity.firstName"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "type": "badge",
268
+ "label": "@entity.lastName"
269
+ }
270
+ ]
271
+ },
272
+ {
273
+ "type": "typography",
274
+ "variant": "caption",
275
+ "color": "muted",
276
+ "content": "@entity.dateOfBirth"
277
+ }
278
+ ]
279
+ }
280
+ ]
281
+ }
282
+ ]
283
+ }
284
+ ]
285
+ ]
286
+ },
287
+ {
288
+ "from": "browsing",
289
+ "to": "browsing",
290
+ "event": "PATIENT_CREATED",
291
+ "effects": [
292
+ [
293
+ "fetch",
294
+ "Patient"
295
+ ]
296
+ ]
297
+ },
298
+ {
299
+ "from": "browsing",
300
+ "to": "browsing",
301
+ "event": "PATIENT_UPDATED",
302
+ "effects": [
303
+ [
304
+ "fetch",
305
+ "Patient"
306
+ ]
307
+ ]
308
+ },
309
+ {
310
+ "from": "browsing",
311
+ "to": "deleting",
312
+ "event": "DELETE",
313
+ "effects": [
314
+ [
315
+ "fetch",
316
+ "Patient",
317
+ "@payload.id"
318
+ ],
319
+ [
320
+ "render-ui",
321
+ "modal",
322
+ {
323
+ "type": "stack",
324
+ "direction": "vertical",
325
+ "gap": "md",
326
+ "children": [
327
+ {
328
+ "type": "stack",
329
+ "direction": "horizontal",
330
+ "gap": "sm",
331
+ "children": [
332
+ {
333
+ "type": "icon",
334
+ "name": "trash-2",
335
+ "size": "md"
336
+ },
337
+ {
338
+ "type": "typography",
339
+ "content": "Delete Patient",
340
+ "variant": "h3"
341
+ }
342
+ ]
343
+ },
344
+ {
345
+ "type": "divider"
346
+ },
347
+ {
348
+ "type": "typography",
349
+ "content": "Are you sure you want to delete this patient?",
350
+ "variant": "body"
351
+ },
352
+ {
353
+ "type": "stack",
354
+ "direction": "horizontal",
355
+ "gap": "sm",
356
+ "justify": "end",
357
+ "children": [
358
+ {
359
+ "type": "button",
360
+ "label": "Cancel",
361
+ "event": "CANCEL",
362
+ "variant": "ghost"
363
+ },
364
+ {
365
+ "type": "button",
366
+ "label": "Delete",
367
+ "event": "CONFIRM_DELETE",
368
+ "variant": "danger",
369
+ "icon": "trash"
370
+ }
371
+ ]
372
+ }
373
+ ]
374
+ }
375
+ ]
376
+ ]
377
+ },
378
+ {
379
+ "from": "deleting",
380
+ "to": "browsing",
381
+ "event": "CONFIRM_DELETE",
382
+ "effects": [
383
+ [
384
+ "persist",
385
+ "delete",
386
+ "Patient",
387
+ "@entity.id"
388
+ ],
389
+ [
390
+ "render-ui",
391
+ "modal",
392
+ null
393
+ ],
394
+ [
395
+ "fetch",
396
+ "Patient"
397
+ ],
398
+ [
399
+ "notify",
400
+ "Patient deleted successfully"
401
+ ]
402
+ ]
403
+ },
404
+ {
405
+ "from": "deleting",
406
+ "to": "browsing",
407
+ "event": "CANCEL",
408
+ "effects": [
409
+ [
410
+ "render-ui",
411
+ "modal",
412
+ null
413
+ ]
414
+ ]
415
+ },
416
+ {
417
+ "from": "deleting",
418
+ "to": "browsing",
419
+ "event": "CLOSE",
420
+ "effects": [
421
+ [
422
+ "render-ui",
423
+ "modal",
424
+ null
425
+ ]
426
+ ]
427
+ }
428
+ ]
429
+ }
430
+ },
431
+ {
432
+ "name": "PatientCreate",
433
+ "linkedEntity": "Patient",
434
+ "category": "interaction",
435
+ "emits": [
436
+ {
437
+ "event": "PATIENT_CREATED"
438
+ }
439
+ ],
440
+ "stateMachine": {
441
+ "states": [
442
+ {
443
+ "name": "closed",
444
+ "isInitial": true
445
+ },
446
+ {
447
+ "name": "open"
448
+ }
449
+ ],
450
+ "events": [
451
+ {
452
+ "key": "INIT",
453
+ "name": "Initialize"
454
+ },
455
+ {
456
+ "key": "CREATE",
457
+ "name": "Open"
458
+ },
459
+ {
460
+ "key": "CLOSE",
461
+ "name": "Close"
462
+ },
463
+ {
464
+ "key": "SAVE",
465
+ "name": "Save",
466
+ "payload": [
467
+ {
468
+ "name": "data",
469
+ "type": "object",
470
+ "required": true
471
+ }
472
+ ]
473
+ }
474
+ ],
475
+ "transitions": [
476
+ {
477
+ "from": "closed",
478
+ "to": "closed",
479
+ "event": "INIT",
480
+ "effects": [
481
+ [
482
+ "fetch",
483
+ "Patient"
484
+ ]
485
+ ]
486
+ },
487
+ {
488
+ "from": "closed",
489
+ "to": "open",
490
+ "event": "CREATE",
491
+ "effects": [
492
+ [
493
+ "fetch",
494
+ "Patient"
495
+ ],
496
+ [
497
+ "render-ui",
498
+ "modal",
499
+ {
500
+ "type": "stack",
501
+ "direction": "vertical",
502
+ "gap": "md",
503
+ "children": [
504
+ {
505
+ "type": "stack",
506
+ "direction": "horizontal",
507
+ "gap": "sm",
508
+ "children": [
509
+ {
510
+ "type": "icon",
511
+ "name": "plus-circle",
512
+ "size": "md"
513
+ },
514
+ {
515
+ "type": "typography",
516
+ "content": "Create Patient",
517
+ "variant": "h3"
518
+ }
519
+ ]
520
+ },
521
+ {
522
+ "type": "divider"
523
+ },
524
+ {
525
+ "type": "form-section",
526
+ "entity": "Patient",
527
+ "mode": "create",
528
+ "submitEvent": "SAVE",
529
+ "cancelEvent": "CLOSE",
530
+ "fields": [
531
+ "firstName",
532
+ "lastName",
533
+ "dateOfBirth",
534
+ "phone",
535
+ "insuranceId",
536
+ "status"
537
+ ]
538
+ }
539
+ ]
540
+ }
541
+ ]
542
+ ]
543
+ },
544
+ {
545
+ "from": "open",
546
+ "to": "closed",
547
+ "event": "CLOSE",
548
+ "effects": [
549
+ [
550
+ "render-ui",
551
+ "modal",
552
+ null
553
+ ]
554
+ ]
555
+ },
556
+ {
557
+ "from": "open",
558
+ "to": "closed",
559
+ "event": "SAVE",
560
+ "effects": [
561
+ [
562
+ "persist",
563
+ "create",
564
+ "Patient",
565
+ "@payload.data"
566
+ ],
567
+ [
568
+ "fetch",
569
+ "Patient"
570
+ ],
571
+ [
572
+ "render-ui",
573
+ "modal",
574
+ null
575
+ ],
576
+ [
577
+ "emit",
578
+ "PATIENT_CREATED"
579
+ ],
580
+ [
581
+ "notify",
582
+ "Patient created successfully"
583
+ ]
584
+ ]
585
+ }
586
+ ]
587
+ }
588
+ },
589
+ {
590
+ "name": "PatientEdit",
591
+ "linkedEntity": "Patient",
592
+ "category": "interaction",
593
+ "emits": [
594
+ {
595
+ "event": "PATIENT_UPDATED"
596
+ }
597
+ ],
598
+ "stateMachine": {
599
+ "states": [
600
+ {
601
+ "name": "closed",
602
+ "isInitial": true
603
+ },
604
+ {
605
+ "name": "open"
606
+ }
607
+ ],
608
+ "events": [
609
+ {
610
+ "key": "INIT",
611
+ "name": "Initialize"
612
+ },
613
+ {
614
+ "key": "EDIT",
615
+ "name": "Open",
616
+ "payload": [
617
+ {
618
+ "name": "id",
619
+ "type": "string",
620
+ "required": true
621
+ }
622
+ ]
623
+ },
624
+ {
625
+ "key": "CLOSE",
626
+ "name": "Close"
627
+ },
628
+ {
629
+ "key": "SAVE",
630
+ "name": "Save",
631
+ "payload": [
632
+ {
633
+ "name": "data",
634
+ "type": "object",
635
+ "required": true
636
+ }
637
+ ]
638
+ }
639
+ ],
640
+ "transitions": [
641
+ {
642
+ "from": "closed",
643
+ "to": "closed",
644
+ "event": "INIT",
645
+ "effects": [
646
+ [
647
+ "fetch",
648
+ "Patient"
649
+ ]
650
+ ]
651
+ },
652
+ {
653
+ "from": "closed",
654
+ "to": "open",
655
+ "event": "EDIT",
656
+ "effects": [
657
+ [
658
+ "fetch",
659
+ "Patient",
660
+ "@payload.id"
661
+ ],
662
+ [
663
+ "render-ui",
664
+ "modal",
665
+ {
666
+ "type": "stack",
667
+ "direction": "vertical",
668
+ "gap": "md",
669
+ "children": [
670
+ {
671
+ "type": "stack",
672
+ "direction": "horizontal",
673
+ "gap": "sm",
674
+ "children": [
675
+ {
676
+ "type": "icon",
677
+ "name": "edit",
678
+ "size": "md"
679
+ },
680
+ {
681
+ "type": "typography",
682
+ "content": "Edit Patient",
683
+ "variant": "h3"
684
+ }
685
+ ]
686
+ },
687
+ {
688
+ "type": "divider"
689
+ },
690
+ {
691
+ "type": "form-section",
692
+ "entity": "Patient",
693
+ "mode": "edit",
694
+ "submitEvent": "SAVE",
695
+ "cancelEvent": "CLOSE",
696
+ "fields": [
697
+ "firstName",
698
+ "lastName",
699
+ "dateOfBirth",
700
+ "phone",
701
+ "insuranceId",
702
+ "status"
703
+ ]
704
+ }
705
+ ]
706
+ }
707
+ ]
708
+ ]
709
+ },
710
+ {
711
+ "from": "open",
712
+ "to": "closed",
713
+ "event": "CLOSE",
714
+ "effects": [
715
+ [
716
+ "render-ui",
717
+ "modal",
718
+ null
719
+ ]
720
+ ]
721
+ },
722
+ {
723
+ "from": "open",
724
+ "to": "closed",
725
+ "event": "SAVE",
726
+ "effects": [
727
+ [
728
+ "persist",
729
+ "update",
730
+ "Patient",
731
+ "@payload.data"
732
+ ],
733
+ [
734
+ "fetch",
735
+ "Patient"
736
+ ],
737
+ [
738
+ "render-ui",
739
+ "modal",
740
+ null
741
+ ],
742
+ [
743
+ "emit",
744
+ "PATIENT_UPDATED"
745
+ ],
746
+ [
747
+ "notify",
748
+ "Patient updated successfully"
749
+ ]
750
+ ]
751
+ }
752
+ ]
753
+ }
754
+ },
755
+ {
756
+ "name": "PatientView",
757
+ "linkedEntity": "Patient",
758
+ "category": "interaction",
759
+ "stateMachine": {
760
+ "states": [
761
+ {
762
+ "name": "closed",
763
+ "isInitial": true
764
+ },
765
+ {
766
+ "name": "open"
767
+ }
768
+ ],
769
+ "events": [
770
+ {
771
+ "key": "INIT",
772
+ "name": "Initialize"
773
+ },
774
+ {
775
+ "key": "VIEW",
776
+ "name": "Open",
777
+ "payload": [
778
+ {
779
+ "name": "id",
780
+ "type": "string",
781
+ "required": true
782
+ }
783
+ ]
784
+ },
785
+ {
786
+ "key": "CLOSE",
787
+ "name": "Close"
788
+ }
789
+ ],
790
+ "transitions": [
791
+ {
792
+ "from": "closed",
793
+ "to": "closed",
794
+ "event": "INIT",
795
+ "effects": [
796
+ [
797
+ "fetch",
798
+ "Patient"
799
+ ]
800
+ ]
801
+ },
802
+ {
803
+ "from": "closed",
804
+ "to": "open",
805
+ "event": "VIEW",
806
+ "effects": [
807
+ [
808
+ "fetch",
809
+ "Patient",
810
+ "@payload.id"
811
+ ],
812
+ [
813
+ "render-ui",
814
+ "modal",
815
+ {
816
+ "type": "stack",
817
+ "direction": "vertical",
818
+ "gap": "md",
819
+ "children": [
820
+ {
821
+ "type": "stack",
822
+ "direction": "horizontal",
823
+ "gap": "sm",
824
+ "align": "center",
825
+ "children": [
826
+ {
827
+ "type": "icon",
828
+ "name": "eye",
829
+ "size": "md"
830
+ },
831
+ {
832
+ "type": "typography",
833
+ "variant": "h3",
834
+ "content": "@entity.firstName"
835
+ }
836
+ ]
837
+ },
838
+ {
839
+ "type": "divider"
840
+ },
841
+ {
842
+ "type": "stack",
843
+ "direction": "horizontal",
844
+ "gap": "md",
845
+ "children": [
846
+ {
847
+ "type": "typography",
848
+ "variant": "caption",
849
+ "content": "FirstName"
850
+ },
851
+ {
852
+ "type": "typography",
853
+ "variant": "body",
854
+ "content": "@entity.firstName"
855
+ }
856
+ ]
857
+ },
858
+ {
859
+ "type": "stack",
860
+ "direction": "horizontal",
861
+ "gap": "md",
862
+ "children": [
863
+ {
864
+ "type": "typography",
865
+ "variant": "caption",
866
+ "content": "LastName"
867
+ },
868
+ {
869
+ "type": "typography",
870
+ "variant": "body",
871
+ "content": "@entity.lastName"
872
+ }
873
+ ]
874
+ },
875
+ {
876
+ "type": "stack",
877
+ "direction": "horizontal",
878
+ "gap": "md",
879
+ "children": [
880
+ {
881
+ "type": "typography",
882
+ "variant": "caption",
883
+ "content": "DateOfBirth"
884
+ },
885
+ {
886
+ "type": "typography",
887
+ "variant": "body",
888
+ "content": "@entity.dateOfBirth"
889
+ }
890
+ ]
891
+ },
892
+ {
893
+ "type": "stack",
894
+ "direction": "horizontal",
895
+ "gap": "md",
896
+ "children": [
897
+ {
898
+ "type": "typography",
899
+ "variant": "caption",
900
+ "content": "Phone"
901
+ },
902
+ {
903
+ "type": "typography",
904
+ "variant": "body",
905
+ "content": "@entity.phone"
906
+ }
907
+ ]
908
+ },
909
+ {
910
+ "type": "stack",
911
+ "direction": "horizontal",
912
+ "gap": "md",
913
+ "children": [
914
+ {
915
+ "type": "typography",
916
+ "variant": "caption",
917
+ "content": "InsuranceId"
918
+ },
919
+ {
920
+ "type": "typography",
921
+ "variant": "body",
922
+ "content": "@entity.insuranceId"
923
+ }
924
+ ]
925
+ },
926
+ {
927
+ "type": "stack",
928
+ "direction": "horizontal",
929
+ "gap": "md",
930
+ "children": [
931
+ {
932
+ "type": "typography",
933
+ "variant": "caption",
934
+ "content": "Status"
935
+ },
936
+ {
937
+ "type": "typography",
938
+ "variant": "body",
939
+ "content": "@entity.status"
940
+ }
941
+ ]
942
+ },
943
+ {
944
+ "type": "divider"
945
+ },
946
+ {
947
+ "type": "stack",
948
+ "direction": "horizontal",
949
+ "gap": "sm",
950
+ "justify": "end",
951
+ "children": [
952
+ {
953
+ "type": "button",
954
+ "label": "Edit",
955
+ "event": "EDIT",
956
+ "variant": "primary",
957
+ "icon": "edit"
958
+ },
959
+ {
960
+ "type": "button",
961
+ "label": "Close",
962
+ "event": "CLOSE",
963
+ "variant": "ghost"
964
+ }
965
+ ]
966
+ }
967
+ ]
968
+ }
969
+ ]
970
+ ]
971
+ },
972
+ {
973
+ "from": "open",
974
+ "to": "closed",
975
+ "event": "CLOSE",
976
+ "effects": [
977
+ [
978
+ "render-ui",
979
+ "modal",
980
+ null
981
+ ]
982
+ ]
983
+ }
984
+ ]
985
+ }
986
+ }
987
+ ],
988
+ "pages": [
989
+ {
990
+ "name": "PatientsPage",
991
+ "path": "/patients",
992
+ "isInitial": true,
993
+ "traits": [
994
+ {
995
+ "ref": "PatientBrowse"
996
+ },
997
+ {
998
+ "ref": "PatientCreate"
999
+ },
1000
+ {
1001
+ "ref": "PatientEdit"
1002
+ },
1003
+ {
1004
+ "ref": "PatientView"
1005
+ }
1006
+ ]
1007
+ }
1008
+ ]
1009
+ },
1010
+ {
1011
+ "name": "AppointmentOrbital",
1012
+ "entity": {
1013
+ "name": "Appointment",
1014
+ "persistence": "runtime",
1015
+ "fields": [
1016
+ {
1017
+ "name": "id",
1018
+ "type": "string",
1019
+ "required": true
1020
+ },
1021
+ {
1022
+ "name": "patientName",
1023
+ "type": "string",
1024
+ "required": true
1025
+ },
1026
+ {
1027
+ "name": "doctorName",
1028
+ "type": "string",
1029
+ "required": true
1030
+ },
1031
+ {
1032
+ "name": "date",
1033
+ "type": "string",
1034
+ "required": true
1035
+ },
1036
+ {
1037
+ "name": "time",
1038
+ "type": "string",
1039
+ "required": true
1040
+ },
1041
+ {
1042
+ "name": "reason",
1043
+ "type": "string"
1044
+ },
1045
+ {
1046
+ "name": "status",
1047
+ "type": "string",
1048
+ "default": "scheduled"
1049
+ }
1050
+ ]
1051
+ },
1052
+ "traits": [
1053
+ {
1054
+ "name": "AppointmentBrowse",
1055
+ "linkedEntity": "Appointment",
1056
+ "category": "interaction",
1057
+ "listens": [
1058
+ {
1059
+ "event": "APPOINTMENT_CREATED",
1060
+ "triggers": "APPOINTMENT_CREATED"
1061
+ },
1062
+ {
1063
+ "event": "APPOINTMENT_UPDATED",
1064
+ "triggers": "APPOINTMENT_UPDATED"
1065
+ }
1066
+ ],
1067
+ "stateMachine": {
1068
+ "states": [
1069
+ {
1070
+ "name": "browsing",
1071
+ "isInitial": true
1072
+ },
1073
+ {
1074
+ "name": "deleting"
1075
+ }
1076
+ ],
1077
+ "events": [
1078
+ {
1079
+ "key": "INIT",
1080
+ "name": "Initialize"
1081
+ },
1082
+ {
1083
+ "key": "CREATE",
1084
+ "name": "CREATE"
1085
+ },
1086
+ {
1087
+ "key": "VIEW",
1088
+ "name": "VIEW",
1089
+ "payload": [
1090
+ {
1091
+ "name": "id",
1092
+ "type": "string",
1093
+ "required": true
1094
+ }
1095
+ ]
1096
+ },
1097
+ {
1098
+ "key": "EDIT",
1099
+ "name": "EDIT",
1100
+ "payload": [
1101
+ {
1102
+ "name": "id",
1103
+ "type": "string",
1104
+ "required": true
1105
+ }
1106
+ ]
1107
+ },
1108
+ {
1109
+ "key": "DELETE",
1110
+ "name": "DELETE",
1111
+ "payload": [
1112
+ {
1113
+ "name": "id",
1114
+ "type": "string",
1115
+ "required": true
1116
+ }
1117
+ ]
1118
+ },
1119
+ {
1120
+ "key": "APPOINTMENT_CREATED",
1121
+ "name": "APPOINTMENT_CREATED",
1122
+ "payload": [
1123
+ {
1124
+ "name": "data",
1125
+ "type": "object",
1126
+ "required": true
1127
+ }
1128
+ ]
1129
+ },
1130
+ {
1131
+ "key": "APPOINTMENT_UPDATED",
1132
+ "name": "APPOINTMENT_UPDATED",
1133
+ "payload": [
1134
+ {
1135
+ "name": "data",
1136
+ "type": "object",
1137
+ "required": true
1138
+ }
1139
+ ]
1140
+ },
1141
+ {
1142
+ "key": "CONFIRM_DELETE",
1143
+ "name": "Confirm Delete"
1144
+ },
1145
+ {
1146
+ "key": "CANCEL",
1147
+ "name": "Cancel"
1148
+ },
1149
+ {
1150
+ "key": "CLOSE",
1151
+ "name": "Close"
1152
+ }
1153
+ ],
1154
+ "transitions": [
1155
+ {
1156
+ "from": "browsing",
1157
+ "to": "browsing",
1158
+ "event": "INIT",
1159
+ "effects": [
1160
+ [
1161
+ "fetch",
1162
+ "Appointment"
1163
+ ],
1164
+ [
1165
+ "render-ui",
1166
+ "main",
1167
+ {
1168
+ "type": "stack",
1169
+ "direction": "vertical",
1170
+ "gap": "lg",
1171
+ "children": [
1172
+ {
1173
+ "type": "stack",
1174
+ "direction": "horizontal",
1175
+ "gap": "md",
1176
+ "justify": "space-between",
1177
+ "children": [
1178
+ {
1179
+ "type": "stack",
1180
+ "direction": "horizontal",
1181
+ "gap": "sm",
1182
+ "align": "center",
1183
+ "children": [
1184
+ {
1185
+ "type": "icon",
1186
+ "name": "calendar",
1187
+ "size": "lg"
1188
+ },
1189
+ {
1190
+ "type": "typography",
1191
+ "content": "Appointments",
1192
+ "variant": "h2"
1193
+ }
1194
+ ]
1195
+ },
1196
+ {
1197
+ "type": "stack",
1198
+ "direction": "horizontal",
1199
+ "gap": "sm",
1200
+ "children": [
1201
+ {
1202
+ "type": "button",
1203
+ "label": "Create Appointment",
1204
+ "event": "CREATE",
1205
+ "variant": "primary",
1206
+ "icon": "plus"
1207
+ }
1208
+ ]
1209
+ }
1210
+ ]
1211
+ },
1212
+ {
1213
+ "type": "divider"
1214
+ },
1215
+ {
1216
+ "type": "data-grid",
1217
+ "entity": "Appointment",
1218
+ "emptyIcon": "inbox",
1219
+ "emptyTitle": "No appointments yet",
1220
+ "emptyDescription": "Create your first appointment to get started.",
1221
+ "itemActions": [
1222
+ {
1223
+ "label": "View",
1224
+ "event": "VIEW"
1225
+ },
1226
+ {
1227
+ "label": "Edit",
1228
+ "event": "EDIT"
1229
+ },
1230
+ {
1231
+ "label": "Delete",
1232
+ "event": "DELETE",
1233
+ "variant": "danger"
1234
+ }
1235
+ ],
1236
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
1237
+ "children": [
1238
+ {
1239
+ "type": "stack",
1240
+ "direction": "vertical",
1241
+ "gap": "sm",
1242
+ "children": [
1243
+ {
1244
+ "type": "stack",
1245
+ "direction": "horizontal",
1246
+ "justify": "space-between",
1247
+ "align": "center",
1248
+ "children": [
1249
+ {
1250
+ "type": "stack",
1251
+ "direction": "horizontal",
1252
+ "gap": "sm",
1253
+ "align": "center",
1254
+ "children": [
1255
+ {
1256
+ "type": "icon",
1257
+ "name": "calendar",
1258
+ "size": "sm"
1259
+ },
1260
+ {
1261
+ "type": "typography",
1262
+ "variant": "h4",
1263
+ "content": "@entity.patientName"
1264
+ }
1265
+ ]
1266
+ },
1267
+ {
1268
+ "type": "badge",
1269
+ "label": "@entity.doctorName"
1270
+ }
1271
+ ]
1272
+ },
1273
+ {
1274
+ "type": "typography",
1275
+ "variant": "caption",
1276
+ "color": "muted",
1277
+ "content": "@entity.date"
1278
+ }
1279
+ ]
1280
+ }
1281
+ ]
1282
+ }
1283
+ ]
1284
+ }
1285
+ ]
1286
+ ]
1287
+ },
1288
+ {
1289
+ "from": "browsing",
1290
+ "to": "browsing",
1291
+ "event": "APPOINTMENT_CREATED",
1292
+ "effects": [
1293
+ [
1294
+ "fetch",
1295
+ "Appointment"
1296
+ ]
1297
+ ]
1298
+ },
1299
+ {
1300
+ "from": "browsing",
1301
+ "to": "browsing",
1302
+ "event": "APPOINTMENT_UPDATED",
1303
+ "effects": [
1304
+ [
1305
+ "fetch",
1306
+ "Appointment"
1307
+ ]
1308
+ ]
1309
+ },
1310
+ {
1311
+ "from": "browsing",
1312
+ "to": "deleting",
1313
+ "event": "DELETE",
1314
+ "effects": [
1315
+ [
1316
+ "fetch",
1317
+ "Appointment",
1318
+ "@payload.id"
1319
+ ],
1320
+ [
1321
+ "render-ui",
1322
+ "modal",
1323
+ {
1324
+ "type": "stack",
1325
+ "direction": "vertical",
1326
+ "gap": "md",
1327
+ "children": [
1328
+ {
1329
+ "type": "stack",
1330
+ "direction": "horizontal",
1331
+ "gap": "sm",
1332
+ "children": [
1333
+ {
1334
+ "type": "icon",
1335
+ "name": "trash-2",
1336
+ "size": "md"
1337
+ },
1338
+ {
1339
+ "type": "typography",
1340
+ "content": "Delete Appointment",
1341
+ "variant": "h3"
1342
+ }
1343
+ ]
1344
+ },
1345
+ {
1346
+ "type": "divider"
1347
+ },
1348
+ {
1349
+ "type": "typography",
1350
+ "content": "Are you sure you want to delete this appointment?",
1351
+ "variant": "body"
1352
+ },
1353
+ {
1354
+ "type": "stack",
1355
+ "direction": "horizontal",
1356
+ "gap": "sm",
1357
+ "justify": "end",
1358
+ "children": [
1359
+ {
1360
+ "type": "button",
1361
+ "label": "Cancel",
1362
+ "event": "CANCEL",
1363
+ "variant": "ghost"
1364
+ },
1365
+ {
1366
+ "type": "button",
1367
+ "label": "Delete",
1368
+ "event": "CONFIRM_DELETE",
1369
+ "variant": "danger",
1370
+ "icon": "trash"
1371
+ }
1372
+ ]
1373
+ }
1374
+ ]
1375
+ }
1376
+ ]
1377
+ ]
1378
+ },
1379
+ {
1380
+ "from": "deleting",
1381
+ "to": "browsing",
1382
+ "event": "CONFIRM_DELETE",
1383
+ "effects": [
1384
+ [
1385
+ "persist",
1386
+ "delete",
1387
+ "Appointment",
1388
+ "@entity.id"
1389
+ ],
1390
+ [
1391
+ "render-ui",
1392
+ "modal",
1393
+ null
1394
+ ],
1395
+ [
1396
+ "fetch",
1397
+ "Appointment"
1398
+ ],
1399
+ [
1400
+ "notify",
1401
+ "Appointment deleted successfully"
1402
+ ]
1403
+ ]
1404
+ },
1405
+ {
1406
+ "from": "deleting",
1407
+ "to": "browsing",
1408
+ "event": "CANCEL",
1409
+ "effects": [
1410
+ [
1411
+ "render-ui",
1412
+ "modal",
1413
+ null
1414
+ ]
1415
+ ]
1416
+ },
1417
+ {
1418
+ "from": "deleting",
1419
+ "to": "browsing",
1420
+ "event": "CLOSE",
1421
+ "effects": [
1422
+ [
1423
+ "render-ui",
1424
+ "modal",
1425
+ null
1426
+ ]
1427
+ ]
1428
+ }
1429
+ ]
1430
+ },
1431
+ "emits": [
1432
+ {
1433
+ "event": "PRESCRIBE",
1434
+ "payload": [
1435
+ {
1436
+ "name": "id",
1437
+ "type": "string",
1438
+ "required": true
1439
+ }
1440
+ ],
1441
+ "scope": "external"
1442
+ }
1443
+ ]
1444
+ },
1445
+ {
1446
+ "name": "AppointmentCreate",
1447
+ "linkedEntity": "Appointment",
1448
+ "category": "interaction",
1449
+ "emits": [
1450
+ {
1451
+ "event": "APPOINTMENT_CREATED"
1452
+ }
1453
+ ],
1454
+ "stateMachine": {
1455
+ "states": [
1456
+ {
1457
+ "name": "closed",
1458
+ "isInitial": true
1459
+ },
1460
+ {
1461
+ "name": "open"
1462
+ }
1463
+ ],
1464
+ "events": [
1465
+ {
1466
+ "key": "INIT",
1467
+ "name": "Initialize"
1468
+ },
1469
+ {
1470
+ "key": "CREATE",
1471
+ "name": "Open"
1472
+ },
1473
+ {
1474
+ "key": "CLOSE",
1475
+ "name": "Close"
1476
+ },
1477
+ {
1478
+ "key": "SAVE",
1479
+ "name": "Save",
1480
+ "payload": [
1481
+ {
1482
+ "name": "data",
1483
+ "type": "object",
1484
+ "required": true
1485
+ }
1486
+ ]
1487
+ }
1488
+ ],
1489
+ "transitions": [
1490
+ {
1491
+ "from": "closed",
1492
+ "to": "closed",
1493
+ "event": "INIT",
1494
+ "effects": [
1495
+ [
1496
+ "fetch",
1497
+ "Appointment"
1498
+ ]
1499
+ ]
1500
+ },
1501
+ {
1502
+ "from": "closed",
1503
+ "to": "open",
1504
+ "event": "CREATE",
1505
+ "effects": [
1506
+ [
1507
+ "fetch",
1508
+ "Appointment"
1509
+ ],
1510
+ [
1511
+ "render-ui",
1512
+ "modal",
1513
+ {
1514
+ "type": "stack",
1515
+ "direction": "vertical",
1516
+ "gap": "md",
1517
+ "children": [
1518
+ {
1519
+ "type": "stack",
1520
+ "direction": "horizontal",
1521
+ "gap": "sm",
1522
+ "children": [
1523
+ {
1524
+ "type": "icon",
1525
+ "name": "plus-circle",
1526
+ "size": "md"
1527
+ },
1528
+ {
1529
+ "type": "typography",
1530
+ "content": "Create Appointment",
1531
+ "variant": "h3"
1532
+ }
1533
+ ]
1534
+ },
1535
+ {
1536
+ "type": "divider"
1537
+ },
1538
+ {
1539
+ "type": "form-section",
1540
+ "entity": "Appointment",
1541
+ "mode": "create",
1542
+ "submitEvent": "SAVE",
1543
+ "cancelEvent": "CLOSE",
1544
+ "fields": [
1545
+ "patientName",
1546
+ "doctorName",
1547
+ "date",
1548
+ "time",
1549
+ "reason",
1550
+ "status"
1551
+ ]
1552
+ }
1553
+ ]
1554
+ }
1555
+ ]
1556
+ ]
1557
+ },
1558
+ {
1559
+ "from": "open",
1560
+ "to": "closed",
1561
+ "event": "CLOSE",
1562
+ "effects": [
1563
+ [
1564
+ "render-ui",
1565
+ "modal",
1566
+ null
1567
+ ]
1568
+ ]
1569
+ },
1570
+ {
1571
+ "from": "open",
1572
+ "to": "closed",
1573
+ "event": "SAVE",
1574
+ "effects": [
1575
+ [
1576
+ "persist",
1577
+ "create",
1578
+ "Appointment",
1579
+ "@payload.data"
1580
+ ],
1581
+ [
1582
+ "fetch",
1583
+ "Appointment"
1584
+ ],
1585
+ [
1586
+ "render-ui",
1587
+ "modal",
1588
+ null
1589
+ ],
1590
+ [
1591
+ "emit",
1592
+ "APPOINTMENT_CREATED"
1593
+ ],
1594
+ [
1595
+ "notify",
1596
+ "Appointment created successfully"
1597
+ ]
1598
+ ]
1599
+ }
1600
+ ]
1601
+ }
1602
+ },
1603
+ {
1604
+ "name": "AppointmentEdit",
1605
+ "linkedEntity": "Appointment",
1606
+ "category": "interaction",
1607
+ "emits": [
1608
+ {
1609
+ "event": "APPOINTMENT_UPDATED"
1610
+ }
1611
+ ],
1612
+ "stateMachine": {
1613
+ "states": [
1614
+ {
1615
+ "name": "closed",
1616
+ "isInitial": true
1617
+ },
1618
+ {
1619
+ "name": "open"
1620
+ }
1621
+ ],
1622
+ "events": [
1623
+ {
1624
+ "key": "INIT",
1625
+ "name": "Initialize"
1626
+ },
1627
+ {
1628
+ "key": "EDIT",
1629
+ "name": "Open",
1630
+ "payload": [
1631
+ {
1632
+ "name": "id",
1633
+ "type": "string",
1634
+ "required": true
1635
+ }
1636
+ ]
1637
+ },
1638
+ {
1639
+ "key": "CLOSE",
1640
+ "name": "Close"
1641
+ },
1642
+ {
1643
+ "key": "SAVE",
1644
+ "name": "Save",
1645
+ "payload": [
1646
+ {
1647
+ "name": "data",
1648
+ "type": "object",
1649
+ "required": true
1650
+ }
1651
+ ]
1652
+ }
1653
+ ],
1654
+ "transitions": [
1655
+ {
1656
+ "from": "closed",
1657
+ "to": "closed",
1658
+ "event": "INIT",
1659
+ "effects": [
1660
+ [
1661
+ "fetch",
1662
+ "Appointment"
1663
+ ]
1664
+ ]
1665
+ },
1666
+ {
1667
+ "from": "closed",
1668
+ "to": "open",
1669
+ "event": "EDIT",
1670
+ "effects": [
1671
+ [
1672
+ "fetch",
1673
+ "Appointment",
1674
+ "@payload.id"
1675
+ ],
1676
+ [
1677
+ "render-ui",
1678
+ "modal",
1679
+ {
1680
+ "type": "stack",
1681
+ "direction": "vertical",
1682
+ "gap": "md",
1683
+ "children": [
1684
+ {
1685
+ "type": "stack",
1686
+ "direction": "horizontal",
1687
+ "gap": "sm",
1688
+ "children": [
1689
+ {
1690
+ "type": "icon",
1691
+ "name": "edit",
1692
+ "size": "md"
1693
+ },
1694
+ {
1695
+ "type": "typography",
1696
+ "content": "Edit Appointment",
1697
+ "variant": "h3"
1698
+ }
1699
+ ]
1700
+ },
1701
+ {
1702
+ "type": "divider"
1703
+ },
1704
+ {
1705
+ "type": "form-section",
1706
+ "entity": "Appointment",
1707
+ "mode": "edit",
1708
+ "submitEvent": "SAVE",
1709
+ "cancelEvent": "CLOSE",
1710
+ "fields": [
1711
+ "patientName",
1712
+ "doctorName",
1713
+ "date",
1714
+ "time",
1715
+ "reason",
1716
+ "status"
1717
+ ]
1718
+ }
1719
+ ]
1720
+ }
1721
+ ]
1722
+ ]
1723
+ },
1724
+ {
1725
+ "from": "open",
1726
+ "to": "closed",
1727
+ "event": "CLOSE",
1728
+ "effects": [
1729
+ [
1730
+ "render-ui",
1731
+ "modal",
1732
+ null
1733
+ ]
1734
+ ]
1735
+ },
1736
+ {
1737
+ "from": "open",
1738
+ "to": "closed",
1739
+ "event": "SAVE",
1740
+ "effects": [
1741
+ [
1742
+ "persist",
1743
+ "update",
1744
+ "Appointment",
1745
+ "@payload.data"
1746
+ ],
1747
+ [
1748
+ "fetch",
1749
+ "Appointment"
1750
+ ],
1751
+ [
1752
+ "render-ui",
1753
+ "modal",
1754
+ null
1755
+ ],
1756
+ [
1757
+ "emit",
1758
+ "APPOINTMENT_UPDATED"
1759
+ ],
1760
+ [
1761
+ "notify",
1762
+ "Appointment updated successfully"
1763
+ ]
1764
+ ]
1765
+ }
1766
+ ]
1767
+ }
1768
+ },
1769
+ {
1770
+ "name": "AppointmentView",
1771
+ "linkedEntity": "Appointment",
1772
+ "category": "interaction",
1773
+ "stateMachine": {
1774
+ "states": [
1775
+ {
1776
+ "name": "closed",
1777
+ "isInitial": true
1778
+ },
1779
+ {
1780
+ "name": "open"
1781
+ }
1782
+ ],
1783
+ "events": [
1784
+ {
1785
+ "key": "INIT",
1786
+ "name": "Initialize"
1787
+ },
1788
+ {
1789
+ "key": "VIEW",
1790
+ "name": "Open",
1791
+ "payload": [
1792
+ {
1793
+ "name": "id",
1794
+ "type": "string",
1795
+ "required": true
1796
+ }
1797
+ ]
1798
+ },
1799
+ {
1800
+ "key": "CLOSE",
1801
+ "name": "Close"
1802
+ }
1803
+ ],
1804
+ "transitions": [
1805
+ {
1806
+ "from": "closed",
1807
+ "to": "closed",
1808
+ "event": "INIT",
1809
+ "effects": [
1810
+ [
1811
+ "fetch",
1812
+ "Appointment"
1813
+ ]
1814
+ ]
1815
+ },
1816
+ {
1817
+ "from": "closed",
1818
+ "to": "open",
1819
+ "event": "VIEW",
1820
+ "effects": [
1821
+ [
1822
+ "fetch",
1823
+ "Appointment",
1824
+ "@payload.id"
1825
+ ],
1826
+ [
1827
+ "render-ui",
1828
+ "modal",
1829
+ {
1830
+ "type": "stack",
1831
+ "direction": "vertical",
1832
+ "gap": "md",
1833
+ "children": [
1834
+ {
1835
+ "type": "stack",
1836
+ "direction": "horizontal",
1837
+ "gap": "sm",
1838
+ "align": "center",
1839
+ "children": [
1840
+ {
1841
+ "type": "icon",
1842
+ "name": "eye",
1843
+ "size": "md"
1844
+ },
1845
+ {
1846
+ "type": "typography",
1847
+ "variant": "h3",
1848
+ "content": "@entity.patientName"
1849
+ }
1850
+ ]
1851
+ },
1852
+ {
1853
+ "type": "divider"
1854
+ },
1855
+ {
1856
+ "type": "stack",
1857
+ "direction": "horizontal",
1858
+ "gap": "md",
1859
+ "children": [
1860
+ {
1861
+ "type": "typography",
1862
+ "variant": "caption",
1863
+ "content": "PatientName"
1864
+ },
1865
+ {
1866
+ "type": "typography",
1867
+ "variant": "body",
1868
+ "content": "@entity.patientName"
1869
+ }
1870
+ ]
1871
+ },
1872
+ {
1873
+ "type": "stack",
1874
+ "direction": "horizontal",
1875
+ "gap": "md",
1876
+ "children": [
1877
+ {
1878
+ "type": "typography",
1879
+ "variant": "caption",
1880
+ "content": "DoctorName"
1881
+ },
1882
+ {
1883
+ "type": "typography",
1884
+ "variant": "body",
1885
+ "content": "@entity.doctorName"
1886
+ }
1887
+ ]
1888
+ },
1889
+ {
1890
+ "type": "stack",
1891
+ "direction": "horizontal",
1892
+ "gap": "md",
1893
+ "children": [
1894
+ {
1895
+ "type": "typography",
1896
+ "variant": "caption",
1897
+ "content": "Date"
1898
+ },
1899
+ {
1900
+ "type": "typography",
1901
+ "variant": "body",
1902
+ "content": "@entity.date"
1903
+ }
1904
+ ]
1905
+ },
1906
+ {
1907
+ "type": "stack",
1908
+ "direction": "horizontal",
1909
+ "gap": "md",
1910
+ "children": [
1911
+ {
1912
+ "type": "typography",
1913
+ "variant": "caption",
1914
+ "content": "Time"
1915
+ },
1916
+ {
1917
+ "type": "typography",
1918
+ "variant": "body",
1919
+ "content": "@entity.time"
1920
+ }
1921
+ ]
1922
+ },
1923
+ {
1924
+ "type": "stack",
1925
+ "direction": "horizontal",
1926
+ "gap": "md",
1927
+ "children": [
1928
+ {
1929
+ "type": "typography",
1930
+ "variant": "caption",
1931
+ "content": "Reason"
1932
+ },
1933
+ {
1934
+ "type": "typography",
1935
+ "variant": "body",
1936
+ "content": "@entity.reason"
1937
+ }
1938
+ ]
1939
+ },
1940
+ {
1941
+ "type": "stack",
1942
+ "direction": "horizontal",
1943
+ "gap": "md",
1944
+ "children": [
1945
+ {
1946
+ "type": "typography",
1947
+ "variant": "caption",
1948
+ "content": "Status"
1949
+ },
1950
+ {
1951
+ "type": "typography",
1952
+ "variant": "body",
1953
+ "content": "@entity.status"
1954
+ }
1955
+ ]
1956
+ },
1957
+ {
1958
+ "type": "divider"
1959
+ },
1960
+ {
1961
+ "type": "stack",
1962
+ "direction": "horizontal",
1963
+ "gap": "sm",
1964
+ "justify": "end",
1965
+ "children": [
1966
+ {
1967
+ "type": "button",
1968
+ "label": "Edit",
1969
+ "event": "EDIT",
1970
+ "variant": "primary",
1971
+ "icon": "edit"
1972
+ },
1973
+ {
1974
+ "type": "button",
1975
+ "label": "Close",
1976
+ "event": "CLOSE",
1977
+ "variant": "ghost"
1978
+ }
1979
+ ]
1980
+ }
1981
+ ]
1982
+ }
1983
+ ]
1984
+ ]
1985
+ },
1986
+ {
1987
+ "from": "open",
1988
+ "to": "closed",
1989
+ "event": "CLOSE",
1990
+ "effects": [
1991
+ [
1992
+ "render-ui",
1993
+ "modal",
1994
+ null
1995
+ ]
1996
+ ]
1997
+ }
1998
+ ]
1999
+ }
2000
+ }
2001
+ ],
2002
+ "pages": [
2003
+ {
2004
+ "name": "AppointmentsPage",
2005
+ "path": "/appointments",
2006
+ "traits": [
2007
+ {
2008
+ "ref": "AppointmentBrowse"
2009
+ },
2010
+ {
2011
+ "ref": "AppointmentCreate"
2012
+ },
2013
+ {
2014
+ "ref": "AppointmentEdit"
2015
+ },
2016
+ {
2017
+ "ref": "AppointmentView"
2018
+ }
2019
+ ]
2020
+ }
2021
+ ]
2022
+ },
2023
+ {
2024
+ "name": "IntakeFormOrbital",
2025
+ "entity": {
2026
+ "name": "IntakeForm",
2027
+ "persistence": "runtime",
2028
+ "fields": [
2029
+ {
2030
+ "name": "id",
2031
+ "type": "string",
2032
+ "required": true
2033
+ },
2034
+ {
2035
+ "name": "firstName",
2036
+ "type": "string",
2037
+ "required": true
2038
+ },
2039
+ {
2040
+ "name": "lastName",
2041
+ "type": "string",
2042
+ "required": true
2043
+ },
2044
+ {
2045
+ "name": "dateOfBirth",
2046
+ "type": "string",
2047
+ "required": true
2048
+ },
2049
+ {
2050
+ "name": "allergies",
2051
+ "type": "string"
2052
+ },
2053
+ {
2054
+ "name": "medications",
2055
+ "type": "string"
2056
+ },
2057
+ {
2058
+ "name": "emergencyContact",
2059
+ "type": "string"
2060
+ },
2061
+ {
2062
+ "name": "insuranceProvider",
2063
+ "type": "string"
2064
+ },
2065
+ {
2066
+ "name": "insuranceId",
2067
+ "type": "string"
2068
+ }
2069
+ ]
2070
+ },
2071
+ "traits": [
2072
+ {
2073
+ "name": "IntakeFormWizard",
2074
+ "linkedEntity": "IntakeForm",
2075
+ "category": "interaction",
2076
+ "stateMachine": {
2077
+ "states": [
2078
+ {
2079
+ "name": "step1",
2080
+ "isInitial": true
2081
+ },
2082
+ {
2083
+ "name": "step2"
2084
+ },
2085
+ {
2086
+ "name": "step3"
2087
+ },
2088
+ {
2089
+ "name": "review"
2090
+ },
2091
+ {
2092
+ "name": "complete"
2093
+ }
2094
+ ],
2095
+ "events": [
2096
+ {
2097
+ "key": "INIT",
2098
+ "name": "Initialize"
2099
+ },
2100
+ {
2101
+ "key": "NEXT",
2102
+ "name": "Next Step",
2103
+ "payload": [
2104
+ {
2105
+ "name": "data",
2106
+ "type": "object",
2107
+ "required": true
2108
+ }
2109
+ ]
2110
+ },
2111
+ {
2112
+ "key": "PREV",
2113
+ "name": "Previous Step"
2114
+ },
2115
+ {
2116
+ "key": "COMPLETE",
2117
+ "name": "Complete Wizard",
2118
+ "payload": [
2119
+ {
2120
+ "name": "data",
2121
+ "type": "object",
2122
+ "required": true
2123
+ }
2124
+ ]
2125
+ },
2126
+ {
2127
+ "key": "RESTART",
2128
+ "name": "Restart Wizard"
2129
+ }
2130
+ ],
2131
+ "transitions": [
2132
+ {
2133
+ "from": "step1",
2134
+ "to": "step1",
2135
+ "event": "INIT",
2136
+ "effects": [
2137
+ [
2138
+ "fetch",
2139
+ "IntakeForm"
2140
+ ],
2141
+ [
2142
+ "render-ui",
2143
+ "main",
2144
+ {
2145
+ "type": "stack",
2146
+ "direction": "vertical",
2147
+ "gap": "lg",
2148
+ "children": [
2149
+ {
2150
+ "type": "stack",
2151
+ "direction": "horizontal",
2152
+ "gap": "sm",
2153
+ "align": "center",
2154
+ "children": [
2155
+ {
2156
+ "type": "icon",
2157
+ "name": "clipboard",
2158
+ "size": "lg"
2159
+ },
2160
+ {
2161
+ "type": "typography",
2162
+ "content": "Patient Intake",
2163
+ "variant": "h2"
2164
+ }
2165
+ ]
2166
+ },
2167
+ {
2168
+ "type": "badge",
2169
+ "label": "Step 1 of 3"
2170
+ },
2171
+ {
2172
+ "type": "wizard-progress",
2173
+ "steps": [
2174
+ "Personal Info",
2175
+ "Medical History",
2176
+ "Insurance"
2177
+ ],
2178
+ "currentStep": 0
2179
+ },
2180
+ {
2181
+ "type": "divider"
2182
+ },
2183
+ {
2184
+ "type": "typography",
2185
+ "content": "Personal Info",
2186
+ "variant": "h3"
2187
+ },
2188
+ {
2189
+ "type": "form-section",
2190
+ "entity": "IntakeForm",
2191
+ "mode": "create",
2192
+ "submitEvent": "NEXT",
2193
+ "cancelEvent": "INIT",
2194
+ "fields": [
2195
+ "firstName",
2196
+ "lastName",
2197
+ "dateOfBirth"
2198
+ ]
2199
+ },
2200
+ {
2201
+ "type": "stack",
2202
+ "direction": "horizontal",
2203
+ "gap": "sm",
2204
+ "justify": "end",
2205
+ "children": [
2206
+ {
2207
+ "type": "button",
2208
+ "label": "Next",
2209
+ "event": "NEXT",
2210
+ "variant": "primary",
2211
+ "icon": "arrow-right"
2212
+ }
2213
+ ]
2214
+ }
2215
+ ]
2216
+ }
2217
+ ]
2218
+ ]
2219
+ },
2220
+ {
2221
+ "from": "step1",
2222
+ "to": "step2",
2223
+ "event": "NEXT",
2224
+ "effects": [
2225
+ [
2226
+ "fetch",
2227
+ "IntakeForm"
2228
+ ],
2229
+ [
2230
+ "render-ui",
2231
+ "main",
2232
+ {
2233
+ "type": "stack",
2234
+ "direction": "vertical",
2235
+ "gap": "lg",
2236
+ "children": [
2237
+ {
2238
+ "type": "stack",
2239
+ "direction": "horizontal",
2240
+ "gap": "sm",
2241
+ "align": "center",
2242
+ "children": [
2243
+ {
2244
+ "type": "icon",
2245
+ "name": "clipboard",
2246
+ "size": "lg"
2247
+ },
2248
+ {
2249
+ "type": "typography",
2250
+ "content": "Patient Intake",
2251
+ "variant": "h2"
2252
+ }
2253
+ ]
2254
+ },
2255
+ {
2256
+ "type": "badge",
2257
+ "label": "Step 2 of 3"
2258
+ },
2259
+ {
2260
+ "type": "wizard-progress",
2261
+ "steps": [
2262
+ "Personal Info",
2263
+ "Medical History",
2264
+ "Insurance"
2265
+ ],
2266
+ "currentStep": 1
2267
+ },
2268
+ {
2269
+ "type": "divider"
2270
+ },
2271
+ {
2272
+ "type": "typography",
2273
+ "content": "Medical History",
2274
+ "variant": "h3"
2275
+ },
2276
+ {
2277
+ "type": "form-section",
2278
+ "entity": "IntakeForm",
2279
+ "mode": "create",
2280
+ "submitEvent": "NEXT",
2281
+ "cancelEvent": "PREV",
2282
+ "fields": [
2283
+ "allergies",
2284
+ "medications"
2285
+ ]
2286
+ },
2287
+ {
2288
+ "type": "stack",
2289
+ "direction": "horizontal",
2290
+ "gap": "sm",
2291
+ "justify": "end",
2292
+ "children": [
2293
+ {
2294
+ "type": "button",
2295
+ "label": "Back",
2296
+ "event": "PREV",
2297
+ "variant": "ghost",
2298
+ "icon": "arrow-left"
2299
+ },
2300
+ {
2301
+ "type": "button",
2302
+ "label": "Next",
2303
+ "event": "NEXT",
2304
+ "variant": "primary",
2305
+ "icon": "arrow-right"
2306
+ }
2307
+ ]
2308
+ }
2309
+ ]
2310
+ }
2311
+ ]
2312
+ ]
2313
+ },
2314
+ {
2315
+ "from": "step2",
2316
+ "to": "step3",
2317
+ "event": "NEXT",
2318
+ "effects": [
2319
+ [
2320
+ "fetch",
2321
+ "IntakeForm"
2322
+ ],
2323
+ [
2324
+ "render-ui",
2325
+ "main",
2326
+ {
2327
+ "type": "stack",
2328
+ "direction": "vertical",
2329
+ "gap": "lg",
2330
+ "children": [
2331
+ {
2332
+ "type": "stack",
2333
+ "direction": "horizontal",
2334
+ "gap": "sm",
2335
+ "align": "center",
2336
+ "children": [
2337
+ {
2338
+ "type": "icon",
2339
+ "name": "clipboard",
2340
+ "size": "lg"
2341
+ },
2342
+ {
2343
+ "type": "typography",
2344
+ "content": "Patient Intake",
2345
+ "variant": "h2"
2346
+ }
2347
+ ]
2348
+ },
2349
+ {
2350
+ "type": "badge",
2351
+ "label": "Step 3 of 3"
2352
+ },
2353
+ {
2354
+ "type": "wizard-progress",
2355
+ "steps": [
2356
+ "Personal Info",
2357
+ "Medical History",
2358
+ "Insurance"
2359
+ ],
2360
+ "currentStep": 2
2361
+ },
2362
+ {
2363
+ "type": "divider"
2364
+ },
2365
+ {
2366
+ "type": "typography",
2367
+ "content": "Insurance",
2368
+ "variant": "h3"
2369
+ },
2370
+ {
2371
+ "type": "form-section",
2372
+ "entity": "IntakeForm",
2373
+ "mode": "create",
2374
+ "submitEvent": "NEXT",
2375
+ "cancelEvent": "PREV",
2376
+ "fields": [
2377
+ "emergencyContact",
2378
+ "insuranceProvider",
2379
+ "insuranceId"
2380
+ ]
2381
+ },
2382
+ {
2383
+ "type": "stack",
2384
+ "direction": "horizontal",
2385
+ "gap": "sm",
2386
+ "justify": "end",
2387
+ "children": [
2388
+ {
2389
+ "type": "button",
2390
+ "label": "Back",
2391
+ "event": "PREV",
2392
+ "variant": "ghost",
2393
+ "icon": "arrow-left"
2394
+ },
2395
+ {
2396
+ "type": "button",
2397
+ "label": "Next",
2398
+ "event": "NEXT",
2399
+ "variant": "primary",
2400
+ "icon": "arrow-right"
2401
+ }
2402
+ ]
2403
+ }
2404
+ ]
2405
+ }
2406
+ ]
2407
+ ]
2408
+ },
2409
+ {
2410
+ "from": "step3",
2411
+ "to": "review",
2412
+ "event": "NEXT",
2413
+ "effects": [
2414
+ [
2415
+ "fetch",
2416
+ "IntakeForm"
2417
+ ],
2418
+ [
2419
+ "render-ui",
2420
+ "main",
2421
+ {
2422
+ "type": "stack",
2423
+ "direction": "vertical",
2424
+ "gap": "lg",
2425
+ "children": [
2426
+ {
2427
+ "type": "stack",
2428
+ "direction": "horizontal",
2429
+ "gap": "sm",
2430
+ "align": "center",
2431
+ "children": [
2432
+ {
2433
+ "type": "icon",
2434
+ "name": "clipboard",
2435
+ "size": "lg"
2436
+ },
2437
+ {
2438
+ "type": "typography",
2439
+ "content": "Patient Intake",
2440
+ "variant": "h2"
2441
+ }
2442
+ ]
2443
+ },
2444
+ {
2445
+ "type": "badge",
2446
+ "label": "Review"
2447
+ },
2448
+ {
2449
+ "type": "wizard-progress",
2450
+ "steps": [
2451
+ "Personal Info",
2452
+ "Medical History",
2453
+ "Insurance"
2454
+ ],
2455
+ "currentStep": 3
2456
+ },
2457
+ {
2458
+ "type": "divider"
2459
+ },
2460
+ {
2461
+ "type": "data-list",
2462
+ "entity": "IntakeForm",
2463
+ "children": [
2464
+ {
2465
+ "type": "stack",
2466
+ "direction": "vertical",
2467
+ "gap": "sm",
2468
+ "children": [
2469
+ {
2470
+ "type": "stack",
2471
+ "direction": "horizontal",
2472
+ "gap": "md",
2473
+ "justify": "space-between",
2474
+ "children": [
2475
+ {
2476
+ "type": "typography",
2477
+ "variant": "caption",
2478
+ "content": "FirstName"
2479
+ },
2480
+ {
2481
+ "type": "typography",
2482
+ "variant": "body",
2483
+ "content": "@entity.firstName"
2484
+ }
2485
+ ]
2486
+ },
2487
+ {
2488
+ "type": "stack",
2489
+ "direction": "horizontal",
2490
+ "gap": "md",
2491
+ "justify": "space-between",
2492
+ "children": [
2493
+ {
2494
+ "type": "typography",
2495
+ "variant": "caption",
2496
+ "content": "LastName"
2497
+ },
2498
+ {
2499
+ "type": "typography",
2500
+ "variant": "body",
2501
+ "content": "@entity.lastName"
2502
+ }
2503
+ ]
2504
+ },
2505
+ {
2506
+ "type": "stack",
2507
+ "direction": "horizontal",
2508
+ "gap": "md",
2509
+ "justify": "space-between",
2510
+ "children": [
2511
+ {
2512
+ "type": "typography",
2513
+ "variant": "caption",
2514
+ "content": "DateOfBirth"
2515
+ },
2516
+ {
2517
+ "type": "typography",
2518
+ "variant": "body",
2519
+ "content": "@entity.dateOfBirth"
2520
+ }
2521
+ ]
2522
+ },
2523
+ {
2524
+ "type": "stack",
2525
+ "direction": "horizontal",
2526
+ "gap": "md",
2527
+ "justify": "space-between",
2528
+ "children": [
2529
+ {
2530
+ "type": "typography",
2531
+ "variant": "caption",
2532
+ "content": "Allergies"
2533
+ },
2534
+ {
2535
+ "type": "typography",
2536
+ "variant": "body",
2537
+ "content": "@entity.allergies"
2538
+ }
2539
+ ]
2540
+ },
2541
+ {
2542
+ "type": "stack",
2543
+ "direction": "horizontal",
2544
+ "gap": "md",
2545
+ "justify": "space-between",
2546
+ "children": [
2547
+ {
2548
+ "type": "typography",
2549
+ "variant": "caption",
2550
+ "content": "Medications"
2551
+ },
2552
+ {
2553
+ "type": "typography",
2554
+ "variant": "body",
2555
+ "content": "@entity.medications"
2556
+ }
2557
+ ]
2558
+ },
2559
+ {
2560
+ "type": "stack",
2561
+ "direction": "horizontal",
2562
+ "gap": "md",
2563
+ "justify": "space-between",
2564
+ "children": [
2565
+ {
2566
+ "type": "typography",
2567
+ "variant": "caption",
2568
+ "content": "EmergencyContact"
2569
+ },
2570
+ {
2571
+ "type": "typography",
2572
+ "variant": "body",
2573
+ "content": "@entity.emergencyContact"
2574
+ }
2575
+ ]
2576
+ },
2577
+ {
2578
+ "type": "stack",
2579
+ "direction": "horizontal",
2580
+ "gap": "md",
2581
+ "justify": "space-between",
2582
+ "children": [
2583
+ {
2584
+ "type": "typography",
2585
+ "variant": "caption",
2586
+ "content": "InsuranceProvider"
2587
+ },
2588
+ {
2589
+ "type": "typography",
2590
+ "variant": "body",
2591
+ "content": "@entity.insuranceProvider"
2592
+ }
2593
+ ]
2594
+ },
2595
+ {
2596
+ "type": "stack",
2597
+ "direction": "horizontal",
2598
+ "gap": "md",
2599
+ "justify": "space-between",
2600
+ "children": [
2601
+ {
2602
+ "type": "typography",
2603
+ "variant": "caption",
2604
+ "content": "InsuranceId"
2605
+ },
2606
+ {
2607
+ "type": "typography",
2608
+ "variant": "body",
2609
+ "content": "@entity.insuranceId"
2610
+ }
2611
+ ]
2612
+ }
2613
+ ]
2614
+ }
2615
+ ]
2616
+ },
2617
+ {
2618
+ "type": "stack",
2619
+ "direction": "horizontal",
2620
+ "gap": "sm",
2621
+ "justify": "end",
2622
+ "children": [
2623
+ {
2624
+ "type": "button",
2625
+ "label": "Back",
2626
+ "event": "PREV",
2627
+ "variant": "ghost",
2628
+ "icon": "arrow-left"
2629
+ },
2630
+ {
2631
+ "type": "button",
2632
+ "label": "Submit Intake",
2633
+ "event": "COMPLETE",
2634
+ "variant": "primary",
2635
+ "icon": "check"
2636
+ }
2637
+ ]
2638
+ }
2639
+ ]
2640
+ }
2641
+ ]
2642
+ ]
2643
+ },
2644
+ {
2645
+ "from": "step2",
2646
+ "to": "step1",
2647
+ "event": "PREV",
2648
+ "effects": [
2649
+ [
2650
+ "fetch",
2651
+ "IntakeForm"
2652
+ ],
2653
+ [
2654
+ "render-ui",
2655
+ "main",
2656
+ {
2657
+ "type": "stack",
2658
+ "direction": "vertical",
2659
+ "gap": "lg",
2660
+ "children": [
2661
+ {
2662
+ "type": "stack",
2663
+ "direction": "horizontal",
2664
+ "gap": "sm",
2665
+ "align": "center",
2666
+ "children": [
2667
+ {
2668
+ "type": "icon",
2669
+ "name": "clipboard",
2670
+ "size": "lg"
2671
+ },
2672
+ {
2673
+ "type": "typography",
2674
+ "content": "Patient Intake",
2675
+ "variant": "h2"
2676
+ }
2677
+ ]
2678
+ },
2679
+ {
2680
+ "type": "badge",
2681
+ "label": "Step 1 of 3"
2682
+ },
2683
+ {
2684
+ "type": "wizard-progress",
2685
+ "steps": [
2686
+ "Personal Info",
2687
+ "Medical History",
2688
+ "Insurance"
2689
+ ],
2690
+ "currentStep": 0
2691
+ },
2692
+ {
2693
+ "type": "divider"
2694
+ },
2695
+ {
2696
+ "type": "typography",
2697
+ "content": "Personal Info",
2698
+ "variant": "h3"
2699
+ },
2700
+ {
2701
+ "type": "form-section",
2702
+ "entity": "IntakeForm",
2703
+ "mode": "create",
2704
+ "submitEvent": "NEXT",
2705
+ "cancelEvent": "INIT",
2706
+ "fields": [
2707
+ "firstName",
2708
+ "lastName",
2709
+ "dateOfBirth"
2710
+ ]
2711
+ },
2712
+ {
2713
+ "type": "stack",
2714
+ "direction": "horizontal",
2715
+ "gap": "sm",
2716
+ "justify": "end",
2717
+ "children": [
2718
+ {
2719
+ "type": "button",
2720
+ "label": "Next",
2721
+ "event": "NEXT",
2722
+ "variant": "primary",
2723
+ "icon": "arrow-right"
2724
+ }
2725
+ ]
2726
+ }
2727
+ ]
2728
+ }
2729
+ ]
2730
+ ]
2731
+ },
2732
+ {
2733
+ "from": "step3",
2734
+ "to": "step2",
2735
+ "event": "PREV",
2736
+ "effects": [
2737
+ [
2738
+ "fetch",
2739
+ "IntakeForm"
2740
+ ],
2741
+ [
2742
+ "render-ui",
2743
+ "main",
2744
+ {
2745
+ "type": "stack",
2746
+ "direction": "vertical",
2747
+ "gap": "lg",
2748
+ "children": [
2749
+ {
2750
+ "type": "stack",
2751
+ "direction": "horizontal",
2752
+ "gap": "sm",
2753
+ "align": "center",
2754
+ "children": [
2755
+ {
2756
+ "type": "icon",
2757
+ "name": "clipboard",
2758
+ "size": "lg"
2759
+ },
2760
+ {
2761
+ "type": "typography",
2762
+ "content": "Patient Intake",
2763
+ "variant": "h2"
2764
+ }
2765
+ ]
2766
+ },
2767
+ {
2768
+ "type": "badge",
2769
+ "label": "Step 2 of 3"
2770
+ },
2771
+ {
2772
+ "type": "wizard-progress",
2773
+ "steps": [
2774
+ "Personal Info",
2775
+ "Medical History",
2776
+ "Insurance"
2777
+ ],
2778
+ "currentStep": 1
2779
+ },
2780
+ {
2781
+ "type": "divider"
2782
+ },
2783
+ {
2784
+ "type": "typography",
2785
+ "content": "Medical History",
2786
+ "variant": "h3"
2787
+ },
2788
+ {
2789
+ "type": "form-section",
2790
+ "entity": "IntakeForm",
2791
+ "mode": "create",
2792
+ "submitEvent": "NEXT",
2793
+ "cancelEvent": "PREV",
2794
+ "fields": [
2795
+ "allergies",
2796
+ "medications"
2797
+ ]
2798
+ },
2799
+ {
2800
+ "type": "stack",
2801
+ "direction": "horizontal",
2802
+ "gap": "sm",
2803
+ "justify": "end",
2804
+ "children": [
2805
+ {
2806
+ "type": "button",
2807
+ "label": "Back",
2808
+ "event": "PREV",
2809
+ "variant": "ghost",
2810
+ "icon": "arrow-left"
2811
+ },
2812
+ {
2813
+ "type": "button",
2814
+ "label": "Next",
2815
+ "event": "NEXT",
2816
+ "variant": "primary",
2817
+ "icon": "arrow-right"
2818
+ }
2819
+ ]
2820
+ }
2821
+ ]
2822
+ }
2823
+ ]
2824
+ ]
2825
+ },
2826
+ {
2827
+ "from": "review",
2828
+ "to": "step3",
2829
+ "event": "PREV",
2830
+ "effects": [
2831
+ [
2832
+ "fetch",
2833
+ "IntakeForm"
2834
+ ],
2835
+ [
2836
+ "render-ui",
2837
+ "main",
2838
+ {
2839
+ "type": "stack",
2840
+ "direction": "vertical",
2841
+ "gap": "lg",
2842
+ "children": [
2843
+ {
2844
+ "type": "stack",
2845
+ "direction": "horizontal",
2846
+ "gap": "sm",
2847
+ "align": "center",
2848
+ "children": [
2849
+ {
2850
+ "type": "icon",
2851
+ "name": "clipboard",
2852
+ "size": "lg"
2853
+ },
2854
+ {
2855
+ "type": "typography",
2856
+ "content": "Patient Intake",
2857
+ "variant": "h2"
2858
+ }
2859
+ ]
2860
+ },
2861
+ {
2862
+ "type": "badge",
2863
+ "label": "Step 3 of 3"
2864
+ },
2865
+ {
2866
+ "type": "wizard-progress",
2867
+ "steps": [
2868
+ "Personal Info",
2869
+ "Medical History",
2870
+ "Insurance"
2871
+ ],
2872
+ "currentStep": 2
2873
+ },
2874
+ {
2875
+ "type": "divider"
2876
+ },
2877
+ {
2878
+ "type": "typography",
2879
+ "content": "Insurance",
2880
+ "variant": "h3"
2881
+ },
2882
+ {
2883
+ "type": "form-section",
2884
+ "entity": "IntakeForm",
2885
+ "mode": "create",
2886
+ "submitEvent": "NEXT",
2887
+ "cancelEvent": "PREV",
2888
+ "fields": [
2889
+ "emergencyContact",
2890
+ "insuranceProvider",
2891
+ "insuranceId"
2892
+ ]
2893
+ },
2894
+ {
2895
+ "type": "stack",
2896
+ "direction": "horizontal",
2897
+ "gap": "sm",
2898
+ "justify": "end",
2899
+ "children": [
2900
+ {
2901
+ "type": "button",
2902
+ "label": "Back",
2903
+ "event": "PREV",
2904
+ "variant": "ghost",
2905
+ "icon": "arrow-left"
2906
+ },
2907
+ {
2908
+ "type": "button",
2909
+ "label": "Next",
2910
+ "event": "NEXT",
2911
+ "variant": "primary",
2912
+ "icon": "arrow-right"
2913
+ }
2914
+ ]
2915
+ }
2916
+ ]
2917
+ }
2918
+ ]
2919
+ ]
2920
+ },
2921
+ {
2922
+ "from": "review",
2923
+ "to": "complete",
2924
+ "event": "COMPLETE",
2925
+ "effects": [
2926
+ [
2927
+ "persist",
2928
+ "create",
2929
+ "IntakeForm",
2930
+ "@payload.data"
2931
+ ],
2932
+ [
2933
+ "notify",
2934
+ "success",
2935
+ "IntakeForm created successfully"
2936
+ ],
2937
+ [
2938
+ "render-ui",
2939
+ "main",
2940
+ {
2941
+ "type": "stack",
2942
+ "direction": "vertical",
2943
+ "gap": "lg",
2944
+ "align": "center",
2945
+ "children": [
2946
+ {
2947
+ "type": "icon",
2948
+ "name": "check-circle",
2949
+ "size": "lg"
2950
+ },
2951
+ {
2952
+ "type": "typography",
2953
+ "content": "Intake Complete",
2954
+ "variant": "h2"
2955
+ },
2956
+ {
2957
+ "type": "typography",
2958
+ "content": "Patient intake form has been submitted successfully.",
2959
+ "variant": "body"
2960
+ },
2961
+ {
2962
+ "type": "button",
2963
+ "label": "Start New",
2964
+ "event": "RESTART",
2965
+ "variant": "primary",
2966
+ "icon": "refresh-cw"
2967
+ }
2968
+ ]
2969
+ }
2970
+ ]
2971
+ ]
2972
+ },
2973
+ {
2974
+ "from": "complete",
2975
+ "to": "step1",
2976
+ "event": "RESTART",
2977
+ "effects": [
2978
+ [
2979
+ "fetch",
2980
+ "IntakeForm"
2981
+ ],
2982
+ [
2983
+ "render-ui",
2984
+ "main",
2985
+ {
2986
+ "type": "stack",
2987
+ "direction": "vertical",
2988
+ "gap": "lg",
2989
+ "children": [
2990
+ {
2991
+ "type": "stack",
2992
+ "direction": "horizontal",
2993
+ "gap": "sm",
2994
+ "align": "center",
2995
+ "children": [
2996
+ {
2997
+ "type": "icon",
2998
+ "name": "clipboard",
2999
+ "size": "lg"
3000
+ },
3001
+ {
3002
+ "type": "typography",
3003
+ "content": "Patient Intake",
3004
+ "variant": "h2"
3005
+ }
3006
+ ]
3007
+ },
3008
+ {
3009
+ "type": "badge",
3010
+ "label": "Step 1 of 3"
3011
+ },
3012
+ {
3013
+ "type": "wizard-progress",
3014
+ "steps": [
3015
+ "Personal Info",
3016
+ "Medical History",
3017
+ "Insurance"
3018
+ ],
3019
+ "currentStep": 0
3020
+ },
3021
+ {
3022
+ "type": "divider"
3023
+ },
3024
+ {
3025
+ "type": "typography",
3026
+ "content": "Personal Info",
3027
+ "variant": "h3"
3028
+ },
3029
+ {
3030
+ "type": "form-section",
3031
+ "entity": "IntakeForm",
3032
+ "mode": "create",
3033
+ "submitEvent": "NEXT",
3034
+ "cancelEvent": "INIT",
3035
+ "fields": [
3036
+ "firstName",
3037
+ "lastName",
3038
+ "dateOfBirth"
3039
+ ]
3040
+ },
3041
+ {
3042
+ "type": "stack",
3043
+ "direction": "horizontal",
3044
+ "gap": "sm",
3045
+ "justify": "end",
3046
+ "children": [
3047
+ {
3048
+ "type": "button",
3049
+ "label": "Next",
3050
+ "event": "NEXT",
3051
+ "variant": "primary",
3052
+ "icon": "arrow-right"
3053
+ }
3054
+ ]
3055
+ }
3056
+ ]
3057
+ }
3058
+ ]
3059
+ ]
3060
+ },
3061
+ {
3062
+ "from": "complete",
3063
+ "to": "step1",
3064
+ "event": "INIT",
3065
+ "effects": [
3066
+ [
3067
+ "fetch",
3068
+ "IntakeForm"
3069
+ ],
3070
+ [
3071
+ "render-ui",
3072
+ "main",
3073
+ {
3074
+ "type": "stack",
3075
+ "direction": "vertical",
3076
+ "gap": "lg",
3077
+ "children": [
3078
+ {
3079
+ "type": "stack",
3080
+ "direction": "horizontal",
3081
+ "gap": "sm",
3082
+ "align": "center",
3083
+ "children": [
3084
+ {
3085
+ "type": "icon",
3086
+ "name": "clipboard",
3087
+ "size": "lg"
3088
+ },
3089
+ {
3090
+ "type": "typography",
3091
+ "content": "Patient Intake",
3092
+ "variant": "h2"
3093
+ }
3094
+ ]
3095
+ },
3096
+ {
3097
+ "type": "badge",
3098
+ "label": "Step 1 of 3"
3099
+ },
3100
+ {
3101
+ "type": "wizard-progress",
3102
+ "steps": [
3103
+ "Personal Info",
3104
+ "Medical History",
3105
+ "Insurance"
3106
+ ],
3107
+ "currentStep": 0
3108
+ },
3109
+ {
3110
+ "type": "divider"
3111
+ },
3112
+ {
3113
+ "type": "typography",
3114
+ "content": "Personal Info",
3115
+ "variant": "h3"
3116
+ },
3117
+ {
3118
+ "type": "form-section",
3119
+ "entity": "IntakeForm",
3120
+ "mode": "create",
3121
+ "submitEvent": "NEXT",
3122
+ "cancelEvent": "INIT",
3123
+ "fields": [
3124
+ "firstName",
3125
+ "lastName",
3126
+ "dateOfBirth"
3127
+ ]
3128
+ },
3129
+ {
3130
+ "type": "stack",
3131
+ "direction": "horizontal",
3132
+ "gap": "sm",
3133
+ "justify": "end",
3134
+ "children": [
3135
+ {
3136
+ "type": "button",
3137
+ "label": "Next",
3138
+ "event": "NEXT",
3139
+ "variant": "primary",
3140
+ "icon": "arrow-right"
3141
+ }
3142
+ ]
3143
+ }
3144
+ ]
3145
+ }
3146
+ ]
3147
+ ]
3148
+ }
3149
+ ]
3150
+ },
3151
+ "emits": [
3152
+ {
3153
+ "event": "INTAKE_COMPLETE",
3154
+ "payload": [
3155
+ {
3156
+ "name": "id",
3157
+ "type": "string",
3158
+ "required": true
3159
+ }
3160
+ ],
3161
+ "scope": "external"
3162
+ }
3163
+ ]
3164
+ }
3165
+ ],
3166
+ "pages": [
3167
+ {
3168
+ "name": "IntakePage",
3169
+ "path": "/intake",
3170
+ "traits": [
3171
+ {
3172
+ "ref": "IntakeFormWizard"
3173
+ }
3174
+ ]
3175
+ }
3176
+ ]
3177
+ },
3178
+ {
3179
+ "name": "PrescriptionOrbital",
3180
+ "entity": {
3181
+ "name": "Prescription",
3182
+ "persistence": "runtime",
3183
+ "fields": [
3184
+ {
3185
+ "name": "id",
3186
+ "type": "string",
3187
+ "required": true
3188
+ },
3189
+ {
3190
+ "name": "medication",
3191
+ "type": "string",
3192
+ "required": true
3193
+ },
3194
+ {
3195
+ "name": "dosage",
3196
+ "type": "string",
3197
+ "required": true
3198
+ },
3199
+ {
3200
+ "name": "frequency",
3201
+ "type": "string",
3202
+ "required": true
3203
+ },
3204
+ {
3205
+ "name": "patientName",
3206
+ "type": "string",
3207
+ "required": true
3208
+ },
3209
+ {
3210
+ "name": "prescribedBy",
3211
+ "type": "string"
3212
+ },
3213
+ {
3214
+ "name": "startDate",
3215
+ "type": "string"
3216
+ },
3217
+ {
3218
+ "name": "endDate",
3219
+ "type": "string"
3220
+ }
3221
+ ]
3222
+ },
3223
+ "traits": [
3224
+ {
3225
+ "name": "PrescriptionBrowse",
3226
+ "linkedEntity": "Prescription",
3227
+ "category": "interaction",
3228
+ "listens": [
3229
+ {
3230
+ "event": "SAVE",
3231
+ "triggers": "SAVE"
3232
+ },
3233
+ {
3234
+ "event": "PRESCRIBE",
3235
+ "triggers": "INIT",
3236
+ "scope": "external"
3237
+ }
3238
+ ],
3239
+ "stateMachine": {
3240
+ "states": [
3241
+ {
3242
+ "name": "browsing",
3243
+ "isInitial": true
3244
+ }
3245
+ ],
3246
+ "events": [
3247
+ {
3248
+ "key": "INIT",
3249
+ "name": "Initialize"
3250
+ },
3251
+ {
3252
+ "key": "CREATE",
3253
+ "name": "CREATE"
3254
+ },
3255
+ {
3256
+ "key": "VIEW",
3257
+ "name": "VIEW",
3258
+ "payload": [
3259
+ {
3260
+ "name": "id",
3261
+ "type": "string",
3262
+ "required": true
3263
+ }
3264
+ ]
3265
+ },
3266
+ {
3267
+ "key": "SAVE",
3268
+ "name": "SAVE",
3269
+ "payload": [
3270
+ {
3271
+ "name": "data",
3272
+ "type": "object",
3273
+ "required": true
3274
+ }
3275
+ ]
3276
+ }
3277
+ ],
3278
+ "transitions": [
3279
+ {
3280
+ "from": "browsing",
3281
+ "to": "browsing",
3282
+ "event": "INIT",
3283
+ "effects": [
3284
+ [
3285
+ "fetch",
3286
+ "Prescription"
3287
+ ],
3288
+ [
3289
+ "render-ui",
3290
+ "main",
3291
+ {
3292
+ "type": "stack",
3293
+ "direction": "vertical",
3294
+ "gap": "lg",
3295
+ "children": [
3296
+ {
3297
+ "type": "stack",
3298
+ "direction": "horizontal",
3299
+ "gap": "md",
3300
+ "justify": "space-between",
3301
+ "children": [
3302
+ {
3303
+ "type": "stack",
3304
+ "direction": "horizontal",
3305
+ "gap": "sm",
3306
+ "align": "center",
3307
+ "children": [
3308
+ {
3309
+ "type": "icon",
3310
+ "name": "file-text",
3311
+ "size": "lg"
3312
+ },
3313
+ {
3314
+ "type": "typography",
3315
+ "content": "Prescriptions",
3316
+ "variant": "h2"
3317
+ }
3318
+ ]
3319
+ },
3320
+ {
3321
+ "type": "stack",
3322
+ "direction": "horizontal",
3323
+ "gap": "sm",
3324
+ "children": [
3325
+ {
3326
+ "type": "button",
3327
+ "label": "Create Prescription",
3328
+ "event": "CREATE",
3329
+ "variant": "primary",
3330
+ "icon": "plus"
3331
+ }
3332
+ ]
3333
+ }
3334
+ ]
3335
+ },
3336
+ {
3337
+ "type": "divider"
3338
+ },
3339
+ {
3340
+ "type": "data-grid",
3341
+ "entity": "Prescription",
3342
+ "emptyIcon": "inbox",
3343
+ "emptyTitle": "No prescriptions yet",
3344
+ "emptyDescription": "Create your first prescription to get started.",
3345
+ "itemActions": [
3346
+ {
3347
+ "label": "View",
3348
+ "event": "VIEW"
3349
+ }
3350
+ ],
3351
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
3352
+ "children": [
3353
+ {
3354
+ "type": "stack",
3355
+ "direction": "vertical",
3356
+ "gap": "sm",
3357
+ "children": [
3358
+ {
3359
+ "type": "stack",
3360
+ "direction": "horizontal",
3361
+ "justify": "space-between",
3362
+ "align": "center",
3363
+ "children": [
3364
+ {
3365
+ "type": "stack",
3366
+ "direction": "horizontal",
3367
+ "gap": "sm",
3368
+ "align": "center",
3369
+ "children": [
3370
+ {
3371
+ "type": "icon",
3372
+ "name": "file-text",
3373
+ "size": "sm"
3374
+ },
3375
+ {
3376
+ "type": "typography",
3377
+ "variant": "h4",
3378
+ "content": "@entity.medication"
3379
+ }
3380
+ ]
3381
+ },
3382
+ {
3383
+ "type": "badge",
3384
+ "label": "@entity.dosage"
3385
+ }
3386
+ ]
3387
+ },
3388
+ {
3389
+ "type": "typography",
3390
+ "variant": "caption",
3391
+ "color": "muted",
3392
+ "content": "@entity.frequency"
3393
+ }
3394
+ ]
3395
+ }
3396
+ ]
3397
+ }
3398
+ ]
3399
+ }
3400
+ ]
3401
+ ]
3402
+ },
3403
+ {
3404
+ "from": "browsing",
3405
+ "to": "browsing",
3406
+ "event": "SAVE",
3407
+ "effects": [
3408
+ [
3409
+ "fetch",
3410
+ "Prescription"
3411
+ ]
3412
+ ]
3413
+ }
3414
+ ]
3415
+ }
3416
+ },
3417
+ {
3418
+ "name": "PrescriptionCreate",
3419
+ "linkedEntity": "Prescription",
3420
+ "category": "interaction",
3421
+ "emits": [
3422
+ {
3423
+ "event": "SAVE"
3424
+ }
3425
+ ],
3426
+ "stateMachine": {
3427
+ "states": [
3428
+ {
3429
+ "name": "closed",
3430
+ "isInitial": true
3431
+ },
3432
+ {
3433
+ "name": "open"
3434
+ }
3435
+ ],
3436
+ "events": [
3437
+ {
3438
+ "key": "INIT",
3439
+ "name": "Initialize"
3440
+ },
3441
+ {
3442
+ "key": "CREATE",
3443
+ "name": "Open"
3444
+ },
3445
+ {
3446
+ "key": "CLOSE",
3447
+ "name": "Close"
3448
+ },
3449
+ {
3450
+ "key": "SAVE",
3451
+ "name": "Save",
3452
+ "payload": [
3453
+ {
3454
+ "name": "data",
3455
+ "type": "object",
3456
+ "required": true
3457
+ }
3458
+ ]
3459
+ }
3460
+ ],
3461
+ "transitions": [
3462
+ {
3463
+ "from": "closed",
3464
+ "to": "closed",
3465
+ "event": "INIT",
3466
+ "effects": [
3467
+ [
3468
+ "fetch",
3469
+ "Prescription"
3470
+ ]
3471
+ ]
3472
+ },
3473
+ {
3474
+ "from": "closed",
3475
+ "to": "open",
3476
+ "event": "CREATE",
3477
+ "effects": [
3478
+ [
3479
+ "fetch",
3480
+ "Prescription"
3481
+ ],
3482
+ [
3483
+ "render-ui",
3484
+ "modal",
3485
+ {
3486
+ "type": "stack",
3487
+ "direction": "vertical",
3488
+ "gap": "md",
3489
+ "children": [
3490
+ {
3491
+ "type": "stack",
3492
+ "direction": "horizontal",
3493
+ "gap": "sm",
3494
+ "children": [
3495
+ {
3496
+ "type": "icon",
3497
+ "name": "plus-circle",
3498
+ "size": "md"
3499
+ },
3500
+ {
3501
+ "type": "typography",
3502
+ "content": "New Prescription",
3503
+ "variant": "h3"
3504
+ }
3505
+ ]
3506
+ },
3507
+ {
3508
+ "type": "divider"
3509
+ },
3510
+ {
3511
+ "type": "form-section",
3512
+ "entity": "Prescription",
3513
+ "mode": "create",
3514
+ "submitEvent": "SAVE",
3515
+ "cancelEvent": "CLOSE",
3516
+ "fields": [
3517
+ "medication",
3518
+ "dosage",
3519
+ "frequency",
3520
+ "patientName",
3521
+ "prescribedBy",
3522
+ "startDate",
3523
+ "endDate"
3524
+ ]
3525
+ }
3526
+ ]
3527
+ }
3528
+ ]
3529
+ ]
3530
+ },
3531
+ {
3532
+ "from": "open",
3533
+ "to": "closed",
3534
+ "event": "CLOSE",
3535
+ "effects": [
3536
+ [
3537
+ "render-ui",
3538
+ "modal",
3539
+ null
3540
+ ]
3541
+ ]
3542
+ },
3543
+ {
3544
+ "from": "open",
3545
+ "to": "closed",
3546
+ "event": "SAVE",
3547
+ "effects": [
3548
+ [
3549
+ "persist",
3550
+ "create",
3551
+ "Prescription",
3552
+ "@payload.data"
3553
+ ],
3554
+ [
3555
+ "fetch",
3556
+ "Prescription"
3557
+ ],
3558
+ [
3559
+ "render-ui",
3560
+ "modal",
3561
+ null
3562
+ ],
3563
+ [
3564
+ "emit",
3565
+ "SAVE"
3566
+ ],
3567
+ [
3568
+ "notify",
3569
+ "Prescription created successfully"
3570
+ ]
3571
+ ]
3572
+ }
3573
+ ]
3574
+ }
3575
+ },
3576
+ {
3577
+ "name": "PrescriptionView",
3578
+ "linkedEntity": "Prescription",
3579
+ "category": "interaction",
3580
+ "stateMachine": {
3581
+ "states": [
3582
+ {
3583
+ "name": "closed",
3584
+ "isInitial": true
3585
+ },
3586
+ {
3587
+ "name": "open"
3588
+ }
3589
+ ],
3590
+ "events": [
3591
+ {
3592
+ "key": "INIT",
3593
+ "name": "Initialize"
3594
+ },
3595
+ {
3596
+ "key": "VIEW",
3597
+ "name": "Open",
3598
+ "payload": [
3599
+ {
3600
+ "name": "id",
3601
+ "type": "string",
3602
+ "required": true
3603
+ }
3604
+ ]
3605
+ },
3606
+ {
3607
+ "key": "CLOSE",
3608
+ "name": "Close"
3609
+ }
3610
+ ],
3611
+ "transitions": [
3612
+ {
3613
+ "from": "closed",
3614
+ "to": "closed",
3615
+ "event": "INIT",
3616
+ "effects": [
3617
+ [
3618
+ "fetch",
3619
+ "Prescription"
3620
+ ]
3621
+ ]
3622
+ },
3623
+ {
3624
+ "from": "closed",
3625
+ "to": "open",
3626
+ "event": "VIEW",
3627
+ "effects": [
3628
+ [
3629
+ "fetch",
3630
+ "Prescription",
3631
+ "@payload.id"
3632
+ ],
3633
+ [
3634
+ "render-ui",
3635
+ "modal",
3636
+ {
3637
+ "type": "stack",
3638
+ "direction": "vertical",
3639
+ "gap": "md",
3640
+ "children": [
3641
+ {
3642
+ "type": "stack",
3643
+ "direction": "horizontal",
3644
+ "gap": "sm",
3645
+ "align": "center",
3646
+ "children": [
3647
+ {
3648
+ "type": "icon",
3649
+ "name": "eye",
3650
+ "size": "md"
3651
+ },
3652
+ {
3653
+ "type": "typography",
3654
+ "variant": "h3",
3655
+ "content": "@entity.medication"
3656
+ }
3657
+ ]
3658
+ },
3659
+ {
3660
+ "type": "divider"
3661
+ },
3662
+ {
3663
+ "type": "stack",
3664
+ "direction": "horizontal",
3665
+ "gap": "md",
3666
+ "children": [
3667
+ {
3668
+ "type": "typography",
3669
+ "variant": "caption",
3670
+ "content": "Medication"
3671
+ },
3672
+ {
3673
+ "type": "typography",
3674
+ "variant": "body",
3675
+ "content": "@entity.medication"
3676
+ }
3677
+ ]
3678
+ },
3679
+ {
3680
+ "type": "stack",
3681
+ "direction": "horizontal",
3682
+ "gap": "md",
3683
+ "children": [
3684
+ {
3685
+ "type": "typography",
3686
+ "variant": "caption",
3687
+ "content": "Dosage"
3688
+ },
3689
+ {
3690
+ "type": "typography",
3691
+ "variant": "body",
3692
+ "content": "@entity.dosage"
3693
+ }
3694
+ ]
3695
+ },
3696
+ {
3697
+ "type": "stack",
3698
+ "direction": "horizontal",
3699
+ "gap": "md",
3700
+ "children": [
3701
+ {
3702
+ "type": "typography",
3703
+ "variant": "caption",
3704
+ "content": "Frequency"
3705
+ },
3706
+ {
3707
+ "type": "typography",
3708
+ "variant": "body",
3709
+ "content": "@entity.frequency"
3710
+ }
3711
+ ]
3712
+ },
3713
+ {
3714
+ "type": "stack",
3715
+ "direction": "horizontal",
3716
+ "gap": "md",
3717
+ "children": [
3718
+ {
3719
+ "type": "typography",
3720
+ "variant": "caption",
3721
+ "content": "PatientName"
3722
+ },
3723
+ {
3724
+ "type": "typography",
3725
+ "variant": "body",
3726
+ "content": "@entity.patientName"
3727
+ }
3728
+ ]
3729
+ },
3730
+ {
3731
+ "type": "stack",
3732
+ "direction": "horizontal",
3733
+ "gap": "md",
3734
+ "children": [
3735
+ {
3736
+ "type": "typography",
3737
+ "variant": "caption",
3738
+ "content": "PrescribedBy"
3739
+ },
3740
+ {
3741
+ "type": "typography",
3742
+ "variant": "body",
3743
+ "content": "@entity.prescribedBy"
3744
+ }
3745
+ ]
3746
+ },
3747
+ {
3748
+ "type": "stack",
3749
+ "direction": "horizontal",
3750
+ "gap": "md",
3751
+ "children": [
3752
+ {
3753
+ "type": "typography",
3754
+ "variant": "caption",
3755
+ "content": "StartDate"
3756
+ },
3757
+ {
3758
+ "type": "typography",
3759
+ "variant": "body",
3760
+ "content": "@entity.startDate"
3761
+ }
3762
+ ]
3763
+ },
3764
+ {
3765
+ "type": "stack",
3766
+ "direction": "horizontal",
3767
+ "gap": "md",
3768
+ "children": [
3769
+ {
3770
+ "type": "typography",
3771
+ "variant": "caption",
3772
+ "content": "EndDate"
3773
+ },
3774
+ {
3775
+ "type": "typography",
3776
+ "variant": "body",
3777
+ "content": "@entity.endDate"
3778
+ }
3779
+ ]
3780
+ },
3781
+ {
3782
+ "type": "divider"
3783
+ },
3784
+ {
3785
+ "type": "stack",
3786
+ "direction": "horizontal",
3787
+ "gap": "sm",
3788
+ "justify": "end",
3789
+ "children": [
3790
+ {
3791
+ "type": "button",
3792
+ "label": "Close",
3793
+ "event": "CLOSE",
3794
+ "variant": "ghost"
3795
+ }
3796
+ ]
3797
+ }
3798
+ ]
3799
+ }
3800
+ ]
3801
+ ]
3802
+ },
3803
+ {
3804
+ "from": "open",
3805
+ "to": "closed",
3806
+ "event": "CLOSE",
3807
+ "effects": [
3808
+ [
3809
+ "render-ui",
3810
+ "modal",
3811
+ null
3812
+ ]
3813
+ ]
3814
+ }
3815
+ ]
3816
+ }
3817
+ }
3818
+ ],
3819
+ "pages": [
3820
+ {
3821
+ "name": "PrescriptionsPage",
3822
+ "path": "/prescriptions",
3823
+ "traits": [
3824
+ {
3825
+ "ref": "PrescriptionBrowse"
3826
+ },
3827
+ {
3828
+ "ref": "PrescriptionCreate"
3829
+ },
3830
+ {
3831
+ "ref": "PrescriptionView"
3832
+ }
3833
+ ]
3834
+ }
3835
+ ]
3836
+ },
3837
+ {
3838
+ "name": "DashboardOrbital",
3839
+ "entity": {
3840
+ "name": "Dashboard",
3841
+ "persistence": "singleton",
3842
+ "fields": [
3843
+ {
3844
+ "name": "id",
3845
+ "type": "string",
3846
+ "required": true
3847
+ },
3848
+ {
3849
+ "name": "totalPatients",
3850
+ "type": "number",
3851
+ "default": 0
3852
+ },
3853
+ {
3854
+ "name": "appointmentsToday",
3855
+ "type": "number",
3856
+ "default": 0
3857
+ },
3858
+ {
3859
+ "name": "pendingIntakes",
3860
+ "type": "number",
3861
+ "default": 0
3862
+ },
3863
+ {
3864
+ "name": "activePrescriptions",
3865
+ "type": "number",
3866
+ "default": 0
3867
+ }
3868
+ ]
3869
+ },
3870
+ "traits": [
3871
+ {
3872
+ "name": "DashboardDisplay",
3873
+ "linkedEntity": "Dashboard",
3874
+ "category": "interaction",
3875
+ "stateMachine": {
3876
+ "states": [
3877
+ {
3878
+ "name": "loading",
3879
+ "isInitial": true
3880
+ },
3881
+ {
3882
+ "name": "displaying"
3883
+ },
3884
+ {
3885
+ "name": "refreshing"
3886
+ }
3887
+ ],
3888
+ "events": [
3889
+ {
3890
+ "key": "INIT",
3891
+ "name": "Initialize"
3892
+ },
3893
+ {
3894
+ "key": "LOADED",
3895
+ "name": "Loaded"
3896
+ },
3897
+ {
3898
+ "key": "REFRESH",
3899
+ "name": "Refresh"
3900
+ },
3901
+ {
3902
+ "key": "REFRESHED",
3903
+ "name": "Refreshed"
3904
+ }
3905
+ ],
3906
+ "transitions": [
3907
+ {
3908
+ "from": "loading",
3909
+ "to": "displaying",
3910
+ "event": "INIT",
3911
+ "effects": [
3912
+ [
3913
+ "fetch",
3914
+ "Dashboard"
3915
+ ],
3916
+ [
3917
+ "render-ui",
3918
+ "main",
3919
+ {
3920
+ "type": "stack",
3921
+ "direction": "vertical",
3922
+ "gap": "lg",
3923
+ "children": [
3924
+ {
3925
+ "type": "stack",
3926
+ "direction": "horizontal",
3927
+ "gap": "md",
3928
+ "justify": "space-between",
3929
+ "children": [
3930
+ {
3931
+ "type": "stack",
3932
+ "direction": "horizontal",
3933
+ "gap": "md",
3934
+ "children": [
3935
+ {
3936
+ "type": "icon",
3937
+ "name": "activity",
3938
+ "size": "lg"
3939
+ },
3940
+ {
3941
+ "type": "typography",
3942
+ "content": "Clinic Dashboard",
3943
+ "variant": "h2"
3944
+ }
3945
+ ]
3946
+ },
3947
+ {
3948
+ "type": "button",
3949
+ "label": "Refresh",
3950
+ "event": "REFRESH",
3951
+ "variant": "secondary",
3952
+ "icon": "refresh-cw"
3953
+ }
3954
+ ]
3955
+ },
3956
+ {
3957
+ "type": "divider"
3958
+ },
3959
+ {
3960
+ "type": "simple-grid",
3961
+ "columns": 4,
3962
+ "children": [
3963
+ {
3964
+ "type": "card",
3965
+ "children": [
3966
+ {
3967
+ "type": "stack",
3968
+ "direction": "vertical",
3969
+ "gap": "sm",
3970
+ "children": [
3971
+ {
3972
+ "type": "typography",
3973
+ "variant": "caption",
3974
+ "content": "TotalPatients"
3975
+ },
3976
+ {
3977
+ "type": "typography",
3978
+ "variant": "h3",
3979
+ "content": "@entity.totalPatients"
3980
+ }
3981
+ ]
3982
+ }
3983
+ ]
3984
+ },
3985
+ {
3986
+ "type": "card",
3987
+ "children": [
3988
+ {
3989
+ "type": "stack",
3990
+ "direction": "vertical",
3991
+ "gap": "sm",
3992
+ "children": [
3993
+ {
3994
+ "type": "typography",
3995
+ "variant": "caption",
3996
+ "content": "AppointmentsToday"
3997
+ },
3998
+ {
3999
+ "type": "typography",
4000
+ "variant": "h3",
4001
+ "content": "@entity.appointmentsToday"
4002
+ }
4003
+ ]
4004
+ }
4005
+ ]
4006
+ },
4007
+ {
4008
+ "type": "card",
4009
+ "children": [
4010
+ {
4011
+ "type": "stack",
4012
+ "direction": "vertical",
4013
+ "gap": "sm",
4014
+ "children": [
4015
+ {
4016
+ "type": "typography",
4017
+ "variant": "caption",
4018
+ "content": "PendingIntakes"
4019
+ },
4020
+ {
4021
+ "type": "typography",
4022
+ "variant": "h3",
4023
+ "content": "@entity.pendingIntakes"
4024
+ }
4025
+ ]
4026
+ }
4027
+ ]
4028
+ },
4029
+ {
4030
+ "type": "card",
4031
+ "children": [
4032
+ {
4033
+ "type": "stack",
4034
+ "direction": "vertical",
4035
+ "gap": "sm",
4036
+ "children": [
4037
+ {
4038
+ "type": "typography",
4039
+ "variant": "caption",
4040
+ "content": "ActivePrescriptions"
4041
+ },
4042
+ {
4043
+ "type": "typography",
4044
+ "variant": "h3",
4045
+ "content": "@entity.activePrescriptions"
4046
+ }
4047
+ ]
4048
+ }
4049
+ ]
4050
+ }
4051
+ ]
4052
+ }
4053
+ ]
4054
+ }
4055
+ ]
4056
+ ]
4057
+ },
4058
+ {
4059
+ "from": "loading",
4060
+ "to": "displaying",
4061
+ "event": "LOADED",
4062
+ "effects": [
4063
+ [
4064
+ "fetch",
4065
+ "Dashboard"
4066
+ ],
4067
+ [
4068
+ "render-ui",
4069
+ "main",
4070
+ {
4071
+ "type": "stack",
4072
+ "direction": "vertical",
4073
+ "gap": "lg",
4074
+ "children": [
4075
+ {
4076
+ "type": "stack",
4077
+ "direction": "horizontal",
4078
+ "gap": "md",
4079
+ "justify": "space-between",
4080
+ "children": [
4081
+ {
4082
+ "type": "stack",
4083
+ "direction": "horizontal",
4084
+ "gap": "md",
4085
+ "children": [
4086
+ {
4087
+ "type": "icon",
4088
+ "name": "activity",
4089
+ "size": "lg"
4090
+ },
4091
+ {
4092
+ "type": "typography",
4093
+ "content": "Clinic Dashboard",
4094
+ "variant": "h2"
4095
+ }
4096
+ ]
4097
+ },
4098
+ {
4099
+ "type": "button",
4100
+ "label": "Refresh",
4101
+ "event": "REFRESH",
4102
+ "variant": "secondary",
4103
+ "icon": "refresh-cw"
4104
+ }
4105
+ ]
4106
+ },
4107
+ {
4108
+ "type": "divider"
4109
+ },
4110
+ {
4111
+ "type": "simple-grid",
4112
+ "columns": 4,
4113
+ "children": [
4114
+ {
4115
+ "type": "card",
4116
+ "children": [
4117
+ {
4118
+ "type": "stack",
4119
+ "direction": "vertical",
4120
+ "gap": "sm",
4121
+ "children": [
4122
+ {
4123
+ "type": "typography",
4124
+ "variant": "caption",
4125
+ "content": "TotalPatients"
4126
+ },
4127
+ {
4128
+ "type": "typography",
4129
+ "variant": "h3",
4130
+ "content": "@entity.totalPatients"
4131
+ }
4132
+ ]
4133
+ }
4134
+ ]
4135
+ },
4136
+ {
4137
+ "type": "card",
4138
+ "children": [
4139
+ {
4140
+ "type": "stack",
4141
+ "direction": "vertical",
4142
+ "gap": "sm",
4143
+ "children": [
4144
+ {
4145
+ "type": "typography",
4146
+ "variant": "caption",
4147
+ "content": "AppointmentsToday"
4148
+ },
4149
+ {
4150
+ "type": "typography",
4151
+ "variant": "h3",
4152
+ "content": "@entity.appointmentsToday"
4153
+ }
4154
+ ]
4155
+ }
4156
+ ]
4157
+ },
4158
+ {
4159
+ "type": "card",
4160
+ "children": [
4161
+ {
4162
+ "type": "stack",
4163
+ "direction": "vertical",
4164
+ "gap": "sm",
4165
+ "children": [
4166
+ {
4167
+ "type": "typography",
4168
+ "variant": "caption",
4169
+ "content": "PendingIntakes"
4170
+ },
4171
+ {
4172
+ "type": "typography",
4173
+ "variant": "h3",
4174
+ "content": "@entity.pendingIntakes"
4175
+ }
4176
+ ]
4177
+ }
4178
+ ]
4179
+ },
4180
+ {
4181
+ "type": "card",
4182
+ "children": [
4183
+ {
4184
+ "type": "stack",
4185
+ "direction": "vertical",
4186
+ "gap": "sm",
4187
+ "children": [
4188
+ {
4189
+ "type": "typography",
4190
+ "variant": "caption",
4191
+ "content": "ActivePrescriptions"
4192
+ },
4193
+ {
4194
+ "type": "typography",
4195
+ "variant": "h3",
4196
+ "content": "@entity.activePrescriptions"
4197
+ }
4198
+ ]
4199
+ }
4200
+ ]
4201
+ }
4202
+ ]
4203
+ }
4204
+ ]
4205
+ }
4206
+ ]
4207
+ ]
4208
+ },
4209
+ {
4210
+ "from": "displaying",
4211
+ "to": "displaying",
4212
+ "event": "INIT",
4213
+ "effects": [
4214
+ [
4215
+ "fetch",
4216
+ "Dashboard"
4217
+ ],
4218
+ [
4219
+ "render-ui",
4220
+ "main",
4221
+ {
4222
+ "type": "stack",
4223
+ "direction": "vertical",
4224
+ "gap": "lg",
4225
+ "children": [
4226
+ {
4227
+ "type": "stack",
4228
+ "direction": "horizontal",
4229
+ "gap": "md",
4230
+ "justify": "space-between",
4231
+ "children": [
4232
+ {
4233
+ "type": "stack",
4234
+ "direction": "horizontal",
4235
+ "gap": "md",
4236
+ "children": [
4237
+ {
4238
+ "type": "icon",
4239
+ "name": "activity",
4240
+ "size": "lg"
4241
+ },
4242
+ {
4243
+ "type": "typography",
4244
+ "content": "Clinic Dashboard",
4245
+ "variant": "h2"
4246
+ }
4247
+ ]
4248
+ },
4249
+ {
4250
+ "type": "button",
4251
+ "label": "Refresh",
4252
+ "event": "REFRESH",
4253
+ "variant": "secondary",
4254
+ "icon": "refresh-cw"
4255
+ }
4256
+ ]
4257
+ },
4258
+ {
4259
+ "type": "divider"
4260
+ },
4261
+ {
4262
+ "type": "simple-grid",
4263
+ "columns": 4,
4264
+ "children": [
4265
+ {
4266
+ "type": "card",
4267
+ "children": [
4268
+ {
4269
+ "type": "stack",
4270
+ "direction": "vertical",
4271
+ "gap": "sm",
4272
+ "children": [
4273
+ {
4274
+ "type": "typography",
4275
+ "variant": "caption",
4276
+ "content": "TotalPatients"
4277
+ },
4278
+ {
4279
+ "type": "typography",
4280
+ "variant": "h3",
4281
+ "content": "@entity.totalPatients"
4282
+ }
4283
+ ]
4284
+ }
4285
+ ]
4286
+ },
4287
+ {
4288
+ "type": "card",
4289
+ "children": [
4290
+ {
4291
+ "type": "stack",
4292
+ "direction": "vertical",
4293
+ "gap": "sm",
4294
+ "children": [
4295
+ {
4296
+ "type": "typography",
4297
+ "variant": "caption",
4298
+ "content": "AppointmentsToday"
4299
+ },
4300
+ {
4301
+ "type": "typography",
4302
+ "variant": "h3",
4303
+ "content": "@entity.appointmentsToday"
4304
+ }
4305
+ ]
4306
+ }
4307
+ ]
4308
+ },
4309
+ {
4310
+ "type": "card",
4311
+ "children": [
4312
+ {
4313
+ "type": "stack",
4314
+ "direction": "vertical",
4315
+ "gap": "sm",
4316
+ "children": [
4317
+ {
4318
+ "type": "typography",
4319
+ "variant": "caption",
4320
+ "content": "PendingIntakes"
4321
+ },
4322
+ {
4323
+ "type": "typography",
4324
+ "variant": "h3",
4325
+ "content": "@entity.pendingIntakes"
4326
+ }
4327
+ ]
4328
+ }
4329
+ ]
4330
+ },
4331
+ {
4332
+ "type": "card",
4333
+ "children": [
4334
+ {
4335
+ "type": "stack",
4336
+ "direction": "vertical",
4337
+ "gap": "sm",
4338
+ "children": [
4339
+ {
4340
+ "type": "typography",
4341
+ "variant": "caption",
4342
+ "content": "ActivePrescriptions"
4343
+ },
4344
+ {
4345
+ "type": "typography",
4346
+ "variant": "h3",
4347
+ "content": "@entity.activePrescriptions"
4348
+ }
4349
+ ]
4350
+ }
4351
+ ]
4352
+ }
4353
+ ]
4354
+ }
4355
+ ]
4356
+ }
4357
+ ]
4358
+ ]
4359
+ },
4360
+ {
4361
+ "from": "displaying",
4362
+ "to": "refreshing",
4363
+ "event": "REFRESH",
4364
+ "effects": [
4365
+ [
4366
+ "fetch",
4367
+ "Dashboard"
4368
+ ],
4369
+ [
4370
+ "render-ui",
4371
+ "main",
4372
+ {
4373
+ "type": "stack",
4374
+ "direction": "vertical",
4375
+ "gap": "lg",
4376
+ "children": [
4377
+ {
4378
+ "type": "stack",
4379
+ "direction": "horizontal",
4380
+ "gap": "md",
4381
+ "justify": "space-between",
4382
+ "children": [
4383
+ {
4384
+ "type": "stack",
4385
+ "direction": "horizontal",
4386
+ "gap": "md",
4387
+ "children": [
4388
+ {
4389
+ "type": "icon",
4390
+ "name": "activity",
4391
+ "size": "lg"
4392
+ },
4393
+ {
4394
+ "type": "typography",
4395
+ "content": "Clinic Dashboard",
4396
+ "variant": "h2"
4397
+ }
4398
+ ]
4399
+ },
4400
+ {
4401
+ "type": "button",
4402
+ "label": "Refresh",
4403
+ "event": "REFRESH",
4404
+ "variant": "secondary",
4405
+ "icon": "refresh-cw"
4406
+ }
4407
+ ]
4408
+ },
4409
+ {
4410
+ "type": "divider"
4411
+ },
4412
+ {
4413
+ "type": "simple-grid",
4414
+ "columns": 4,
4415
+ "children": [
4416
+ {
4417
+ "type": "card",
4418
+ "children": [
4419
+ {
4420
+ "type": "stack",
4421
+ "direction": "vertical",
4422
+ "gap": "sm",
4423
+ "children": [
4424
+ {
4425
+ "type": "typography",
4426
+ "variant": "caption",
4427
+ "content": "TotalPatients"
4428
+ },
4429
+ {
4430
+ "type": "typography",
4431
+ "variant": "h3",
4432
+ "content": "@entity.totalPatients"
4433
+ }
4434
+ ]
4435
+ }
4436
+ ]
4437
+ },
4438
+ {
4439
+ "type": "card",
4440
+ "children": [
4441
+ {
4442
+ "type": "stack",
4443
+ "direction": "vertical",
4444
+ "gap": "sm",
4445
+ "children": [
4446
+ {
4447
+ "type": "typography",
4448
+ "variant": "caption",
4449
+ "content": "AppointmentsToday"
4450
+ },
4451
+ {
4452
+ "type": "typography",
4453
+ "variant": "h3",
4454
+ "content": "@entity.appointmentsToday"
4455
+ }
4456
+ ]
4457
+ }
4458
+ ]
4459
+ },
4460
+ {
4461
+ "type": "card",
4462
+ "children": [
4463
+ {
4464
+ "type": "stack",
4465
+ "direction": "vertical",
4466
+ "gap": "sm",
4467
+ "children": [
4468
+ {
4469
+ "type": "typography",
4470
+ "variant": "caption",
4471
+ "content": "PendingIntakes"
4472
+ },
4473
+ {
4474
+ "type": "typography",
4475
+ "variant": "h3",
4476
+ "content": "@entity.pendingIntakes"
4477
+ }
4478
+ ]
4479
+ }
4480
+ ]
4481
+ },
4482
+ {
4483
+ "type": "card",
4484
+ "children": [
4485
+ {
4486
+ "type": "stack",
4487
+ "direction": "vertical",
4488
+ "gap": "sm",
4489
+ "children": [
4490
+ {
4491
+ "type": "typography",
4492
+ "variant": "caption",
4493
+ "content": "ActivePrescriptions"
4494
+ },
4495
+ {
4496
+ "type": "typography",
4497
+ "variant": "h3",
4498
+ "content": "@entity.activePrescriptions"
4499
+ }
4500
+ ]
4501
+ }
4502
+ ]
4503
+ }
4504
+ ]
4505
+ }
4506
+ ]
4507
+ }
4508
+ ]
4509
+ ]
4510
+ },
4511
+ {
4512
+ "from": "refreshing",
4513
+ "to": "displaying",
4514
+ "event": "REFRESHED",
4515
+ "effects": [
4516
+ [
4517
+ "fetch",
4518
+ "Dashboard"
4519
+ ],
4520
+ [
4521
+ "render-ui",
4522
+ "main",
4523
+ {
4524
+ "type": "stack",
4525
+ "direction": "vertical",
4526
+ "gap": "lg",
4527
+ "children": [
4528
+ {
4529
+ "type": "stack",
4530
+ "direction": "horizontal",
4531
+ "gap": "md",
4532
+ "justify": "space-between",
4533
+ "children": [
4534
+ {
4535
+ "type": "stack",
4536
+ "direction": "horizontal",
4537
+ "gap": "md",
4538
+ "children": [
4539
+ {
4540
+ "type": "icon",
4541
+ "name": "activity",
4542
+ "size": "lg"
4543
+ },
4544
+ {
4545
+ "type": "typography",
4546
+ "content": "Clinic Dashboard",
4547
+ "variant": "h2"
4548
+ }
4549
+ ]
4550
+ },
4551
+ {
4552
+ "type": "button",
4553
+ "label": "Refresh",
4554
+ "event": "REFRESH",
4555
+ "variant": "secondary",
4556
+ "icon": "refresh-cw"
4557
+ }
4558
+ ]
4559
+ },
4560
+ {
4561
+ "type": "divider"
4562
+ },
4563
+ {
4564
+ "type": "simple-grid",
4565
+ "columns": 4,
4566
+ "children": [
4567
+ {
4568
+ "type": "card",
4569
+ "children": [
4570
+ {
4571
+ "type": "stack",
4572
+ "direction": "vertical",
4573
+ "gap": "sm",
4574
+ "children": [
4575
+ {
4576
+ "type": "typography",
4577
+ "variant": "caption",
4578
+ "content": "TotalPatients"
4579
+ },
4580
+ {
4581
+ "type": "typography",
4582
+ "variant": "h3",
4583
+ "content": "@entity.totalPatients"
4584
+ }
4585
+ ]
4586
+ }
4587
+ ]
4588
+ },
4589
+ {
4590
+ "type": "card",
4591
+ "children": [
4592
+ {
4593
+ "type": "stack",
4594
+ "direction": "vertical",
4595
+ "gap": "sm",
4596
+ "children": [
4597
+ {
4598
+ "type": "typography",
4599
+ "variant": "caption",
4600
+ "content": "AppointmentsToday"
4601
+ },
4602
+ {
4603
+ "type": "typography",
4604
+ "variant": "h3",
4605
+ "content": "@entity.appointmentsToday"
4606
+ }
4607
+ ]
4608
+ }
4609
+ ]
4610
+ },
4611
+ {
4612
+ "type": "card",
4613
+ "children": [
4614
+ {
4615
+ "type": "stack",
4616
+ "direction": "vertical",
4617
+ "gap": "sm",
4618
+ "children": [
4619
+ {
4620
+ "type": "typography",
4621
+ "variant": "caption",
4622
+ "content": "PendingIntakes"
4623
+ },
4624
+ {
4625
+ "type": "typography",
4626
+ "variant": "h3",
4627
+ "content": "@entity.pendingIntakes"
4628
+ }
4629
+ ]
4630
+ }
4631
+ ]
4632
+ },
4633
+ {
4634
+ "type": "card",
4635
+ "children": [
4636
+ {
4637
+ "type": "stack",
4638
+ "direction": "vertical",
4639
+ "gap": "sm",
4640
+ "children": [
4641
+ {
4642
+ "type": "typography",
4643
+ "variant": "caption",
4644
+ "content": "ActivePrescriptions"
4645
+ },
4646
+ {
4647
+ "type": "typography",
4648
+ "variant": "h3",
4649
+ "content": "@entity.activePrescriptions"
4650
+ }
4651
+ ]
4652
+ }
4653
+ ]
4654
+ }
4655
+ ]
4656
+ }
4657
+ ]
4658
+ }
4659
+ ]
4660
+ ]
4661
+ }
4662
+ ]
4663
+ }
4664
+ }
4665
+ ],
4666
+ "pages": [
4667
+ {
4668
+ "name": "DashboardPage",
4669
+ "path": "/dashboard",
4670
+ "traits": [
4671
+ {
4672
+ "ref": "DashboardDisplay"
4673
+ }
4674
+ ]
4675
+ }
4676
+ ]
4677
+ }
4678
+ ]
4679
+ }