database

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg aws.Config, table string) dao.DBActions

New returns a new instance of the DynamoDB database client. It requires a valid AWS configuration and the name of the table to use. It uses a single table design, where the partition key is the UUID of the patient and the sort key is the UUID of the DICOM file.

Types

type DB

type DB struct {
	Client *dynamodb.Client
	Table  string
}

func (DB) AddDCM

func (db DB) AddDCM(ctx context.Context, pk string, data *dao.DCMInfo) error

AddDCM adds a new DICOM file to the database. PK, SK, CreatedAt and DeletedAt are automatically populated.

func (DB) AddPatientInfo

func (db DB) AddPatientInfo(ctx context.Context, data *dao.PatientInfo) error

AddPatient adds a new patient to the database. PK, SK, CreatedAt, UpdatedAt and DeletedAt are automatically populated.

func (DB) CheckDCM

func (db DB) CheckDCM(ctx context.Context, filename string) (bool, error)

CheckDCM searches for patient info by fullname (case sensitive, dynamodb doesn't implement full-text search).

func (DB) DeletePatient

func (db DB) DeletePatient(ctx context.Context, pk string) error

func (DB) GetPatientInfo

func (db DB) GetPatientInfo(ctx context.Context, pk string) (*dao.PatientInfo, error)

GetPatientInfo searches for patient info by fullname (case sensitive, dynamodb doesn't implement full-text search).

func (DB) GetPatientRecords

func (db DB) GetPatientRecords(ctx context.Context, pk string) ([]map[string]interface{}, error)

GetPatientRecords looks for all records for a given patient. It returns a list of SK (INFO and DCM)

func (DB) GetPatientsInfo

func (db DB) GetPatientsInfo(ctx context.Context) ([]dao.PatientInfo, error)

GetPatientInfo returns all patients info.

func (DB) SearchPatientInfo

func (db DB) SearchPatientInfo(ctx context.Context, fullname string) ([]dao.PatientInfo, error)

SearchPatientInfo searches for patient info by fullname (case sensitive, dynamodb doesn't implement full-text search).

func (DB) UpdatePatientInfo

func (db DB) UpdatePatientInfo(ctx context.Context, pk string, data *dao.PatientInfo) error

Jump to

Keyboard shortcuts

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