patients

package
v0.0.0-...-c7f2103 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeListAllEndpoint

func MakeListAllEndpoint(component Component) endpoint.Endpoint

MakeListAllEndpoint makes the ListAllEndpoint.

Types

type Component

type Component interface {
	ListAll(context.Context) ([]Patient, error)
}

Component is the patient business component interface.

func NewComponent

func NewComponent(module Module) Component

NewComponent returns a patient business component

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database deals with the communication with CockroachDB.

func InitDatabase

func InitDatabase(db cockroachDB) (*Database, error)

InitDatabase initializes the database

func (*Database) ReadFromDb

func (c *Database) ReadFromDb() ([]Patient, error)

ReadFromDb returns all the patients from the database

type Endpoints

type Endpoints struct {
	ListAllEndpoint endpoint.Endpoint
}

Endpoints wraps a service behind a set of endpoints.

type Module

type Module interface {
	ListAll(ctx context.Context) ([]Patient, error)
}

Module contains the business logic for the patients.

func NewModule

func NewModule(database Database) Module

NewModule returns a patient module

type Patient

type Patient struct {
	ID         int32     `json:"id,omitempty"`
	FirstName  string    `json:"firstName,omitempty"`
	LastName   string    `json:"lastName,omitempty"`
	BirthDate  time.Time `json:"birthDate,omitempty"`
	AVSNumber  string    `json:"avsNumber,omitempty"`
	DoctorsIds []int32   `json:"doctors,omitempty"`
}

Patient represents a patient

Jump to

Keyboard shortcuts

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