entity

package
v0.0.0-...-ddd1a7f Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrICDRecordNotFound = errors.New("no record found for this code")

Functions

func IsErrNotFound

func IsErrNotFound(err error) bool

func IsValidEmail

func IsValidEmail(email string) bool

Types

type CreateICDRequest

type CreateICDRequest struct {
	// CategoryCode always at least a 3lettered and above code
	CategoryCode string `conform:"trim" json:"categoryCode" validate:"required|min_len:3"`

	// DiagnosisCode could be null but has a max of 1 digits (9)
	DiagnosisCode *string `conform:"trim" json:"diagnosisCode" validate:""`

	// AbbreviatedDescription is a brief description of the diagnosis
	AbbreviatedDescription string `conform:"trim" json:"abbreviatedDescription" validate:"required|min_len:4"`

	// FullDescription is a description of the  diagnosis in full.
	FullDescription string `conform:"trim" json:"fullDescription" validate:"required|min_len:4"`

	// CategoryTitle title of category
	CategoryTitle string `conform:"trim" json:"categoryTitle" validate:"required|min_len:3"`
}

CreateICDRequest handles the create ICD request body

func (CreateICDRequest) GetFullCode

func (req CreateICDRequest) GetFullCode() string

FullCode is a combination of categorycode and DiagnosisCode

type CreateICDResponse

type CreateICDResponse struct {
	CategoryCode           string  `json:"categoryCode" `
	DiagnosisCode          *string `json:"diagnosisCode"`
	AbbreviatedDescription string  `json:"abbreviatedDescription"`
	FullDescription        string  `json:"fullDescription"`
	CategoryTitle          string  `json:"categoryTitle"`
}

type EditICDRequest

type EditICDRequest struct {
	CategoryCode           string  `conform:"trim" json:"categoryCode" validate:"required|min_len:3"`
	DiagnosisCode          *string `conform:"trim" json:"diagnosisCode" validate:""`
	AbbreviatedDescription string  `conform:"trim" json:"abbreviatedDescription" validate:"required|min_len:4"`
	FullDescription        string  `conform:"trim" json:"fullDescription" validate:"required|min_len:4"`
	CategoryTitle          string  `conform:"trim" json:"categoryTitle" validate:"required|min_len:3"`
}

EditICDRequest handles the edit ICD request body

func (EditICDRequest) GetFullCode

func (req EditICDRequest) GetFullCode() string

FullCode is a combination of categorycode and DiagnosisCode

type ICD

type ICD struct {
	bun.BaseModel          `bun:"table:icd10_codes"`
	CategoryCode           string    `json:"categoryCode"`
	DiagnosisCode          *string   `json:"diagnosisCode"`
	FullCode               string    `json:"fullCode" bun:",pk"`
	AbbreviatedDescription string    `json:"abbreviatedDeScription"`
	FullDescription        string    `json:"fullDecription"`
	CategoryTitle          string    `json:"categoryTitle"`
	CreatedAt              time.Time `json:"createdAt"`
	UpdatedAt              time.Time `json:"updatedAt"`
}

type IICDRepository

type IICDRepository interface {
	CreateRecord(ctx context.Context, in CreateICDRequest) (*ICD, error)
	UpdateRecord(ctx context.Context, fullCode string, in ICD) (*ICD, error)
	GetRecord(ctx context.Context, id string) (*ICD, error)
	DeleteRecord(ctx context.Context, id string) error
	ListRecords(ctx context.Context, limit int, cursor string) (nextCursor *string, results []ICD, e error)
	HasPrevPage(ctx context.Context, onFirstPage bool, cursor string) (cursorPrevPage *string, err error)
}

Jump to

Keyboard shortcuts

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