Documentation ¶
Overview ¶
Package codedelement contains functionality to generate Coded Elements that have a Code and a Description.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllergyConvertor ¶
type AllergyConvertor struct {
// contains filtered or unexported fields
}
AllergyConvertor converts between the HL7 and FHIR representations of codes pertaining to allergies.
func NewAllergyConvertor ¶
func NewAllergyConvertor(hc *config.HL7Config) (AllergyConvertor, error)
NewAllergyConvertor returns a new allergy convertor based on the HL7Config.
func (AllergyConvertor) SeverityHL7ToFHIR ¶
func (c AllergyConvertor) SeverityHL7ToFHIR(severity string) cpb.AllergyIntoleranceSeverityCode_Value
SeverityHL7ToFHIR returns the FHIR representation for the given HL7 severity.
func (AllergyConvertor) TypeHL7ToFHIR ¶
func (c AllergyConvertor) TypeHL7ToFHIR(allergyType string) cpb.AllergyIntoleranceCategoryCode_Value
TypeHL7ToFHIR returns the FHIR representation for the given HL7 type.
type AllergyGenerator ¶
type AllergyGenerator struct { *Generator // contains filtered or unexported fields }
AllergyGenerator provides functionality to generate an allergy.
func NewAllergyGenerator ¶
func NewAllergyGenerator(hc *config.HL7Config, d *config.Data, c clock.Clock, dg DateGenerator) *AllergyGenerator
NewAllergyGenerator creates a new Generator with the allergies from the given configurations.
func (*AllergyGenerator) DeriveCodingSystem ¶
func (g *AllergyGenerator) DeriveCodingSystem(config config.HL7Allergy, a pathway.Allergy) string
DeriveCodingSystem uses the coding system configured for the allergy, or defaults to the allergy coding system in the default message configuration.
func (*AllergyGenerator) DeriveIdentificationDateTime ¶
func (g *AllergyGenerator) DeriveIdentificationDateTime(a pathway.Allergy) ir.NullTime
DeriveIdentificationDateTime returns an absolute or invalid NullTime value for an allergy's IdentificationDateTime.
func (*AllergyGenerator) GenerateRandomDistinctAllergies ¶
func (g *AllergyGenerator) GenerateRandomDistinctAllergies() []*ir.Allergy
GenerateRandomDistinctAllergies generates a list of allergies. The list will have at least one item with probability percentage. After that, the final number of items is picked randomly between 1 to maxAllergies (both inclusive).
type CodeDescriptionMapping ¶
type CodeDescriptionMapping struct {
// contains filtered or unexported fields
}
CodeDescriptionMapping contains a mapping between code and description, to make the lookup more efficient.
func NewCodeDescriptionMapping ¶
func NewCodeDescriptionMapping() *CodeDescriptionMapping
NewCodeDescriptionMapping initializes an empty CodeDescriptionMapping structure.
func (*CodeDescriptionMapping) Add ¶
func (m *CodeDescriptionMapping) Add(code string, description string)
Add adds a code-description pair to the CodeDescriptionMapping.
type CodingSystemConvertor ¶
type CodingSystemConvertor struct {
// contains filtered or unexported fields
}
CodingSystemConvertor converts between the HL7 and FHIR representations of coding systems.
func NewCodingSystemConvertor ¶
func NewCodingSystemConvertor(hc *config.HL7Config) CodingSystemConvertor
NewCodingSystemConvertor returns a new coding system converter based on the HL7Config,
func (CodingSystemConvertor) HL7ToFHIR ¶
func (c CodingSystemConvertor) HL7ToFHIR(name string) string
HL7ToFHIR returns the FHIR representation for the given HL7 name.
type DateGenerator ¶
type DateGenerator interface { // Random returns a random time based on the given time. Random(now time.Time) ir.NullTime }
DateGenerator is an interface for the generation of random dates.
type DiagOrProcGenerator ¶
type DiagOrProcGenerator struct {
*Generator
}
DiagOrProcGenerator is a generator of Diagnoses or Procedures.
func NewDiagnosisGenerator ¶
func NewDiagnosisGenerator(hc *config.HL7Config, d *config.Data, c clock.Clock, dg DateGenerator) *DiagOrProcGenerator
NewDiagnosisGenerator creates a new generator of Diagnoses.
func NewProcedureGenerator ¶
func NewProcedureGenerator(hc *config.HL7Config, d *config.Data, c clock.Clock, dg DateGenerator) *DiagOrProcGenerator
NewProcedureGenerator creates a new generator of Procedures.
func (*DiagOrProcGenerator) RandomOrFromPathway ¶
func (g *DiagOrProcGenerator) RandomOrFromPathway(dt *pathway.DateTime, p *pathway.DiagnosisOrProcedure) *ir.DiagnosisOrProcedure
RandomOrFromPathway returns a random ir.DiagnosisOrProcedure or one based on the pathway depending on the value of the pathway's Code or Description.
type Generator ¶
type Generator struct { // contains a distribution of the coded elements, which will be used // when generating the random CodedElement in Random() function. *sample.DiscreteDistribution // contains filtered or unexported fields }
Generator provides functionality to derive random coded element with some probability distribution.
func (*Generator) DeriveCodeAndDescription ¶
DeriveCodeAndDescription returns underlying CodeDescriptionMapping.
func (*Generator) Random ¶
func (g *Generator) Random() *ir.CodedElement
Random returns a random coded element with some probability distribution.
func (*Generator) RandomType ¶
RandomType returns a random type value, where each value has an equal probability to be selected.
type SimpleDateGenerator ¶
type SimpleDateGenerator struct{}
SimpleDateGenerator is a generator of random dates.