doctor all ids into code

This commit is contained in:
dpurbosakti
2025-11-06 11:04:40 +07:00
parent d1d63b7bb3
commit 42265e95f7
6 changed files with 39 additions and 22 deletions
+18 -12
View File
@@ -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"`
}
@@ -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"`
}
@@ -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