Squashed commit of the following:
commitb9f910cc5fMerge:ba3e70c064f341Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Fri Nov 21 08:55:22 2025 +0700 Merge pull request #177 from dikstub-rssa/feat/prescription Feat/prescription commit064f34177cMerge:88d89f2ba3e70cAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Nov 21 08:52:24 2025 +0700 Merge branch 'dev' into feat/prescription commitba3e70c854Merge:d75b32cd6c4a1eAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Fri Nov 21 08:46:33 2025 +0700 Merge pull request #176 from dikstub-rssa/feat/device-order Feat/device order commitd6c4a1ebb4Merge:a8a71d8d75b32cAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Nov 21 08:42:09 2025 +0700 Merge branch 'dev' into feat/device-order commitd75b32cc08Merge:79d8bfa2e48f11Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Fri Nov 21 08:38:51 2025 +0700 Merge pull request #172 from dikstub-rssa/feat/uploads-85-after-reset Fix: debug Uplaod Doc after reset commit2e48f11f9cMerge:c3f1f9979d8bfaAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Nov 21 08:38:37 2025 +0700 Merge branch 'dev' into feat/uploads-85-after-reset commit79d8bfa782Merge:f375724cffaa2bAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Fri Nov 21 08:19:55 2025 +0700 Merge pull request #170 from dikstub-rssa/feat/medicine-form-167 Feat/medicine form 167 commitcffaa2b855Merge:ac5fd26f375724Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Nov 21 08:17:43 2025 +0700 Merge branch 'dev' into feat/medicine-form-167 commitf375724be1Merge:2c07b9c6780a65Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Fri Nov 21 07:43:22 2025 +0700 Merge pull request #152 from dikstub-rssa/feat/general-consent-145 ✨ feat (encounter): implement general consent feature commit6780a65f04Merge:1f3ca6f2c07b9cAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Nov 21 07:43:08 2025 +0700 Merge branch 'dev' into feat/general-consent-145 commit2c07b9cde8Merge:baf6ab1dab6adcAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Fri Nov 21 07:31:13 2025 +0700 Merge pull request #148 from dikstub-rssa/feat/resume-81 Feat: UI Rehab Medik - Resume commit1f3ca6f19bAuthor: Abizrh <abizarah857@gmail.com> Date: Thu Nov 20 13:43:19 2025 +0700 🐛 fix (general-consent): fix type error when create encounter commitb379a9bc94Author: Abizrh <abizarah857@gmail.com> Date: Thu Nov 20 13:04:27 2025 +0700 ✨ feat (general-consent): display file url in diagnose dialog commitf1307980ffAuthor: Abizrh <abizarah857@gmail.com> Date: Thu Nov 20 00:35:25 2025 +0700 🐛 fix (general-consent): fix mapping data from api commit0d821cbe31Author: Abizrh <abizarah857@gmail.com> Date: Thu Nov 20 00:13:44 2025 +0700 ⚙️ chore (general-consent): adjust general consent list and form component commitcf4f5574d3Author: Abizrh <abizarah857@gmail.com> Date: Wed Nov 19 23:46:21 2025 +0700 ✨ feat (generate-file): add generate file schema commit6e34e175e7Merge:e62ee1bbaf6ab1Author: Abizrh <abizarah857@gmail.com> Date: Wed Nov 19 23:12:38 2025 +0700 Merge branch 'dev' of https://github.com/dikstub-rssa/simrs-fe into feat/general-consent-145 commita8a71d8978Merge:bfbe72bbaf6ab1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 19 22:22:03 2025 +0700 Merge branch 'dev' into feat/device-order commit88d89f2a2dMerge:512f8e8391469eAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 19 22:21:36 2025 +0700 Merge branch 'feat/prescription' of github.com:dikstub-rssa/simrs-fe into feat/prescription commit512f8e8c91Merge:f41a51dbaf6ab1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 19 22:19:45 2025 +0700 Merge branch 'dev' into feat/prescription commitbaf6ab1fdaAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Wed Nov 19 20:09:19 2025 +0700 dev: hotfix, pubs + my-ui/confirmation/confirmation noTrueSlot from record-confirmation + my-ui/confirmation/confirmation additional message + my-ui/confirmation/record-confirmation supplies noTrueSlot + my-ui/modal/modal text size + my-ui/doc-entry semicolon export commitf41a51d9d0Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 19 10:58:26 2025 +0700 feat/prescription: cleaning commitc3f1f997b3Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Nov 19 10:22:12 2025 +0700 Fix: refactor upload API url commitbfbe72be94Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 19 03:36:24 2025 +0700 feat/device-order: final commit0a68dbf3a6Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 18 15:31:04 2025 +0700 Fix: debug after reset commitac5fd26399Merge:94e4eadbcfb4c1Author: Muhammad Hasyim Chaidir Ali <68959522+Hasyim-Kai@users.noreply.github.com> Date: Tue Nov 18 13:33:09 2025 +0700 Merge branch 'dev' into feat/medicine-form-167 commit94e4ead8feAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 18 13:13:52 2025 +0700 Fix: debug updaate medicine master commitc98018bb4eAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 18 12:58:58 2025 +0700 Squashed commit of the following: commitbcfb4c1456Merge:1cbde57975c87dAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Mon Nov 17 11:15:14 2025 +0700 Merge pull request #147 from dikstub-rssa/feat/surat-kontrol-135 Feat: Integration Rehab Medik - Surat Kontrol commit975c87d99aMerge:f5820901cbde57Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Nov 17 10:58:10 2025 +0700 Merge branch 'dev' into feat/surat-kontrol-135 commitf582090d18Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Thu Nov 13 11:56:21 2025 +0700 Fix: Refactor surat kontrol commita14c4a5d3cAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 11 14:21:58 2025 +0700 Fix: Refactor Surat Kontrol CRUD {id} to {code} commit24313adef6Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 7 10:35:46 2025 +0700 Fix: debug back btn in add, edit, detail content page commit59b44b5729Merge:99a61a0db15ec9Author: Muhammad Hasyim Chaidir Ali <68959522+Hasyim-Kai@users.noreply.github.com> Date: Fri Nov 7 09:11:10 2025 +0700 Merge branch 'dev' into feat/surat-kontrol-135 commit99a61a0bf2Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Thu Nov 6 08:06:01 2025 +0700 Feat: add right & bottom label in input base component commitdb48919325Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Nov 5 13:53:43 2025 +0700 Feat: add banner in List if requirement not met commitbd57250f7eAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Nov 5 13:26:48 2025 +0700 Fix: refactor getDetail url param commita361922e32Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Nov 5 13:19:07 2025 +0700 Feat: Add & integrate add, edit, detail page commit331f4a6b20Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 4 16:56:08 2025 +0700 Feat: Integrate Control Letter commit2275f4dc99Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Oct 27 14:01:58 2025 +0700 Feat: add UI BPJS > Surat Kontrol commit89e0e7a2c8Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Oct 27 10:21:59 2025 +0700 Feat: add UI CRUD Surat Kontrol at Rehab Medik > kunjungan > Proses commitdab6adc4a9Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 18 11:19:48 2025 +0700 Fix: add role authorization in Resume commitc28fc8f7aaMerge:7ed1cc8bcfb4c1Author: Muhammad Hasyim Chaidir Ali <68959522+Hasyim-Kai@users.noreply.github.com> Date: Tue Nov 18 09:02:16 2025 +0700 Merge branch 'dev' into feat/resume-81 commit7ed1cc83bfAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Nov 17 15:04:01 2025 +0700 Feat: add doc preview in Resume List commitbcfb4c1456Merge:1cbde57975c87dAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Mon Nov 17 11:15:14 2025 +0700 Merge pull request #147 from dikstub-rssa/feat/surat-kontrol-135 Feat: Integration Rehab Medik - Surat Kontrol commit975c87d99aMerge:f5820901cbde57Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Nov 17 10:58:10 2025 +0700 Merge branch 'dev' into feat/surat-kontrol-135 commit15ab43c1b1Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Nov 17 10:38:21 2025 +0700 Feat: add verification capthca and form adjustment commitdc0bcc3606Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Nov 17 09:26:29 2025 +0700 Feat: integration Medicine Form commitdfb2c305caMerge:1cbde57d0aa69dAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Nov 17 09:18:47 2025 +0700 Merge remote-tracking branch 'origin/feat/uploads-85' into feat/medicine-form-167 commit468c6a164fMerge:72532721cbde57Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Nov 17 07:12:38 2025 +0700 Merge branch 'dev' into feat/device-order commit20649c5917Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 16 19:52:22 2025 +0700 feat/prescription: finalize #1 + integration + non mix entry commit0da8701a6cAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 16 08:15:19 2025 +0700 feat/prescription: added group and flat list commit7253272681Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 16 11:21:02 2025 +0700 feat/device-order: adjustment wip commit391469e633Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 16 08:15:19 2025 +0700 feat/prescription: added group and flat list commitb1dbae7928Merge:b8478861cbde57Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Nov 16 08:14:09 2025 +0700 Merge branch 'dev' into feat/prescription commit1cbde57cf9Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Sun Nov 16 00:44:53 2025 +0700 dev: hotfix comps/pub/myui + updated data/types + updated data-table + updated nav-header + added toggle comps/pub/ui + updated button + updated toggle commitb847886601Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Nov 15 22:40:23 2025 +0700 feat/prescription: more adjustment commit83cdd070edMerge:224bc7cccabe01Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Nov 15 20:15:18 2025 +0700 Merge branch 'dev' into feat/prescription commit224bc7cd61Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Nov 15 20:13:15 2025 +0700 feat/prescription: integrated non-mix commitccabe0177bAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Nov 14 16:39:21 2025 +0700 dev: hotfix, added combobox objectsToItems commitd0aa69d9a1Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 14 17:12:17 2025 +0700 Fix: debug table typo Uplaod Doc commitbb0017ffcbAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 14 15:47:11 2025 +0700 Fix: refactor constList Uplaod Doc commit60c13649d9Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 14 14:55:32 2025 +0700 Fix: debug Uplaod Doc commit1d03258f44Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 14 14:08:47 2025 +0700 Fix: Typo uplaod doc type commit56109564cbAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Thu Nov 13 16:16:26 2025 +0700 Feat: API Integration supporting doc upload commitcbe1883c9fMerge:7f3fe810d97ba9Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Nov 13 13:42:44 2025 +0700 Merge branch 'dev' into feat/device-order-x commitf582090d18Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Thu Nov 13 11:56:21 2025 +0700 Fix: Refactor surat kontrol commit0d97ba9d25Merge:02508b2bb8df3dAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Thu Nov 13 11:52:23 2025 +0700 Merge pull request #164 from dikstub-rssa/feeat/pendaftaran-kemoterapi-141 Feat: Pendaftaran Kemoterapi commit16626a2feeAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Nov 13 11:49:28 2025 +0700 feat/prescription: added submit commitbb8df3d53aMerge:a592a0b02508b2Author: riefive <rie.five@gmail.com> Date: Thu Nov 13 10:14:17 2025 +0700 Merge branch 'dev' of https://github.com/dikstub-rssa/simrs-fe into feeat/pendaftaran-kemoterapi-141 commit02508b22deMerge:6b933de295bb81Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Thu Nov 13 07:56:31 2025 +0700 Merge pull request #162 from dikstub-rssa/fe-prescription-56 Fe prescription 56 commit295bb8120fMerge:8462eba6b933deAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Thu Nov 13 07:45:48 2025 +0700 Merge branch 'dev' into fe-prescription-56 commit6b933de212Merge:f2e98fc471c846Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Wed Nov 12 07:13:11 2025 +0700 Merge pull request #156 from dikstub-rssa/feat/cp-lab-order-48 Feat/cp lab order 48 commitf2e98fc732Merge:2e899c69b281deAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Wed Nov 12 07:12:40 2025 +0700 Merge pull request #158 from dikstub-rssa/feat/menu-structure Feat/menu structure commit471c846045Merge:f676c8a2e899c6Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 12 07:11:46 2025 +0700 Merge branch 'dev' into feat/cp-lab-order-48 commit9b281de00bMerge:80383a52e899c6Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 12 07:08:29 2025 +0700 Merge branch 'dev' into feat/menu-structure commit2e899c6022Merge:8effefbb7d4fcfAuthor: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Wed Nov 12 07:04:47 2025 +0700 Merge pull request #157 from dikstub-rssa/feat/encounter-status-107 Feat/encounter status 107 commit8effefb5adMerge:3f63f198e7f9b1Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Wed Nov 12 07:04:17 2025 +0700 Merge pull request #155 from dikstub-rssa/feat/radiology-order-54 Feat/radiology order 54 commit80383a5f0aAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 12 06:52:31 2025 +0700 feat/menu-structure: adjust page rehab commit93c9e74d08Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 12 06:52:14 2025 +0700 feat/menu-structure: adjust menu items all roles commitf0d2bc4de1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 12 06:51:37 2025 +0700 feat/menu-structure: update access control commit02c14089f1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 12 06:51:03 2025 +0700 feat/menu-structure: update role switcher commita14c4a5d3cAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 11 14:21:58 2025 +0700 Fix: Refactor Surat Kontrol CRUD {id} to {code} commite9e0e21d1bAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Tue Nov 11 12:30:43 2025 +0700 feat/menu-structure: wip commite62ee1b37eAuthor: Abizrh <abizarah857@gmail.com> Date: Tue Nov 11 08:57:49 2025 +0700 ✨ feat (encounter): implement general consent feature commit8e7f9b19e3Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Mon Nov 10 23:17:49 2025 +0700 feat/radiology-order-54: upgraded mcu-order/list commitb2a512314bAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 7 14:02:54 2025 +0700 Feat: UI uplaod doc pendukung commit24313adef6Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 7 10:35:46 2025 +0700 Fix: debug back btn in add, edit, detail content page commit59b44b5729Merge:99a61a0db15ec9Author: Muhammad Hasyim Chaidir Ali <68959522+Hasyim-Kai@users.noreply.github.com> Date: Fri Nov 7 09:11:10 2025 +0700 Merge branch 'dev' into feat/surat-kontrol-135 commit53bd8e7f6eAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Fri Nov 7 08:55:23 2025 +0700 Fix: refactor rehab medik - Resume UI commit99a61a0bf2Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Thu Nov 6 08:06:01 2025 +0700 Feat: add right & bottom label in input base component commit8462eba94bAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Nov 5 21:23:04 2025 +0700 feat/prescription-56: wip commitdb48919325Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Nov 5 13:53:43 2025 +0700 Feat: add banner in List if requirement not met commitbd57250f7eAuthor: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Nov 5 13:26:48 2025 +0700 Fix: refactor getDetail url param commita361922e32Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Nov 5 13:19:07 2025 +0700 Feat: Add & integrate add, edit, detail page commit331f4a6b20Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Tue Nov 4 16:56:08 2025 +0700 Feat: Integrate Control Letter commita592a0be36Author: riefive <rie.five@gmail.com> Date: Tue Nov 4 15:15:38 2025 +0700 feat(cemo): add home encounter commitbe0a761170Author: riefive <rie.five@gmail.com> Date: Tue Nov 4 13:23:52 2025 +0700 feat(cemo): change flow admin commit64fe2524fbAuthor: riefive <rie.five@gmail.com> Date: Tue Nov 4 12:02:31 2025 +0700 feat(cemo): enhance admin mode functionality and update series handling commitfb7731188dAuthor: riefive <rie.five@gmail.com> Date: Mon Nov 3 15:52:35 2025 +0700 feat(cemo): add mode adm + series commit89b2fb9cd9Author: riefive <rie.five@gmail.com> Date: Mon Nov 3 15:03:56 2025 +0700 feat(chemo): add page process and modify components commitf676c8a4b9Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Nov 3 08:11:02 2025 +0700 feat/cp-lab-order-48: wip commit69ffe6bd49Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Oct 31 14:35:39 2025 +0700 feat/radiology-order: added the page commitd1369d513bAuthor: riefive <rie.five@gmail.com> Date: Fri Oct 31 16:08:22 2025 +0700 feat(cemo): add list verification commita9ab75fd98Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Oct 31 14:35:05 2025 +0700 feat/readiology-order: added mcu commit71d68e5a0eAuthor: riefive <rie.five@gmail.com> Date: Fri Oct 31 14:49:21 2025 +0700 feat(cemo): add dialog verification and list register commitf8d906b6c2Merge:66872c95f9e441Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Oct 31 14:48:21 2025 +0700 Merge branch 'dev' into fe-prescription-56 commit40d78a999aAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Oct 31 14:35:05 2025 +0700 feat/readiology-order: added mcu commitb3502df0f8Merge:831749a7119f67Author: riefive <rie.five@gmail.com> Date: Fri Oct 31 13:12:11 2025 +0700 Merge branch 'feat/fe-kemoterapi' into feeat/pendaftaran-kemoterapi-141 commit7119f67402Author: riefive <rie.five@gmail.com> Date: Fri Oct 31 13:09:59 2025 +0700 feat(cemo): modify schema commit66872c95f8Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Oct 31 07:56:36 2025 +0700 feat/prescription-56: wip commit45cc019ec1Author: riefive <rie.five@gmail.com> Date: Thu Oct 30 15:43:50 2025 +0700 feat(cemo): layouting form commite866c0cf2aAuthor: riefive <rie.five@gmail.com> Date: Thu Oct 30 14:41:52 2025 +0700 feat(cemo): layouting protocol commitdc4edc1dc0Author: riefive <rie.five@gmail.com> Date: Wed Oct 29 15:58:52 2025 +0700 feat(cemo): show list cemo commit3234853473Author: riefive <rie.five@gmail.com> Date: Wed Oct 29 15:39:55 2025 +0700 feat(cemo): add list of cemo commitfc308809b8Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Wed Oct 29 14:57:19 2025 +0700 Feat: add UI Rehab Medik > Proses > Resume commit9b383a5437Merge:a4dc7d7831749aAuthor: Muhammad Hasyim Chaidir Ali <68959522+Hasyim-Kai@users.noreply.github.com> Date: Wed Oct 29 13:32:47 2025 +0700 Merge pull request #139 from dikstub-rssa/dev Update branch feat/resume-81 commit67ee129f4bMerge:9919b4b9e82d17Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Tue Oct 28 16:20:17 2025 +0700 Merge branch 'dev' into fe-prescription-56 commit2275f4dc99Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Oct 27 14:01:58 2025 +0700 Feat: add UI BPJS > Surat Kontrol commit89e0e7a2c8Author: hasyim_kai <muhammad.hasyim.c.a@gmail.com> Date: Mon Oct 27 10:21:59 2025 +0700 Feat: add UI CRUD Surat Kontrol at Rehab Medik > kunjungan > Proses commit9919b4b896Merge:19a43bde93e72aAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Oct 25 15:36:29 2025 +0700 Merge branch 'dev' into fe-prescription-56 commitb7d4fcf939Merge:eaac4aae93e72aAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Oct 25 15:31:30 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commit19a43bd291Merge:d90e4003558672Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Oct 25 05:02:57 2025 +0700 Merge branch 'dev' into fe-prescription-56 commiteaac4aab85Merge:72e8d433558672Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Oct 25 05:01:45 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commitd90e40043cMerge:0c9f9deb90f0c1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Oct 24 12:40:59 2025 +0700 Merge branch 'dev' into fe-prescription-56 commit0c9f9deb7eAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Oct 24 12:38:02 2025 +0700 fe-prescription-56: wip commit729474a2a0Merge:7159bd6ddd35d6Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Oct 23 14:16:52 2025 +0700 Merge branch 'dev' into fe-prescription-56 commit7f3fe813c5Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Oct 23 14:09:01 2025 +0700 feat/device-order: wip commit72e8d431d6Merge:3f77d922a9b78aAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Oct 22 07:17:41 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commit1b1fac7695Merge:0b4420627ab7c2Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Oct 22 04:28:31 2025 +0700 Merge branch 'dev' into feat/device-order-x commit3f77d927b6Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Tue Oct 21 22:48:34 2025 +0700 feat/encounter: done commitd8c861d60cMerge:6bdee6627ab7c2Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Tue Oct 21 00:15:01 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commit0b4420620dMerge:39af60502b2b76Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 20 13:35:00 2025 +0700 Merge branch 'dev' into feat/device-order-58 commit02b2b7657cMerge:7ddb14ae1942d1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 20 11:24:54 2025 +0700 Merge branch 'dev' of github.com:dikstub-rssa/simrs-fe into dev commit39af6052e7Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 20 11:22:54 2025 +0700 feat/device-order-58: wip commit7ddb14acccAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Mon Oct 13 16:38:23 2025 +0700 dev: hotfix, added userQueryCRUD commit7159bd6566Merge:ccc9b0bbe5768bAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 13 07:45:15 2025 +0700 Merge branch 'dev' into fe-prescription-56 commitccc9b0bda3Merge:f94ccd7cad7ac6Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 13 06:29:03 2025 +0700 Merge branch 'dev' into fe-prescription-56 commit6bdee66cc6Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 13 06:26:30 2025 +0700 feat/encounter: wip commitf7c53fc4e5Merge:a7c7ef6cad7ac6Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 13 06:24:45 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commita7c7ef6dd8Merge:89b051bf52e516Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Oct 12 13:27:06 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commit89b051b883Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Oct 12 13:18:46 2025 +0700 feat/encounter-status-107: wip commit743c38804aMerge:d6d60e3f7b66d2Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Oct 12 11:53:03 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commitd6d60e38d0Merge:9530cdd18e00bfAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Oct 12 11:49:49 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commit18e00bf89aAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Sun Oct 12 11:40:53 2025 +0700 dev: hotfix, text-size standardization commit9530cdd4f9Merge:0820cb60d1e469Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Oct 12 11:41:49 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commit0d1e469eceAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Sun Oct 12 11:40:53 2025 +0700 dev: hotfix, text-size standardization commit0820cb653cMerge:fff1ce0867c1b4Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Oct 11 00:38:10 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commitfff1ce0eb7Merge:1a3edd53a4b2aaAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sat Oct 11 00:35:16 2025 +0700 Merge branch 'dev' into feat/encounter-status-107 commit3a4b2aa6fbAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Sat Oct 11 00:25:44 2025 +0700 dev: hotfix, moved combobox and datepicker commit1a3edd5a1eAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Fri Oct 10 23:58:44 2025 +0700 dev: hotfix, moved combobox and datepicker commitf94ccd707bMerge:064767551d1221Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Wed Oct 8 08:00:01 2025 +0700 Merge branch 'feat/consultation-82' into fe-prescription-56 commit06476756fbAuthor: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Wed Oct 8 07:58:48 2025 +0700 fe-prescription-56: wip commitfdbcfed87fMerge:4da896abd66a88Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Tue Oct 7 03:10:19 2025 +0700 Merge branch 'dev' into fe-prescription-56 commitbd66a8887dMerge:19e00faba61d05Author: Munawwirul Jamal <57973347+munaja@users.noreply.github.com> Date: Tue Oct 7 03:07:46 2025 +0700 Merge pull request #103 from dikstub-rssa/feat/fe-integrasi-org-src-72 Feat - Integrasi Org Src commitba61d05257Author: riefive <rie.five@gmail.com> Date: Mon Oct 6 12:42:08 2025 +0700 fix: adjustment division app + flow commit8601d4a4fdAuthor: riefive <rie.five@gmail.com> Date: Mon Oct 6 11:07:05 2025 +0700 fix: remove shared handlers commitfff5f2c11dAuthor: riefive <rie.five@gmail.com> Date: Mon Oct 6 11:06:29 2025 +0700 fix: update content list of specialist, subspecialist, etc commit301cb82803Author: riefive <rie.five@gmail.com> Date: Mon Oct 6 11:00:14 2025 +0700 fix: update list medicine commit3003ec9d80Author: riefive <rie.five@gmail.com> Date: Mon Oct 6 10:45:15 2025 +0700 fix: update list division + equipment commitd1bcd6e66cAuthor: riefive <rie.five@gmail.com> Date: Mon Oct 6 10:38:10 2025 +0700 fix: update some service commit78ae8a8aa0Author: riefive <rie.five@gmail.com> Date: Mon Oct 6 10:26:25 2025 +0700 fix: medicine method and group commit8eaf95dd3eAuthor: riefive <rie.five@gmail.com> Date: Mon Oct 6 10:20:05 2025 +0700 fix: update service for unit and uom commit58c0dde377Author: riefive <rie.five@gmail.com> Date: Mon Oct 6 10:14:51 2025 +0700 fix: update handler for unit and uom commitfe23c75acaAuthor: riefive <rie.five@gmail.com> Date: Mon Oct 6 10:09:24 2025 +0700 fix: update some service and handlers commit4da896a242Merge:285c3ee19e00faAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 6 09:55:24 2025 +0700 Merge branch 'dev' into fe-prescription-56 commitecdc5d80d9Author: riefive <rie.five@gmail.com> Date: Mon Oct 6 09:51:31 2025 +0700 fix: update device service and handler commit45ea70d415Author: riefive <rie.five@gmail.com> Date: Mon Oct 6 09:44:48 2025 +0700 fix: update crud base commit51ddb9d8b5Merge:42a54bb19e00faAuthor: riefive <rie.five@gmail.com> Date: Mon Oct 6 09:40:22 2025 +0700 fix: resolve conflict commit19e00fa143Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Mon Oct 6 08:26:08 2025 +0700 dev: hotfix, moved encounter to pub/component commit285c3ee4e5Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 6 07:56:29 2025 +0700 Merged Stash commit421159971eAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 6 04:41:21 2025 +0700 feat/prescription-56: wip commit3a45de413dAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 6 04:31:08 2025 +0700 Merge from Stash commite959c3ae61Merge:32c69afad4695cAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Oct 6 04:21:06 2025 +0700 Merge branch 'dev' into fe-prescription-56 commitad4695c867Author: Munawwirul Jamal <munawwirul.jamal@gmail.com> Date: Mon Oct 6 04:18:55 2025 +0700 dev: hotfix, encounter content back nav commit42a54bbb3bMerge:a7cbbee55559a4Author: riefive <rie.five@gmail.com> Date: Sat Oct 4 09:07:03 2025 +0700 fix: solve conflict after pull commita7cbbeeda9Author: riefive <rie.five@gmail.com> Date: Sat Oct 4 09:05:28 2025 +0700 feat(division): fixing logic treeview commit71e0615ee1Author: riefive <rie.five@gmail.com> Date: Sat Oct 4 08:49:38 2025 +0700 feat(division): restructure division parent commitf02903e756Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 15:00:10 2025 +0700 feat(division): change parent id to number before integrate commit2e8667a780Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 14:47:02 2025 +0700 feat(division): parent id to default null commite65e562690Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 12:45:05 2025 +0700 feat(division): change form attribute commit9407501c49Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 11:03:19 2025 +0700 feat(division): change compoent combobox to tree select commitc5ba07a226Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 10:54:35 2025 +0700 feat(division): create tree item converter for division commit8e7ce771b0Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 15:31:27 2025 +0700 test: call division position commit7edab33427Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:49:55 2025 +0700 fix: handler reset state commitce59eac86cAuthor: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:37:17 2025 +0700 fix: list unit commit39d2869ffbAuthor: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:34:19 2025 +0700 fix: list with params error commit3c046a4d82Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:12:10 2025 +0700 fix: list integration commit6feb480a51Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 11:16:23 2025 +0700 fix: change get encounter class to constants commitd7d984810eAuthor: riefive <rie.five@gmail.com> Date: Thu Oct 2 11:00:05 2025 +0700 remove previous list + form from any features commita6377ef943Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 15:24:54 2025 +0700 fix: includes for unit commitb00b9b198eAuthor: riefive <rie.five@gmail.com> Date: Wed Oct 1 15:17:31 2025 +0700 fix: includes for medicine list commit4908f16770Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 14:56:11 2025 +0700 fix: search on list file commit41405ae113Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 14:36:48 2025 +0700 fix: resolve list organization source commit6b69e48bd6Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 13:05:36 2025 +0700 feat(installation): add encounter list commit59847dce34Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 13:01:24 2025 +0700 chore: add shared handlers commite78342829eAuthor: riefive <rie.five@gmail.com> Date: Wed Oct 1 12:38:04 2025 +0700 feat(installation): integrate api installation commit55559a4683Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 15:00:10 2025 +0700 feat(division): change parent id to number before integrate commit2d8c751788Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 14:47:02 2025 +0700 feat(division): parent id to default null commitf374f9ef5bAuthor: riefive <rie.five@gmail.com> Date: Fri Oct 3 12:45:05 2025 +0700 feat(division): change form attribute commit1837afce6cAuthor: riefive <rie.five@gmail.com> Date: Fri Oct 3 11:03:19 2025 +0700 feat(division): change compoent combobox to tree select commit539a1cefb0Author: riefive <rie.five@gmail.com> Date: Fri Oct 3 10:54:35 2025 +0700 feat(division): create tree item converter for division commit32c69af4e1Merge:075285510bbee9Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Fri Oct 3 06:05:35 2025 +0700 Merge branch 'feat/layout-cleaning' into fe-prescription-56 commit757b8c0444Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 15:31:27 2025 +0700 test: call division position commit378e6773b8Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:49:55 2025 +0700 fix: handler reset state commit0e115eed5eAuthor: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:37:17 2025 +0700 fix: list unit commitd544d031c3Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:34:19 2025 +0700 fix: list with params error commit693d8225bfAuthor: riefive <rie.five@gmail.com> Date: Thu Oct 2 14:12:10 2025 +0700 fix: list integration commit0752855808Merge:f83dbfec0557ccAuthor: Andrian Roshandy <andrianovsky95@gmail.com> Date: Thu Oct 2 12:46:54 2025 +0700 Merge branch 'dev' into fe-prescription-56 commitfc3bda14f4Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 11:16:23 2025 +0700 fix: change get encounter class to constants commit9603915fd7Author: riefive <rie.five@gmail.com> Date: Thu Oct 2 11:00:05 2025 +0700 remove previous list + form from any features commit546423bdfbAuthor: riefive <rie.five@gmail.com> Date: Wed Oct 1 15:24:54 2025 +0700 fix: includes for unit commitdb48233f6cAuthor: riefive <rie.five@gmail.com> Date: Wed Oct 1 15:17:31 2025 +0700 fix: includes for medicine list commit54a5aaa78fAuthor: riefive <rie.five@gmail.com> Date: Wed Oct 1 14:56:11 2025 +0700 fix: search on list file commitcc41118570Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 14:36:48 2025 +0700 fix: resolve list organization source commit6a7a9cda80Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 13:05:36 2025 +0700 feat(installation): add encounter list commitc96d738379Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 13:01:24 2025 +0700 chore: add shared handlers commita48f375018Author: riefive <rie.five@gmail.com> Date: Wed Oct 1 12:38:04 2025 +0700 feat(installation): integrate api installation commitf83dbfeae3Merge:ba77ed1f29eb38Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Wed Oct 1 04:02:05 2025 +0700 Merge branch 'feat/layout-cleaning' into fe-prescription-56 commitba77ed1bb5Merge:4fbd8ee97d36f1Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Mon Sep 29 08:27:01 2025 +0700 Merge branch 'dev' into fe-prescription-56 commit4fbd8ee757Author: Andrian Roshandy <andrianovsky95@gmail.com> Date: Sun Sep 28 07:10:32 2025 +0700 feat/prescription-56: merapikan models
This commit is contained in:
@@ -1,24 +1,177 @@
|
||||
<script setup lang="ts">
|
||||
import Nav from '~/components/pub/my-ui/nav-footer/ba-su.vue'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
|
||||
// Composables
|
||||
import { useQueryCRUDMode } from '~/composables/useQueryCRUD'
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
|
||||
// Pub components
|
||||
import Nav from '~/components/pub/my-ui/nav-footer/ba-de-su.vue'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import * as DE from '~/components/pub/my-ui/doc-entry'
|
||||
|
||||
// Refs / src
|
||||
import { type Device } from '~/models/device'
|
||||
import { getList as getDeviceList } from '~/services/device.service'
|
||||
|
||||
// Device order things
|
||||
import { getDetail, remove, submit } from '~/services/device-order.service'
|
||||
import EntryForm from '~/components/app/device-order/entry-form.vue'
|
||||
|
||||
// Items
|
||||
import {
|
||||
getList as getItemList,
|
||||
create as createItem,
|
||||
update as updateItem,
|
||||
} from '~/services/device-order-item.service'
|
||||
import {
|
||||
recId,
|
||||
recAction,
|
||||
recItem,
|
||||
handleActionRemove,
|
||||
} from '~/handlers/device-order-item.handler'
|
||||
import { genDeviceOrderItem, type DeviceOrderItem } from '~/models/device-order-item'
|
||||
import ItemListEntry from '~/components/app/device-order-item/list-entry.vue'
|
||||
import type { HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
|
||||
const { backToList } = useQueryCRUDMode()
|
||||
import ItemEntry from '~/components/app/device-order-item/entry-form.vue'
|
||||
|
||||
// Header
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: 'Tambah Order Alkes',
|
||||
icon: 'i-lucide-box',
|
||||
}
|
||||
|
||||
function navClick(type: 'cancel' | 'submit') {
|
||||
if (type === 'cancel') {
|
||||
backToList()
|
||||
}
|
||||
// Device order things
|
||||
const { getQueryParam } = useQueryParam()
|
||||
const rawId = getQueryParam('id')
|
||||
const id = typeof rawId === 'string' ? parseInt(rawId) : 0
|
||||
const dataRes = await getDetail(id, { includes: 'doctor,doctor-employee,doctor-employee-person' })
|
||||
const data = ref(dataRes.body?.data || null)
|
||||
const devices = ref<Device[]>([])
|
||||
|
||||
const isSubmitConfirmationOpen = ref(false)
|
||||
const isDeleteConfirmationOpen = ref(false)
|
||||
|
||||
// Items
|
||||
const {
|
||||
data: items,
|
||||
isLoading,
|
||||
fetchData: getDeviceOrderItems,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getItemList({
|
||||
'device-order-id': id,
|
||||
includes: 'device',
|
||||
search: params.search,
|
||||
sort: 'createdAt:asc',
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'division',
|
||||
})
|
||||
const selectedItem = ref<DeviceOrderItem>(genDeviceOrderItem())
|
||||
const isItemDetailDialogOpen = ref(false)
|
||||
const isItemEntryDialogOpen = ref(false)
|
||||
const isItemDelConfirmDialogOpen = ref(false)
|
||||
|
||||
selectedItem.value.deviceOrder_id = id
|
||||
|
||||
// Last navs
|
||||
const { backToList } = useQueryCRUDMode()
|
||||
|
||||
// Reactivities
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
watch([recId, recAction], () => {
|
||||
let item: DeviceOrderItem | null
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
item = pickItem()
|
||||
if (item) {
|
||||
isItemDetailDialogOpen.value = true
|
||||
}
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
item = pickItem()
|
||||
if (item) {
|
||||
isItemEntryDialogOpen.value = true
|
||||
getDevices('', item.device_code)
|
||||
}
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isItemDelConfirmDialogOpen.value = true
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await getDeviceOrderItems()
|
||||
})
|
||||
|
||||
// Functions
|
||||
function navClick(type: 'back' | 'delete' | 'draft' | 'submit') {
|
||||
if (type === 'back') {
|
||||
backToList()
|
||||
} else if (type === 'delete') {
|
||||
isDeleteConfirmationOpen.value = true
|
||||
} else if (type === 'submit') {
|
||||
isSubmitConfirmationOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
async function removeOrder() {
|
||||
const res = await remove(id)
|
||||
if (res.success) {
|
||||
backToList()
|
||||
}
|
||||
}
|
||||
|
||||
async function submitOrder() {
|
||||
const res = await submit(id)
|
||||
if (res.success) {
|
||||
backToList()
|
||||
}
|
||||
}
|
||||
|
||||
function addItem() {
|
||||
isItemEntryDialogOpen.value = true
|
||||
}
|
||||
|
||||
async function getDevices(value: string, code?: string) {
|
||||
const res = await getDeviceList({ 'search': value, 'code': code })
|
||||
if (res.success) {
|
||||
devices.value = res.body.data
|
||||
} else {
|
||||
devices.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function pickItem(): DeviceOrderItem | null {
|
||||
const item = items.value.find(item => item.id === recId.value)
|
||||
selectedItem.value = item
|
||||
return item
|
||||
}
|
||||
|
||||
async function saveItem() {
|
||||
let res: any;
|
||||
if(!selectedItem.value.id) {
|
||||
res = await createItem(selectedItem.value)
|
||||
} else {
|
||||
res = await updateItem(selectedItem.value.id, selectedItem.value)
|
||||
}
|
||||
if (res.success) {
|
||||
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
||||
getDeviceOrderItems()
|
||||
isItemEntryDialogOpen.value = false
|
||||
selectedItem.value = genDeviceOrderItem()
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -28,10 +181,74 @@ const headerPrep: HeaderPrep = {
|
||||
class="mb-4 xl:mb-5"
|
||||
/>
|
||||
|
||||
<ItemListEntry />
|
||||
<EntryForm :data="data" @add="addItem" />
|
||||
|
||||
<ItemListEntry :data="items" @add="addItem" />
|
||||
|
||||
<Separator class="my-5" />
|
||||
|
||||
<div class="w-full flex justify-center">
|
||||
<Nav @click="navClick" />
|
||||
</div>
|
||||
|
||||
<!-- Confirm delete -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isDeleteConfirmationOpen"
|
||||
action="delete"
|
||||
:record="data"
|
||||
@confirm="removeOrder()"
|
||||
/>
|
||||
|
||||
<!-- Confirm submit -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isSubmitConfirmationOpen"
|
||||
customTitle="Ajukan Order"
|
||||
customMessage="Akan dilakukan pengajuan order alat kesehatan"
|
||||
customConfirmText="Ajukan"
|
||||
:record="data"
|
||||
@confirm="submitOrder"
|
||||
@cancel=""
|
||||
/>
|
||||
|
||||
<!-- Item entry -->
|
||||
<Dialog
|
||||
v-model:open="isItemEntryDialogOpen"
|
||||
title="Item Order"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
>
|
||||
<ItemEntry
|
||||
:data="selectedItem"
|
||||
:devices="devices"
|
||||
@close="isItemEntryDialogOpen = false"
|
||||
@save="saveItem"
|
||||
@update:searchText="getDevices"
|
||||
/>
|
||||
</Dialog>
|
||||
|
||||
<RecordConfirmation
|
||||
v-model:open="isItemDelConfirmDialogOpen"
|
||||
action="delete"
|
||||
size="md"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getDeviceOrderItems, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<DE.Block mode="preview" label-size="small">
|
||||
<DE.Cell>
|
||||
<DE.Label>Nama</DE.Label>
|
||||
<DE.Colon />
|
||||
<DE.Field>
|
||||
{{ recItem.device.name }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell>
|
||||
<DE.Label>Dosis</DE.Label>
|
||||
<DE.Colon />
|
||||
<DE.Field>
|
||||
{{ recItem.quantity }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
</DE.Block>
|
||||
</RecordConfirmation>
|
||||
</template>
|
||||
|
||||
@@ -1,69 +1,39 @@
|
||||
<script setup lang="ts">
|
||||
// Helpers
|
||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||
|
||||
// Components
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import List from '~/components/app/device-order/list.vue'
|
||||
|
||||
// Helpers
|
||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
// import { useQueryMode } from '~/composables/useQueryMode'
|
||||
import { useQueryCRUDMode } from '~/composables/useQueryCRUD'
|
||||
|
||||
// Types
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import { type DeviceOrderFormData, DeviceOrderSchema } from '~/schemas/device-order.schema'
|
||||
import type { DeviceOrder } from "~/models/device-order";
|
||||
|
||||
// Handlers
|
||||
// Device order things
|
||||
import {
|
||||
recId,
|
||||
recAction,
|
||||
recItem,
|
||||
isReadonly,
|
||||
isProcessing,
|
||||
isFormEntryDialogOpen,
|
||||
isRecordConfirmationOpen,
|
||||
onResetState,
|
||||
handleActionSave,
|
||||
handleActionEdit,
|
||||
handleActionRemove,
|
||||
handleCancelForm,
|
||||
} from '~/handlers/device-order.handler'
|
||||
import { getList, submit } from '~/services/device-order.service'
|
||||
import type { ToastFn } from '~/handlers/_handler'
|
||||
import { type DeviceOrder } from "~/models/device-order";
|
||||
import ConfirmationInfo from '~/components/app/device-order/confirmation-info.vue'
|
||||
|
||||
// Services
|
||||
import { getList } from '~/services/device-order.service'
|
||||
// Props
|
||||
const props = defineProps<{
|
||||
encounter_id: number
|
||||
}>()
|
||||
|
||||
const route = useRoute()
|
||||
const title = ref('')
|
||||
|
||||
// const { mode, openForm, backToList } = useQueryMode()
|
||||
const { mode, goToEntry, backToList } = useQueryCRUDMode()
|
||||
const { recordId } = useQueryCRUDRecordId()
|
||||
|
||||
const {
|
||||
data,
|
||||
isLoading,
|
||||
paginationMeta,
|
||||
searchInput,
|
||||
handlePageChange,
|
||||
handleSearch,
|
||||
fetchData: getMyList,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getList({
|
||||
search: params.search,
|
||||
sort: 'createdAt:asc',
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
includes: 'parent,childrens',
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'device-order',
|
||||
})
|
||||
const encounter_id = props.encounter_id
|
||||
|
||||
// Header
|
||||
const voidFn = () => {}
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: 'Order Alkes',
|
||||
icon: 'i-lucide-box',
|
||||
@@ -85,21 +55,88 @@ const headerPrep: HeaderPrep = {
|
||||
recItem.value = null
|
||||
recId.value = 0
|
||||
isReadonly.value = false
|
||||
// await handleActionSave(recItem, getMyList, () => {}, () => {})
|
||||
goToEntry()
|
||||
const saveResp = await handleActionSave({ encounter_id }, voidFn, voidFn, voidFn)
|
||||
if (saveResp.success) {
|
||||
setQueryParams({
|
||||
'mode': 'entry',
|
||||
'id': saveResp.body?.data?.id.toString()
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// List
|
||||
const {
|
||||
data,
|
||||
isLoading,
|
||||
paginationMeta,
|
||||
searchInput,
|
||||
handlePageChange,
|
||||
handleSearch,
|
||||
fetchData: getMyList,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getList({
|
||||
'encounter-id': encounter_id,
|
||||
search: params.search,
|
||||
includes: 'doctor,doctor-employee,doctor-employee-person,items,items-device',
|
||||
page: params.page,
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'device-order',
|
||||
})
|
||||
|
||||
// Selected item
|
||||
const selectedItem = ref<DeviceOrder | null>()
|
||||
const isSubmitConfirmationOpen = ref(false)
|
||||
const isDeleteConfirmationOpen = ref(false)
|
||||
const { setQueryParams } = useQueryParam()
|
||||
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
// Watch for row actions when recId or recAction changes
|
||||
onMounted(async () => {
|
||||
await getMyList()
|
||||
watch([recId, recAction], () => {
|
||||
let item: DeviceOrder | null
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
setQueryParams({
|
||||
'mode': 'entry',
|
||||
'id': recId.value.toString()
|
||||
})
|
||||
break
|
||||
case ActionEvents.showConfirmSubmit:
|
||||
selectedItem.value = pickItem()
|
||||
isSubmitConfirmationOpen.value = true
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
selectedItem.value = pickItem()
|
||||
isDeleteConfirmationOpen.value = true
|
||||
break
|
||||
}
|
||||
recAction.value = '';
|
||||
})
|
||||
|
||||
async function handleActionSubmit(id: number, refresh: () => void, toast: ToastFn) {
|
||||
const result = await submit(id)
|
||||
if (result.success) {
|
||||
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
||||
setTimeout(refresh, 300)
|
||||
} else {
|
||||
toast({ title: 'Gagal', description: 'Gagal menjalankan perintah', variant: 'destructive' })
|
||||
}
|
||||
}
|
||||
|
||||
function pickItem(): DeviceOrder | null {
|
||||
const item = data.value.find(item => item.id === recId.value)
|
||||
selectedItem.value = item
|
||||
return item
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -108,38 +145,39 @@ onMounted(async () => {
|
||||
:prep="headerPrep"
|
||||
:ref-search-nav="headerPrep.refSearchNav"
|
||||
@search="handleSearch"
|
||||
class="mb-4 xl:mb-5"
|
||||
/>
|
||||
|
||||
<List
|
||||
v-if="!isLoading.dataListLoading"
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"
|
||||
/>
|
||||
<!--
|
||||
@cancel="cancel"
|
||||
@edit="edit"
|
||||
@submit="submit"
|
||||
-->
|
||||
|
||||
<!-- Record Confirmation Modal -->
|
||||
<!-- Submit Record Confirmation Modal -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
v-model:open="isSubmitConfirmationOpen"
|
||||
customTitle="Ajukan Order"
|
||||
customMessage="Akan dilakukan pengajuan order alat kesehatan"
|
||||
customConfirmText="Ajukan"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionSubmit(recId, getMyList, toast)"
|
||||
>
|
||||
<ConfirmationInfo :data="selectedItem" />
|
||||
</RecordConfirmation>
|
||||
|
||||
<!-- Del Record Confirmation Modal -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isDeleteConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getMyList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
<p>
|
||||
<strong>ID:</strong>
|
||||
{{ record?.id }}
|
||||
</p>
|
||||
<p v-if="record?.name">
|
||||
<strong>Nama:</strong>
|
||||
{{ record.name }}
|
||||
</p>
|
||||
<p v-if="record?.code">
|
||||
<strong>Kode:</strong>
|
||||
{{ record.code }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
<ConfirmationInfo :data="selectedItem" />
|
||||
</RecordConfirmation>
|
||||
</template>
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
import List from './list.vue'
|
||||
import Entry from './entry.vue'
|
||||
|
||||
const { mode } = useQueryMode()
|
||||
defineProps<{
|
||||
encounter_id: number
|
||||
}>()
|
||||
|
||||
const { mode } = useQueryCRUDMode()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<List v-if="mode === 'list'" />
|
||||
<Entry v-else />
|
||||
<List v-if="mode === 'list'" :encounter_id="encounter_id" />
|
||||
<Entry v-else :encounter_id="encounter_id" />
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import type { ExposedForm } from '~/types/form'
|
||||
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
|
||||
import { handleActionSave,} from '~/handlers/supporting-document.handler'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
|
||||
import { DocumentUploadSchema } from '~/schemas/document-upload.schema'
|
||||
import { toFormData } from '~/lib/utils'
|
||||
import { uploadAttachment } from '~/services/supporting-document.service'
|
||||
|
||||
// #region Props & Emits
|
||||
const props = defineProps<{
|
||||
callbackUrl?: string
|
||||
}>()
|
||||
|
||||
// form related state
|
||||
const route = useRoute()
|
||||
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
const inputForm = ref<ExposedForm<any> | null>(null)
|
||||
const { user } = useUserStore()
|
||||
// #endregion
|
||||
|
||||
// #region State & Computed
|
||||
const router = useRouter()
|
||||
const isConfirmationOpen = ref(false)
|
||||
const initialValues = {
|
||||
officer: user.user_name,
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Lifecycle Hooks
|
||||
// #endregion
|
||||
|
||||
// #region Functions
|
||||
function goBack() {
|
||||
router.go(-1)
|
||||
}
|
||||
|
||||
|
||||
async function handleConfirmAdd() {
|
||||
const inputData = await composeFormData()
|
||||
const inputFormData: FormData = toFormData(inputData)
|
||||
|
||||
const response = await handleActionSave(inputFormData, () => { }, () => { }, toast, )
|
||||
const data = (response?.body?.data ?? null)
|
||||
if (!data) return
|
||||
|
||||
// // If has callback provided redirect to callback with patientData
|
||||
if (props.callbackUrl) {
|
||||
navigateTo(props.callbackUrl + '?control-letter-id=' + inputData.id)
|
||||
}
|
||||
goBack()
|
||||
}
|
||||
|
||||
async function composeFormData(): Promise<any> {
|
||||
inputForm.value?.setValues({
|
||||
...inputForm.value?.values,
|
||||
ref_id: encounterId,
|
||||
upload_employee_id: user.employee_id
|
||||
})
|
||||
|
||||
const [inputFormState,] = await Promise.all([
|
||||
inputForm.value?.validate(),
|
||||
])
|
||||
|
||||
const results = [inputFormState]
|
||||
const allValid = results.every((r) => r?.valid)
|
||||
|
||||
// exit, if form errors happend during validation
|
||||
if (!allValid) {
|
||||
toast({ title: 'Form validation failed', variant: 'destructive',})
|
||||
return Promise.reject('Form validation failed')
|
||||
}
|
||||
const formData = inputFormState?.values
|
||||
return new Promise((resolve) => resolve(formData))
|
||||
}
|
||||
// #endregion region
|
||||
|
||||
// #region Utilities & event handlers
|
||||
async function handleActionClick(eventType: string) {
|
||||
if (eventType === 'submit') {
|
||||
isConfirmationOpen.value = true
|
||||
}
|
||||
|
||||
if (eventType === 'back') {
|
||||
if (props.callbackUrl) {
|
||||
await navigateTo(props.callbackUrl)
|
||||
return
|
||||
}
|
||||
goBack()
|
||||
}
|
||||
}
|
||||
|
||||
function handleCancelAdd() {
|
||||
isConfirmationOpen.value = false
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Watchers
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">
|
||||
<h1>Upload Dokumen</h1>
|
||||
</div>
|
||||
<AppDocumentUploadEntryForm
|
||||
ref="inputForm"
|
||||
:schema="DocumentUploadSchema"
|
||||
:initial-values="initialValues"
|
||||
/>
|
||||
|
||||
<div class="mb-2 flex justify-end py-2">
|
||||
<Action :enable-draft="false" @click="handleActionClick" />
|
||||
</div>
|
||||
|
||||
<Confirmation v-model:open="isConfirmationOpen"
|
||||
title="Simpan Data"
|
||||
message="Apakah Anda yakin ingin menyimpan data ini?"
|
||||
confirm-text="Simpan"
|
||||
@confirm="handleConfirmAdd"
|
||||
@cancel="handleCancelAdd" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* component style */
|
||||
</style>
|
||||
@@ -0,0 +1,134 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import type { ExposedForm } from '~/types/form'
|
||||
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
|
||||
import { handleActionSave,} from '~/handlers/supporting-document.handler'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
|
||||
import { DocumentUploadSchema } from '~/schemas/document-upload.schema'
|
||||
import { getDetail } from '~/services/supporting-document.service'
|
||||
|
||||
// #region Props & Emits
|
||||
const props = defineProps<{
|
||||
callbackUrl?: string
|
||||
}>()
|
||||
|
||||
// form related state
|
||||
const route = useRoute()
|
||||
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
const docId = typeof route.params.document_id == 'string' ? parseInt(route.params.document_id) : 0
|
||||
const inputForm = ref<ExposedForm<any> | null>(null)
|
||||
// #endregion
|
||||
|
||||
// #region State & Computed
|
||||
const router = useRouter()
|
||||
const isConfirmationOpen = ref(false)
|
||||
const { user } = useUserStore()
|
||||
const initialValues = {
|
||||
officer: user.user_name,
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Lifecycle Hooks
|
||||
onMounted(async () => {
|
||||
const result = await getDetail(docId)
|
||||
if (result.success) {
|
||||
inputForm.value?.setValues(result.body.data)
|
||||
}
|
||||
})
|
||||
// #endregion
|
||||
|
||||
// #region Functions
|
||||
function goBack() {
|
||||
router.go(-1)
|
||||
}
|
||||
|
||||
async function handleConfirmAdd() {
|
||||
const inputData = await composeFormData()
|
||||
let createdDataId = 0
|
||||
|
||||
// const response = await handleActionSave(
|
||||
// inputData,
|
||||
// () => { },
|
||||
// () => { },
|
||||
// toast,
|
||||
// )
|
||||
|
||||
// const data = (response?.body?.data ?? null)
|
||||
// if (!data) return
|
||||
// createdDataId = data.id
|
||||
|
||||
// // // If has callback provided redirect to callback with patientData
|
||||
// if (props.callbackUrl) {
|
||||
// navigateTo(props.callbackUrl + '?control-letter-id=' + inputData.id)
|
||||
// }
|
||||
// goBack()
|
||||
}
|
||||
|
||||
async function composeFormData(): Promise<any> {
|
||||
const [inputFormState,] = await Promise.all([
|
||||
inputForm.value?.validate(),
|
||||
])
|
||||
|
||||
const results = [inputFormState]
|
||||
const allValid = results.every((r) => r?.valid)
|
||||
|
||||
// exit, if form errors happend during validation
|
||||
if (!allValid) return Promise.reject('Form validation failed')
|
||||
|
||||
const formData = inputFormState?.values
|
||||
formData.encounter_id = encounterId
|
||||
return new Promise((resolve) => resolve(formData))
|
||||
}
|
||||
// #endregion region
|
||||
|
||||
// #region Utilities & event handlers
|
||||
async function handleActionClick(eventType: string) {
|
||||
if (eventType === 'submit') {
|
||||
isConfirmationOpen.value = true
|
||||
}
|
||||
|
||||
if (eventType === 'back') {
|
||||
if (props.callbackUrl) {
|
||||
await navigateTo(props.callbackUrl)
|
||||
return
|
||||
}
|
||||
|
||||
goBack()
|
||||
}
|
||||
}
|
||||
|
||||
function handleCancelAdd() {
|
||||
isConfirmationOpen.value = false
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Watchers
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">
|
||||
<h1>Upload Dokumen</h1>
|
||||
</div>
|
||||
<AppDocumentUploadEntryForm
|
||||
ref="inputForm"
|
||||
:schema="DocumentUploadSchema"
|
||||
:initial-values="initialValues"
|
||||
/>
|
||||
|
||||
<div class="my-2 flex justify-end py-2">
|
||||
<Action :enable-draft="false" @click="handleActionClick" />
|
||||
</div>
|
||||
|
||||
<Confirmation v-model:open="isConfirmationOpen"
|
||||
title="Simpan Data"
|
||||
message="Apakah Anda yakin ingin menyimpan data ini?"
|
||||
confirm-text="Simpan"
|
||||
@confirm="handleConfirmAdd"
|
||||
@cancel="handleCancelAdd" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* component style */
|
||||
</style>
|
||||
@@ -0,0 +1,183 @@
|
||||
<script setup lang="ts">
|
||||
// #region Imports
|
||||
import { ActionEvents } from '~/components/pub/my-ui/data/types'
|
||||
import type { HeaderPrep, RefSearchNav, } from '~/components/pub/my-ui/data/types'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import { getList, remove } from '~/services/supporting-document.service'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import type { Encounter } from '~/models/encounter'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import DocPreviewDialog from '~/components/pub/my-ui/modal/doc-preview-dialog.vue'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import type { PagePermission } from '~/models/role'
|
||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
||||
import { unauthorizedToast } from '~/lib/utils'
|
||||
// #endregion
|
||||
|
||||
|
||||
// #region Permission
|
||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
||||
const { getPagePermissions } = useRBAC()
|
||||
const pagePermission = getPagePermissions(roleAccess)
|
||||
|
||||
const {user,userRole} = useUserStore()
|
||||
const {getUserPermissions} = useRBAC()
|
||||
// #endregion
|
||||
|
||||
// #region State
|
||||
const props = defineProps<{
|
||||
encounter?: Encounter
|
||||
refresh: () => void
|
||||
}>()
|
||||
|
||||
const route = useRoute()
|
||||
const encounterId = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
|
||||
const { data, paginationMeta, handlePageChange, handleSearch, searchInput, fetchData } = usePaginatedList({
|
||||
fetchFn: (params) => getList({
|
||||
'encounter-id': encounterId,
|
||||
// includes: "employee",
|
||||
...params,
|
||||
}),
|
||||
entityName: 'encounter-document',
|
||||
})
|
||||
|
||||
const isDocPreviewDialogOpen = ref(false)
|
||||
const isRecordConfirmationOpen = ref(false)
|
||||
const recId = ref<number>(0)
|
||||
const recAction = ref<string>('')
|
||||
const recItem = ref<any>(null)
|
||||
const timestamp = ref<number>(0)
|
||||
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: "Upload Dokumen",
|
||||
icon: 'i-lucide-newspaper',
|
||||
}
|
||||
if (pagePermission.canCreate) {
|
||||
headerPrep.addNav = {
|
||||
label: "Upload Dokumen",
|
||||
onClick: () => navigateTo({
|
||||
name: 'rehab-encounter-id-document-upload-add',
|
||||
params: { id: encounterId },
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
const refSearchNav: RefSearchNav = {
|
||||
onClick: () => {
|
||||
// open filter modal
|
||||
},
|
||||
onInput: (val: string) => {
|
||||
searchInput.value = val
|
||||
},
|
||||
onClear: () => {
|
||||
searchInput.value = ''
|
||||
},
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Lifecycle Hooks
|
||||
onMounted(() => {
|
||||
})
|
||||
// #endregion
|
||||
|
||||
// #region Functions
|
||||
|
||||
async function handleConfirmDelete(record: any, action: string) {
|
||||
if (action === 'delete' && record?.id) {
|
||||
try {
|
||||
const result = await remove(record.id)
|
||||
if (result.success) {
|
||||
toast({ title: 'Berhasil', description: 'Data berhasil dihapus', variant: 'default' })
|
||||
fetchData()
|
||||
} else {
|
||||
toast({ title: 'Gagal', description: `Data gagal dihapus`, variant: 'destructive' })
|
||||
}
|
||||
} catch (error) {
|
||||
toast({ title: 'Gagal', description: `Something went wrong`, variant: 'destructive' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function handleCancelConfirmation() {
|
||||
// Reset record state when cancelled
|
||||
recId.value = 0
|
||||
recAction.value = ''
|
||||
recItem.value = null
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Provide
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('timestamp', timestamp)
|
||||
// #endregion
|
||||
|
||||
// #region Watchers
|
||||
watch([recId, recAction, timestamp], () => {
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
isDocPreviewDialogOpen.value = true
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
if(pagePermission.canUpdate){
|
||||
navigateTo({
|
||||
name: 'rehab-encounter-id-document-upload-document_id-edit',
|
||||
params: { id: encounterId, "document_id": recId.value },
|
||||
})
|
||||
} else {
|
||||
unauthorizedToast()
|
||||
}
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
if(pagePermission.canDelete){
|
||||
isRecordConfirmationOpen.value = true
|
||||
} else {
|
||||
unauthorizedToast()
|
||||
}
|
||||
navigateTo(recItem.value.filePath, { external: true, open: { target: '_blank' } })
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
navigateTo({
|
||||
name: 'rehab-encounter-id-document-upload-document_id-edit',
|
||||
params: { id: encounterId, "document_id": recId.value },
|
||||
})
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isRecordConfirmationOpen.value = true
|
||||
break
|
||||
}
|
||||
})
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Header :prep="{ ...headerPrep }"
|
||||
v-model:search="searchInput"
|
||||
:ref-search-nav="refSearchNav"
|
||||
@search="handleSearch"
|
||||
/>
|
||||
<AppDocumentUploadList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange"/>
|
||||
|
||||
<RecordConfirmation v-model:open="isRecordConfirmationOpen" action="delete" :record="recItem"
|
||||
@confirm="handleConfirmDelete" @cancel="handleCancelConfirmation">
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
<p>
|
||||
<strong>ID:</strong>
|
||||
{{ record?.id }}
|
||||
</p>
|
||||
<p v-if="record?.name">
|
||||
<strong>Nama:</strong>
|
||||
{{ record?.name }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</RecordConfirmation>
|
||||
|
||||
<Dialog v-model:open="isDocPreviewDialogOpen" title="Preview Dokumen" size="2xl">
|
||||
<DocPreviewDialog :link="recItem?.filePath" />
|
||||
</Dialog>
|
||||
</template>
|
||||
@@ -9,15 +9,21 @@ import { getDetail } from '~/services/encounter.service'
|
||||
import type { TabItem } from '~/components/pub/my-ui/comp-tab/type'
|
||||
import CompTab from '~/components/pub/my-ui/comp-tab/comp-tab.vue'
|
||||
|
||||
import { genEncounter } from '~/models/encounter'
|
||||
|
||||
// PLASE ORDER BY TAB POSITION
|
||||
import Status from '~/components/content/encounter/status.vue'
|
||||
import AssesmentFunctionList from '~/components/content/soapi/entry.vue'
|
||||
import EarlyMedicalAssesmentList from '~/components/content/soapi/entry.vue'
|
||||
import EarlyMedicalRehabList from '~/components/content/soapi/entry.vue'
|
||||
import DeviceOrder from '~/components/content/device-order/main.vue'
|
||||
import Prescription from '~/components/content/prescription/main.vue'
|
||||
import CpLabOrder from '~/components/content/cp-lab-order/main.vue'
|
||||
import Radiology from '~/components/content/radiology-order/main.vue'
|
||||
import Consultation from '~/components/content/consultation/list.vue'
|
||||
import DocUploadList from '~/components/content/document-upload/list.vue'
|
||||
import GeneralConsentList from '~/components/content/general-consent/entry.vue'
|
||||
import ResumeList from '~/components/content/resume/list.vue'
|
||||
import ControlLetterList from '~/components/content/control-letter/list.vue'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -32,12 +38,18 @@ const activeTab = computed({
|
||||
})
|
||||
|
||||
const id = typeof route.params.id == 'string' ? parseInt(route.params.id) : 0
|
||||
const dataRes = await getDetail(id, {
|
||||
includes:
|
||||
'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person',
|
||||
const data = ref(genEncounter())
|
||||
|
||||
async function fetchDetail() {
|
||||
const res = await getDetail(id, {
|
||||
includes: 'patient,patient-person,patient-person-addresses,unit,Appointment_Doctor,Appointment_Doctor-employee,Appointment_Doctor-employee-person,EncounterDocuments',
|
||||
})
|
||||
if(res.body?.data) data.value = res.body?.data
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDetail()
|
||||
})
|
||||
const dataResBody = dataRes.body ?? null
|
||||
const data = dataResBody?.data ?? null
|
||||
|
||||
const tabs: TabItem[] = [
|
||||
{ value: 'status', label: 'Status Masuk/Keluar', component: Status, props: { encounter: data } },
|
||||
@@ -61,21 +73,21 @@ const tabs: TabItem[] = [
|
||||
},
|
||||
{ value: 'therapy-protocol', label: 'Protokol Terapi' },
|
||||
{ value: 'education-assessment', label: 'Asesmen Kebutuhan Edukasi' },
|
||||
{ value: 'consent', label: 'General Consent' },
|
||||
{ value: 'consent', label: 'General Consent', component: GeneralConsentList, props: { encounter: data } },
|
||||
{ value: 'patient-note', label: 'CPRJ' },
|
||||
{ value: 'prescription', label: 'Order Obat', component: Prescription, props: { encounter_id: data.id } },
|
||||
{ value: 'device', label: 'Order Alkes' },
|
||||
{ value: 'mcu-radiology', label: 'Order Radiologi', component: Radiology, props: { encounter_id: data.id } },
|
||||
{ value: 'mcu-lab-cp', label: 'Order Lab PK', component: CpLabOrder, props: { encounter_id: data.id } },
|
||||
{ value: 'prescription', label: 'Order Obat', component: Prescription, props: { encounter_id: data.value.id } },
|
||||
{ value: 'device-order', label: 'Order Alkes', component: DeviceOrder, props: { encounter_id: data.value.id } },
|
||||
{ value: 'mcu-radiology', label: 'Order Radiologi', component: Radiology, props: { encounter_id: data.value.id } },
|
||||
{ value: 'mcu-lab-cp', label: 'Order Lab PK', component: CpLabOrder, props: { encounter_id: data.value.id } },
|
||||
{ value: 'mcu-lab-micro', label: 'Order Lab Mikro' },
|
||||
{ value: 'mcu-lab-pa', label: 'Order Lab PA' },
|
||||
{ value: 'medical-action', label: 'Order Ruang Tindakan' },
|
||||
{ value: 'mcu-result', label: 'Hasil Penunjang' },
|
||||
{ value: 'consultation', label: 'Konsultasi', component: Consultation, props: { encounter: data } },
|
||||
{ value: 'resume', label: 'Resume' },
|
||||
{ value: 'resume', label: 'Resume', component: ResumeList, props: { encounter: data } },
|
||||
{ value: 'control', label: 'Surat Kontrol', component: ControlLetterList, props: { encounter: data } },
|
||||
{ value: 'screening', label: 'Skrinning MPP' },
|
||||
{ value: 'supporting-document', label: 'Upload Dokumen Pendukung' },
|
||||
{ value: 'supporting-document', label: 'Upload Dokumen Pendukung', component: DocUploadList, props: { encounter: data }, },
|
||||
]
|
||||
</script>
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ watch([recId, recAction], () => {
|
||||
getCurrentMaterialDetail(recId.value)
|
||||
title.value = 'Edit Perlengkapan'
|
||||
isReadonly.value = false
|
||||
isFormEntryDialogOpen.value = true
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isRecordConfirmationOpen.value = true
|
||||
@@ -158,7 +159,7 @@ onMounted(async () => {
|
||||
@submit="
|
||||
(values: MaterialFormData, resetForm: any) => {
|
||||
if (recId > 0) {
|
||||
handleActionEdit(recId, values, getEquipmentList, resetForm, toast)
|
||||
handleActionEdit(recItem.code, values, getEquipmentList, resetForm, toast)
|
||||
return
|
||||
}
|
||||
handleActionSave(values, getEquipmentList, resetForm, toast)
|
||||
@@ -173,7 +174,7 @@ onMounted(async () => {
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getEquipmentList, toast)"
|
||||
@confirm="() => handleActionRemove(recItem.code, getEquipmentList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useQueryMode } from '@/composables/useQueryMode'
|
||||
|
||||
import List from './list.vue'
|
||||
import Form from './form.vue'
|
||||
|
||||
// Models
|
||||
import type { Encounter } from '~/models/encounter'
|
||||
|
||||
// Props
|
||||
interface Props {
|
||||
encounter: Encounter
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const route = useRoute()
|
||||
|
||||
const { mode, goToEntry, backToList } = useQueryCRUDMode('mode')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<List
|
||||
v-if="mode === 'list'"
|
||||
:encounter="props.encounter"
|
||||
@add="goToEntry"
|
||||
@edit="goToEntry"
|
||||
/>
|
||||
<Form
|
||||
v-else
|
||||
@back="backToList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,185 @@
|
||||
<script setup lang="ts">
|
||||
import { z } from 'zod'
|
||||
import Entry from '~/components/app/general-consent/entry.vue'
|
||||
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su-pr.vue'
|
||||
import ActionDialog from '~/components/pub/my-ui/nav-footer/ba-su.vue'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import { GeneralConsentSchema } from '~/schemas/general-consent.schema'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import { handleActionSave, handleActionEdit } from '~/handlers/general-consent.handler'
|
||||
import { create } from '~/services/generate-file.service'
|
||||
// Services
|
||||
import { getDetail } from '~/services/general-consent.service'
|
||||
const { backToList } = useQueryCRUDMode('mode')
|
||||
const { recordId } = useQueryCRUDRecordId('record-id')
|
||||
|
||||
const route = useRoute()
|
||||
const isOpenProcedure = ref(false)
|
||||
const isOpenDiagnose = ref(false)
|
||||
const isOpenFungsional = ref(false)
|
||||
const procedures = ref([])
|
||||
const diagnoses = ref([])
|
||||
const fungsional = ref([])
|
||||
const selectedProcedure = ref<any>(null)
|
||||
const selectedDiagnose = ref<any>(null)
|
||||
const selectedFungsional = ref<any>(null)
|
||||
const schema = GeneralConsentSchema
|
||||
const payload = ref({
|
||||
encounter_id: 0,
|
||||
value: '',
|
||||
})
|
||||
const model = ref({
|
||||
relatives: [],
|
||||
responsibleName: '',
|
||||
responsiblePhone: '',
|
||||
informant: '',
|
||||
witness1: '',
|
||||
witness2: '',
|
||||
})
|
||||
|
||||
const fileUrl = ref('')
|
||||
const isLoading = reactive<DataTableLoader>({
|
||||
isTableLoading: false,
|
||||
})
|
||||
|
||||
async function getDiagnoses() {
|
||||
isLoading.isTableLoading = true
|
||||
const resp = await xfetch('/api/v1/diagnose-src')
|
||||
if (resp.success) {
|
||||
diagnoses.value = (resp.body as Record<string, any>).data
|
||||
}
|
||||
isLoading.isTableLoading = false
|
||||
}
|
||||
|
||||
async function getProcedures() {
|
||||
isLoading.isTableLoading = true
|
||||
const resp = await xfetch('/api/v1/procedure-src')
|
||||
if (resp.success) {
|
||||
procedures.value = (resp.body as Record<string, any>).data
|
||||
}
|
||||
isLoading.isTableLoading = false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const mode = route.query.mode
|
||||
const recordId = route.query['record-id']
|
||||
|
||||
if (mode === 'entry' && recordId) {
|
||||
loadEntryForEdit(+recordId)
|
||||
}
|
||||
})
|
||||
|
||||
// TODO: mapping data detail when edit
|
||||
const loadEntryForEdit = async (id: number) => {
|
||||
const result = await getDetail(id)
|
||||
|
||||
if (result?.success) {
|
||||
const data = result.body?.data || {}
|
||||
|
||||
const value = JSON.parse(data.value || '{}')
|
||||
model.value.witness1 = value?.witness1 || ''
|
||||
model.value.witness2 = value?.witness2 || ''
|
||||
model.value.informant = value?.informant || ''
|
||||
model.value.responsibleName = value?.responsible || ''
|
||||
model.value.responsiblePhone = value?.responsiblePhone || ''
|
||||
model.value.relatives = value?.relatives || []
|
||||
console.log('model', model.value)
|
||||
}
|
||||
}
|
||||
|
||||
function handleClick(type: string) {
|
||||
if (type === 'prosedur') {
|
||||
isOpenProcedure.value = true
|
||||
} else if (type === 'diagnosa') {
|
||||
isOpenDiagnose.value = true
|
||||
} else if (type === 'fungsional') {
|
||||
isOpenDiagnose.value = true
|
||||
}
|
||||
}
|
||||
const entryGeneralConsent = ref()
|
||||
async function actionHandler(type: string) {
|
||||
if (type === 'back') {
|
||||
backToList()
|
||||
return
|
||||
}
|
||||
if (type === 'print') {
|
||||
const data = await getDetail(recordId.value)
|
||||
const detail = data.body?.data
|
||||
fileUrl.value = detail?.fileUrl
|
||||
isOpenDiagnose.value = true
|
||||
return
|
||||
}
|
||||
const result = await entryGeneralConsent.value?.validate()
|
||||
if (result?.valid) {
|
||||
if (result.data.relatives.length > 0) {
|
||||
result.data.relatives = result.data.relatives.map((item: any) => {
|
||||
return item.name
|
||||
})
|
||||
}
|
||||
|
||||
console.log('data', result)
|
||||
const resp = await handleActionSave(
|
||||
{
|
||||
...payload.value,
|
||||
value: JSON.stringify(result.data),
|
||||
encounter_id: +route.params.id,
|
||||
},
|
||||
() => {},
|
||||
() => {},
|
||||
toast,
|
||||
)
|
||||
const data = resp.body?.data
|
||||
if (data) {
|
||||
const resp2 = await create({
|
||||
entityType_code: 'encounter',
|
||||
ref_id: data?.id,
|
||||
type_code: 'general-consent',
|
||||
})
|
||||
console.log('resp2', resp2.body?.data)
|
||||
backToList()
|
||||
}
|
||||
} else {
|
||||
console.log('Ada error di form', result)
|
||||
}
|
||||
}
|
||||
|
||||
const icdPreview = ref({
|
||||
procedures: [],
|
||||
diagnoses: [],
|
||||
})
|
||||
|
||||
function actionDialogHandler(type: string) {
|
||||
if (type === 'submit') {
|
||||
// icdPreview.value.procedures = selectedProcedure.value || []
|
||||
// icdPreview.value.diagnoses = selectedDiagnose.value || []
|
||||
// icdPreview.value.fungsional = selectedFungsional.value || []
|
||||
}
|
||||
isOpenProcedure.value = false
|
||||
isOpenDiagnose.value = false
|
||||
}
|
||||
|
||||
provide('table_data_loader', isLoading)
|
||||
provide('icdPreview', icdPreview)
|
||||
</script>
|
||||
<template>
|
||||
<Entry
|
||||
ref="entryGeneralConsent"
|
||||
v-model="model"
|
||||
:schema="schema"
|
||||
@click="handleClick"
|
||||
/>
|
||||
<div class="my-2 flex justify-end py-2">
|
||||
<Action @click="actionHandler" />
|
||||
</div>
|
||||
<Dialog
|
||||
v-model:open="isOpenDiagnose"
|
||||
title="Preview General Content"
|
||||
size="xl"
|
||||
prevent-outside
|
||||
>
|
||||
<embed
|
||||
style="width: 100%; height: 90vh"
|
||||
:src="fileUrl"
|
||||
/>
|
||||
</Dialog>
|
||||
</template>
|
||||
@@ -0,0 +1,179 @@
|
||||
<script setup lang="ts">
|
||||
// Components
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import List from '~/components/app/general-consent/list.vue'
|
||||
import Entry from '~/components/app/general-consent/entry.vue'
|
||||
|
||||
// Helpers
|
||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
|
||||
// Types
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import { GeneralConsentSchema, type GeneralConsentFormData } from '~/schemas/general-consent.schema'
|
||||
|
||||
// Handlers
|
||||
import {
|
||||
recId,
|
||||
recAction,
|
||||
recItem,
|
||||
isReadonly,
|
||||
isProcessing,
|
||||
isFormEntryDialogOpen,
|
||||
isRecordConfirmationOpen,
|
||||
onResetState,
|
||||
handleActionSave,
|
||||
handleActionEdit,
|
||||
handleActionRemove,
|
||||
handleCancelForm,
|
||||
} from '~/handlers/general-consent.handler'
|
||||
|
||||
// Services
|
||||
import { getList, getDetail } from '~/services/general-consent.service'
|
||||
|
||||
// Models
|
||||
import type { Encounter } from '~/models/encounter'
|
||||
|
||||
// Props
|
||||
interface Props {
|
||||
encounter: Encounter
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
const emits = defineEmits(['add', 'edit'])
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const { goToEntry, backToList } = useQueryCRUDMode('mode')
|
||||
|
||||
let units = ref<{ value: string; label: string }[]>([])
|
||||
const encounterId = ref<number>(props?.encounter?.id || 0)
|
||||
const title = ref('')
|
||||
|
||||
const {
|
||||
data,
|
||||
isLoading,
|
||||
paginationMeta,
|
||||
searchInput,
|
||||
handlePageChange,
|
||||
handleSearch,
|
||||
fetchData: getMyList,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async ({ page, search }) => {
|
||||
const result = await getList({ 'encounter-id': props.encounter.id, includes: '', search, page })
|
||||
if (result.success) {
|
||||
data.value = result.body.data
|
||||
}
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'general-consent',
|
||||
})
|
||||
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: 'General Consent',
|
||||
icon: 'i-lucide-box',
|
||||
refSearchNav: {
|
||||
placeholder: 'Cari (min. 3 karakter)...',
|
||||
minLength: 3,
|
||||
debounceMs: 500,
|
||||
showValidationFeedback: true,
|
||||
onInput: (value: string) => {
|
||||
searchInput.value = value
|
||||
},
|
||||
onClick: () => {},
|
||||
onClear: () => {},
|
||||
},
|
||||
addNav: {
|
||||
label: 'Tambah',
|
||||
icon: 'i-lucide-plus',
|
||||
onClick: () => {
|
||||
goToEntry()
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const goEdit = (id: string) => {
|
||||
router.replace({
|
||||
path: route.path,
|
||||
query: {
|
||||
...route.query,
|
||||
mode: 'entry',
|
||||
'record-id': id,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const today = new Date()
|
||||
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
const getMyDetail = async (id: number | string) => {
|
||||
const result = await getDetail(id)
|
||||
if (result.success) {
|
||||
const currentValue = result.body?.data || {}
|
||||
recItem.value = currentValue
|
||||
isFormEntryDialogOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
// Watch for row actions when recId or recAction changes
|
||||
watch(recId, () => {
|
||||
console.log('recId', recId.value)
|
||||
if (recAction.value === ActionEvents.showEdit) {
|
||||
goEdit(recId.value)
|
||||
return
|
||||
} else {
|
||||
isRecordConfirmationOpen.value = true
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await getMyList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Header
|
||||
v-model="searchInput"
|
||||
:prep="headerPrep"
|
||||
:ref-search-nav="headerPrep.refSearchNav"
|
||||
@search="handleSearch"
|
||||
class="mb-4 xl:mb-5"
|
||||
/>
|
||||
|
||||
<List
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"
|
||||
/>
|
||||
|
||||
<!-- Record Confirmation Modal -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getMyList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
<p>
|
||||
<strong>ID:</strong>
|
||||
{{ record?.id }}
|
||||
</p>
|
||||
<p v-if="record?.name">
|
||||
<strong>Nama:</strong>
|
||||
{{ record.name }}
|
||||
</p>
|
||||
<p v-if="record?.code">
|
||||
<strong>Kode:</strong>
|
||||
{{ record.code }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</RecordConfirmation>
|
||||
</template>
|
||||
@@ -0,0 +1,193 @@
|
||||
<script setup lang="ts">
|
||||
// Components
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import AppMedicineFormList from '~/components/app/medicine-form/list.vue'
|
||||
import AppMedicineFormEntryForm from '~/components/app/medicine-form/entry-form.vue'
|
||||
|
||||
// Helpers
|
||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
|
||||
// Types
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import { BaseSchema, type BaseFormData } from '~/schemas/base.schema'
|
||||
|
||||
// Handlers
|
||||
import {
|
||||
recId,
|
||||
recAction,
|
||||
recItem,
|
||||
isReadonly,
|
||||
isProcessing,
|
||||
isFormEntryDialogOpen,
|
||||
isRecordConfirmationOpen,
|
||||
onResetState,
|
||||
handleActionSave,
|
||||
handleActionEdit,
|
||||
handleActionRemove,
|
||||
handleCancelForm,
|
||||
} from '~/handlers/medicine-form.handler'
|
||||
|
||||
// Services
|
||||
import { getList, getDetail } from '~/services/medicine-form.service'
|
||||
|
||||
const title = ref('')
|
||||
|
||||
const {
|
||||
data,
|
||||
isLoading,
|
||||
paginationMeta,
|
||||
searchInput,
|
||||
handlePageChange,
|
||||
handleSearch,
|
||||
fetchData: getMedicineFormList,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getList({
|
||||
search: params.search,
|
||||
sort: 'createdAt:asc',
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'medicine-form',
|
||||
})
|
||||
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: 'Sediaan Obat',
|
||||
icon: 'i-lucide-medicine-bottle',
|
||||
refSearchNav: {
|
||||
placeholder: 'Cari (min. 3 karakter)...',
|
||||
minLength: 3,
|
||||
debounceMs: 500,
|
||||
showValidationFeedback: true,
|
||||
onInput: (value: string) => {
|
||||
searchInput.value = value
|
||||
},
|
||||
onClick: () => {},
|
||||
onClear: () => {},
|
||||
},
|
||||
addNav: {
|
||||
label: 'Tambah',
|
||||
icon: 'i-lucide-plus',
|
||||
onClick: () => {
|
||||
recItem.value = null
|
||||
recId.value = 0
|
||||
isFormEntryDialogOpen.value = true
|
||||
isReadonly.value = false
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
const getCurrentMedicineFormDetail = async (id: number | string) => {
|
||||
const result = await getDetail(id)
|
||||
if (result.success) {
|
||||
const currentValue = result.body?.data || {}
|
||||
recItem.value = currentValue
|
||||
isFormEntryDialogOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
// Watch for row actions when recId or recAction changes
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
getCurrentMedicineFormDetail(recId.value)
|
||||
title.value = 'Detail Sediaan Obat'
|
||||
isReadonly.value = true
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
getCurrentMedicineFormDetail(recId.value)
|
||||
title.value = 'Edit Sediaan Obat'
|
||||
isFormEntryDialogOpen.value = true
|
||||
isReadonly.value = false
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isRecordConfirmationOpen.value = true
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await getMedicineFormList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Header
|
||||
v-model="searchInput"
|
||||
:prep="headerPrep"
|
||||
:ref-search-nav="headerPrep.refSearchNav"
|
||||
@search="handleSearch"
|
||||
/>
|
||||
|
||||
<AppMedicineFormList
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"
|
||||
/>
|
||||
|
||||
<Dialog
|
||||
v-model:open="isFormEntryDialogOpen"
|
||||
:title="!!recItem ? title : 'Tambah Sediaan Obat'"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
@update:open="
|
||||
(value: any) => {
|
||||
onResetState()
|
||||
isFormEntryDialogOpen = value
|
||||
}
|
||||
"
|
||||
>
|
||||
<AppMedicineFormEntryForm
|
||||
:schema="BaseSchema"
|
||||
:values="recItem"
|
||||
:is-loading="isProcessing"
|
||||
:is-readonly="isReadonly"
|
||||
@submit="
|
||||
(values: BaseFormData | Record<string, any>, resetForm: () => void) => {
|
||||
if (recId > 0) {
|
||||
handleActionEdit(recItem.code, values, getMedicineFormList, resetForm, toast)
|
||||
return
|
||||
}
|
||||
handleActionSave(values, getMedicineFormList, resetForm, toast)
|
||||
}
|
||||
"
|
||||
@cancel="handleCancelForm"
|
||||
/>
|
||||
</Dialog>
|
||||
|
||||
<!-- Record Confirmation Modal -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recItem.code, getMedicineFormList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
<p>
|
||||
<strong>ID:</strong>
|
||||
{{ record?.id }}
|
||||
</p>
|
||||
<p v-if="record?.name">
|
||||
<strong>Nama:</strong>
|
||||
{{ record.name }}
|
||||
</p>
|
||||
<p v-if="record?.code">
|
||||
<strong>Kode:</strong>
|
||||
{{ record.code }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</RecordConfirmation>
|
||||
</template>
|
||||
@@ -108,6 +108,7 @@ watch([recId, recAction], () => {
|
||||
getCurrentMedicineGroupDetail(recId.value)
|
||||
title.value = 'Edit Kelompok Obat'
|
||||
isReadonly.value = false
|
||||
isFormEntryDialogOpen.value = true
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isRecordConfirmationOpen.value = true
|
||||
@@ -154,7 +155,7 @@ onMounted(async () => {
|
||||
@submit="
|
||||
(values: BaseFormData | Record<string, any>, resetForm: () => void) => {
|
||||
if (recId > 0) {
|
||||
handleActionEdit(recId, values, getMedicineGroupList, resetForm, toast)
|
||||
handleActionEdit(recItem.code, values, getMedicineGroupList, resetForm, toast)
|
||||
return
|
||||
}
|
||||
handleActionSave(values, getMedicineGroupList, resetForm, toast)
|
||||
@@ -169,7 +170,7 @@ onMounted(async () => {
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getMedicineGroupList, toast)"
|
||||
@confirm="() => handleActionRemove(recItem.code, getMedicineGroupList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
|
||||
@@ -108,6 +108,7 @@ watch([recId, recAction], () => {
|
||||
getCurrentMedicineMethodDetail(recId.value)
|
||||
title.value = 'Edit Metode Obat'
|
||||
isReadonly.value = false
|
||||
isFormEntryDialogOpen.value = true
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isRecordConfirmationOpen.value = true
|
||||
@@ -154,7 +155,7 @@ onMounted(async () => {
|
||||
@submit="
|
||||
(values: BaseFormData | Record<string, any>, resetForm: () => void) => {
|
||||
if (recId > 0) {
|
||||
handleActionEdit(recId, values, getMedicineMethodList, resetForm, toast)
|
||||
handleActionEdit(recItem.code, values, getMedicineMethodList, resetForm, toast)
|
||||
return
|
||||
}
|
||||
handleActionSave(values, getMedicineMethodList, resetForm, toast)
|
||||
@@ -169,7 +170,7 @@ onMounted(async () => {
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getMedicineMethodList, toast)"
|
||||
@confirm="() => handleActionRemove(recItem.code, getMedicineMethodList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
|
||||
@@ -37,10 +37,12 @@ import {
|
||||
import { getList, getDetail } from '~/services/medicine.service'
|
||||
import { getValueLabelList as getMedicineGroupList } from '~/services/medicine-group.service'
|
||||
import { getValueLabelList as getMedicineMethodList } from '~/services/medicine-method.service'
|
||||
import { getValueLabelList as getMedicineFormList } from '~/services/medicine-form.service'
|
||||
import { getValueLabelList as getUomList } from '~/services/uom.service'
|
||||
|
||||
const medicineGroups = ref<{ value: string; label: string }[]>([])
|
||||
const medicineMethods = ref<{ value: string; label: string }[]>([])
|
||||
const medicineForms = ref<{ value: string; label: string }[]>([])
|
||||
const uoms = ref<{ value: string; label: string }[]>([])
|
||||
const title = ref('')
|
||||
|
||||
@@ -59,7 +61,7 @@ const {
|
||||
sort: 'createdAt:asc',
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
includes: 'medicineGroup,medicineMethod,uom',
|
||||
includes: 'medicineGroup,medicineMethod,medicineForm,uom',
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
@@ -116,6 +118,7 @@ watch([recId, recAction], () => {
|
||||
case ActionEvents.showEdit:
|
||||
getCurrentMedicineDetail(recId.value)
|
||||
title.value = 'Edit Obat'
|
||||
isFormEntryDialogOpen.value = true
|
||||
isReadonly.value = false
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
@@ -127,6 +130,7 @@ watch([recId, recAction], () => {
|
||||
onMounted(async () => {
|
||||
medicineGroups.value = await getMedicineGroupList({ sort: 'createdAt:asc', 'page-size': 100 })
|
||||
medicineMethods.value = await getMedicineMethodList({ sort: 'createdAt:asc', 'page-size': 100 })
|
||||
medicineForms.value = await getMedicineFormList({ sort: 'createdAt:asc', 'page-size': 100 })
|
||||
uoms.value = await getUomList({ sort: 'createdAt:asc', 'page-size': 100 })
|
||||
await getMedicineList()
|
||||
})
|
||||
@@ -163,13 +167,14 @@ onMounted(async () => {
|
||||
:values="recItem"
|
||||
:medicineGroups="medicineGroups"
|
||||
:medicineMethods="medicineMethods"
|
||||
:medicineForms="medicineForms"
|
||||
:uoms="uoms"
|
||||
:is-loading="isProcessing"
|
||||
:is-readonly="isReadonly"
|
||||
@submit="
|
||||
(values: MedicineFormData | Record<string, any>, resetForm: () => void) => {
|
||||
if (recId > 0) {
|
||||
handleActionEdit(recId, values, getMedicineList, resetForm, toast)
|
||||
handleActionEdit(recItem.code, values, getMedicineList, resetForm, toast)
|
||||
return
|
||||
}
|
||||
handleActionSave(values, getMedicineList, resetForm, toast)
|
||||
@@ -184,7 +189,7 @@ onMounted(async () => {
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getMedicineList, toast)"
|
||||
@confirm="() => handleActionRemove(recItem.code, getMedicineList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
|
||||
@@ -1,86 +1,215 @@
|
||||
<script setup lang="ts">
|
||||
import { type HeaderPrep, ActionEvents } from '~/components/pub/my-ui/data/types'
|
||||
import Nav from '~/components/pub/my-ui/nav-footer/ba-de-su.vue'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import * as DE from '~/components/pub/my-ui/doc-entry'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
|
||||
import { useQueryCRUDMode } from '~/composables/useQueryCRUD'
|
||||
import type { HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
|
||||
// Medicine
|
||||
import { type Medicine } from '~/models/medicine'
|
||||
import { getList as getMedicineList } from '~/services/medicine.service'
|
||||
|
||||
// Prescription
|
||||
import { getDetail } from '~/services/prescription.service'
|
||||
import Detail from '~/components/app/prescription/detail.vue'
|
||||
import { getList as getPrescriptionItemList } from '~/services/prescription-item.service'
|
||||
import ItemListEntry from '~/components/app/prescription-item/list-entry.vue'
|
||||
import { type PrescriptionItem } from '~/models/prescription-item'
|
||||
|
||||
import MixItemEntry from '~/components/app/prescription-item/mix-entry.vue'
|
||||
import { create } from '~/services/prescription-item.service';
|
||||
|
||||
import NonMixItemEntry from '~/components/app/prescription-item/non-mix-entry.vue'
|
||||
// import Detail from '~/components/app/prescription/detail.vue'
|
||||
import Entry from '~/components/app/prescription/entry.vue'
|
||||
import { remove, submit } from '~/services/prescription.service'
|
||||
|
||||
// Prescription items
|
||||
import {
|
||||
getList as getItemList,
|
||||
create as createItem,
|
||||
update as updateItem,
|
||||
} from '~/services/prescription-item.service'
|
||||
import {
|
||||
recId,
|
||||
recAction,
|
||||
recItem,
|
||||
isRecordConfirmationOpen,
|
||||
handleActionRemove,
|
||||
} from '~/handlers/prescription-item.handler'
|
||||
|
||||
// props
|
||||
import { type PrescriptionItem, genPrescriptionItem } from '~/models/prescription-item'
|
||||
import { type MedicinemixItem } from '~/models/medicinemix-item';
|
||||
import ItemListEntry from '~/components/app/prescription-item/list-entry.vue'
|
||||
import NonMixItemEntry from '~/components/app/prescription-item/non-mix-entry.vue'
|
||||
import MixItemEntry from '~/components/app/prescription-item/mix-entry.vue'
|
||||
|
||||
// Props
|
||||
const props = defineProps<{
|
||||
encounter_id: number
|
||||
}>()
|
||||
|
||||
// declaration & flows
|
||||
// const route = useRoute()
|
||||
const { getQueryParam } = useQueryParam()
|
||||
const id = getQueryParam('id')
|
||||
const dataRes = await getDetail(
|
||||
typeof id === 'string' ? parseInt(id) : 0,
|
||||
{ includes: 'encounter,doctor,doctor-employee,doctor-employee-person' }
|
||||
)
|
||||
const data = dataRes.body?.data || null
|
||||
const items = ref(data?.items || [])
|
||||
// Prescriptions
|
||||
const isSubmitConfirmationOpen = ref(false)
|
||||
const isDeleteConfirmationOpen = ref(false)
|
||||
|
||||
// Prescription Items
|
||||
const isItemDetailDialogOpen = ref(false)
|
||||
|
||||
// Prescription
|
||||
const { getQueryParam } = useQueryParam()
|
||||
const rawId = getQueryParam('id')
|
||||
const id = typeof rawId === 'string' ? parseInt(rawId) : 0
|
||||
const dataRes = await getDetail(id, { includes: 'encounter,doctor,doctor-employee,doctor-employee-person' })
|
||||
const data = ref(dataRes.body?.data || null)
|
||||
|
||||
// Prescription Items
|
||||
const getItemsOpt = { 'prescription-id': id, includes: 'medicine,medicine-medicineForm,medicineMix' }
|
||||
const {
|
||||
data: prescriptionItems,
|
||||
fetchData: getMyList,
|
||||
} = usePaginatedList<PrescriptionItem> ({
|
||||
fetchFn: async ({ page, search }) => {
|
||||
const result = await getPrescriptionItemList({ 'prescription-id': id, search, page })
|
||||
if (result.success) {
|
||||
data.value = result.body.data
|
||||
}
|
||||
data: items,
|
||||
isLoading,
|
||||
fetchData: getPrescriptionItems,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getItemList({
|
||||
...getItemsOpt,
|
||||
search: params.search,
|
||||
sort: 'createdAt:asc',
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'prescription-item',
|
||||
entityName: 'division',
|
||||
})
|
||||
|
||||
|
||||
// const items = ref<PrescriptionItem[]>([])
|
||||
const mixItem = ref<PrescriptionItem>(genPrescriptionItem())
|
||||
const medicinemixItems = ref<MedicinemixItem[]>([])
|
||||
const nonMixItem = ref<PrescriptionItem>(genPrescriptionItem())
|
||||
|
||||
mixItem.value.prescription_id = id
|
||||
nonMixItem.value.prescription_id = id
|
||||
|
||||
const { backToList } = useQueryCRUDMode()
|
||||
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: 'Tambah Order Obat / Resep',
|
||||
title: 'Pembuatan Order Obat / Resep',
|
||||
icon: 'i-lucide-box',
|
||||
}
|
||||
|
||||
const mixDialogOpen = ref(false)
|
||||
const nonMixDialogOpen = ref(false)
|
||||
const mixDialogOpenStatus = ref(false)
|
||||
const nonMixDialogOpenStatus = ref(false)
|
||||
const medicines = ref<Medicine[]>([])
|
||||
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
watch([recId, recAction], () => {
|
||||
let item: PrescriptionItem | null
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
item = pickItem()
|
||||
if (item) {
|
||||
isItemDetailDialogOpen.value = true
|
||||
}
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
item = pickItem()
|
||||
if (item) {
|
||||
if(item.isMix) {
|
||||
mixDialogOpenStatus.value = true
|
||||
} else {
|
||||
nonMixDialogOpenStatus.value = true
|
||||
}
|
||||
getMedicines('', item.medicine_code)
|
||||
}
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isRecordConfirmationOpen.value = true
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await getPrescriptionItems()
|
||||
})
|
||||
|
||||
function navClick(type: 'back' | 'delete' | 'draft' | 'submit') {
|
||||
if (type === 'back') {
|
||||
backToList()
|
||||
} else if (type === 'delete') {
|
||||
isDeleteConfirmationOpen.value = true
|
||||
} else if (type === 'submit') {
|
||||
isSubmitConfirmationOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
async function removePrescription() {
|
||||
const res = await remove(id)
|
||||
if (res.success) {
|
||||
backToList()
|
||||
}
|
||||
// handleActionRemove(recId.value, getItems, toast)
|
||||
}
|
||||
|
||||
async function submitPrescription() {
|
||||
const res = await submit(id)
|
||||
if (res.success) {
|
||||
backToList()
|
||||
}
|
||||
// handleActionRemove(recId.value, getItems, toast)
|
||||
}
|
||||
|
||||
function addItem(mode: 'mix' | 'non-mix') {
|
||||
if (mode === 'mix') {
|
||||
mixDialogOpen.value = true
|
||||
mixDialogOpenStatus.value = true
|
||||
} else if (mode === 'non-mix') {
|
||||
nonMixDialogOpen.value = true
|
||||
nonMixDialogOpenStatus.value = true
|
||||
}
|
||||
}
|
||||
|
||||
function saveMix() {
|
||||
create({data})
|
||||
async function saveMix() {
|
||||
const res = await createItem(mixItem.value)
|
||||
if (res.success) {
|
||||
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
||||
getPrescriptionItems()
|
||||
mixDialogOpenStatus.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function saveNonMix(data: PrescriptionItem) {
|
||||
create({data})
|
||||
async function saveNonMix() {
|
||||
let res: any;
|
||||
if(!nonMixItem.value.id) {
|
||||
res = await createItem(nonMixItem.value)
|
||||
} else {
|
||||
res = await updateItem(nonMixItem.value.id, nonMixItem.value)
|
||||
}
|
||||
if (res.success) {
|
||||
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
||||
getPrescriptionItems()
|
||||
nonMixDialogOpenStatus.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function getMedicines(value: string, code?: string) {
|
||||
const res = await getMedicineList({ 'search': value, 'includes': 'medicineForm', 'code': code })
|
||||
if (res.success) {
|
||||
medicines.value = res.body.data
|
||||
} else {
|
||||
medicines.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function pickItem(): PrescriptionItem | null {
|
||||
const item = items.value.find(item => item.id === recId.value)
|
||||
if (!item) {
|
||||
return null
|
||||
}
|
||||
if(item.isMix) {
|
||||
mixItem.value = item
|
||||
} else {
|
||||
nonMixItem.value = item
|
||||
}
|
||||
return item
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -91,42 +220,147 @@ function saveNonMix(data: PrescriptionItem) {
|
||||
class="mb-4 xl:mb-5"
|
||||
/>
|
||||
|
||||
<Detail :data="data" />
|
||||
<Entry :data="data" />
|
||||
|
||||
<!-- <div class="mb-8">
|
||||
<Button>
|
||||
<Icon name="i-lucide-check" />
|
||||
Simpan
|
||||
</Button>
|
||||
</div> -->
|
||||
|
||||
<ItemListEntry
|
||||
:data="prescriptionItems"
|
||||
:data="items"
|
||||
@add="addItem"/>
|
||||
|
||||
<Separator class="my-5" />
|
||||
|
||||
<div class="w-full flex justify-center">
|
||||
<Nav @click="navClick" />
|
||||
</div>
|
||||
|
||||
<!-- Confirm delete -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isDeleteConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="removePrescription()"
|
||||
/>
|
||||
|
||||
<!-- Confirm submit -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isSubmitConfirmationOpen"
|
||||
action="delete"
|
||||
customTitle="Ajukan Resep"
|
||||
customMessage="Proses akan mengajukan resep ini untuk diproses lebih lanjut. Lanjutkan?"
|
||||
customConfirmText="Ajukan"
|
||||
:record="recItem"
|
||||
@confirm="submitPrescription"
|
||||
@cancel=""
|
||||
/>
|
||||
|
||||
<!-- Mix form -->
|
||||
<Dialog
|
||||
v-model:open="mixDialogOpen"
|
||||
:title="recItem?.id ? 'Edit Racikan' : 'Tambah Racikan'"
|
||||
size="xl"
|
||||
v-model:open="mixDialogOpenStatus"
|
||||
title="Pembuatan Racikan"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
>
|
||||
<MixItemEntry
|
||||
:data="data"
|
||||
:items="items"
|
||||
@close="mixDialogOpen = false"
|
||||
:data="mixItem"
|
||||
:items="medicinemixItems"
|
||||
:medicines="medicines"
|
||||
@close="mixDialogOpenStatus = false"
|
||||
@save="saveMix"
|
||||
@update:searchText="getMedicines"
|
||||
/>
|
||||
</Dialog>
|
||||
|
||||
<!-- Non mix form -->
|
||||
<Dialog
|
||||
v-model:open="nonMixDialogOpen"
|
||||
:title="recItem?.id ? 'Edit Non Racikan' : 'Tambah Non Racikan'"
|
||||
size="xl"
|
||||
v-model:open="nonMixDialogOpenStatus"
|
||||
title="Pembuatan Non Racikan"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
>
|
||||
<NonMixItemEntry
|
||||
:data="data"
|
||||
:items="items"
|
||||
@close="mixDialogOpen = false"
|
||||
:data="nonMixItem"
|
||||
:medicines="medicines"
|
||||
@close="mixDialogOpenStatus = false"
|
||||
@save="saveNonMix"
|
||||
@update:searchText="getMedicines"
|
||||
/>
|
||||
</Dialog>
|
||||
|
||||
<!-- Detail item -->
|
||||
<Dialog
|
||||
v-model:open="isItemDetailDialogOpen"
|
||||
title="Detail Obat"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
>
|
||||
<DE.Block mode="preview" label-size="small">
|
||||
<DE.Cell>
|
||||
<DE.Label>Nama</DE.Label>
|
||||
<DE.Colon />
|
||||
<DE.Field>
|
||||
{{ recItem.medicine.name }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell>
|
||||
<DE.Label>Dosis</DE.Label>
|
||||
<DE.Colon />
|
||||
<DE.Field>
|
||||
{{ recItem.dose }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell>
|
||||
<DE.Label>Sediaan</DE.Label>
|
||||
<DE.Colon />
|
||||
<DE.Field>
|
||||
{{ recItem.medicine.medicineForm.name }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell>
|
||||
<DE.Label>Jumlah</DE.Label>
|
||||
<DE.Colon />
|
||||
<DE.Field>
|
||||
{{ recItem.quantity }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
<DE.Cell>
|
||||
<DE.Label>Cara Pakai</DE.Label>
|
||||
<DE.Colon />
|
||||
<DE.Field>
|
||||
{{ recItem.Usage }}
|
||||
</DE.Field>
|
||||
</DE.Cell>
|
||||
</DE.Block>
|
||||
</Dialog>
|
||||
|
||||
<!-- Confirm delete items -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getPrescriptionItems, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
<p>
|
||||
<strong>ID:</strong>
|
||||
{{ record?.id }}
|
||||
</p>
|
||||
<p v-if="record?.name">
|
||||
<strong>Nama:</strong>
|
||||
{{ record.name }}
|
||||
</p>
|
||||
<p v-if="record?.code">
|
||||
<strong>Kode:</strong>
|
||||
{{ record.code }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</RecordConfirmation>
|
||||
</template>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
// Composables
|
||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||
|
||||
// Pubs component
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import { type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
|
||||
@@ -12,7 +14,6 @@ import {
|
||||
recAction,
|
||||
recItem,
|
||||
isReadonly,
|
||||
isFormEntryDialogOpen,
|
||||
isRecordConfirmationOpen,
|
||||
handleActionRemove,
|
||||
handleActionSave,
|
||||
@@ -20,17 +21,17 @@ import {
|
||||
|
||||
// Services
|
||||
import { getList, getDetail } from '~/services/prescription.service'
|
||||
import List from '~/components/app/prescription/list.vue'
|
||||
import FlatList from '~/components/app/prescription/flat-list.vue'
|
||||
import Grouped from '~/components/app/prescription/grouped-list.vue'
|
||||
import type { Prescription } from '~/models/prescription'
|
||||
|
||||
const props = defineProps<{
|
||||
encounter_id: number
|
||||
}>()
|
||||
import { submit } from '~/services/prescription.service'
|
||||
import type { ToastFn } from '~/handlers/_handler'
|
||||
|
||||
const route = useRoute()
|
||||
const { setQueryParams } = useQueryParam()
|
||||
|
||||
const title = ref('')
|
||||
const isSubmitConfirmationOpen = ref(false)
|
||||
|
||||
const plainEid = route.params.id
|
||||
const encounter_id = (plainEid && typeof plainEid == 'string') ? parseInt(plainEid) : 0
|
||||
@@ -42,21 +43,40 @@ const {
|
||||
searchInput,
|
||||
fetchData: getMyList,
|
||||
} = usePaginatedList<Prescription>({
|
||||
fetchFn: async ({ page, search }) => {
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getList({
|
||||
search,
|
||||
page,
|
||||
'encounter-id': encounter_id,
|
||||
includes: 'doctor,doctor-employee,doctor-employee-person',
|
||||
includes: 'doctor,doctor-employee,doctor-employee-person,items,items-medicine,items-medicine-medicineForm',
|
||||
search: params.search,
|
||||
page: params.page,
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'prescription'
|
||||
})
|
||||
|
||||
function updateProvidedVal(val: boolean) {
|
||||
flatMode.value = val
|
||||
}
|
||||
const flatMode = ref(false)
|
||||
const flatModeLabel = ref('Mode Flat: Tidak')
|
||||
provide('flatMode', { flatMode, updateProvidedVal })
|
||||
watch(flatMode, (newVal) => {
|
||||
flatModeLabel.value = newVal ? 'Mode Flat: Ya' : 'Mode Flat: Tidak'
|
||||
})
|
||||
|
||||
const vFn = () => {} // Void function
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: 'Order Obat',
|
||||
icon: 'i-lucide-box',
|
||||
components: [
|
||||
{
|
||||
component: defineAsyncComponent(() => import('~/components/pub/my-ui/toggle/provided-toggle.vue')),
|
||||
props: { variant: 'outline', label: flatModeLabel, providedKey: 'flatMode' }
|
||||
},
|
||||
],
|
||||
refSearchNav: {
|
||||
placeholder: 'Cari (min. 3 karakter)...',
|
||||
minLength: 3,
|
||||
@@ -71,11 +91,17 @@ const headerPrep: HeaderPrep = {
|
||||
addNav: {
|
||||
label: 'Tambah',
|
||||
icon: 'i-lucide-plus',
|
||||
onClick: () => {
|
||||
onClick: async () => {
|
||||
recItem.value = null
|
||||
recId.value = 0
|
||||
isFormEntryDialogOpen.value = true
|
||||
isReadonly.value = false
|
||||
const saveResp = await handleActionSave({ encounter_id }, vFn, vFn, vFn)
|
||||
if (saveResp.success) {
|
||||
setQueryParams({
|
||||
'mode': 'entry',
|
||||
'id': saveResp.body?.data?.id.toString()
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -85,53 +111,13 @@ provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
const getMyDetail = async (id: number | string) => {
|
||||
const result = await getDetail(id)
|
||||
if (result.success) {
|
||||
const currentValue = result.body?.data || {}
|
||||
recItem.value = currentValue
|
||||
isFormEntryDialogOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
// Watch for row actions when recId or recAction changes
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
getMyDetail(recId.value)
|
||||
title.value = 'Detail Konsultasi'
|
||||
isReadonly.value = true
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
getMyDetail(recId.value)
|
||||
title.value = 'Edit Konsultasi'
|
||||
isReadonly.value = false
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
break
|
||||
}
|
||||
})
|
||||
|
||||
watch([isFormEntryDialogOpen], async () => {
|
||||
if (isFormEntryDialogOpen.value) {
|
||||
isFormEntryDialogOpen.value = false;
|
||||
const saveResp = await handleActionSave({ encounter_id }, getMyList, () =>{}, toast)
|
||||
if (saveResp.success) {
|
||||
setQueryParams({
|
||||
'mode': 'entry',
|
||||
'id': saveResp.body?.data?.id.toString()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function cancel(data: Prescription) {
|
||||
function confirmCancel(data: Prescription) {
|
||||
recId.value = data.id
|
||||
recItem.value = data
|
||||
isRecordConfirmationOpen.value = true
|
||||
}
|
||||
|
||||
function edit(data: Prescription) {
|
||||
function goToEdit(data: Prescription) {
|
||||
setQueryParams({
|
||||
'mode': 'entry',
|
||||
'id': data.id.toString()
|
||||
@@ -139,21 +125,45 @@ function edit(data: Prescription) {
|
||||
recItem.value = data
|
||||
}
|
||||
|
||||
function submit(data: Prescription) {
|
||||
function confirmSubmit(data: Prescription) {
|
||||
recId.value = data.id
|
||||
recItem.value = data
|
||||
isSubmitConfirmationOpen.value = true
|
||||
}
|
||||
|
||||
async function handleActionSubmit(id: number, refresh: () => void, toast: ToastFn) {
|
||||
const result = await submit(id)
|
||||
if (result.success) {
|
||||
toast({ title: 'Berhasil', description: 'Resep telah di ajukan', variant: 'default' })
|
||||
setTimeout(refresh, 300)
|
||||
} else {
|
||||
toast({ title: 'Gagal', description: 'Gagal menjalankan perintah', variant: 'destructive' })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Header :prep="{ ...headerPrep }" />
|
||||
<List
|
||||
v-if="!isLoading.dataListLoading"
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@cancel="cancel"
|
||||
@edit="edit"
|
||||
@submit="submit"
|
||||
/>
|
||||
<template v-if="!flatMode">
|
||||
<Grouped
|
||||
v-if="!isLoading.dataListLoading"
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@cancel="confirmCancel"
|
||||
@edit="goToEdit"
|
||||
@submit="confirmSubmit"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<FlatList
|
||||
v-if="!isLoading.dataListLoading"
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@cancel="confirmCancel"
|
||||
@edit="goToEdit"
|
||||
@submit="confirmSubmit"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<RecordConfirmation
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
@@ -162,5 +172,37 @@ function submit(data: Prescription) {
|
||||
@confirm="() => handleActionRemove(recId, getMyList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<div class="flex mb-2">
|
||||
<div class="w-20">Tanggal</div>
|
||||
<div class="w-4">:</div>
|
||||
<div class="">{{ recItem.createdAt.substring(0, 10) }}</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="w-20">DPJP</div>
|
||||
<div class="w-4">:</div>
|
||||
<div class="">{{ recItem.doctor?.employee?.person?.name }}</div>
|
||||
</div>
|
||||
</RecordConfirmation>
|
||||
|
||||
<RecordConfirmation
|
||||
v-model:open="isSubmitConfirmationOpen"
|
||||
action="delete"
|
||||
customTitle="Ajukan Resep"
|
||||
customMessage="Proses akan mengajukan resep ini untuk diproses lebih lanjut. Lanjutkan?"
|
||||
customConfirmText="Ajukan"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionSubmit(recId, getMyList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<div class="flex mb-2">
|
||||
<div class="w-20">Tanggal</div>
|
||||
<div class="w-4">:</div>
|
||||
<div class="">{{ recItem.createdAt.substring(0, 10) }}</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="w-20">DPJP</div>
|
||||
<div class="w-4">:</div>
|
||||
<div class="">{{ recItem.doctor?.employee?.person?.name }}</div>
|
||||
</div>
|
||||
</RecordConfirmation>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
<script setup lang="ts">
|
||||
import type { ExposedForm } from '~/types/form';
|
||||
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
|
||||
import { ResumeSchema } from '~/schemas/resume.schema';
|
||||
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
|
||||
import { CalendarDate, DateFormatter, getLocalTimeZone } from '@internationalized/date';
|
||||
import type { DateRange } from 'radix-vue';
|
||||
import { getPatients } from '~/services/patient.service';
|
||||
import ActionHistoryDialog from '~/components/app/resume/history-list/action-history-dialog.vue';
|
||||
import ConsultationHistoryDialog from '~/components/app/resume/history-list/consultation-history-dialog.vue';
|
||||
import SupportingHistoryDialog from '~/components/app/resume/history-list/supporting-history-dialog.vue';
|
||||
import FarmacyHistoryDialog from '~/components/app/resume/history-list/farmacy-history-dialog.vue';
|
||||
import NationalProgramHistoryDialog from '~/components/app/resume/history-list/national-program-history-dialog.vue';
|
||||
|
||||
// #region Props & Emits
|
||||
const props = defineProps<{
|
||||
callbackUrl?: string
|
||||
}>()
|
||||
|
||||
// form related state
|
||||
const personPatientForm = ref<ExposedForm<any> | null>(null)
|
||||
const actionHistoryData = usePaginatedList({
|
||||
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
|
||||
entityName: 'patient',
|
||||
})
|
||||
const consultationHistoryData = usePaginatedList({
|
||||
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
|
||||
entityName: 'patient',
|
||||
})
|
||||
const supportingHistoryData = usePaginatedList({
|
||||
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
|
||||
entityName: 'patient',
|
||||
})
|
||||
const farmacyHistoryData = usePaginatedList({
|
||||
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
|
||||
entityName: 'patient',
|
||||
})
|
||||
const nationalProgramServiceHistoryData = usePaginatedList({
|
||||
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
|
||||
entityName: 'patient',
|
||||
})
|
||||
// #endregion
|
||||
|
||||
// #region State & Computed
|
||||
const router = useRouter()
|
||||
const isConfirmationOpen = ref(false)
|
||||
const isActionHistoryOpen = ref<boolean>(false)
|
||||
const isConsultationHistoryOpen = ref<boolean>(false)
|
||||
const isSupportingHistoryOpen = ref<boolean>(false)
|
||||
const isFarmacyHistoryOpen = ref<boolean>(false)
|
||||
const isNationalProgramServiceHistoryOpen = ref<boolean>(false)
|
||||
|
||||
provide(`isActionHistoryOpen`, isActionHistoryOpen)
|
||||
provide(`isConsultationHistoryOpen`, isConsultationHistoryOpen)
|
||||
provide(`isSupportingHistoryOpen`, isSupportingHistoryOpen)
|
||||
provide(`isFarmacyHistoryOpen`, isFarmacyHistoryOpen)
|
||||
provide(`isNationalProgramServiceHistoryOpen`, isNationalProgramServiceHistoryOpen)
|
||||
|
||||
const defaultDate = {
|
||||
start: new CalendarDate(2022, 1, 20),
|
||||
end: new CalendarDate(2022, 1, 20).add({ days: 20 }),
|
||||
}
|
||||
|
||||
const actionHistoryDateValue = ref(defaultDate) as Ref<DateRange>
|
||||
const consultationHistoryDateValue = ref(defaultDate) as Ref<DateRange>
|
||||
const supportingHistoryDateValue = ref(defaultDate) as Ref<DateRange>
|
||||
const farmacyHistoryDateValue = ref(defaultDate) as Ref<DateRange>
|
||||
const nationalProgramServiceSearch = ref<string>('')
|
||||
const nationalProgramServiceSelectedStatus = ref<string>('all')
|
||||
// #endregion
|
||||
|
||||
// #region Lifecycle Hooks
|
||||
onMounted(() => {
|
||||
|
||||
})
|
||||
// #endregion
|
||||
|
||||
// #region Functions
|
||||
function goBack() {
|
||||
router.go(-1)
|
||||
}
|
||||
|
||||
async function handleConfirmAdd() {
|
||||
// handleActionClick('submit')
|
||||
console.log(`tersubmit wak`)
|
||||
}
|
||||
|
||||
function handleCancelAdd() {
|
||||
isConfirmationOpen.value = false
|
||||
}
|
||||
// #endregion region
|
||||
|
||||
// #region Utilities & event handlers
|
||||
async function handleActionClick(eventType: string) {
|
||||
if (eventType === 'submit') {
|
||||
isConfirmationOpen.value = true
|
||||
// const patient: Patient = await composeFormData()
|
||||
// let createdPatientId = 0
|
||||
|
||||
// const response = await handleActionSave(
|
||||
// patient,
|
||||
// () => {},
|
||||
// () => {},
|
||||
// toast,
|
||||
// )
|
||||
|
||||
// const data = (response?.body?.data ?? null) as PatientBase | null
|
||||
// if (!data) return
|
||||
// createdPatientId = data.id
|
||||
|
||||
// If has callback provided redirect to callback with patientData
|
||||
// if (props.callbackUrl) {
|
||||
// await navigateTo(props.callbackUrl + '?patient-id=' + patient.id)
|
||||
// return
|
||||
// }
|
||||
|
||||
// Navigate to patient list or show success message
|
||||
// await navigateTo('/outpatient/encounter')
|
||||
// return
|
||||
}
|
||||
|
||||
if (eventType === 'back') {
|
||||
if (props.callbackUrl) {
|
||||
await navigateTo(props.callbackUrl)
|
||||
return
|
||||
}
|
||||
|
||||
goBack()
|
||||
// handleCancelForm()
|
||||
}
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Watchers
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg font-semibold xl:text-xl">Tambah Resume</div>
|
||||
<AppResumeAdd
|
||||
ref="personPatientForm"
|
||||
:schema="ResumeSchema"
|
||||
:resume-arrangement-type="personPatientForm?.values.arrangement"/>
|
||||
|
||||
<div class="my-2 flex justify-end py-2">
|
||||
<Action :enable-draft="false"
|
||||
@click="handleActionClick"/>
|
||||
</div>
|
||||
|
||||
<Confirmation
|
||||
v-model:open="isConfirmationOpen"
|
||||
title="Simpan Data"
|
||||
message="Apakah Anda yakin ingin menyimpan data ini?"
|
||||
confirm-text="Simpan"
|
||||
@confirm="handleConfirmAdd"
|
||||
@cancel="handleCancelAdd"
|
||||
/>
|
||||
|
||||
<ActionHistoryDialog
|
||||
v-model:is-modal-open="isActionHistoryOpen"
|
||||
v-model:date-value="actionHistoryDateValue"
|
||||
:data="actionHistoryData.data.value"
|
||||
:pagination-meta="actionHistoryData.paginationMeta"
|
||||
@page-change="actionHistoryData.handlePageChange"
|
||||
/>
|
||||
|
||||
<p v-if="isConsultationHistoryOpen === true">aaaaaaaaaaaaaaa</p>
|
||||
<ConsultationHistoryDialog
|
||||
v-model:is-modal-open="isConsultationHistoryOpen"
|
||||
v-model:date-value="consultationHistoryDateValue"
|
||||
:data="consultationHistoryData.data.value"
|
||||
:pagination-meta="consultationHistoryData.paginationMeta"
|
||||
@page-change="consultationHistoryData.handlePageChange"
|
||||
/>
|
||||
|
||||
<SupportingHistoryDialog
|
||||
v-model:is-modal-open="isSupportingHistoryOpen"
|
||||
v-model:date-value="supportingHistoryDateValue"
|
||||
:data="supportingHistoryData.data.value"
|
||||
:pagination-meta="supportingHistoryData.paginationMeta"
|
||||
@page-change="supportingHistoryData.handlePageChange"
|
||||
/>
|
||||
|
||||
<FarmacyHistoryDialog
|
||||
v-model:is-modal-open="isFarmacyHistoryOpen"
|
||||
v-model:date-value="farmacyHistoryDateValue"
|
||||
:data="farmacyHistoryData.data.value"
|
||||
:pagination-meta="farmacyHistoryData.paginationMeta"
|
||||
@page-change="farmacyHistoryData.handlePageChange"
|
||||
/>
|
||||
|
||||
<NationalProgramHistoryDialog
|
||||
v-model:is-modal-open="isNationalProgramServiceHistoryOpen"
|
||||
v-model:search-value="nationalProgramServiceSearch"
|
||||
v-model:status-value="nationalProgramServiceSelectedStatus"
|
||||
:data="nationalProgramServiceHistoryData.data.value"
|
||||
:pagination-meta="nationalProgramServiceHistoryData.paginationMeta"
|
||||
@page-change="nationalProgramServiceHistoryData.handlePageChange"
|
||||
/>
|
||||
</template>
|
||||
@@ -0,0 +1,215 @@
|
||||
<script setup lang="ts">
|
||||
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
||||
import type { Summary } from '~/components/pub/my-ui/summary-card/type'
|
||||
|
||||
// #region Imports
|
||||
import { Calendar, Hospital, UserCheck, UsersRound } from 'lucide-vue-next'
|
||||
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
|
||||
import { ActionEvents } from '~/components/pub/my-ui/data/types'
|
||||
|
||||
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
||||
import SummaryCard from '~/components/pub/my-ui/summary-card/summary-card.vue'
|
||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
|
||||
|
||||
import { getPatients, removePatient } from '~/services/patient.service'
|
||||
import DetailRow from '~/components/pub/my-ui/form/view/detail-row.vue'
|
||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
|
||||
import type { ExposedForm } from '~/types/form'
|
||||
import { VerificationSchema } from '~/schemas/verification.schema'
|
||||
import DocPreviewDialog from '~/components/pub/my-ui/modal/doc-preview-dialog.vue'
|
||||
import type { PagePermission } from '~/models/role'
|
||||
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
||||
import { unauthorizedToast } from '~/lib/utils'
|
||||
// #endregion
|
||||
|
||||
|
||||
// #region Permission
|
||||
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
|
||||
const { getPagePermissions } = useRBAC()
|
||||
const pagePermission = getPagePermissions(roleAccess)
|
||||
|
||||
// #region State
|
||||
const { data, isLoading, paginationMeta, searchInput, handlePageChange, handleSearch, fetchData } = usePaginatedList({
|
||||
fetchFn: (params) => getPatients({ ...params, includes: ['person', 'person-Addresses'] }),
|
||||
entityName: 'patient',
|
||||
})
|
||||
|
||||
const refSearchNav: RefSearchNav = {
|
||||
onClick: () => {
|
||||
// open filter modal
|
||||
},
|
||||
onInput: (val: string) => {
|
||||
searchInput.value = val
|
||||
},
|
||||
onClear: () => {
|
||||
searchInput.value = ''
|
||||
},
|
||||
}
|
||||
|
||||
const verificationInputForm = ref<ExposedForm<any> | null>(null)
|
||||
const isVerifyDialogOpen = ref(false)
|
||||
const isDocPreviewDialogOpen = ref(false)
|
||||
const isRecordConfirmationOpen = ref(false)
|
||||
const summaryLoading = ref(false)
|
||||
|
||||
const recId = ref<number>(0)
|
||||
const recAction = ref<string>('')
|
||||
const recItem = ref<any>(null)
|
||||
const isCaptchaValid = ref(false)
|
||||
provide('isCaptchaValid', isCaptchaValid)
|
||||
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: "Resume",
|
||||
icon: 'i-lucide-newspaper',
|
||||
}
|
||||
if (pagePermission.canCreate) {
|
||||
headerPrep.addNav = {
|
||||
label: "Resume",
|
||||
onClick: () => navigateTo('/resume/add'),
|
||||
}
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Lifecycle Hooks
|
||||
onMounted(() => {
|
||||
getPatientSummary()
|
||||
})
|
||||
// #endregion
|
||||
|
||||
// #region Functions
|
||||
async function getPatientSummary() {
|
||||
try {
|
||||
summaryLoading.value = true
|
||||
await new Promise((resolve) => setTimeout(resolve, 500))
|
||||
} catch (error) {
|
||||
console.error('Error fetching patient summary:', error)
|
||||
} finally {
|
||||
summaryLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleActionClick(eventType: string) {
|
||||
if (eventType === 'submit') {
|
||||
// const patient: Patient = await composeFormData()
|
||||
// let createdPatientId = 0
|
||||
|
||||
// const response = await handleActionSave(
|
||||
// patient,
|
||||
// () => {},
|
||||
// () => {},
|
||||
// toast,
|
||||
// )
|
||||
|
||||
// const data = (response?.body?.data ?? null) as PatientBase | null
|
||||
// if (!data) return
|
||||
// createdPatientId = data.id
|
||||
|
||||
// If has callback provided redirect to callback with patientData
|
||||
// if (props.callbackUrl) {
|
||||
// await navigateTo(props.callbackUrl + '?patient-id=' + patient.id)
|
||||
// return
|
||||
// }
|
||||
|
||||
// Navigate to patient list or show success message
|
||||
// await navigateTo('/outpatient/encounter')
|
||||
// return
|
||||
}
|
||||
|
||||
if (eventType === 'back') {
|
||||
isVerifyDialogOpen.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleConfirmDelete() {
|
||||
try {
|
||||
const result = await removePatient(recId.value)
|
||||
if (result.success) {
|
||||
console.log('Patient deleted successfully')
|
||||
// Refresh the list
|
||||
await fetchData()
|
||||
} else {
|
||||
console.error('Failed to delete patient:', result)
|
||||
// Handle error - show error message to user
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error deleting patient:', error)
|
||||
// Handle error - show error message to user
|
||||
}
|
||||
}
|
||||
|
||||
function handleCancelConfirmation() {
|
||||
// Reset record state when cancelled
|
||||
recId.value = 0
|
||||
recAction.value = ''
|
||||
recItem.value = null
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region Provide
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
// #endregion
|
||||
|
||||
// #region Watchers
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showVerify:
|
||||
if(pagePermission.canUpdate) {
|
||||
isVerifyDialogOpen.value = true
|
||||
} else {
|
||||
unauthorizedToast()
|
||||
}
|
||||
break
|
||||
case ActionEvents.showValidate:
|
||||
if(pagePermission.canUpdate) {
|
||||
isRecordConfirmationOpen.value = true
|
||||
} else {
|
||||
unauthorizedToast()
|
||||
}
|
||||
break
|
||||
case ActionEvents.showPrint:
|
||||
isDocPreviewDialogOpen.value = true
|
||||
break
|
||||
}
|
||||
})
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Header :prep="{ ...headerPrep }" />
|
||||
|
||||
<!-- <AppTherapyProtocolList
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"/> -->
|
||||
<AppResumeList
|
||||
:data="data"
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"/>
|
||||
|
||||
<Dialog v-model:open="isVerifyDialogOpen" title="Verifikasi">
|
||||
<AppResumeVerifyDialog
|
||||
ref="verificationInputForm"
|
||||
:schema="VerificationSchema" />
|
||||
<div class="flex justify-end">
|
||||
<Action v-show="isCaptchaValid" :enable-draft="false" @click="handleActionClick" />
|
||||
</div>
|
||||
</Dialog>
|
||||
|
||||
<Dialog v-model:open="isDocPreviewDialogOpen" title="Preview Dokumen" size="2xl">
|
||||
<DocPreviewDialog :link="`https://www.antennahouse.com/hubfs/xsl-fo-sample/pdf/basic-link-1.pdf`" />
|
||||
</Dialog>
|
||||
|
||||
<Confirmation
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
title="Validasi Data"
|
||||
message="Apakah Anda yakin ingin menvalidasi data ini?"
|
||||
confirm-text="Validasi"
|
||||
@confirm="handleConfirmDelete"
|
||||
@cancel="handleCancelConfirmation"
|
||||
/>
|
||||
</template>
|
||||
@@ -163,7 +163,7 @@ onMounted(async () => {
|
||||
@submit="
|
||||
(values: DeviceFormData, resetForm: any) => {
|
||||
if (recId > 0) {
|
||||
handleActionEdit(recId, values, getToolsList, resetForm, toast)
|
||||
handleActionEdit(recItem.code, values, getToolsList, resetForm, toast)
|
||||
return
|
||||
}
|
||||
handleActionSave(values, getToolsList, resetForm, toast)
|
||||
@@ -178,7 +178,7 @@ onMounted(async () => {
|
||||
v-model:open="isRecordConfirmationOpen"
|
||||
action="delete"
|
||||
:record="recItem"
|
||||
@confirm="() => handleActionRemove(recId, getToolsList, toast)"
|
||||
@confirm="() => handleActionRemove(recItem.code, getToolsList, toast)"
|
||||
@cancel=""
|
||||
>
|
||||
<template #default="{ record }">
|
||||
|
||||
Reference in New Issue
Block a user