From 388072ef517e064521afcda4bb3b7701e627a0fe Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Mon, 3 Nov 2025 08:03:09 +0700 Subject: [PATCH 1/7] feat/trx-order: ref changes for MCU --- .../domain/main-entities/mcu-order/dto.go | 1 + .../domain/main-entities/mcu-order/entity.go | 3 +-- .../main-entities/mcu-src-category/dto.go | 22 +++++++++---------- .../main-entities/mcu-src-category/entity.go | 10 ++++----- .../domain/references/clinical/clinical.go | 6 +++++ .../domain/references/encounter/encounter.go | 6 ----- .../main-use-case/mcu-order/helper.go | 1 + 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/internal/domain/main-entities/mcu-order/dto.go b/internal/domain/main-entities/mcu-order/dto.go index 3d042c2f..e63a3e08 100644 --- a/internal/domain/main-entities/mcu-order/dto.go +++ b/internal/domain/main-entities/mcu-order/dto.go @@ -28,6 +28,7 @@ type CreateDto struct { Number uint8 `json:"number"` Temperature float64 `json:"temperature"` UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code"` + Scope_Code ercl.McuScopeCode `json:"scope_code"` pa.AuthInfo } diff --git a/internal/domain/main-entities/mcu-order/entity.go b/internal/domain/main-entities/mcu-order/entity.go index d2b81e58..bf4e2e77 100644 --- a/internal/domain/main-entities/mcu-order/entity.go +++ b/internal/domain/main-entities/mcu-order/entity.go @@ -8,7 +8,6 @@ import ( ercl "simrs-vx/internal/domain/references/clinical" erc "simrs-vx/internal/domain/references/common" - ere "simrs-vx/internal/domain/references/encounter" ) type McuOrder struct { @@ -23,7 +22,7 @@ type McuOrder struct { Number uint8 `json:"number"` Temperature float64 `json:"temperature"` UrgencyLevel_Code ercl.McuUrgencyLevelCode `json:"urgencyLevel_code" gorm:"not null;size:15"` - Scope_Code *ere.CheckupScopeCode `json:"scope_code" gorm:"index;size:10"` + Scope_Code ercl.McuScopeCode `json:"scope_code" gorm:"index;size:10"` } func (d McuOrder) IsCompleted() bool { diff --git a/internal/domain/main-entities/mcu-src-category/dto.go b/internal/domain/main-entities/mcu-src-category/dto.go index 278c5e5c..c1988790 100644 --- a/internal/domain/main-entities/mcu-src-category/dto.go +++ b/internal/domain/main-entities/mcu-src-category/dto.go @@ -3,13 +3,13 @@ package division import ( ecore "simrs-vx/internal/domain/base-entities/core" - ere "simrs-vx/internal/domain/references/encounter" + erc "simrs-vx/internal/domain/references/clinical" ) type CreateDto struct { - Code string `json:"code" validate:"maxLength=20"` - Name string `json:"name" validate:"maxLength=50"` - Scope_Code *ere.CheckupScopeCode `json:"scope_code" validate:"maxLength=10"` + Code string `json:"code" validate:"maxLength=20"` + Name string `json:"name" validate:"maxLength=50"` + Scope_Code erc.McuScopeCode `json:"scope_code" validate:"maxLength=10"` } type ReadListDto struct { @@ -20,10 +20,10 @@ type ReadListDto struct { } type FilterDto struct { - Code string `json:"code"` - Name string `json:"name"` - Scope_Code *ere.CheckupScopeCode `json:"scope-code"` - Search string `json:"search" gormhelper:"searchColumns=Code,Name"` + Code string `json:"code"` + Name string `json:"name"` + Scope_Code *erc.McuScopeCode `json:"scope-code"` + Search string `json:"search" gormhelper:"searchColumns=Code,Name"` } type ReadDetailDto struct { @@ -48,9 +48,9 @@ type MetaDto struct { type ResponseDto struct { ecore.SmallMain - Code string `json:"code"` - Name string `json:"name"` - Scope_Code *ere.CheckupScopeCode `json:"scope_code"` + Code string `json:"code"` + Name string `json:"name"` + Scope_Code erc.McuScopeCode `json:"scope_code"` } func (d McuSrcCategory) ToResponse() ResponseDto { diff --git a/internal/domain/main-entities/mcu-src-category/entity.go b/internal/domain/main-entities/mcu-src-category/entity.go index 3a0d08ca..8fc801b9 100644 --- a/internal/domain/main-entities/mcu-src-category/entity.go +++ b/internal/domain/main-entities/mcu-src-category/entity.go @@ -2,12 +2,12 @@ package division import ( ecore "simrs-vx/internal/domain/base-entities/core" - ere "simrs-vx/internal/domain/references/encounter" + erc "simrs-vx/internal/domain/references/clinical" ) type McuSrcCategory struct { - ecore.SmallMain // adjust this according to the needs - Code string `json:"code" gorm:"unique;size:20"` - Name string `json:"name" gorm:"size:50"` - Scope_Code *ere.CheckupScopeCode `json:"scope_code" gorm:"index;size:10"` + ecore.SmallMain // adjust this according to the needs + Code string `json:"code" gorm:"unique;size:20"` + Name string `json:"name" gorm:"size:50"` + Scope_Code erc.McuScopeCode `json:"scope_code" gorm:"index;size:10"` } diff --git a/internal/domain/references/clinical/clinical.go b/internal/domain/references/clinical/clinical.go index c0eb3594..9b2af591 100644 --- a/internal/domain/references/clinical/clinical.go +++ b/internal/domain/references/clinical/clinical.go @@ -9,6 +9,7 @@ type ( InstructionCode string HeadToToeCode string McuUrgencyLevelCode string + McuScopeCode string SoapiTypeCode string MedicalAction string VehicleTypeCode string @@ -113,6 +114,11 @@ const ( MULCPF McuUrgencyLevelCode = "priority-form" // Form Prioritas MULCRT McuUrgencyLevelCode = "routine" // Pemeriksaan Rutin + MSCRad McuScopeCode = "rad" // Pemeriksaan Rutin + MSCCpLab McuScopeCode = "cp-lab" // Pemeriksaan Rutin + MSCApLab McuScopeCode = "ap-lab" // Pemeriksaan Rutin + MSCMicLab McuScopeCode = "mic-lab" // Pemeriksaan Rutin + STCEarlyNurse SoapiTypeCode = "early-nurse" // Kajian Awal Medis STCEEarlyMedic SoapiTypeCode = "early-medic" // Kajian Awal Rehab Medis STCEarlyRehab SoapiTypeCode = "early-rehab" // Kajian Awal Rehab Medik diff --git a/internal/domain/references/encounter/encounter.go b/internal/domain/references/encounter/encounter.go index eeccb8fe..c2d150be 100644 --- a/internal/domain/references/encounter/encounter.go +++ b/internal/domain/references/encounter/encounter.go @@ -8,7 +8,6 @@ type ( PersonConditionCode string EmergencyClassCode string OutpatientClassCode string - CheckupScopeCode string AmbulatoryClassCode string InpatientClassCode string UploadCode string @@ -64,11 +63,6 @@ const ( OCCHcu OutpatientClassCode = "hcu" // HCU OCCVk OutpatientClassCode = "vk" // Verlos kamer - CSCLab CheckupScopeCode = "lab" // Laboratorium - CSCMLab CheckupScopeCode = "mic-lab" // Microbacterial Laboratorium - CSCPLab CheckupScopeCode = "pa-lab" // Patology Anatomy Laboratorium - CSCRad CheckupScopeCode = "radiology" // Radiology - ACCReg AmbulatoryClassCode = "reg" // Regular ACCRme AmbulatoryClassCode = "rme" // Rehab Medik ACCCad AmbulatoryClassCode = "chemo-adm" // Chemotherapy diff --git a/internal/use-case/main-use-case/mcu-order/helper.go b/internal/use-case/main-use-case/mcu-order/helper.go index c7d6fc6f..7c21f1f6 100644 --- a/internal/use-case/main-use-case/mcu-order/helper.go +++ b/internal/use-case/main-use-case/mcu-order/helper.go @@ -28,4 +28,5 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.McuOrder) { data.Temperature = inputSrc.Temperature data.UrgencyLevel_Code = inputSrc.UrgencyLevel_Code data.Doctor_Id = inputSrc.Doctor_Id + data.Scope_Code = inputSrc.Scope_Code } From 8e35aafca2450e0398b3ec32245374f46ed03d38 Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Mon, 3 Nov 2025 14:59:03 +0700 Subject: [PATCH 2/7] feat/trx-orders: changed set value for Doctor_Id and the setData --- internal/use-case/main-use-case/prescription/helper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/use-case/main-use-case/prescription/helper.go b/internal/use-case/main-use-case/prescription/helper.go index 8b85884a..35c55512 100644 --- a/internal/use-case/main-use-case/prescription/helper.go +++ b/internal/use-case/main-use-case/prescription/helper.go @@ -37,7 +37,8 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Prescription) { } data.Encounter_Id = inputSrc.Encounter_Id - data.Doctor_Id = inputSrc.Doctor_Id + // data.Doctor_Id = inputSrc.Doctor_Id + data.Doctor_Id = inputSrc.AuthInfo.Doctor_Id data.IssuedAt = inputSrc.IssuedAt } From 5c8c5511d9c51c65257136d22fc2d28ed4bf8a28 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 5 Nov 2025 11:18:38 +0700 Subject: [PATCH 3/7] migration from server --- cmd/main-migration/migrations/atlas.sum | 142 ++++++++++++------------ 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 40b66b02..d2c79b63 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,71 +1,71 @@ -h1:drtrRtMhlNYK0c9wV3CUkJvXwWgrD8xGPPJy9wlcvNA= -20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= -20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= -20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= -20250908062323.sql h1:oXl6Z143tOpIl4EfP4B8JNU8LrMvVmHEtCgAfiB4gs8= -20250908073811.sql h1:m2aNXfnGxnLq1+rVWrh4f60q7fhyhV3gEwNu/OIqQlE= -20250908073839.sql h1:cPk54xjLdMs26uY8ZHjNWLuyfAMzV7Zb0/9oJQrsw04= -20250910055902.sql h1:5xwjAV6QbtZT9empTJKfhyAjdknbHzb15B0Ku5dzqtQ= -20250915123412.sql h1:D83xaU2YlDEd21HLup/YQpQ2easMToYCyy/oK6AFgQs= -20250916043819.sql h1:ekoTJsBqQZ8G8n0qJ03d13+eoNoc7sAUEQGA5D/CCxk= -20250917040616.sql h1:zoCnmcXuM7AVv85SmN7RmFglCgJnoDmpRWExH0LAc9Q= -20250917040751.sql h1:J1xyRrh32y1+lezwAyNwPcUQ6ABBSgbvzNLva4SVdQU= -20250917045138.sql h1:jKe1Z0uOLG4SGBYM+S/3P+/zMPztmgoderD5swnMuCg= -20250917093645.sql h1:cNI3Pbz1R3LxvIXLuexafJFCXUXrmuFCgXXJ2sG+FW0= -20250918073552.sql h1:RJ1SvMzP6aeWnoPVD3eVAmIQOkcp6Php8z3QRri6v4g= -20250918073742.sql h1:+cEsnJTJFybe2fR69ZoOiX2R6c6iITl4m6WTZ1hjyzY= -20250918074745.sql h1:2hNVQCXF/dVYXAh+T/7oBFgERGWxzVb2FXJjwkFWGCI= -20250923025134.sql h1:Ykz/qpHiGDXPsCsWTjydQFVSibZP2D+h2fIeb2h2JGA= -20250924051317.sql h1:yQuW6SwJxIOM5fcxeAaie5lSm1oLysU/C2hH2xNCVoQ= -20250929034321.sql h1:101FJ8VH12mrZWlt/X1gvKUGOhoiF8tFbjiapAjnHzg= -20250929034428.sql h1:i+pROD9p+g5dOmmZma6WF/0Hw5g3Ha28NN85iTo1K34= -20250930025550.sql h1:+F+CsCUXD/ql0tHGEow70GhPBX1ZybVn+bh/T4YMh7Y= -20250930140351.sql h1:9AAEG1AnOAH+o0+oHL5G7I8vqlWOhwRlCGyyCpT/y1Q= -20251002085604.sql h1:3xZ68eYp4urXRnvotNH1XvG2mYOSDV/j3zHEZ/txg5E= -20251003032030.sql h1:HB+mQ2lXMNomHDpaRhB/9IwYI9/YiDO5eOJ+nAQH/jw= -20251005060450.sql h1:LbtCE2b+8osM3CvnmQJH1uCPtn+d7WchsslBOz8bL3Q= -20251006041122.sql h1:MlS7f21z06sutnf9dIekt5fuHJr4lgcQ4uCuCXAGsfc= -20251006045658.sql h1:3FmGCPCzjgMPdWDRodZTsx3KVaodd9zB9ilib69aewk= -20251006045928.sql h1:Z5g31PmnzNwk/OKdODcxZGm8fjJQdMFK32Xfnt3bRHg= -20251007022859.sql h1:FO03zEfaNEk/aXwY81d5Lp3MoBB9kPQuXlXJ4BPiSR8= -20251008031337.sql h1:l+sxUAGvcTfj3I6kAFHo+T6AYodC9k9GkR+jaKO2xXc= -20251008031554.sql h1:AqrVfIhSzY3PCy8ZlP5W91wn2iznfIuj5qQfubp6/94= -20251008052346.sql h1:nxnXmooIJ6r1mmzwnw+6efxLfc/k9h2aE6RMptPRons= -20251008073620.sql h1:6YsJp1W4SmQJ1lxpqF27BBlDC1zqhw7Yhc7pLzQTY6M= -20251009042854.sql h1:nkBV+R6j0fg7/JY6wH3eb5Vv0asJLnXmb6lINfT/GLQ= -20251009052657.sql h1:EPvdsib5rzCGPryd10HShGKvFPwM/R5S2lIVwtYxpms= -20251010031743.sql h1:T8IZmx8/btRFKLzTe78MzcBsPJNodnLvB0tby9QkirQ= -20251010070721.sql h1:5NQUk/yOV6sABLCB7swx++YIOyJe6MnU+yt1nRzde5w= -20251010072711.sql h1:ZJNqR2piyu8xJhBvVABSlnGEoKSKae3wuEs+wshPe4k= -20251013044536.sql h1:0Xjw8fNILiT8nnfrJDZgQnPf3dntmIoilbapnih8AE4= -20251013051438.sql h1:lfSuw5mgJnePBJamvhZ81osFIouXeiIEiSZ/evdwo48= -20251013081808.sql h1:ijgjNX08G6GBjA/ks8EKtb7P7Y7Cg7zbhqEOruGnv6M= -20251014060047.sql h1:0jqj49WTtneEIMQDBoo4c095ZGi8sCrA8NnHBrPU6D8= -20251014063537.sql h1:VZLXol0PTsTW21Epg6vBPsztWkDtcxup9F/z88EGgIg= -20251014063720.sql h1:2HVUyCV0ud3BJJDH2GEKZN/+IWLFPCsN1KqhP6csO14= -20251015045455.sql h1:MeLWmMhAOAz8b15Dd7IAQnt6JxjSml02XCXK22C0Lpg= -20251016010845.sql h1:4BncQdDOasRZJkzVJrSJJA7091A9VPNVx/faUCUPhBM= -20251016011023.sql h1:9JB9eFZKURK5RoCVDKR6glSvdJ8NTXrN7K/4q51zkz4= -20251016062912.sql h1:ACNn0fe+EMqUt3hoY+Dr3uqAV/QICBa1+mIW7fUc9Fk= -20251017060617.sql h1:4T3t9ifWrEQTPMSM0XJ98pF7Qdt+UfgtMui17bhrnWI= -20251017082207.sql h1:8vLG1l/saRRMHXkyA4nelJyjaSddhZd6r7R+Uo4JS/c= -20251018032635.sql h1:2xey5gnO3y2XSOrU8MLlIfoylPKbRGDRtHDD07B3MbQ= -20251018040322.sql h1:k/pdNiSoT8zFPqNQ/avOD0vYkNh3BTD64IlHrfVXr7I= -20251019093915.sql h1:hFcQE0y+p5dZiVwePGsRGto9m/q6kJNiUZbVDd5Rnjk= -20251020062553.sql h1:Iw7hulcm5iRQlfW+ygA4iTPxLqkxx6h9vXMXEwUAHKs= -20251021041042.sql h1:wMgSivBV2A0NDcsLmKGIp0kMcVh2IODSG9b4dgzCaOM= -20251021075552.sql h1:8gfSMAglflNO6L0sSzxFNEubYN8/O4thT7OQT+WH+3M= -20251023044432.sql h1:MkvajJs3bfk9+wHvQ43/ccAluJEBARm1gWr1u92ccLA= -20251024034832.sql h1:x3s3VEVYLOSKLAFxJGb2+c1FyTMMvPE+9k4Ew7rKQaI= -20251024074315.sql h1:EjAjelgi5qAfcRq/8vPTlGGYHvAKxNTllm8f0SzZDns= -20251025013451.sql h1:6hnuIiwYiG+6nLhOY/+Yyn+I6ZCFNRZxrJNqBV6HLqE= -20251025013609.sql h1:evPJaTD8WxYRMOJZHkSr7ONLx9PYxT+ankzQt9c/sJ0= -20251027075128.sql h1:/iFQBM1sytjqpyQSOx61q33gnorMgxTiFVSuL6bQqsM= -20251027091406.sql h1:eCZGtUkxAzEAqpC9UsGpP8Df9mS0DEOqSl885LgqpvM= -20251102002037.sql h1:lFJbuoZ2LMQnUNGdcwHVY3Xlfslgzu9t2WByT8yfOZI= -20251102091932.sql h1:rmdhb5m+P+fU8jROBZNyeYgZKuQvucsuljXv4ZVzvks= -20251103081637.sql h1:tf3BcwTeIw+oxMEisKDDfyKnBfalTLs8b0PJA8JWYxY= -20251104042334.sql h1:7PDMWOhmJywolAPKFZ14XaDBeMvcxShaXFN2IemNtzk= -20251104043530.sql h1:qvYVp3ysPf27f1BcoRNCFGovxuVE12lg9d6Xzda6zWU= -20251104080952.sql h1:avghpv1n3yaCDR/TA0X+hgxDGoLBQGu/GJUwj4VT/Ic= -20251104084135.sql h1:Y4coFrHgDXd/DM8ihEy+qMkOSrO8M4SI4shRCJIiBBA= +h1:XcM4BDP+DX+wOQ5ldDbxOZWeqFBrXyFHkmVIlIdlfBs= +20250904105930.sql h1:Vv4vCurl7m7/ZB6TjRpkubHpQ4RYwSUn0QHdzfoGpzY= +20250904141448.sql h1:FYCHH9Os4KkrZMDu/jR8FMP+wLMRW+Mb0PkLU/9BRDg= +20250908062237.sql h1:oanBpKZd+akPu2I/xYhUSbd0G5tAFbXzKLER/Zs8ENI= +20250908062323.sql h1:miNG9COddXkD1jGTgaROMAZ618eT6oiLGiJhXWnQwhE= +20250908073811.sql h1:gOi5cnGG1htlpfizybYmUIT0vYjZTBfXiI0nPSYK2u8= +20250908073839.sql h1:cWNDA4YikjoOteAJuNLFILjQUJPFB6o8Wxreiek4QyI= +20250910055902.sql h1:nxxOGnU0BbH/v3IPgeIOXOwH8d3tKomw7h6FTeMnnBs= +20250915123412.sql h1:mz7SiWfrdf0qE1VTSAAnA/147d6gyp6ry5vZ2bR9SH0= +20250916043819.sql h1:RHXVtmMkB6wfv06HfPyHMBmUfIpFt1xveafNz0kwKnE= +20250917040616.sql h1:MYVDht+akBlzQGKNu2hTTTLPEcH1bxT/Q8MK6WEtuhs= +20250917040751.sql h1:J79YyS2JzWgh5oKXMTgh67uo3gLxKaAsxRiZmSIfjBs= +20250917045138.sql h1:/SM1N4O8X3yxpoJgMEARmS1uOkuLKsTOy4PLsRCOKaQ= +20250917093645.sql h1:PNBTGZ7s10e5b5+Tie8YfVQBN0zKtJ5T34oK1iOUEb4= +20250918073552.sql h1:jG7+g3i8ODYaJdcdZz12v3nbsZ5mB9wG6kWnGyTQIRI= +20250918073742.sql h1:j+rgw7puxE7s+phqPVZHmPk0af3rcaA56Itp86y1suY= +20250918074745.sql h1:rPmP4DXs6OnY4Vp+xO/z9jFpJt/RrJ52SJJjIIxeDvc= +20250923025134.sql h1:2r6pcwnBSU5Y9Czk1OHBoh4yZXiMtEca9X8843fTEX0= +20250924051317.sql h1:iUAk2gsGoEGIPQ0lEEUp8maMSId8emNbP+kP712ABIA= +20250929034321.sql h1:UlpALNVmdi95zOIT0yc6ZyTj9bBjQEIpZhvgrc52M+k= +20250929034428.sql h1:feF+H4nDyHh5bdx48Oiz0A1qecZfi6v3qTTdjzJ45Dg= +20250930025550.sql h1:6XT1kXI3Z3ZIxxmvT7poufZWWCW0QiejZPaFV5wBnjI= +20250930140351.sql h1:HxnmAbh9gCy8jwl/9ycGktiByaUripsjFFvohofY2CY= +20251002085604.sql h1:SjLPi+ZN6qDccK3DaEQCgNsZpPwr5kynWXwbwEsziCI= +20251003032030.sql h1:oHfxNSuqTxU8Zaf9H+h8TuUb1Da03wcyc6hZjDrUQ2s= +20251005060450.sql h1:GIuCcrd4MwjmXpvbzDzPYL18BV3QaZZ+Y2FmEzjvi0E= +20251006041122.sql h1:uNDQbSw0M08lYoMvUNlQtS3iDzpPM1ixT13ugSAoWjE= +20251006045658.sql h1:z+t7yCK54Q4SSiF9kUyUhkYB2F+kzSW9TB7ogxd9wzw= +20251006045928.sql h1:1lATLFLp4BWwGZqAjZdP0Dc6ypNXiYcwjoNkqGa8NFE= +20251007022859.sql h1:HXXwWrkyvzJzJGAt9mGskCRBBV/c1JfPmfjDocmJhQ4= +20251008031337.sql h1:Ln5pCF3Hxa5foHZLcds+z/us2eH6VAhhEj3w0TAGlVs= +20251008031554.sql h1:aB4MUS2lmqG0//4HKUWorcPSpWya0VC4QItvGyskEVI= +20251008052346.sql h1:MI3AZgU5XcwZT2OvvlWAxdRtL0eJ3jjRwt56IY1+pRU= +20251008073620.sql h1:sztWXuSNYwpEraaSapSsYwno75LO5H/N7ob7OJQ8X/A= +20251009042854.sql h1:TnPXj+dCJls3IU//cuqJZymyBzZMKs7ayazfgtAFRxM= +20251009052657.sql h1:leXbs0CP8r5dRilmYyLRk1MICqak3ea1/LWMtFrijqQ= +20251010031743.sql h1:SgHNY/lQ88G2F4nZyMfiOkDntb+gtOR+nEQLqXBTwv4= +20251010070721.sql h1:AnJnhXsMzDvK4AFgYw6B16Kpo/hljrZtcpc9m2VOSHQ= +20251010072711.sql h1:aXPTtNwLcTuw8C/yAxwxvqs0ayEjNzI1uuE0vE3ERa8= +20251013044536.sql h1:7Pq6JcvTpPBYDCW2dz3HdgUwY65HlhEVWy9TiG8iONE= +20251013051438.sql h1:X6t8bkqpUYYokBunSufMQUe5vCg0VyO6dxbm7ngosUc= +20251013081808.sql h1:495pLguXL2Ozh+ycn4UYZgZbn6WbjXNbyZUc3JU8qhI= +20251014060047.sql h1:nCgImMRGHhziiW57O1ofWaXCAPGaCOHN7PldQ3OSmM4= +20251014063537.sql h1:2cLmID79jP6cuQ1YJaWTtghFiM1GtHMC0ZQl30Hpy1M= +20251014063720.sql h1:bzLKKVAjSHgDFoiI/glj7t1ETlSAKx+AlsIAaP0ru2g= +20251015045455.sql h1:S547+UugQhlTRcn1Lm1IfqT5RNPttIWIiD+RTx69YaE= +20251016010845.sql h1:c9DUvxl17pUkf0azdYGM/YDzYxIJkLcfZOcMI4rL+R0= +20251016011023.sql h1:u3ivg83bXgYHBbojbWpemLxPE9Dmmj53B6LXo664jxw= +20251016062912.sql h1:W9n1hWchfYkqNX9LO9uxFxEXAb/iY+Pexjnhmp6PbgI= +20251017060617.sql h1:VU6yZ2+LfHpDZ3+TIH40t3F5YXPCpTppuF9+uSqa4b8= +20251017082207.sql h1:QshZslfedckz7iDpSGmPyY9sP6dy6ckHbs8L1TuXIA4= +20251018032635.sql h1:M1U/9W/F9wlW5YDmVAmHFfUJU7FWFaX0DblpfZcYWrE= +20251018040322.sql h1:Zk/vw0e6AzWFO2ElLOzB+OrSz6k+h1Ynxp0TImAzxwY= +20251019093915.sql h1:3Q0kPiZwJnHn5rAvdh0w1LBdiA7W2xBmZWncoPXb044= +20251020062553.sql h1:mJwC/J8GzPAIXckNMvy1f/Nguk2VVf8roD/Raclhbao= +20251021041042.sql h1:d1BAOGAQhqr+oOwcpAVozUsTh457VSDEk2qQFavGG58= +20251021075552.sql h1:TNChGQ1Zlr/1iQ6qvK4iDTAJpe6L/z/M6e/O0SkQVaM= +20251023044432.sql h1:GA2AdJk2ULyjr6igtu9C/CEi4YUIks8r9jXGGaCvPsk= +20251024034832.sql h1:RXmbEhMkOLK5g1QL6up8iRPcwYfo89oLP26ZHvrUK9o= +20251024074315.sql h1:3GnPQSbuAAfMa8oWDyBjhXqn1j1zunY/w0ydX0IGPrA= +20251025013451.sql h1:5eNrA9LDxA4i5CCP7wSyOgFZ6t6jBWVil+oGzJpkJ2E= +20251025013609.sql h1:+N6EHc1kv3hqf16CUhXe+UITPmoxOPfi4MECLmJXNrc= +20251027075128.sql h1:PQflgsjce/p2ClbybLtdehdPNDcMZ9Lb1vd98xd0K8E= +20251027091406.sql h1:bYXV57GvodCMjg0/ox+XKGIAGhrDlVuJ1wO4foNEKtQ= +20251102002037.sql h1:ZcwULsJU2lI9t5pX7ukmfAHSx4ZxdxLUX6jzLDc2SrU= +20251102091932.sql h1:A6y9j4wAqm4/HfMDxhpy/ChDn3UNRVN99KGgSCX+e18= +20251103081637.sql h1:RFqJNhJItSwJQaMP5IcQ14mL7eQ3EJjGZua9zLWzwMU= +20251104042334.sql h1:BbjLAwImggvI6489FQgD+S/AaafeiZut8k19TdH7XUE= +20251104043530.sql h1:Y0sOQqgnHxd5vKPA4+4fAGGdWCv6duKAYgHnjRJZUIc= +20251104080952.sql h1:hDHzFs/k+NhPYJ64ifbVp+nTJLMCG5MIMJU1zBMP0V0= +20251104084135.sql h1:p97mW1MPtPrMWJKy/KZqvymMO/vlelnXp43N9bZVCTI= From cd775e33664151e7ac11d8c652511a20fa56567e Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Wed, 5 Nov 2025 11:03:47 +0700 Subject: [PATCH 4/7] feat/trx-order: added entities for antibiotic --- .../main-entities/antibiotic-in-use/dto.go | 76 +++++++++++++++++++ .../main-entities/antibiotic-in-use/entity.go | 15 ++++ .../antibiotic-src-category/dto.go | 66 ++++++++++++++++ .../antibiotic-src-category/entity.go | 11 +++ .../main-entities/antibiotic-src/dto.go | 76 +++++++++++++++++++ .../main-entities/antibiotic-src/entity.go | 17 +++++ internal/interface/migration/main-entities.go | 4 + 7 files changed, 265 insertions(+) create mode 100644 internal/domain/main-entities/antibiotic-in-use/dto.go create mode 100644 internal/domain/main-entities/antibiotic-in-use/entity.go create mode 100644 internal/domain/main-entities/antibiotic-src-category/dto.go create mode 100644 internal/domain/main-entities/antibiotic-src-category/entity.go create mode 100644 internal/domain/main-entities/antibiotic-src/dto.go create mode 100644 internal/domain/main-entities/antibiotic-src/entity.go diff --git a/internal/domain/main-entities/antibiotic-in-use/dto.go b/internal/domain/main-entities/antibiotic-in-use/dto.go new file mode 100644 index 00000000..7fbce2dd --- /dev/null +++ b/internal/domain/main-entities/antibiotic-in-use/dto.go @@ -0,0 +1,76 @@ +package antibioticinuse + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + eas "simrs-vx/internal/domain/main-entities/antibiotic-src" + emo "simrs-vx/internal/domain/main-entities/mcu-order" + erc "simrs-vx/internal/domain/references/common" + "time" +) + +type CreateDto struct { + McuOrder_Id *uint `json:"mcuOrder_id"` + AntibioticSrc_Id *uint `json:"antibioticSrc_id"` +} + +type ReadListDto struct { + FilterDto + Includes string `json:"includes"` + Pagination ecore.Pagination +} + +type FilterDto struct { + McuOrder_Id *uint `json:"mcu-order-id"` + AntibioticSrc_Id *uint `json:"mcu-src-id"` + Result *string `json:"result"` + Status_Code erc.DataStatusCode `json:"status-code"` +} +type ReadDetailDto struct { + Id uint `json:"id"` +} + +type UpdateDto struct { + Id uint `json:"id"` + CreateDto +} + +type DeleteDto struct { + Id uint `json:"id"` +} + +type SetScheduleDto struct { + Id uint `json:"id"` + ExaminationDate *time.Time `json:"examinationDate"` +} + +type MetaDto struct { + PageNumber int `json:"page_number"` + PageSize int `json:"page_size"` + Count int `json:"count"` +} + +type ResponseDto struct { + ecore.Main + McuOrder_Id *uint `json:"mcuOrder_id"` + McuOrder *emo.McuOrder `json:"mcuOrder,omitempty"` + AntibioticSrc_Id *uint `json:"antibioticSrc_id"` + Antibiotic *eas.CreateDto `json:"mcuSrc,omitempty"` +} + +func (d AntibioticInUse) ToResponse() ResponseDto { + resp := ResponseDto{ + McuOrder_Id: d.McuOrder_Id, + McuOrder: d.McuOrder, + AntibioticSrc_Id: d.AntibioticSrc_Id, + } + resp.Main = d.Main + return resp +} + +func ToResponseList(data []AntibioticInUse) []ResponseDto { + resp := make([]ResponseDto, len(data)) + for i, u := range data { + resp[i] = u.ToResponse() + } + return resp +} diff --git a/internal/domain/main-entities/antibiotic-in-use/entity.go b/internal/domain/main-entities/antibiotic-in-use/entity.go new file mode 100644 index 00000000..6d924d4f --- /dev/null +++ b/internal/domain/main-entities/antibiotic-in-use/entity.go @@ -0,0 +1,15 @@ +package antibioticinuse + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + eas "simrs-vx/internal/domain/main-entities/antibiotic-src" + emo "simrs-vx/internal/domain/main-entities/mcu-order" +) + +type AntibioticInUse struct { + ecore.Main // adjust this according to the needs + McuOrder_Id *uint `json:"mcuOrder_id" gorm:"uniqueIndex:idx_order_src"` + McuOrder *emo.McuOrder `json:"mcuOrder,omitempty" gorm:"foreignKey:McuOrder_Id;references:Id"` + AntibioticSrc_Id *uint `json:"antibioticSrcSrc_id" gorm:"uniqueIndex:idx_order_src"` + AntibioticSrc *eas.AntibioticSrc `json:"antibioticSrc,omitempty" gorm:"foreignKey:AntibioticSrc_Id;references:Id"` +} diff --git a/internal/domain/main-entities/antibiotic-src-category/dto.go b/internal/domain/main-entities/antibiotic-src-category/dto.go new file mode 100644 index 00000000..90f420fb --- /dev/null +++ b/internal/domain/main-entities/antibiotic-src-category/dto.go @@ -0,0 +1,66 @@ +package antibioticsrccategory + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" +) + +type CreateDto struct { + Code string `json:"code" validate:"maxLength=20"` + Name string `json:"name" validate:"maxLength=50"` +} + +type ReadListDto struct { + FilterDto + Includes string `json:"includes"` + Sort string `json:"sort"` + Pagination ecore.Pagination +} + +type FilterDto struct { + Code string `json:"code"` + Name string `json:"name"` + Search string `json:"search" gormhelper:"searchColumns=Code,Name"` +} + +type ReadDetailDto struct { + Id uint16 `json:"id"` + Code *string `json:"code"` +} + +type UpdateDto struct { + Id uint16 `json:"id"` + CreateDto +} + +type DeleteDto struct { + Id uint16 `json:"id"` +} + +type MetaDto struct { + PageNumber int `json:"page_number"` + PageSize int `json:"page_size"` + Count int `json:"count"` +} + +type ResponseDto struct { + ecore.SmallMain + Code string `json:"code"` + Name string `json:"name"` +} + +func (d AntibioticSrcCategory) ToResponse() ResponseDto { + resp := ResponseDto{ + Code: d.Code, + Name: d.Name, + } + resp.SmallMain = d.SmallMain + return resp +} + +func ToResponseList(data []AntibioticSrcCategory) []ResponseDto { + resp := make([]ResponseDto, len(data)) + for i, u := range data { + resp[i] = u.ToResponse() + } + return resp +} diff --git a/internal/domain/main-entities/antibiotic-src-category/entity.go b/internal/domain/main-entities/antibiotic-src-category/entity.go new file mode 100644 index 00000000..31169d9d --- /dev/null +++ b/internal/domain/main-entities/antibiotic-src-category/entity.go @@ -0,0 +1,11 @@ +package antibioticsrccategory + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" +) + +type AntibioticSrcCategory struct { + ecore.SmallMain // adjust this according to the needs + Code string `json:"code" gorm:"unique;size:20"` + Name string `json:"name" gorm:"size:50"` +} diff --git a/internal/domain/main-entities/antibiotic-src/dto.go b/internal/domain/main-entities/antibiotic-src/dto.go new file mode 100644 index 00000000..9a7a2846 --- /dev/null +++ b/internal/domain/main-entities/antibiotic-src/dto.go @@ -0,0 +1,76 @@ +package antibioticsrc + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + ei "simrs-vx/internal/domain/main-entities/item" +) + +type CreateDto struct { + Code string `json:"code" validate:"maxLength=20"` + Name string `json:"name" validate:"maxLength=50"` + AntibioticSrcCategory_Code *string `json:"antibioticSrcCategory_code" validate:"maxLength=20"` + Item_Id *uint `json:"item_id"` +} + +type ReadListDto struct { + FilterDto + Includes string `json:"includes"` + Sort string `json:"sort"` + Pagination ecore.Pagination +} + +type FilterDto struct { + Code string `json:"code"` + Name string `json:"name"` + AntibioticSrcCategory_Code *string `json:"antibiotic-src-category-code"` + Search string `json:"search" gormhelper:"searchColumns=Code,Name"` +} + +type ReadDetailDto struct { + Id uint16 `json:"id"` + Code *string `json:"code"` +} + +type UpdateDto struct { + Id uint16 `json:"id"` + CreateDto +} + +type DeleteDto struct { + Id uint16 `json:"id"` +} + +type MetaDto struct { + PageNumber int `json:"page_number"` + PageSize int `json:"page_size"` + Count int `json:"count"` +} + +type ResponseDto struct { + ecore.Main + Code string `json:"code"` + Name string `json:"name"` + AntibioticSrcCategory_Code *string `json:"antibioticSrcCategory_code"` + Item_Id *uint `json:"item_id"` + Item *ei.Item `json:"item,omitempty"` +} + +func (d AntibioticSrc) ToResponse() ResponseDto { + resp := ResponseDto{ + Code: d.Code, + Name: d.Name, + AntibioticSrcCategory_Code: d.AntibioticSrcCategory_Code, + Item_Id: d.Item_Id, + Item: d.Item, + } + resp.Main = d.Main + return resp +} + +func ToResponseList(data []AntibioticSrc) []ResponseDto { + resp := make([]ResponseDto, len(data)) + for i, u := range data { + resp[i] = u.ToResponse() + } + return resp +} diff --git a/internal/domain/main-entities/antibiotic-src/entity.go b/internal/domain/main-entities/antibiotic-src/entity.go new file mode 100644 index 00000000..83089e07 --- /dev/null +++ b/internal/domain/main-entities/antibiotic-src/entity.go @@ -0,0 +1,17 @@ +package antibioticsrc + +import ( + ecore "simrs-vx/internal/domain/base-entities/core" + easc "simrs-vx/internal/domain/main-entities/antibiotic-src-category" + ei "simrs-vx/internal/domain/main-entities/item" +) + +type AntibioticSrc struct { + ecore.Main // adjust this according to the needs + Code string `json:"code" gorm:"unique;size:20"` + Name string `json:"name" gorm:"size:50"` + AntibioticSrcCategory_Code *string `json:"antibioticSrcCategory_code" gorm:"size:20"` + AntibioticSrcCategory *easc.AntibioticSrcCategory `json:"antibioticSrcCategory,omitempty" gorm:"foreignKey:AntibioticSrcCategory_Code;references:Code"` + Item_Id *uint `json:"item_id"` + Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"` +} diff --git a/internal/interface/migration/main-entities.go b/internal/interface/migration/main-entities.go index 6507202e..0248a0d1 100644 --- a/internal/interface/migration/main-entities.go +++ b/internal/interface/migration/main-entities.go @@ -5,6 +5,8 @@ import ( admemployeehist "simrs-vx/internal/domain/main-entities/adm-employee-hist" ambulancetransportreq "simrs-vx/internal/domain/main-entities/ambulance-transport-req" ambulatory "simrs-vx/internal/domain/main-entities/ambulatory" + antibioticinuse "simrs-vx/internal/domain/main-entities/antibiotic-in-use" + antibioticsrccategory "simrs-vx/internal/domain/main-entities/antibiotic-src-category" appointment "simrs-vx/internal/domain/main-entities/appointment" chemo "simrs-vx/internal/domain/main-entities/chemo" consultation "simrs-vx/internal/domain/main-entities/consultation" @@ -172,6 +174,8 @@ func getMainEntities() []any { &mcuorderitem.McuOrderItem{}, &mcusubsrc.McuSubSrc{}, &mcuordersubitem.McuOrderSubItem{}, + &antibioticsrccategory.AntibioticSrcCategory{}, + &antibioticinuse.AntibioticInUse{}, &consultation.Consultation{}, &chemo.Chemo{}, &midwife.Midwife{}, From c5643420f117e91b4dab1e8b2ebfb7fe86482ab1 Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Wed, 5 Nov 2025 11:50:07 +0700 Subject: [PATCH 5/7] feat/tex-orders: updated migration --- .../migrations/20251105044629.sql | 38 +++++ cmd/main-migration/migrations/atlas.sum | 143 +++++++++--------- 2 files changed, 110 insertions(+), 71 deletions(-) create mode 100644 cmd/main-migration/migrations/20251105044629.sql diff --git a/cmd/main-migration/migrations/20251105044629.sql b/cmd/main-migration/migrations/20251105044629.sql new file mode 100644 index 00000000..24ba9d05 --- /dev/null +++ b/cmd/main-migration/migrations/20251105044629.sql @@ -0,0 +1,38 @@ +-- Create "AntibioticSrcCategory" table +CREATE TABLE "public"."AntibioticSrcCategory" ( + "Id" serial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Code" character varying(20) NULL, + "Name" character varying(50) NULL, + PRIMARY KEY ("Id"), + CONSTRAINT "uni_AntibioticSrcCategory_Code" UNIQUE ("Code") +); +-- Create "AntibioticSrc" table +CREATE TABLE "public"."AntibioticSrc" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Code" character varying(20) NULL, + "Name" character varying(50) NULL, + "AntibioticSrcCategory_Code" character varying(20) NULL, + "Item_Id" bigint NULL, + PRIMARY KEY ("Id"), + CONSTRAINT "uni_AntibioticSrc_Code" UNIQUE ("Code"), + CONSTRAINT "fk_AntibioticSrc_AntibioticSrcCategory" FOREIGN KEY ("AntibioticSrcCategory_Code") REFERENCES "public"."AntibioticSrcCategory" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "fk_AntibioticSrc_Item" FOREIGN KEY ("Item_Id") REFERENCES "public"."Item" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION +); +-- Create "AntibioticInUse" table +CREATE TABLE "public"."AntibioticInUse" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "McuOrder_Id" bigint NULL, + "AntibioticSrc_Id" bigint NULL, + PRIMARY KEY ("Id"), + CONSTRAINT "fk_AntibioticInUse_AntibioticSrc" FOREIGN KEY ("AntibioticSrc_Id") REFERENCES "public"."AntibioticSrc" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "fk_AntibioticInUse_McuOrder" FOREIGN KEY ("McuOrder_Id") REFERENCES "public"."McuOrder" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION +); diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index d2c79b63..b51ad522 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,71 +1,72 @@ -h1:XcM4BDP+DX+wOQ5ldDbxOZWeqFBrXyFHkmVIlIdlfBs= -20250904105930.sql h1:Vv4vCurl7m7/ZB6TjRpkubHpQ4RYwSUn0QHdzfoGpzY= -20250904141448.sql h1:FYCHH9Os4KkrZMDu/jR8FMP+wLMRW+Mb0PkLU/9BRDg= -20250908062237.sql h1:oanBpKZd+akPu2I/xYhUSbd0G5tAFbXzKLER/Zs8ENI= -20250908062323.sql h1:miNG9COddXkD1jGTgaROMAZ618eT6oiLGiJhXWnQwhE= -20250908073811.sql h1:gOi5cnGG1htlpfizybYmUIT0vYjZTBfXiI0nPSYK2u8= -20250908073839.sql h1:cWNDA4YikjoOteAJuNLFILjQUJPFB6o8Wxreiek4QyI= -20250910055902.sql h1:nxxOGnU0BbH/v3IPgeIOXOwH8d3tKomw7h6FTeMnnBs= -20250915123412.sql h1:mz7SiWfrdf0qE1VTSAAnA/147d6gyp6ry5vZ2bR9SH0= -20250916043819.sql h1:RHXVtmMkB6wfv06HfPyHMBmUfIpFt1xveafNz0kwKnE= -20250917040616.sql h1:MYVDht+akBlzQGKNu2hTTTLPEcH1bxT/Q8MK6WEtuhs= -20250917040751.sql h1:J79YyS2JzWgh5oKXMTgh67uo3gLxKaAsxRiZmSIfjBs= -20250917045138.sql h1:/SM1N4O8X3yxpoJgMEARmS1uOkuLKsTOy4PLsRCOKaQ= -20250917093645.sql h1:PNBTGZ7s10e5b5+Tie8YfVQBN0zKtJ5T34oK1iOUEb4= -20250918073552.sql h1:jG7+g3i8ODYaJdcdZz12v3nbsZ5mB9wG6kWnGyTQIRI= -20250918073742.sql h1:j+rgw7puxE7s+phqPVZHmPk0af3rcaA56Itp86y1suY= -20250918074745.sql h1:rPmP4DXs6OnY4Vp+xO/z9jFpJt/RrJ52SJJjIIxeDvc= -20250923025134.sql h1:2r6pcwnBSU5Y9Czk1OHBoh4yZXiMtEca9X8843fTEX0= -20250924051317.sql h1:iUAk2gsGoEGIPQ0lEEUp8maMSId8emNbP+kP712ABIA= -20250929034321.sql h1:UlpALNVmdi95zOIT0yc6ZyTj9bBjQEIpZhvgrc52M+k= -20250929034428.sql h1:feF+H4nDyHh5bdx48Oiz0A1qecZfi6v3qTTdjzJ45Dg= -20250930025550.sql h1:6XT1kXI3Z3ZIxxmvT7poufZWWCW0QiejZPaFV5wBnjI= -20250930140351.sql h1:HxnmAbh9gCy8jwl/9ycGktiByaUripsjFFvohofY2CY= -20251002085604.sql h1:SjLPi+ZN6qDccK3DaEQCgNsZpPwr5kynWXwbwEsziCI= -20251003032030.sql h1:oHfxNSuqTxU8Zaf9H+h8TuUb1Da03wcyc6hZjDrUQ2s= -20251005060450.sql h1:GIuCcrd4MwjmXpvbzDzPYL18BV3QaZZ+Y2FmEzjvi0E= -20251006041122.sql h1:uNDQbSw0M08lYoMvUNlQtS3iDzpPM1ixT13ugSAoWjE= -20251006045658.sql h1:z+t7yCK54Q4SSiF9kUyUhkYB2F+kzSW9TB7ogxd9wzw= -20251006045928.sql h1:1lATLFLp4BWwGZqAjZdP0Dc6ypNXiYcwjoNkqGa8NFE= -20251007022859.sql h1:HXXwWrkyvzJzJGAt9mGskCRBBV/c1JfPmfjDocmJhQ4= -20251008031337.sql h1:Ln5pCF3Hxa5foHZLcds+z/us2eH6VAhhEj3w0TAGlVs= -20251008031554.sql h1:aB4MUS2lmqG0//4HKUWorcPSpWya0VC4QItvGyskEVI= -20251008052346.sql h1:MI3AZgU5XcwZT2OvvlWAxdRtL0eJ3jjRwt56IY1+pRU= -20251008073620.sql h1:sztWXuSNYwpEraaSapSsYwno75LO5H/N7ob7OJQ8X/A= -20251009042854.sql h1:TnPXj+dCJls3IU//cuqJZymyBzZMKs7ayazfgtAFRxM= -20251009052657.sql h1:leXbs0CP8r5dRilmYyLRk1MICqak3ea1/LWMtFrijqQ= -20251010031743.sql h1:SgHNY/lQ88G2F4nZyMfiOkDntb+gtOR+nEQLqXBTwv4= -20251010070721.sql h1:AnJnhXsMzDvK4AFgYw6B16Kpo/hljrZtcpc9m2VOSHQ= -20251010072711.sql h1:aXPTtNwLcTuw8C/yAxwxvqs0ayEjNzI1uuE0vE3ERa8= -20251013044536.sql h1:7Pq6JcvTpPBYDCW2dz3HdgUwY65HlhEVWy9TiG8iONE= -20251013051438.sql h1:X6t8bkqpUYYokBunSufMQUe5vCg0VyO6dxbm7ngosUc= -20251013081808.sql h1:495pLguXL2Ozh+ycn4UYZgZbn6WbjXNbyZUc3JU8qhI= -20251014060047.sql h1:nCgImMRGHhziiW57O1ofWaXCAPGaCOHN7PldQ3OSmM4= -20251014063537.sql h1:2cLmID79jP6cuQ1YJaWTtghFiM1GtHMC0ZQl30Hpy1M= -20251014063720.sql h1:bzLKKVAjSHgDFoiI/glj7t1ETlSAKx+AlsIAaP0ru2g= -20251015045455.sql h1:S547+UugQhlTRcn1Lm1IfqT5RNPttIWIiD+RTx69YaE= -20251016010845.sql h1:c9DUvxl17pUkf0azdYGM/YDzYxIJkLcfZOcMI4rL+R0= -20251016011023.sql h1:u3ivg83bXgYHBbojbWpemLxPE9Dmmj53B6LXo664jxw= -20251016062912.sql h1:W9n1hWchfYkqNX9LO9uxFxEXAb/iY+Pexjnhmp6PbgI= -20251017060617.sql h1:VU6yZ2+LfHpDZ3+TIH40t3F5YXPCpTppuF9+uSqa4b8= -20251017082207.sql h1:QshZslfedckz7iDpSGmPyY9sP6dy6ckHbs8L1TuXIA4= -20251018032635.sql h1:M1U/9W/F9wlW5YDmVAmHFfUJU7FWFaX0DblpfZcYWrE= -20251018040322.sql h1:Zk/vw0e6AzWFO2ElLOzB+OrSz6k+h1Ynxp0TImAzxwY= -20251019093915.sql h1:3Q0kPiZwJnHn5rAvdh0w1LBdiA7W2xBmZWncoPXb044= -20251020062553.sql h1:mJwC/J8GzPAIXckNMvy1f/Nguk2VVf8roD/Raclhbao= -20251021041042.sql h1:d1BAOGAQhqr+oOwcpAVozUsTh457VSDEk2qQFavGG58= -20251021075552.sql h1:TNChGQ1Zlr/1iQ6qvK4iDTAJpe6L/z/M6e/O0SkQVaM= -20251023044432.sql h1:GA2AdJk2ULyjr6igtu9C/CEi4YUIks8r9jXGGaCvPsk= -20251024034832.sql h1:RXmbEhMkOLK5g1QL6up8iRPcwYfo89oLP26ZHvrUK9o= -20251024074315.sql h1:3GnPQSbuAAfMa8oWDyBjhXqn1j1zunY/w0ydX0IGPrA= -20251025013451.sql h1:5eNrA9LDxA4i5CCP7wSyOgFZ6t6jBWVil+oGzJpkJ2E= -20251025013609.sql h1:+N6EHc1kv3hqf16CUhXe+UITPmoxOPfi4MECLmJXNrc= -20251027075128.sql h1:PQflgsjce/p2ClbybLtdehdPNDcMZ9Lb1vd98xd0K8E= -20251027091406.sql h1:bYXV57GvodCMjg0/ox+XKGIAGhrDlVuJ1wO4foNEKtQ= -20251102002037.sql h1:ZcwULsJU2lI9t5pX7ukmfAHSx4ZxdxLUX6jzLDc2SrU= -20251102091932.sql h1:A6y9j4wAqm4/HfMDxhpy/ChDn3UNRVN99KGgSCX+e18= -20251103081637.sql h1:RFqJNhJItSwJQaMP5IcQ14mL7eQ3EJjGZua9zLWzwMU= -20251104042334.sql h1:BbjLAwImggvI6489FQgD+S/AaafeiZut8k19TdH7XUE= -20251104043530.sql h1:Y0sOQqgnHxd5vKPA4+4fAGGdWCv6duKAYgHnjRJZUIc= -20251104080952.sql h1:hDHzFs/k+NhPYJ64ifbVp+nTJLMCG5MIMJU1zBMP0V0= -20251104084135.sql h1:p97mW1MPtPrMWJKy/KZqvymMO/vlelnXp43N9bZVCTI= +h1:6MaKjqJ77v0HFibPPeCdp8Bwg2qOZlEKNgHWc2zq6T0= +20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= +20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= +20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= +20250908062323.sql h1:oXl6Z143tOpIl4EfP4B8JNU8LrMvVmHEtCgAfiB4gs8= +20250908073811.sql h1:m2aNXfnGxnLq1+rVWrh4f60q7fhyhV3gEwNu/OIqQlE= +20250908073839.sql h1:cPk54xjLdMs26uY8ZHjNWLuyfAMzV7Zb0/9oJQrsw04= +20250910055902.sql h1:5xwjAV6QbtZT9empTJKfhyAjdknbHzb15B0Ku5dzqtQ= +20250915123412.sql h1:D83xaU2YlDEd21HLup/YQpQ2easMToYCyy/oK6AFgQs= +20250916043819.sql h1:ekoTJsBqQZ8G8n0qJ03d13+eoNoc7sAUEQGA5D/CCxk= +20250917040616.sql h1:zoCnmcXuM7AVv85SmN7RmFglCgJnoDmpRWExH0LAc9Q= +20250917040751.sql h1:J1xyRrh32y1+lezwAyNwPcUQ6ABBSgbvzNLva4SVdQU= +20250917045138.sql h1:jKe1Z0uOLG4SGBYM+S/3P+/zMPztmgoderD5swnMuCg= +20250917093645.sql h1:cNI3Pbz1R3LxvIXLuexafJFCXUXrmuFCgXXJ2sG+FW0= +20250918073552.sql h1:RJ1SvMzP6aeWnoPVD3eVAmIQOkcp6Php8z3QRri6v4g= +20250918073742.sql h1:+cEsnJTJFybe2fR69ZoOiX2R6c6iITl4m6WTZ1hjyzY= +20250918074745.sql h1:2hNVQCXF/dVYXAh+T/7oBFgERGWxzVb2FXJjwkFWGCI= +20250923025134.sql h1:Ykz/qpHiGDXPsCsWTjydQFVSibZP2D+h2fIeb2h2JGA= +20250924051317.sql h1:yQuW6SwJxIOM5fcxeAaie5lSm1oLysU/C2hH2xNCVoQ= +20250929034321.sql h1:101FJ8VH12mrZWlt/X1gvKUGOhoiF8tFbjiapAjnHzg= +20250929034428.sql h1:i+pROD9p+g5dOmmZma6WF/0Hw5g3Ha28NN85iTo1K34= +20250930025550.sql h1:+F+CsCUXD/ql0tHGEow70GhPBX1ZybVn+bh/T4YMh7Y= +20250930140351.sql h1:9AAEG1AnOAH+o0+oHL5G7I8vqlWOhwRlCGyyCpT/y1Q= +20251002085604.sql h1:3xZ68eYp4urXRnvotNH1XvG2mYOSDV/j3zHEZ/txg5E= +20251003032030.sql h1:HB+mQ2lXMNomHDpaRhB/9IwYI9/YiDO5eOJ+nAQH/jw= +20251005060450.sql h1:LbtCE2b+8osM3CvnmQJH1uCPtn+d7WchsslBOz8bL3Q= +20251006041122.sql h1:MlS7f21z06sutnf9dIekt5fuHJr4lgcQ4uCuCXAGsfc= +20251006045658.sql h1:3FmGCPCzjgMPdWDRodZTsx3KVaodd9zB9ilib69aewk= +20251006045928.sql h1:Z5g31PmnzNwk/OKdODcxZGm8fjJQdMFK32Xfnt3bRHg= +20251007022859.sql h1:FO03zEfaNEk/aXwY81d5Lp3MoBB9kPQuXlXJ4BPiSR8= +20251008031337.sql h1:l+sxUAGvcTfj3I6kAFHo+T6AYodC9k9GkR+jaKO2xXc= +20251008031554.sql h1:AqrVfIhSzY3PCy8ZlP5W91wn2iznfIuj5qQfubp6/94= +20251008052346.sql h1:nxnXmooIJ6r1mmzwnw+6efxLfc/k9h2aE6RMptPRons= +20251008073620.sql h1:6YsJp1W4SmQJ1lxpqF27BBlDC1zqhw7Yhc7pLzQTY6M= +20251009042854.sql h1:nkBV+R6j0fg7/JY6wH3eb5Vv0asJLnXmb6lINfT/GLQ= +20251009052657.sql h1:EPvdsib5rzCGPryd10HShGKvFPwM/R5S2lIVwtYxpms= +20251010031743.sql h1:T8IZmx8/btRFKLzTe78MzcBsPJNodnLvB0tby9QkirQ= +20251010070721.sql h1:5NQUk/yOV6sABLCB7swx++YIOyJe6MnU+yt1nRzde5w= +20251010072711.sql h1:ZJNqR2piyu8xJhBvVABSlnGEoKSKae3wuEs+wshPe4k= +20251013044536.sql h1:0Xjw8fNILiT8nnfrJDZgQnPf3dntmIoilbapnih8AE4= +20251013051438.sql h1:lfSuw5mgJnePBJamvhZ81osFIouXeiIEiSZ/evdwo48= +20251013081808.sql h1:ijgjNX08G6GBjA/ks8EKtb7P7Y7Cg7zbhqEOruGnv6M= +20251014060047.sql h1:0jqj49WTtneEIMQDBoo4c095ZGi8sCrA8NnHBrPU6D8= +20251014063537.sql h1:VZLXol0PTsTW21Epg6vBPsztWkDtcxup9F/z88EGgIg= +20251014063720.sql h1:2HVUyCV0ud3BJJDH2GEKZN/+IWLFPCsN1KqhP6csO14= +20251015045455.sql h1:MeLWmMhAOAz8b15Dd7IAQnt6JxjSml02XCXK22C0Lpg= +20251016010845.sql h1:4BncQdDOasRZJkzVJrSJJA7091A9VPNVx/faUCUPhBM= +20251016011023.sql h1:9JB9eFZKURK5RoCVDKR6glSvdJ8NTXrN7K/4q51zkz4= +20251016062912.sql h1:ACNn0fe+EMqUt3hoY+Dr3uqAV/QICBa1+mIW7fUc9Fk= +20251017060617.sql h1:4T3t9ifWrEQTPMSM0XJ98pF7Qdt+UfgtMui17bhrnWI= +20251017082207.sql h1:8vLG1l/saRRMHXkyA4nelJyjaSddhZd6r7R+Uo4JS/c= +20251018032635.sql h1:2xey5gnO3y2XSOrU8MLlIfoylPKbRGDRtHDD07B3MbQ= +20251018040322.sql h1:k/pdNiSoT8zFPqNQ/avOD0vYkNh3BTD64IlHrfVXr7I= +20251019093915.sql h1:hFcQE0y+p5dZiVwePGsRGto9m/q6kJNiUZbVDd5Rnjk= +20251020062553.sql h1:Iw7hulcm5iRQlfW+ygA4iTPxLqkxx6h9vXMXEwUAHKs= +20251021041042.sql h1:wMgSivBV2A0NDcsLmKGIp0kMcVh2IODSG9b4dgzCaOM= +20251021075552.sql h1:8gfSMAglflNO6L0sSzxFNEubYN8/O4thT7OQT+WH+3M= +20251023044432.sql h1:MkvajJs3bfk9+wHvQ43/ccAluJEBARm1gWr1u92ccLA= +20251024034832.sql h1:x3s3VEVYLOSKLAFxJGb2+c1FyTMMvPE+9k4Ew7rKQaI= +20251024074315.sql h1:EjAjelgi5qAfcRq/8vPTlGGYHvAKxNTllm8f0SzZDns= +20251025013451.sql h1:6hnuIiwYiG+6nLhOY/+Yyn+I6ZCFNRZxrJNqBV6HLqE= +20251025013609.sql h1:evPJaTD8WxYRMOJZHkSr7ONLx9PYxT+ankzQt9c/sJ0= +20251027075128.sql h1:/iFQBM1sytjqpyQSOx61q33gnorMgxTiFVSuL6bQqsM= +20251027091406.sql h1:eCZGtUkxAzEAqpC9UsGpP8Df9mS0DEOqSl885LgqpvM= +20251102002037.sql h1:lFJbuoZ2LMQnUNGdcwHVY3Xlfslgzu9t2WByT8yfOZI= +20251102091932.sql h1:rmdhb5m+P+fU8jROBZNyeYgZKuQvucsuljXv4ZVzvks= +20251103081637.sql h1:tf3BcwTeIw+oxMEisKDDfyKnBfalTLs8b0PJA8JWYxY= +20251104042334.sql h1:7PDMWOhmJywolAPKFZ14XaDBeMvcxShaXFN2IemNtzk= +20251104043530.sql h1:qvYVp3ysPf27f1BcoRNCFGovxuVE12lg9d6Xzda6zWU= +20251104080952.sql h1:avghpv1n3yaCDR/TA0X+hgxDGoLBQGu/GJUwj4VT/Ic= +20251104084135.sql h1:rg+eRE5/5sYWR7z+Xyn0zKw8rr8P/oWxF0xhcNVnNec= +20251105044629.sql h1:aS4nm+7hPU3krzm5qouyEf1+d+aAPtlkQ2zgxgV9rXs= From d1d63b7bb397da34842f4370dd8053b944c7a3ca Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Wed, 5 Nov 2025 19:17:45 +0700 Subject: [PATCH 6/7] feat/trx-orders: removed Item from AntibioticSrc --- cmd/main-migration/migrations/20251105121808.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 5 +++-- internal/domain/main-entities/antibiotic-src/dto.go | 4 ++-- internal/domain/main-entities/antibiotic-src/entity.go | 5 ++--- 4 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 cmd/main-migration/migrations/20251105121808.sql diff --git a/cmd/main-migration/migrations/20251105121808.sql b/cmd/main-migration/migrations/20251105121808.sql new file mode 100644 index 00000000..41c1edf0 --- /dev/null +++ b/cmd/main-migration/migrations/20251105121808.sql @@ -0,0 +1,2 @@ +-- Modify "AntibioticSrc" table +ALTER TABLE "public"."AntibioticSrc" DROP COLUMN "Item_Id"; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index b51ad522..88a3f39c 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:6MaKjqJ77v0HFibPPeCdp8Bwg2qOZlEKNgHWc2zq6T0= +h1:c6psxONIBPkfVLCpAnWAm81SgT25UQT6hgO8KAG6O5M= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -69,4 +69,5 @@ h1:6MaKjqJ77v0HFibPPeCdp8Bwg2qOZlEKNgHWc2zq6T0= 20251104043530.sql h1:qvYVp3ysPf27f1BcoRNCFGovxuVE12lg9d6Xzda6zWU= 20251104080952.sql h1:avghpv1n3yaCDR/TA0X+hgxDGoLBQGu/GJUwj4VT/Ic= 20251104084135.sql h1:rg+eRE5/5sYWR7z+Xyn0zKw8rr8P/oWxF0xhcNVnNec= -20251105044629.sql h1:aS4nm+7hPU3krzm5qouyEf1+d+aAPtlkQ2zgxgV9rXs= +20251105044629.sql h1:4NU27HeKUNFsV82LacnwmnCSAH0pSbZR9J9/ZESRs6M= +20251105121808.sql h1:uPFEHJ6pZbuo8+3giskNg4I91MrNRgrR1dMIe7kL+4g= diff --git a/internal/domain/main-entities/antibiotic-src/dto.go b/internal/domain/main-entities/antibiotic-src/dto.go index 9a7a2846..dd453ae3 100644 --- a/internal/domain/main-entities/antibiotic-src/dto.go +++ b/internal/domain/main-entities/antibiotic-src/dto.go @@ -60,8 +60,8 @@ func (d AntibioticSrc) ToResponse() ResponseDto { Code: d.Code, Name: d.Name, AntibioticSrcCategory_Code: d.AntibioticSrcCategory_Code, - Item_Id: d.Item_Id, - Item: d.Item, + // Item_Id: d.Item_Id, + // Item: d.Item, } resp.Main = d.Main return resp diff --git a/internal/domain/main-entities/antibiotic-src/entity.go b/internal/domain/main-entities/antibiotic-src/entity.go index 83089e07..6cb8cc85 100644 --- a/internal/domain/main-entities/antibiotic-src/entity.go +++ b/internal/domain/main-entities/antibiotic-src/entity.go @@ -3,7 +3,6 @@ package antibioticsrc import ( ecore "simrs-vx/internal/domain/base-entities/core" easc "simrs-vx/internal/domain/main-entities/antibiotic-src-category" - ei "simrs-vx/internal/domain/main-entities/item" ) type AntibioticSrc struct { @@ -12,6 +11,6 @@ type AntibioticSrc struct { Name string `json:"name" gorm:"size:50"` AntibioticSrcCategory_Code *string `json:"antibioticSrcCategory_code" gorm:"size:20"` AntibioticSrcCategory *easc.AntibioticSrcCategory `json:"antibioticSrcCategory,omitempty" gorm:"foreignKey:AntibioticSrcCategory_Code;references:Code"` - Item_Id *uint `json:"item_id"` - Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"` + // Item_Id *uint `json:"item_id"` + // Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"` } From 42265e95f747fb7756870f82a525e780ee47c997 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Thu, 6 Nov 2025 11:04:40 +0700 Subject: [PATCH 7/7] doctor all ids into code --- .../migrations/20251106035305.sql | 4 +++ .../migrations/20251106040137.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 6 ++-- .../domain/main-entities/doctor/entity.go | 30 +++++++++++-------- .../domain/main-entities/employee/entity.go | 18 ++++++----- .../domain/references/encounter/encounter.go | 1 + 6 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 cmd/main-migration/migrations/20251106035305.sql create mode 100644 cmd/main-migration/migrations/20251106040137.sql diff --git a/cmd/main-migration/migrations/20251106035305.sql b/cmd/main-migration/migrations/20251106035305.sql new file mode 100644 index 00000000..d2ab1e94 --- /dev/null +++ b/cmd/main-migration/migrations/20251106035305.sql @@ -0,0 +1,4 @@ +-- Modify "Doctor" table +ALTER TABLE "public"."Doctor" ADD COLUMN "SIP_ExpiredDate" timestamptz NULL, ADD COLUMN "Unit_Code" character varying(10) NULL, ADD COLUMN "Specialist_Code" character varying(10) NULL, ADD COLUMN "Subspecialist_Code" character varying(10) NULL, ADD CONSTRAINT "uni_Doctor_Specialist_Code" UNIQUE ("Specialist_Code"), ADD CONSTRAINT "uni_Doctor_Subspecialist_Code" UNIQUE ("Subspecialist_Code"), ADD CONSTRAINT "uni_Doctor_Unit_Code" UNIQUE ("Unit_Code"); +-- Modify "Employee" table +ALTER TABLE "public"."Employee" ADD COLUMN "Contract_ExpiredDate" timestamptz NULL; diff --git a/cmd/main-migration/migrations/20251106040137.sql b/cmd/main-migration/migrations/20251106040137.sql new file mode 100644 index 00000000..f9cb71cc --- /dev/null +++ b/cmd/main-migration/migrations/20251106040137.sql @@ -0,0 +1,2 @@ +-- Modify "Doctor" table +ALTER TABLE "public"."Doctor" DROP CONSTRAINT "uni_Doctor_Specialist_Code", DROP CONSTRAINT "uni_Doctor_Subspecialist_Code", DROP CONSTRAINT "uni_Doctor_Unit_Code"; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index 88a3f39c..d6b62389 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:c6psxONIBPkfVLCpAnWAm81SgT25UQT6hgO8KAG6O5M= +h1:yLtZj2e+mxp2L0eRUjFUIrC1GID4BB3/8x6LaHS+v10= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -70,4 +70,6 @@ h1:c6psxONIBPkfVLCpAnWAm81SgT25UQT6hgO8KAG6O5M= 20251104080952.sql h1:avghpv1n3yaCDR/TA0X+hgxDGoLBQGu/GJUwj4VT/Ic= 20251104084135.sql h1:rg+eRE5/5sYWR7z+Xyn0zKw8rr8P/oWxF0xhcNVnNec= 20251105044629.sql h1:4NU27HeKUNFsV82LacnwmnCSAH0pSbZR9J9/ZESRs6M= -20251105121808.sql h1:uPFEHJ6pZbuo8+3giskNg4I91MrNRgrR1dMIe7kL+4g= +20251105121808.sql h1:fii6LjqWYjrm/pEIqttfvJI6QEUL49gque8wYHh1+yI= +20251106035305.sql h1:hRkWZYLQvjmROqlu9xvuXrPQcBKf6yUGTTbSd0lKbmI= +20251106040137.sql h1:ifT65MV7h0sws5EGBOGefRqxSaZqapEeupuhHMJipyw= diff --git a/internal/domain/main-entities/doctor/entity.go b/internal/domain/main-entities/doctor/entity.go index ec882838..014c6c17 100644 --- a/internal/domain/main-entities/doctor/entity.go +++ b/internal/domain/main-entities/doctor/entity.go @@ -6,19 +6,25 @@ import ( es "simrs-vx/internal/domain/main-entities/specialist" ess "simrs-vx/internal/domain/main-entities/subspecialist" eu "simrs-vx/internal/domain/main-entities/unit" + "time" ) type Doctor struct { - ecore.Main // adjust this according to the needs - Code *string `json:"code" gorm:"unique;size:20"` - Employee_Id *uint `json:"employee_id"` - Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` - IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` - SIP_Number *string `json:"sip_number" gorm:"unique;size:20"` - Unit_Id *uint16 `json:"unit_id"` - Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"` - Specialist_Id *uint16 `json:"specialist_id"` - Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"` - Subspecialist_Id *uint16 `json:"subspecialist_id"` - Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"` + ecore.Main // adjust this according to the needs + Code *string `json:"code" gorm:"unique;size:20"` + Employee_Id *uint `json:"employee_id"` + Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"` + IHS_Number *string `json:"ihs_number" gorm:"unique;size:20"` + SIP_Number *string `json:"sip_number" gorm:"unique;size:20"` + SIP_ExpiredDate *time.Time `json:"sip_expiredDate"` + Unit_Id *uint16 `json:"unit_id"` + Unit_Code *string `json:"unit_code" gorm:"size:10"` + Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"` + // Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"` + Specialist_Id *uint16 `json:"specialist_id"` + Specialist_Code *string `json:"specialist_code" gorm:"size:10"` + Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"` + Subspecialist_Id *uint16 `json:"subspecialist_id"` + Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"` + Subspecialist *ess.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id"` } diff --git a/internal/domain/main-entities/employee/entity.go b/internal/domain/main-entities/employee/entity.go index 7a770be0..299ae021 100644 --- a/internal/domain/main-entities/employee/entity.go +++ b/internal/domain/main-entities/employee/entity.go @@ -6,15 +6,17 @@ import ( eu "simrs-vx/internal/domain/main-entities/user" erc "simrs-vx/internal/domain/references/common" erg "simrs-vx/internal/domain/references/organization" + "time" ) type Employee struct { - ecore.Main // adjust this according to the needs - User_Id *uint `json:"user_id"` - User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"` - Person_Id *uint `json:"person_id"` - Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"` - Position_Code *erg.EmployeePositionCode `json:"position_code" gorm:"size:20"` - Number *string `json:"number" gorm:"size:20"` - Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"` + ecore.Main // adjust this according to the needs + User_Id *uint `json:"user_id"` + User *eu.User `json:"user,omitempty" gorm:"foreignKey:User_Id;references:Id"` + Person_Id *uint `json:"person_id"` + Person *ep.Person `json:"person,omitempty" gorm:"foreignKey:Person_Id;references:Id"` + Position_Code *erg.EmployeePositionCode `json:"position_code" gorm:"size:20"` + Number *string `json:"number" gorm:"size:20"` + Contract_ExpiredDate *time.Time `json:"contract_expiredDate"` + Status_Code erc.ActiveStatusCode `json:"status_code" gorm:"not null;size:10"` } diff --git a/internal/domain/references/encounter/encounter.go b/internal/domain/references/encounter/encounter.go index f7c8fdc8..45ee8c89 100644 --- a/internal/domain/references/encounter/encounter.go +++ b/internal/domain/references/encounter/encounter.go @@ -43,6 +43,7 @@ const ( DMCExtRef DischargeMethodCode = "external" // Rujuk Faskes Lain DMCDeath DischargeMethodCode = "death" // Meninggal DMCDeathOnArrival DischargeMethodCode = "death-on-arrival" // Meninggal Saat Tiba + DMCRunAway DischargeMethodCode = "run-away" // Melarikan Diri TCAmbulance TransportationCode = "ambulance" // Ambulans TCCar TransportationCode = "car" // Mobil