models

package
v0.0.0-...-99d0739 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ScheduleStatus = struct {
	Waiting   int
	Completed int
	Cancelled int
}{
	Waiting:   1,
	Completed: 2,
	Cancelled: 2,
}
View Source
var ScheduleType = struct {
	Regular int
	Service int
}{
	Regular: 1,
	Service: 2,
}

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	AccID     int       `json:"acc_id" db:"acc_id"`
	CitizenID string    `json:"citizen_id" db:"citizen_id"`
	Phone     string    `json:"phone" db:"phone"`
	Email     string    `json:"email" db:"email"`
	Role      string    `json:"role" db:"role"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
}

type AccountInfoUpdateRequest

type AccountInfoUpdateRequest struct {
	// "password", "email", "phone", "citizen_id" are possible choices
	Field    string `json:"field"`
	NewValue string `json:"new_value"`
	Password string `json:"password"`
}

type AccountRecoverConfirmRequest

type AccountRecoverConfirmRequest struct {
	CitizenID string `json:"citizen_id" db:"citizen_id"`
	OTP       string `json:"otp" db:"otp"`
}

type AccountRecoverConfirmResponse

type AccountRecoverConfirmResponse struct {
	Token string `json:"token"`
}

type AccountRecoverRequest

type AccountRecoverRequest struct {
	CitizenID string `json:"citizen_id" db:"citizen_id"`
	Email     string `json:"email" db:"email"`
}

type AccountRegistrationRequest

type AccountRegistrationRequest struct {
	CitizenID string `json:"citizen_id" db:"citizen_id"`
	Phone     string `json:"phone" db:"phone"`
	Email     string `json:"email" db:"email"`
	Role      string `json:"role" db:"role"`
}

type AccountRegistrationResponse

type AccountRegistrationResponse struct {
	// JWT token. If acc ID = -1, token will allow user to register new account, otherwise token will allow user to add new patient or staff
	Token string `json:"token"`

	// Account ID (-1 means account is not registered yet)
	AccID int `json:"acc_id"`
}

type AmountOfRecordsByDiagnosis

type AmountOfRecordsByDiagnosis struct {
	DiagnosisID  string                  `json:"diagnosis_id"`
	AmountByTime []AmountOfRecordsByTime `json:"amount_by_time"`
	TotalAmount  int                     `json:"total_amount"`
}

type AmountOfRecordsByDoctor

type AmountOfRecordsByDoctor struct {
	DoctorID     int64                   `json:"doctor_id"`
	AmountByTime []AmountOfRecordsByTime `json:"amount_by_time"`
	TotalAmount  int                     `json:"total_amount"`
}

type AmountOfRecordsByTime

type AmountOfRecordsByTime struct {
	TimestampStart time.Time `json:"timestamp_start"`
	Amount         int       `json:"amount"`
}

type Conversation

type Conversation struct {
	ConversationID int64      `json:"conversation_id"`
	PartnerAccID   int64      `json:"partner_acc_id"`
	PartnerName    string     `json:"partner_name"`
	LastMessageAt  *time.Time `json:"last_message_at"`
}

type DeleteRecordAttachmentRequest

type DeleteRecordAttachmentRequest struct {
	AttachmentFileName string `json:"attachment_file_name"`
}

type DiagnosisInfo

type DiagnosisInfo struct {
	ICDCode     string  `json:"icd_code" db:"icd_code"`
	Name        string  `json:"name" db:"name"`
	Description *string `json:"description" db:"description"`
}

type ExtractedRecordInfo

type ExtractedRecordInfo struct {
	PrimaryDiagnosis   string `json:"primary_diagnosis"`
	SecondaryDiagnosis string `json:"secondary_diagnosis"`
}

type GetScheduleListRequest

type GetScheduleListRequest struct {
	// The list of types of examination (1: Regular, 2: Service)
	Type []int `form:"type[]"`
	// The list of statuses of the schedule (1: Waiting, 2: Completed, 3: Cancelled)
	Status []int `form:"status[]"`
}

type InboundMessage

type InboundMessage struct {
	Type           string     `json:"type"`                      // "sendMessage", "loadHistory", "markSeenMessage"
	ConversationID int64      `json:"conversation_id,omitempty"` // For "sendMessage", "loadHistory", "markSeenMessage"
	PartnerAccID   int64      `json:"partner_acc_id,omitempty"`  // For "sendMessage", "markSeenMessage"
	Text           string     `json:"text,omitempty"`            // For "sendMessage"
	ReadTime       *time.Time `json:"read_time,omitempty"`       // For "markSeenMessage"
}

type InitRegistrationRequest

type InitRegistrationRequest struct {
	CitizenID string `json:"citizen_id" db:"citizen_id"`
}

type LoginRequest

type LoginRequest struct {
	Identifier string `json:"id" db:"id"`
	Password   string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

type MedicalRecordBriefInfo

type MedicalRecordBriefInfo struct {
	RecordID           int     `json:"record_id" db:"record_id"`
	PatientID          int     `json:"patient_id" db:"patient_id"`
	DoctorID           int     `json:"doctor_id" db:"doctor_id"`
	TypeID             string  `json:"type_id" db:"type_id"`
	PrimaryDiagnosis   string  `json:"primary_diagnosis" db:"primary_diagnosis"`
	SecondaryDiagnosis *string `json:"secondary_diagnosis" db:"secondary_diagnosis"`
}

type MedicalRecordInfo

type MedicalRecordInfo struct {
	RecordID     int         `json:"record_id" db:"record_id"`
	PatientID    int         `json:"patient_id" db:"patient_id"`
	DoctorID     int         `json:"doctor_id" db:"doctor_id"`
	TypeID       string      `json:"type_id" db:"type_id"`
	RecordDetail pgtype.JSON `json:"record_detail" db:"record_detail" swaggertype:"object"`
	CreatedAt    time.Time   `json:"created_at" db:"created_at"`
	ExpiredAt    time.Time   `json:"expired_at" db:"expired_at"`
}

type MedicalRecordType

type MedicalRecordType struct {
	TypeID   string `json:"type_id" db:"type_id"`
	TypeName string `json:"type_name" db:"type_name"`
}

type MedicalRecordTypeInfo

type MedicalRecordTypeInfo struct {
	MedicalRecordType
	Description  *string `json:"description" db:"description"`
	TemplatePath string  `json:"template_path" db:"template_path"`
	SchemaPath   string  `json:"schema_path" db:"schema_path"`
}

type MedicationInfo

type MedicationInfo struct {
	MedicationID          int    `json:"med_id" db:"med_id"`
	Name                  string `json:"name" db:"name"`
	GenericName           string `json:"generic_name" db:"generic_name"`
	MedicationType        string `json:"med_type" db:"med_type"`
	Strength              string `json:"strength" db:"strength"`
	RouteOfAdministration string `json:"route_of_administration" db:"route_of_administration"`
	Manufacturer          string `json:"manufacturer" db:"manufacturer"`
}

type Message

type Message struct {
	NewMessage
	MessageID   int64     `json:"message_id"`
	SenderAccID int64     `json:"sender_acc_id"`
	IsSeen      bool      `json:"is_seen"`
	SentAt      time.Time `json:"sent_at"`
}

type NewMedicalRecordRequest

type NewMedicalRecordRequest struct {
	PatientID    int         `json:"patient_id" `
	TypeID       string      `json:"type_id" `
	RecordDetail pgtype.JSON `json:"record_detail" swaggertype:"object"`
}

type NewMedicalRecordResponse

type NewMedicalRecordResponse struct {
	RecordID int `json:"record_id"`
}

type NewMessage

type NewMessage struct {
	ConversationID int64  `json:"conversation_id"`
	Content        string `json:"content"`
}

type NewPrescriptionRequest

type NewPrescriptionRequest struct {
	RecordID           int    `json:"record_id" db:"record_id"`
	IsInsuranceCovered bool   `json:"is_insurance_covered" db:"is_insurance_covered"`
	PrescriptionNote   string `json:"prescription_note" db:"prescription_note"`
}

type NewPrescriptionResponse

type NewPrescriptionResponse struct {
	PrescriptionID int `json:"prescription_id" db:"prescription_id"`
}

type OutboundMessage

type OutboundMessage struct {
	Type           string         `json:"type"`                      // "yourID", "newMessage", "messageHistory", "conversationList",  "error"
	ID             string         `json:"id,omitempty"`              // For "yourID"
	Message        *Message       `json:"message,omitempty"`         // For "newMessage"
	Messages       []Message      `json:"messages,omitempty"`        // For "messageHistory"
	Conversations  []Conversation `json:"conversations,omitempty"`   // For "conversationList"
	Text           string         `json:"text,omitempty"`            // For "error"
	ConversationID int64          `json:"conversation_id,omitempty"` // for "newMessage", "seenMessage", "messageHistory"
	ReadTime       *time.Time     `json:"read_time,omitempty"`       // For "seenMessage"
}

type PasswordResetRequest

type PasswordResetRequest struct {
	NewPassword string `json:"new_password"`
}

type PatientBriefInfo

type PatientBriefInfo struct {
	PatientID   int       `json:"patient_id" db:"patient_id"`
	FullName    string    `json:"full_name" db:"full_name"`
	DateOfBirth time.Time `json:"date_of_birth" db:"date_of_birth"`
	Gender      string    `json:"gender" db:"gender"`
}

type PatientInfo

type PatientInfo struct {
	PatientID                  int       `json:"patient_id" db:"patient_id"`
	FullName                   string    `json:"full_name" db:"full_name"`
	DateOfBirth                time.Time `json:"date_of_birth" db:"date_of_birth"`
	Gender                     string    `json:"gender" db:"gender"`
	Ethnicity                  string    `json:"ethnicity" db:"ethnicity"`
	Nationality                string    `json:"nationality" db:"nationality"`
	Address                    string    `json:"address" db:"address"`
	HealthInsuranceExpiredDate time.Time `json:"health_insurance_expired_date" db:"health_insurance_expired_date"`
	HealthInsuranceNumber      string    `json:"health_insurance_number" db:"health_insurance_number"`
	EmergencyContactInfo       string    `json:"emergency_contact_info" db:"emergency_contact_info"`
}

type PatientInfoUpdateRequest

type PatientInfoUpdateRequest struct {
	FullName                   string    `json:"full_name" db:"full_name"`
	DateOfBirth                time.Time `json:"date_of_birth" db:"date_of_birth"`
	Gender                     string    `json:"gender" db:"gender"`
	Ethnicity                  string    `json:"ethnicity" db:"ethnicity"`
	Nationality                string    `json:"nationality" db:"nationality"`
	Address                    string    `json:"address" db:"address"`
	HealthInsuranceExpiredDate time.Time `json:"health_insurance_expired_date" db:"health_insurance_expired_date"`
	HealthInsuranceNumber      string    `json:"health_insurance_number" db:"health_insurance_number"`
	EmergencyContactInfo       string    `json:"emergency_contact_info" db:"emergency_contact_info"`
}

type PatientRegistrationRequest

type PatientRegistrationRequest struct {
	AccID                      int       `json:"acc_id" db:"acc_id"`
	FullName                   string    `json:"full_name" db:"full_name"`
	DateOfBirth                time.Time `json:"date_of_birth" db:"date_of_birth"`
	Gender                     string    `json:"gender" db:"gender"`
	Ethnicity                  string    `json:"ethnicity" db:"ethnicity"`
	Nationality                string    `json:"nationality" db:"nationality"`
	Address                    string    `json:"address" db:"address"`
	HealthInsuranceExpiredDate time.Time `json:"health_insurance_expired_date" db:"health_insurance_expired_date"`
	HealthInsuranceNumber      string    `json:"health_insurance_number" db:"health_insurance_number"`
	EmergencyContactInfo       string    `json:"emergency_contact_info" db:"emergency_contact_info"`
}

type PrescriptionDetail

type PrescriptionDetail struct {
	MorningDosage   float32 `json:"morning_dosage" db:"morning_dosage"`
	AfternoonDosage float32 `json:"afternoon_dosage" db:"afternoon_dosage"`
	EveningDosage   float32 `json:"evening_dosage" db:"evening_dosage"`
	DurationDays    int     `json:"duration_days" db:"duration_days"`
	TotalDosage     float32 `json:"total_dosage" db:"total_dosage"`
	DosageUnit      string  `json:"dosage_unit" db:"dosage_unit"`
	Instructions    string  `json:"instructions" db:"instructions"`
}

type PrescriptionDetailInfo

type PrescriptionDetailInfo struct {
	MedicationID int `json:"med_id" db:"med_id"`
	PrescriptionDetail
}

type PrescriptionInfo

type PrescriptionInfo struct {
	PrescriptionID     int        `json:"prescription_id" db:"prescription_id"`
	RecordID           int        `json:"record_id" db:"record_id"`
	IsInsuranceCovered bool       `json:"is_insurance_covered" db:"is_insurance_covered"`
	PrescriptionNote   string     `json:"prescription_note" db:"prescription_note"`
	CreatedAt          time.Time  `json:"created_at" db:"created_at"`
	ReceivedAt         *time.Time `json:"received_at" db:"received_at"`
}

type PrescriptionUpdateRequest

type PrescriptionUpdateRequest struct {
	IsInsuranceCovered bool   `json:"is_insurance_covered" db:"is_insurance_covered"`
	PrescriptionNote   string `json:"prescription_note" db:"prescription_note"`
}

type RecordInfoForStatistic

type RecordInfoForStatistic struct {
	PatientID        int64     `json:"patient_id"`
	DoctorID         int64     `json:"doctor_id"`
	PrimaryDiagnosis string    `json:"primary_diagnosis"`
	CreatedAt        time.Time `json:"created_at"`
}

type RecordStatisticRequest

type RecordStatisticRequest struct {
	TimeUnit string `json:"time_unit"` // "day", "week", "month", "year"
	/*
		This use for determine the period of time we want to compile, must be time in RFC3339 format.
		If time unit is "day", the d-m-y you provide in timestamp will determine that exactly date (e.g, the d-m-y itself).
		If time unit is "week", the d-m-y you provide in timestamp will determine the week which that date belong to (e.g, determine the nearest Monday and nearest Sunday which that date sit in between).
		If time unit is "month", the d-m-y you provide in timestamp will determine the month which that date belong to (e.g, the month m in year y).
		If time unit is "week", the d-m-y you provide in timestamp will determine the year which that date belong to (e.g, the year y).
	*/
	Timestamp time.Time `json:"timestamp"`
}

type ScheduleBookingRequest

type ScheduleBookingRequest struct {
	ExaminationDate time.Time `json:"examination_date"`
	// Type of examination (1: Regular, 2: Service)
	Type int `json:"type" enums:"1,2"`
}

type ScheduleBookingResponse

type ScheduleBookingResponse struct {
	ExaminationDate time.Time `json:"examination_date" db:"examination_date"`
	// Type of examination (1: Regular, 2: Service)
	Type                  int    `json:"type" db:"type" enums:"1,2"`
	QueueNumber           int    `json:"queue_number" db:"queue_number"`
	ExpectedReceptionTime string `json:"expected_reception_time" db:"expected_reception_time"`
	// Status of the schedule (1: Waiting, 2: Completed, 3: Cancelled)
	Status int `json:"status" db:"status" enums:"1,2,3"`
}

type ScheduleInfo

type ScheduleInfo struct {
	ScheduleID int `json:"schedule_id" db:"schedule_id"`
	ScheduleBookingResponse
}

type StaffInfo

type StaffInfo struct {
	StaffID     int       `json:"staff_id" db:"staff_id"`
	FullName    string    `json:"full_name" db:"full_name"`
	DateOfBirth time.Time `json:"date_of_birth" db:"date_of_birth"`
	Gender      string    `json:"gender" db:"gender"`
	Department  string    `json:"department" db:"department"`
}

type StaffInfoUpdateRequest

type StaffInfoUpdateRequest struct {
	FullName    string    `json:"full_name" db:"full_name"`
	DateOfBirth time.Time `json:"date_of_birth" db:"date_of_birth"`
	Gender      string    `json:"gender" db:"gender"`
	Department  string    `json:"department" db:"department"`
}

type StaffRegistrationRequest

type StaffRegistrationRequest struct {
	AccID       int       `json:"acc_id" db:"acc_id"`
	FullName    string    `json:"full_name" db:"full_name"`
	DateOfBirth time.Time `json:"date_of_birth" db:"date_of_birth"`
	Gender      string    `json:"gender" db:"gender"`
	Department  string    `json:"department" db:"department"`
}

type UpdateMedicalRecordRequest

type UpdateMedicalRecordRequest struct {
	NewRecordDetail pgtype.JSON `json:"new_record_detail" swaggertype:"object"`
}

type UpdateScheduleStatusRequest

type UpdateScheduleStatusRequest struct {
	ScheduleID int `json:"schedule_id"`
	// New status of the schedule (1: Waiting, 2: Completed, 3: Cancelled)
	NewStatus     int       `json:"new_status"`
	ReceptionTime time.Time `json:"reception_time"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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