schema

package
v0.0.0-...-5c8a63a Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfDoctorExists

func CheckIfDoctorExists(client *mongo.Client, email, username string) (bool, error)

func CheckIfPatientExists

func CheckIfPatientExists(client *mongo.Client, username, email string) (bool, error)

func DeleteReportByID

func DeleteReportByID(client *mongo.Client, reportID primitive.ObjectID) error

func InsertAppointment

func InsertAppointment(client *mongo.Client, doctor DoctorUser, patient PatientUser, date time.Time) error

func InsertDoctorUser

func InsertDoctorUser(client *mongo.Client, patient *DoctorUser) error

func InsertPatientUser

func InsertPatientUser(client *mongo.Client, patient *PatientUser) error

func InsertReport

func InsertReport(client *mongo.Client, report *Report) error

Types

type Appointment

type Appointment struct {
	ID              primitive.ObjectID `bson:"_id,omitempty"`
	DoctorID        primitive.ObjectID `bson:"doctorID"`
	PatientID       primitive.ObjectID `bson:"patientID"`
	AppointmentDate time.Time          `bson:"appointmentDate"`
}

func FetchFutureAppointments

func FetchFutureAppointments(client *mongo.Client, patient *PatientUser, doctor *DoctorUser) ([]Appointment, error)

type DoctorUser

type DoctorUser struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"`
	Email     string             `bson:"email"`
	FirstName string             `bson:"firstName"`
	LastName  string             `bson:"lastName"`
	Username  string             `bson:"username"`
	Password  string             `bson:"password"`
}

func FetchDoctorBy

func FetchDoctorBy(client *mongo.Client, field, value string) (*DoctorUser, error)

func FetchDoctors

func FetchDoctors(client *mongo.Client, start, end int) ([]DoctorUser, error)

func NewDoctorUser

func NewDoctorUser(email, firstName, lastName, username, password string) *DoctorUser

type PatientAppointments

type PatientAppointments struct {
	Patient      *PatientUser
	Appointments []Appointment
}

type PatientUser

type PatientUser struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"`
	Email     string             `bson:"email"`
	FirstName string             `bson:"firstName"`
	LastName  string             `bson:"lastName"`
	DOB       time.Time          `bson:"dob"`
	Gender    string             `bson:"gender,omitempty"`
	Username  string             `bson:"username"`
	Password  string             `bson:"password"`
}

func FetchPatientExistsBy

func FetchPatientExistsBy(client *mongo.Client, field, value string) (*PatientUser, error)

func FetchUniquePatientsFromAppointments

func FetchUniquePatientsFromAppointments(client *mongo.Client, appointments []Appointment) ([]PatientUser, error)

func NewPatientUser

func NewPatientUser(email, firstName, lastName string, dob time.Time, gender, username, password string) *PatientUser

type Report

type Report struct {
	ID              primitive.ObjectID `bson:"_id,omitempty"`
	DoctorID        primitive.ObjectID `bson:"doctorID"`
	PatientID       primitive.ObjectID `bson:"patientID"`
	AppointmentDate time.Time          `bson:"appointmentDate"`
	Notes           string             `bson:"notes"`
}

func GetReportsByUserID

func GetReportsByUserID(client *mongo.Client, userID primitive.ObjectID) ([]Report, error)

Jump to

Keyboard shortcuts

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