Documentation
¶
Index ¶
- type MedicalRecordService
- func (s *MedicalRecordService) CreateMedicalRecord(record *models.MedicalRecordModel) error
- func (s *MedicalRecordService) DeleteMedicalRecord(ID string) error
- func (s *MedicalRecordService) GetMedicalRecordByID(ID string) (*models.MedicalRecordModel, error)
- func (s *MedicalRecordService) GetMedicalRecordByPatientID(patientID string) ([]models.MedicalRecordModel, error)
- func (s *MedicalRecordService) UpdateMedicalRecord(record *models.MedicalRecordModel) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MedicalRecordService ¶
type MedicalRecordService struct {
// contains filtered or unexported fields
}
MedicalRecordService is the service for MedicalRecord model
func NewMedicalRecordService ¶
func NewMedicalRecordService(db *gorm.DB, ctx *context.ERPContext) *MedicalRecordService
NewMedicalRecordService will create new MedicalRecordService
This method will create a new instance of MedicalRecordService with the given database connection and context.
func (*MedicalRecordService) CreateMedicalRecord ¶
func (s *MedicalRecordService) CreateMedicalRecord(record *models.MedicalRecordModel) error
CreateMedicalRecord creates a new MedicalRecord in the database.
It takes a pointer to a MedicalRecordModel as an argument and returns an error if the creation fails.
func (*MedicalRecordService) DeleteMedicalRecord ¶
func (s *MedicalRecordService) DeleteMedicalRecord(ID string) error
DeleteMedicalRecord deletes a MedicalRecord from the database.
It takes a string argument representing the ID of the MedicalRecord to be deleted and returns an error if the deletion fails.
func (*MedicalRecordService) GetMedicalRecordByID ¶
func (s *MedicalRecordService) GetMedicalRecordByID(ID string) (*models.MedicalRecordModel, error)
GetMedicalRecordByID retrieves a MedicalRecord by its ID from the database.
It takes a string argument representing the ID of the MedicalRecord and returns a pointer to a MedicalRecordModel and an error. If the retrieval fails, it returns an error.
func (*MedicalRecordService) GetMedicalRecordByPatientID ¶
func (s *MedicalRecordService) GetMedicalRecordByPatientID(patientID string) ([]models.MedicalRecordModel, error)
GetMedicalRecordByPatientID retrieves a list of MedicalRecords associated with the specified patient ID from the database.
It takes a string argument representing the patient ID and returns a slice of MedicalRecordModel and an error. If the retrieval fails, it returns an error.
func (*MedicalRecordService) UpdateMedicalRecord ¶
func (s *MedicalRecordService) UpdateMedicalRecord(record *models.MedicalRecordModel) error
UpdateMedicalRecord updates a MedicalRecord in the database.
It takes a pointer to a MedicalRecordModel as an argument and returns an error if the update fails.