Files
simrsx-be/internal/domain/main-entities/prescription/entity.go
T
2025-11-06 13:34:49 +07:00

26 lines
877 B
Go

package prescription
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
"time"
erc "simrs-vx/internal/domain/references/common"
)
type Prescription struct {
ecore.Main // adjust this according to the needs
Encounter_Id *uint `json:"encounter_id"`
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
Doctor_Code *string `json:"doctor_code" gorm:"size:20"`
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Code;references:Code"`
IssuedAt *time.Time `json:"issuedAt"`
Status_Code erc.DataStatusCode `json:"status_code"`
}
func (d Prescription) IsApproved() bool {
return d.Status_Code == erc.DSCDone
}