models

package
v0.0.0-...-d3bc0fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

func ConnectDatabase

func ConnectDatabase()

Types

type Administrator

type Administrator struct {
	ID        string    `json:"id" gorm:"primary_key"`
	Name      string    `json:"name"`
	Gender    bool      `json:"gender"`
	BirthDate time.Time `json:"birthdate"`
	Address   string    `json:"address"`

	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type Doctor

type Doctor struct {
	ID        string    `json:"id" gorm:"primary_key"`
	Name      string    `json:"name"`
	Gender    bool      `json:"gender"`
	BirthDate time.Time `json:"birthdate"`
	Address   string    `json:"address"`

	// foreignkey
	DoctorSpecialitiesID string            `json:"doctor_specialities_id"`
	DoctorSpecialties    DoctorSpecialties `json:"doctor_specialities" gorm:"foreignKey:DoctorSpecialtiesID"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type DoctorSpecialties

type DoctorSpecialties struct {
	ID          string `json:"id" gorm:"primary_key"`
	Specialties string `json:"specialties"`
	Description string `json:"description"`

	// status
	IsNew     bool      `json:"is_new"`
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type DrugConsumptionHistory

type DrugConsumptionHistory struct {
	ID        string `json:"id" gorm:"primary_key"`
	TotalDose string `json:"total_dose"`
	DoseADay  int    `json:"dose_a_day"`

	// foreign
	PatientID        string         `json:"patient_id"`
	Patient          Patient        `json:"patient" gorm:"foreignKey:PatientID"`
	DoctorID         string         `json:"doctor_id"`
	Doctor           Doctor         `json:"doctor" gorm:"foreignKey:DoctorID"`
	ListOfDiseasesID string         `json:"list_of_diseases_id"`
	ListOfDiseases   ListOfDiseases `json:"list_of_diseases" gorm:"foreignKey:ListOfDiseasesID"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type HospitalizedHistory

type HospitalizedHistory struct {
	ID string `json:"id" gorm:"primary_key"`

	// foreign
	PatientID        string                 `json:"patient_id"`
	Patient          Patient                `json:"patient" gorm:"foreignKey:PatientID"`
	DoctorID         string                 `json:"doctor_id"`
	Doctor           Doctor                 `json:"doctor" gorm:"foreignKey:DoctorID"`
	ListOfDiseasesID string                 `json:"list_of_diseases_id"`
	ListOfDiseases   ListOfDiseases         `json:"list_of_diseases" gorm:"foreignKey:ListOfDiseasesID"`
	ChamberID        string                 `json:"chamber_id"`
	Chamber          ListOfHospitalChambers `json:"list_chamber" gorm:"foreignKey:ListOfHospitalChambers"`

	// status
	IsOut     bool      `json:"is_out"`
	CreatedAt time.Time `json:"created_at"`
	OutAt     time.Time `json:"out_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type ListOfDiseases

type ListOfDiseases struct {
	ID          string `json:"id" gorm:"primary_key"`
	Disease     string `json:"disease"` // buat satu disease dengan nama kondisi baik
	Description string `json:"description"`
	Infectious  bool   `json:"infectious"` // apakah menular

	// status
	IsNew     bool      `json:"is_new"`
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type ListOfDrugs

type ListOfDrugs struct {
	ID            string `json:"id" gorm:"primary_key"`
	Drug          string `json:"drug"`
	Description   string `json:"description"`
	Clasification string `json:"clasification"` // list are set in the controller (obat bebas, bebas terbatas, keras, narkotika)

	// stauts
	IsNew     bool      `json:"is_new"`
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type ListOfHospitalChambers

type ListOfHospitalChambers struct {
	ID          string `json:"id" gorm:"primary_key"`
	ChamberName string `json:"chamber_name"`
	Capacity    int    `json:"capacity"`
	Slot        int    `json:"slot"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type LoginAdministrator

type LoginAdministrator struct {
	Username string `json:"username"`
	Password string `json:"password"`

	// foreignkey
	AdministratorID string        `json:"administrator_id"`
	Administrator   Administrator `json:"administrator" gorm:"foreignKey:AdministratorID"`
}

type LoginDoctor

type LoginDoctor struct {
	ID       string `json:"id" gorm:"primary_key"`
	Password string `json:"password"`
}

type Patient

type Patient struct {
	ID        string    `json:"id" gorm:"primary_key"`
	NIK       string    `json:"nik"`
	Name      string    `json:"name"`
	Gender    string    `json:"gender"`
	BirthDate time.Time `json:"birthdate"`
	Address   string    `json:"address"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type TreatmentHistory

type TreatmentHistory struct {
	ID                      string `json:"id" gorm:"primary_key"`
	DiseaseIdentificationAs string `json:"disease_identification_as"`

	// foreign
	PatientID        string         `json:"patient_id"`
	Patient          Patient        `json:"patient" gorm:"foreignKey:PatientID"`
	DoctorID         string         `json:"doctor_id"`
	Doctor           Doctor         `json:"doctor" gorm:"foreignKey:DoctorID"`
	ListOfDiseasesID string         `json:"list_of_diseases_id"`
	ListOfDiseases   ListOfDiseases `json:"list_of_diseases" gorm:"foreignKey:ListOfDiseasesID"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL