Documentation ¶
Overview ¶
Package hl7ids contains utilities to get identifiers from HL7v2 messages.
Index ¶
- func GetAllMRNs(pid *hl7.PID) []hl7.CX
- func GetAllMRNsWithOptions(pid *hl7.PID, opts *Options) []hl7.CX
- func GetMRNNumber(pid *hl7.PID) string
- func GetMRNNumberWithOptions(pid *hl7.PID, opts *Options) string
- func GetNHSNumber(pid *hl7.PID) string
- func GetNHSNumberWithOptions(pid *hl7.PID, opts *Options) string
- func HasKeywordInAnyField(cx hl7.CX, keyword string) bool
- func NHSNumberIsValid(nhs string) bool
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllMRNs ¶
GetAllMRNs returns all MRNs from the PID, using the default options.
func GetAllMRNsWithOptions ¶
GetAllMRNsWithOptions returns all MRNs from the PID, using the provided options.
func GetMRNNumber ¶
GetMRNNumber retrieves the primary MRN number from the provided PID segment using the default options.
func GetMRNNumberWithOptions ¶
GetMRNNumberWithOptions retrieves the primary MRN number from the provided PID segment using the provided options.
func GetNHSNumber ¶
GetNHSNumber retrieves the primary MRN number from the provided PID segment using the default options.
func GetNHSNumberWithOptions ¶
GetNHSNumberWithOptions retrieves the primary MRN number from the provided PID segment using the provided options.
func HasKeywordInAnyField ¶
HasKeywordInAnyField returns whether an identifier of type CX contains "keyword" in its Identifier Type Code, Assigning Facility, Assigning Authority or Code Identifying The Check Digit Scheme Employedfields.
func NHSNumberIsValid ¶
NHSNumberIsValid returns whether the given NHS Number is valid. An explanation of this algorithm can be found here: http://www.datadictionary.nhs.uk/version2/data_dictionary/data_field_notes/n/nhs_number_de.asp?shownav=0
Types ¶
type Options ¶
type Options struct { // The PID fields to look for, in this order, to find the MRNs. Values other than 2, 3 or 4 are ignored. MRNFrom []int // The function to apply to hl7.CX elements to check whether the item is a valid MRN. IsValidMRN func(hl7.CX) bool // The PID fields to look for, in this order, to find the NHS number. Values other than 2, 3 or 4 are ignored. NHSFrom []int // The function to apply to hl7.CX elements to check whether the item is a valid MRN. IsValidNHS func(hl7.CX) bool }
Options contains the configuration for getting identifiers.