admissionServer/basicModels.go

81 lines
1.4 KiB
Go
Raw Normal View History

package main
import (
"database/sql"
"time"
)
type patient struct {
Pesel string
Name string
Surname string
BirthDate time.Time
PatientState sql.NullString
PatientSex sex
PatientEmail string
}
type diagnosis struct {
IcdSymbol string
Name string
FieldOfSurgery surgeryField
Description string
}
type doctor struct {
DoctorID int64
Name string
Surname string
AcademicDegree academicDegree
Specialization specialization
DateOfEmployment time.Time
JobPosition jobPosition
}
type operation struct {
OperationID int64
Name string
averageTime string
operationType operationTypes
cost uint8
refoundation int64
}
type room struct {
RoomNumber int
NumberOfBeds int
IncrasedCare bool
}
type admission struct {
AdmissionID int64
AdmissionDate time.Time
EndDate time.Time
PatientPesel string
DiagnosisSymbol string
MainDoctor int64
PlanedOperation int64
RoomNumber int64
IsPlanned bool
}
func (p patient) showPatient() string {
return p.Pesel
}
type patients []patient
type doctors []doctor
type diagnoses []diagnosis
type admissions []admission
type operations []operation
type rooms []room
type iDatabaseModel interface {
getPrimaryKey() string
getPrimaryKeyName() string
}
type iDatabaseModels []iDatabaseModel
type iStoreModels interface {
readModels(rows *sql.Rows) iDatabaseModels
}