gender

package
v0.0.0-...-0da26dc Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package gender contains the functionality to convert gender values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Convertor

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

Convertor converts gender between pathway, HL7 and internal representations.

func NewConvertor

func NewConvertor(c *config.HL7Config) Convertor

NewConvertor returns a new gender Convertor based on the HL7 config.

func (Convertor) HL7ToFHIR

func (gc Convertor) HL7ToFHIR(gender string) cpb.AdministrativeGenderCode_Value

HL7ToFHIR returns the FHIR representation for the given HL7 gender.

func (Convertor) HL7ToInternal

func (gc Convertor) HL7ToInternal(gender string) Internal

HL7ToInternal returns the Internal representation for the given HL7 gender.

func (Convertor) InternalToHL7

func (gc Convertor) InternalToHL7(gender Internal) string

InternalToHL7 returns the HL7 representation for the given Internal gender.

func (Convertor) PathwayToHL7

func (gc Convertor) PathwayToHL7(g pathway.Gender) string

PathwayToHL7 converts pathway.Gender to HL7 gender representation. If pathway.Gender is not specified as Male or Female, return Unknown.

type Internal

type Internal int

Internal is an internal representation of the gender.

const (
	// Unknown is an unknown gender.
	Unknown Internal = iota
	// Male is a male gender.
	Male
	// Female is a female gender.
	Female
)

func Random

func Random() Internal

Random generates a random gender from the options of Male or Female with equal probability.

Jump to

Keyboard shortcuts

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