refactor/unit-dropping: perbaikan

This commit is contained in:
2025-12-12 09:46:28 +07:00
parent 261f3cdeb3
commit f651a185b3
6 changed files with 20 additions and 16 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ require (
github.com/jackc/pgx/v5 v5.5.5 github.com/jackc/pgx/v5 v5.5.5
github.com/karincake/apem v0.0.17 github.com/karincake/apem v0.0.17
github.com/karincake/dodol v0.0.1 github.com/karincake/dodol v0.0.1
github.com/karincake/getuk v0.3.1 github.com/karincake/getuk v0.3.2
github.com/karincake/hongkue v0.0.4 github.com/karincake/hongkue v0.0.4
github.com/karincake/lepet v0.0.1 github.com/karincake/lepet v0.0.1
github.com/karincake/risoles v0.0.3 github.com/karincake/risoles v0.0.3
+2 -2
View File
@@ -81,8 +81,8 @@ github.com/karincake/apem v0.0.17 h1:y3WXCr9GWLFFFH4Qyq/VWlWWpijHh5zpTc3Lm96twa4
github.com/karincake/apem v0.0.17/go.mod h1:cQP2sJfDrLRIiwWoaLWw/z8uAya+DWu/FpmYeinMQXM= github.com/karincake/apem v0.0.17/go.mod h1:cQP2sJfDrLRIiwWoaLWw/z8uAya+DWu/FpmYeinMQXM=
github.com/karincake/dodol v0.0.1 h1:jUXmJh1r0Ei4fmHPZ6IUkoplW/V9d27L63JEl6zudL0= github.com/karincake/dodol v0.0.1 h1:jUXmJh1r0Ei4fmHPZ6IUkoplW/V9d27L63JEl6zudL0=
github.com/karincake/dodol v0.0.1/go.mod h1:2f1NcvkvY0J3GMUkwILNDYVvRUpz0W3lpPp/Ha/Ld24= github.com/karincake/dodol v0.0.1/go.mod h1:2f1NcvkvY0J3GMUkwILNDYVvRUpz0W3lpPp/Ha/Ld24=
github.com/karincake/getuk v0.3.1 h1:yRqBTrwpnjYcZD3gPDoSxFlsLgI9/GKCr3ZCsS4TtYQ= github.com/karincake/getuk v0.3.2 h1:Qe+PRQ2qdgdiJlWiVEq37N8rrgS654nUnY0PWS6pMzA=
github.com/karincake/getuk v0.3.1/go.mod h1:NVnvxSGAkQ/xuq99FzWACvY5efyKPLFla1cKB8czm7c= github.com/karincake/getuk v0.3.2/go.mod h1:nFl133aKQqxRbe5q9lo8q7BxlYBavmbkpglBhq/dNWk=
github.com/karincake/hongkue v0.0.4 h1:oWthq6cDg5DvDm1Z3e7mCLOATQf+oAdtHxN9OPnCfA8= github.com/karincake/hongkue v0.0.4 h1:oWthq6cDg5DvDm1Z3e7mCLOATQf+oAdtHxN9OPnCfA8=
github.com/karincake/hongkue v0.0.4/go.mod h1:YVi5Lyh3DE+GRHx2OSODOr7FwvLi8U4idvcPHO7yeag= github.com/karincake/hongkue v0.0.4/go.mod h1:YVi5Lyh3DE+GRHx2OSODOr7FwvLi8U4idvcPHO7yeag=
github.com/karincake/lepet v0.0.1 h1:eq/cwn5BBg0jWZ1c/MmvhFIBma0zBpVs2LwkfDOncy4= github.com/karincake/lepet v0.0.1 h1:eq/cwn5BBg0jWZ1c/MmvhFIBma0zBpVs2LwkfDOncy4=
+9 -8
View File
@@ -26,14 +26,15 @@ type ReadListDto struct {
} }
type FilterDto struct { type FilterDto struct {
Code *string `json:"code"` Code *string `json:"code"`
Employee_Id *uint `json:"employee-id"` Employee_Id *uint `json:"employee-id"`
IHS_Number *string `json:"ihs-number" validate:"maxLength=20"` IHS_Number *string `json:"ihs-number" validate:"maxLength=20"`
SIP_Number *string `json:"sip-number" validate:"maxLength=20"` SIP_Number *string `json:"sip-number" validate:"maxLength=20"`
SIP_ExpiredDate *string `json:"sip-expiredDate"` SIP_ExpiredDate *string `json:"sip-expiredDate"`
Unit_Code *string `json:"unit-code"` Unit_Code *string `json:"unit-code"`
Specialist_Code *string `json:"specialist-code"` Specialist_Code *string `json:"specialist-code"`
Subspecialist_Code *string `json:"subspecialist-code"` Specialist_Code_Opt *string `json:"specialist-code-opt"`
Subspecialist_Code *string `json:"subspecialist-code"`
} }
type ReadDetailDto struct { type ReadDetailDto struct {
@@ -105,6 +105,7 @@ type FilterDto struct {
RegisteredAt *time.Time `json:"registeredAt"` RegisteredAt *time.Time `json:"registeredAt"`
Class_Code ere.EncounterClassCode `json:"class-code" validate:"maxLength=10"` Class_Code ere.EncounterClassCode `json:"class-code" validate:"maxLength=10"`
Specialist_Code *string `json:"specialist-code"` Specialist_Code *string `json:"specialist-code"`
Specialist_Code_Opt *string `json:"specialist-code-opt"`
Subspecialist_Code *string `json:"subspecialist-code"` Subspecialist_Code *string `json:"subspecialist-code"`
VisitDate time.Time `json:"visitDate"` VisitDate time.Time `json:"visitDate"`
Appoinment_Doctor_Code *string `json:"appointment-doctor-code"` Appoinment_Doctor_Code *string `json:"appointment-doctor-code"`
@@ -70,7 +70,7 @@ const (
OCCHcu OutpatientClassCode = "hcu" // HCU OCCHcu OutpatientClassCode = "hcu" // HCU
OCCVk OutpatientClassCode = "vk" // Verlos kamer OCCVk OutpatientClassCode = "vk" // Verlos kamer
ACCReg AmbulatoryClassCode = "reg" // Regular ACCReg AmbulatoryClassCode = "regular" // Regular
// ACCRehab ACCRme AmbulatoryClassCode = "rme" // Rehab Medik // ACCRehab ACCRme AmbulatoryClassCode = "rme" // Rehab Medik
// ACCCad AmbulatoryClassCode = "chemo-adm" // Chemotherapy // ACCCad AmbulatoryClassCode = "chemo-adm" // Chemotherapy
// ACCCac AmbulatoryClassCode = "chemo-act" // Chemotherapy // ACCCac AmbulatoryClassCode = "chemo-act" // Chemotherapy
@@ -83,15 +83,17 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.En
tx = tx.Where("\"Encounter\".\"Status_Code\" = ?", *input.Status_Code) tx = tx.Where("\"Encounter\".\"Status_Code\" = ?", *input.Status_Code)
} }
if input.Specialist_Code != nil { // if input.Specialist_Code != nil {
tx = tx.Where("\"Encounter\".\"Specialist_Code\" = ?", *input.Specialist_Code) // tx = tx.Where("\"Encounter\".\"Specialist_Code\" = ?", *input.Specialist_Code)
} // }
if input.PaymentMethod_Code != nil { if input.PaymentMethod_Code != nil {
tx = tx.Where("\"Encounter\".\"PaymentMethod_Code\" = ?", *input.PaymentMethod_Code) tx = tx.Where("\"Encounter\".\"PaymentMethod_Code\" = ?", *input.PaymentMethod_Code)
} }
tx = tx.Scopes(gh.Preload(input.Includes)). tx = tx.Debug().
Scopes(gh.Filter(input.FilterDto)).
Scopes(gh.Preload(input.Includes)).
Count(&count). Count(&count).
Scopes(gh.Paginate(input, &pagination)). Scopes(gh.Paginate(input, &pagination)).
Order("\"CreatedAt\" DESC") Order("\"CreatedAt\" DESC")