sciensano

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURL = "https://epistat.sciensano.be"

Variables

View Source
var Routes = map[string]string{
	"cases":            "/Data/COVID19BE_CASES_AGESEX.json",
	"hospitalisations": "/Data/COVID19BE_HOSP.json",
	"mortalities":      "/Data/COVID19BE_MORT.json",
	"testResults":      "/Data/COVID19BE_tests.json",
	"vaccinations":     "/Data/COVID19BE_VACC.json",
}

Functions

This section is empty.

Types

type Case

type Case struct {
	TimeStamp TimeStamp `json:"DATE"`
	Province  string    `json:"PROVINCE"`
	Region    string    `json:"REGION"`
	AgeGroup  string    `json:"AGEGROUP"`
	Cases     int       `json:"CASES"`
}

func (Case) MarshalEasyJSON

func (v Case) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Case) MarshalJSON

func (v Case) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Case) UnmarshalEasyJSON

func (v *Case) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Case) UnmarshalJSON

func (v *Case) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Cases

type Cases []*Case

func (Cases) MarshalEasyJSON

func (v Cases) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Cases) MarshalJSON

func (v Cases) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Cases) Summarize

func (cs Cases) Summarize(summaryColumn SummaryColumn) (*tabulator.Tabulator, error)

func (*Cases) UnmarshalEasyJSON

func (v *Cases) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Cases) UnmarshalJSON

func (v *Cases) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DoseType

type DoseType int

DoseType is the type of vaccination: first, full, singledose, booster, etc.

const (
	Partial DoseType = iota
	Full
	SingleDose
	Booster
	Booster2
	Booster3
)

func (DoseType) MarshalJSON

func (d DoseType) MarshalJSON() (body []byte, err error)

func (*DoseType) String

func (d *DoseType) String() string

func (*DoseType) UnmarshalJSON

func (d *DoseType) UnmarshalJSON(body []byte) (err error)

type Hospitalisation

type Hospitalisation struct {
	TimeStamp   TimeStamp `json:"DATE"`
	Province    string    `json:"PROVINCE"`
	Region      string    `json:"REGION"`
	TotalIn     int       `json:"TOTAL_IN"`
	TotalInICU  int       `json:"TOTAL_IN_ICU"`
	TotalInResp int       `json:"TOTAL_IN_RESP"`
	TotalInECMO int       `json:"TOTAL_IN_ECMO"`
}

type Hospitalisations

type Hospitalisations []*Hospitalisation

func (Hospitalisations) Categorize

func (h Hospitalisations) Categorize() *tabulator.Tabulator

func (Hospitalisations) Summarize

func (h Hospitalisations) Summarize(summaryColumn SummaryColumn) (*tabulator.Tabulator, error)

type Mortalities

type Mortalities []*Mortality

func (Mortalities) Summarize

func (m Mortalities) Summarize(summaryColumn SummaryColumn) (*tabulator.Tabulator, error)

type Mortality

type Mortality struct {
	TimeStamp TimeStamp `json:"DATE"`
	Region    string    `json:"REGION"`
	AgeGroup  string    `json:"AGEGROUP"`
	Deaths    int       `json:"DEATHS"`
}

type SummaryColumn

type SummaryColumn int
const (
	Total SummaryColumn = iota
	ByRegion
	ByProvince
	ByAgeGroup
	ByManufacturer
)

func (SummaryColumn) String

func (s SummaryColumn) String() string

type TestResult

type TestResult struct {
	TimeStamp TimeStamp `json:"DATE"`
	Province  string    `json:"PROVINCE"`
	Region    string    `json:"REGION"`
	Total     int       `json:"TESTS_ALL"`
	Positive  int       `json:"TESTS_ALL_POS"`
}

type TestResults

type TestResults []*TestResult

func (TestResults) Categorize

func (r TestResults) Categorize() *tabulator.Tabulator

func (TestResults) Summarize

func (r TestResults) Summarize(summaryColumn SummaryColumn) (*tabulator.Tabulator, error)

type TimeStamp

type TimeStamp struct {
	time.Time
}

TimeStamp represents a timestamp in the API response. Needed for parsing purposes

func (*TimeStamp) MarshalJSON

func (ts *TimeStamp) MarshalJSON() ([]byte, error)

MarshalJSON marshals a TimeStamp to JSON

func (*TimeStamp) UnmarshalJSON

func (ts *TimeStamp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a TimeStamp from the API responder.

type Vaccination

type Vaccination struct {
	TimeStamp    TimeStamp `json:"DATE"`
	Manufacturer string    `json:"BRAND"`
	Region       string    `json:"REGION"`
	AgeGroup     string    `json:"AGEGROUP"`
	Gender       string    `json:"SEX"`
	Dose         DoseType  `json:"DOSE"`
	Count        int       `json:"COUNT"`
}

func (Vaccination) MarshalEasyJSON

func (v Vaccination) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Vaccination) MarshalJSON

func (v Vaccination) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Vaccination) UnmarshalEasyJSON

func (v *Vaccination) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Vaccination) UnmarshalJSON

func (v *Vaccination) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Vaccinations

type Vaccinations []*Vaccination

func (Vaccinations) Categorize

func (v Vaccinations) Categorize() *tabulator.Tabulator

func (Vaccinations) MarshalEasyJSON

func (v Vaccinations) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Vaccinations) MarshalJSON

func (v Vaccinations) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Vaccinations) Summarize

func (v Vaccinations) Summarize(summaryColumn SummaryColumn) (*tabulator.Tabulator, error)

func (*Vaccinations) UnmarshalEasyJSON

func (v *Vaccinations) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Vaccinations) UnmarshalJSON

func (v *Vaccinations) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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