2018-11-25 12:46:45 +01:00
|
|
|
package main
|
|
|
|
|
2018-12-08 18:01:33 +01:00
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
"time"
|
|
|
|
)
|
2018-11-25 12:46:45 +01:00
|
|
|
|
|
|
|
type patient struct {
|
|
|
|
Pesel string
|
|
|
|
Name string
|
|
|
|
Surname string
|
|
|
|
BirthDate time.Time
|
2019-01-11 22:49:42 +01:00
|
|
|
PatientState nullString
|
2018-11-25 12:46:45 +01:00
|
|
|
PatientSex sex
|
2019-01-12 11:27:42 +01:00
|
|
|
PatientEmail nullString
|
2018-11-25 12:46:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type diagnosis struct {
|
|
|
|
IcdSymbol string
|
|
|
|
Name string
|
|
|
|
FieldOfSurgery surgeryField
|
|
|
|
Description string
|
|
|
|
}
|
|
|
|
|
|
|
|
type doctor struct {
|
2018-12-08 18:01:33 +01:00
|
|
|
DoctorID int64
|
2018-11-25 12:46:45 +01:00
|
|
|
Name string
|
|
|
|
Surname string
|
|
|
|
AcademicDegree academicDegree
|
|
|
|
Specialization specialization
|
|
|
|
DateOfEmployment time.Time
|
|
|
|
JobPosition jobPosition
|
|
|
|
}
|
|
|
|
|
|
|
|
type operation struct {
|
2018-12-08 18:01:33 +01:00
|
|
|
OperationID int64
|
2018-11-25 12:46:45 +01:00
|
|
|
Name string
|
2019-01-11 22:49:42 +01:00
|
|
|
AverageTime string
|
|
|
|
OperationType operationTypes
|
|
|
|
Cost float32
|
|
|
|
Refoundation int64
|
2018-11-25 12:46:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type room struct {
|
2019-01-11 22:49:42 +01:00
|
|
|
RoomNumber int
|
|
|
|
NumberOfBeds int
|
|
|
|
IncreasedCare bool
|
2018-11-25 12:46:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type admission struct {
|
2019-01-11 22:49:42 +01:00
|
|
|
AdmissionID int64
|
2018-11-25 12:46:45 +01:00
|
|
|
AdmissionDate time.Time
|
2018-12-22 15:56:43 +01:00
|
|
|
EndDate NullTime
|
2019-01-11 22:49:42 +01:00
|
|
|
PatientPesel nullString
|
|
|
|
DiagnosisSymbol nullString
|
2018-12-18 22:10:09 +01:00
|
|
|
MainDoctor int64
|
|
|
|
PlanedOperation int64
|
|
|
|
RoomNumber int64
|
2018-11-25 12:46:45 +01:00
|
|
|
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
|
2018-12-08 18:01:33 +01:00
|
|
|
|
2018-12-18 22:10:09 +01:00
|
|
|
type iDatabaseModel interface {
|
|
|
|
getPrimaryKey() string
|
|
|
|
getPrimaryKeyName() string
|
|
|
|
}
|
2018-12-08 18:01:33 +01:00
|
|
|
type iDatabaseModels []iDatabaseModel
|
|
|
|
type iStoreModels interface {
|
|
|
|
readModels(rows *sql.Rows) iDatabaseModels
|
|
|
|
}
|