Documentation ¶
Overview ¶
Package person provides functionality to generate a person. This includes: - demographic information, ie: name, surname, gender, date of birth, ethnicity, etc. - address, telephone number, - NHS and MRN numbers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressGenerator ¶
AddressGenerator is an interface to generate addresses.
type EthnicityGenerator ¶
type EthnicityGenerator struct {
*sample.DiscreteDistribution
}
EthnicityGenerator generates ethnicity.
func NewEthnicityGenerator ¶
func NewEthnicityGenerator(d *config.Data) EthnicityGenerator
NewEthnicityGenerator returns new EthnicityGenerator based on data provided.
func (EthnicityGenerator) Random ¶
func (eg EthnicityGenerator) Random() *ir.Ethnicity
Random returns a random ethnicity, which can be nil.
type Generator ¶
type Generator struct { Clock clock.Clock NameGenerator *names.Generator GenderConvertor gender.Convertor EthnicityGenerator EthnicityGenerator AddressGenerator AddressGenerator MRNGenerator id.Generator Country string }
Generator is a generator of person.
func (Generator) UpdatePersonFromPathway ¶
UpdatePersonFromPathway updates a person with information from a pathway. Calling this method populates all fields of a Person, if they were not already set. Fields that are set in the pathway's person always override the original person's. Fields that are set in the original person, but not in the pathway, are kept as they are. Fields that are not set in any are generated randomly.