Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeCharsetToUTF8From(charmap *charmap.Charmap, data []byte) ([]byte, error)
- func IdentifyMessage(messageData []byte, encoding Encoding) (string, string, error)
- func Marshal(message interface{}, fieldSeparator FieldSeparator, enc Encoding, tz Timezone, ...) ([][]byte, error)
- func Unmarshal(messageData []byte, targetStruct interface{}, enc Encoding, tz Timezone) error
- type Delimiters
- type Encoding
- type Error
- type FieldSeparator
- type LineBreak
- type Notation
- type OutputRecord
- type OutputRecords
- type RETV
- type Timezone
Constants ¶
View Source
const ( ANNOTATION_FIELDSEPARATOR = "fieldseparator" ANNOTATION_DELIMITER = "delimiter" // annotation that triggers the delimiters in the scanner to be reset ANNOTATION_REQUIRED = "require" // field-annotation: by default all fields are optinal ANNOTATION_OPTIONAL = "optional" // record-annotation: by default all records are mandatory ANNOTATION_SEQUENCE = "sequence" // indicating that a sequence number should be generated (output only) ANNOTATION_LONGDATE = "longdate" )
View Source
const ShortNotation = 2
View Source
const StandardNotation = 1
Variables ¶
View Source
var EOF = fmt.Errorf("EOF")
Functions ¶
func EncodeCharsetToUTF8From ¶
func IdentifyMessage ¶ added in v0.0.3
Types ¶
type Delimiters ¶
HL7 Format delimiters https://blog.interfaceware.com/hl7-delimiter-redefinitions/
type Encoding ¶
type Encoding int
const EncodingASCII Encoding = 2
const EncodingDOS852 Encoding = 6
const EncodingDOS855 Encoding = 7
const EncodingDOS866 Encoding = 8
const EncodingISO8859_1 Encoding = 9
const EncodingUTF8 Encoding = 1
const EncodingWindows1250 Encoding = 3
const EncodingWindows1251 Encoding = 4
const EncodingWindows1252 Encoding = 5
type FieldSeparator ¶ added in v0.0.7
type FieldSeparator string
const StandardFieldSeparator FieldSeparator = "|"
type LineBreak ¶
type LineBreak int
const CR LineBreak = 0x13
const CRLF LineBreak = 0x1310
const LF LineBreak = 0x10
type Notation ¶
type Notation int
Notation defines how the output format is build
ShortNotation will skip all delimiters to the right of the last value StandardNotation will always produce as many delimiters as there are values in the export-format
type OutputRecord ¶
type OutputRecords ¶
type OutputRecords []OutputRecord
func (OutputRecords) Less ¶
func (or OutputRecords) Less(i, j int) bool
func (OutputRecords) Swap ¶
func (or OutputRecords) Swap(i, j int)
type RETV ¶
type RETV int
func ParseStruct ¶
func ParseStruct(bufferedInputLines []string, depth int, currentInputLine int, targetStruct interface{}, enc Encoding, tz Timezone, delimiters Delimiters) (int, RETV, error)
HL7 delimimters (default, rewritten at startup) https://blog.interfaceware.com/hl7-delimiter-redefinitions/ This function takes a string and a struct and matches the annotated fields to the string-input
Click to show internal directories.
Click to hide internal directories.