niki/patientapp/service/entity/patient.go

65 lines
1.3 KiB
Go

package entity
import "time"
type Patient struct {
ID int64
FirstName string
LastName string
DateOfBirth *time.Time
Sex Sex
Phone string
Address Address
CaseStatus CaseStatus
ReferralSource ReferralSource
AssignedStaffId int64
StartDate string
EndDate string
}
// Sex ================================== Sex type ==========================================
type Sex string
const (
SexUnknown Sex = "unknown"
SexMale Sex = "male"
SexFemale Sex = "female"
SexOther Sex = "other"
)
func (s Sex) SexValidation() bool {
switch s {
case SexUnknown, SexMale, SexFemale, SexOther:
return true
default:
return false
}
}
// CaseStatus =================================== Case Status =======================================
type CaseStatus string
const (
Open CaseStatus = "open"
Close CaseStatus = "close"
InProgress CaseStatus = "inProgress"
)
func (s CaseStatus) CaseStatusValidation() bool {
switch s {
case Open, Close, InProgress:
return true
default:
return false
}
}
// ReferralSource =================================== Referral source =======================================
type ReferralSource string
const (
Hospital ReferralSource = "hospital"
Community ReferralSource = "community"
Other ReferralSource = "other"
)