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
|
2018-12-18 22:10:09 +01:00
|
|
|
PatientState sql.NullString
|
2018-11-25 12:46:45 +01:00
|
|
|
PatientSex sex
|
|
|
|
PatientEmail string
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2018-12-08 18:01:33 +01:00
|
|
|
averageTime string
|
2018-11-25 12:46:45 +01:00
|
|
|
operationType operationTypes
|
2018-12-18 22:10:09 +01:00
|
|
|
cost uint8
|
2018-12-08 18:01:33 +01:00
|
|
|
refoundation int64
|
2018-11-25 12:46:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type room struct {
|
|
|
|
RoomNumber int
|
|
|
|
NumberOfBeds int
|
|
|
|
IncrasedCare bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type admission struct {
|
2018-12-18 22:10:09 +01:00
|
|
|
AdmissionID int64
|
2018-11-25 12:46:45 +01:00
|
|
|
AdmissionDate time.Time
|
|
|
|
EndDate time.Time
|
|
|
|
PatientPesel string
|
|
|
|
DiagnosisSymbol string
|
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
|
|
|
|
}
|