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 nullString
PatientSex sex
PatientEmail nullString
}
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 float32
Refoundation int64
}
type room struct {
RoomNumber int
NumberOfBeds int
IncreasedCare bool
}
type admission struct {
AdmissionID int64
AdmissionDate time.Time
EndDate NullTime
PatientPesel nullString
DiagnosisSymbol 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
}