admissionServer/basicModels.go

81 lines
1.5 KiB
Go

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 NullTime
operationType operationTypes
cost uint8
refoundation int64
}
type room struct {
RoomNumber int
NumberOfBeds int
IncrasedCare bool
}
type admission struct {
AdmissionID string
AdmissionDate time.Time
EndDate NullTime
PatientPesel sql.NullString
DiagnosisSymbol sql.NullString
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
}