func (dt *DT) Unmarshal(field []byte, _ *Context) error {
	*dt = DT(field)
	return nil
}
Unmarshal unmarshals the DT value.
package hl7
import (
	"bytes"
	"errors"
	"reflect"
	"strconv"
	"time"
	"golang.org/x/text/encoding/unicode"
)
type ST string
var _ Primitive = (*ST)(nil)
func NewST(st ST) *ST {
	return &st
}
func (st *ST) Marshal(_ *Context) ([]byte, error) {
	return []byte(string(*st)), nil
}
func (st *ST) Unmarshal(field []byte, c *Context) error {
	parsed, err := parseText(field, c)
	if err != nil {
		*st = ""
		return err
	}
	*st = ST(parsed)
	return nil
}
func SanitizeString(s string) string {
	if isHL7Null([]byte(s)) {
		return ""
	}
	return s
}
func (st *ST) SanitizedString() string {
	return SanitizeString(st.String())
}
func (st *ST) String() string {
	if st == nil {
		return ""
	}
	return string(*st)
}
func (st *ST) Empty() bool {
	return st == nil || *st == ""
}
type ID string
var _ Primitive = (*ID)(nil)
func NewID(id ID) *ID {
	return &id
}
func (id *ID) Marshal(_ *Context) ([]byte, error) {
	return []byte(string(*id)), nil
}
func (id *ID) Unmarshal(field []byte, _ *Context) error {
	*id = ID(field)
	return nil
}
func (id *ID) SanitizedString() string {
	return SanitizeString(id.String())
}
func (id *ID) String() string {
	if id == nil {
		return ""
	}
	return string(*id)
}
func (id *ID) Empty() bool {
	return id == nil || *id == ""
}
type SI struct {
	Value uint64
	Valid bool  
}
var _ Primitive = (*SI)(nil)
func NewSI(value uint64) *SI {
	return &SI{value, true}
}
func (si *SI) Marshal(_ *Context) ([]byte, error) {
	return []byte(strconv.FormatUint(si.Value, 10)), nil
}
func (si *SI) Unmarshal(field []byte, _ *Context) error {
	si.Valid = !isHL7Null(field)
	if !si.Valid {
		return nil
	}
	i, err := strconv.ParseInt(string(field), 10, 64)
	if err != nil {
		err = ErrBadValue
	} else if i < 0 {
		err = errors.New("SI must be non-negative")
	} else {
		si.Value = uint64(i)
	}
	return err
}
type NM struct {
	Value float64
	Valid bool  
}
var _ Primitive = (*NM)(nil)
func NewNM(value float64) *NM {
	return &NM{Value: value, Valid: true}
}
func (nm *NM) Marshal(_ *Context) ([]byte, error) {
	return []byte(strconv.FormatFloat(nm.Value, 'f', -1, 64)), nil
}
func (nm *NM) Unmarshal(field []byte, _ *Context) error {
	nm.Valid = !isHL7Null(field)
	if !nm.Valid {
		return nil
	}
	i, err := strconv.ParseFloat(string(field), 64)
	if err != nil {
		return ErrBadValue
	}
	nm.Value = i
	return nil
}
type IS string
var _ Primitive = (*IS)(nil)
func NewIS(is IS) *IS {
	return &is
}
func (is *IS) Marshal(_ *Context) ([]byte, error) {
	return []byte(string(*is)), nil
}
func (is *IS) Unmarshal(field []byte, _ *Context) error {
	*is = IS(field)
	return nil
}
func (is *IS) SanitizedString() string {
	return SanitizeString(is.String())
}
func (is *IS) String() string {
	if is == nil {
		return ""
	}
	return string(*is)
}
func (is *IS) Empty() bool {
	return is == nil || *is == ""
}
type DT string
var _ Primitive = (*DT)(nil)
func NewDT(dt DT) *DT {
	return &dt
}
func (dt *DT) Marshal(_ *Context) ([]byte, error) {
	return []byte(string(*dt)), nil
}