ca.infoway.messagebuilder.datatype
Class StandardDataType

Package class diagram package StandardDataType
java.lang.Object
  extended by ca.infoway.messagebuilder.lang.Enum
      extended by ca.infoway.messagebuilder.lang.EnumPattern
          extended by ca.infoway.messagebuilder.datatype.StandardDataType
All Implemented Interfaces:
Typed, Serializable, Comparable

public class StandardDataType
extends EnumPattern
implements Typed

A list of standard HL7 data types.

Each enum maps to the appropriate HL7 datatype name, actual HL7 datatype, and underlying datatype. An enum will also map to a Simple XMl datatype where appropriate.

This enum class contains numerous helper methods for determining properties about types, and for converting between type variations, eg. determining the HL7 datatype from the Simple Xm ldatatype.

An attempt has been made to try to consistently use the following naming standards:

enum datatype (or enum): a datatype represented by the StandardDataType enum

HL7 datatype: the HL7-defined datatype, eg. URG or URG<TS.DATE> or TS.DATE

java datatype (or just datatype): the underlying java class used for a datatype, eg. String, PostalAddress

simple xml datatype: the datatype equivalent used for the Simple XML variant

Author:
Intelliware Development
See Also:
Serialized Form

Field Summary
static StandardDataType AD
           
static StandardDataType AD_BASIC
           
static StandardDataType AD_FULL
           
static StandardDataType AD_SEARCH
           
static StandardDataType ANY
           
static StandardDataType ANY_CA_IZ
           
static StandardDataType ANY_LAB
           
static StandardDataType ANY_PATH
           
static StandardDataType BAG
          The BAG data type.
static StandardDataType BL
           
static StandardDataType CD
           
static StandardDataType CD_LAB
           
static StandardDataType CE
           
static StandardDataType COLLECTION
           
static StandardDataType CS
           
static StandardDataType CV
           
static StandardDataType ED
           
static StandardDataType ED_DOC
           
static StandardDataType ED_DOC_OR_REF
           
static StandardDataType ED_DOC_REF
           
static StandardDataType ED_REF
           
static StandardDataType ED_SIGNATURE
           
static StandardDataType EN
           
static StandardDataType GTS
           
static StandardDataType GTS_BOUNDEDPIVL
           
static StandardDataType II
           
static StandardDataType II_BUS
           
static StandardDataType II_BUS_AND_VER
           
static StandardDataType II_BUSVER
           
static StandardDataType II_OID
           
static StandardDataType II_PUBLIC
           
static StandardDataType II_PUBLICVER
           
static StandardDataType II_TOKEN
           
static StandardDataType II_VER
           
static StandardDataType INT
           
static StandardDataType INT_NONNEG
           
static StandardDataType INT_POS
           
static StandardDataType IVL
           
static StandardDataType IVL_DATE
           
static StandardDataType IVL_DATETIME
           
static StandardDataType IVL_FULL_DATE
           
static StandardDataType IVL_FULL_DATE_TIME
           
static StandardDataType IVL_FULL_DATE_WITH_TIME
           
static StandardDataType IVL_HIGH
           
static StandardDataType IVL_HIGH_TS_FULLDATE
           
static StandardDataType IVL_LOW
           
static StandardDataType IVL_LOW_TS_DATE
           
static StandardDataType IVL_LOW_TS_FULLDATE
           
static StandardDataType IVL_PQ
           
static StandardDataType IVL_PQ_BASIC
           
static StandardDataType IVL_PQ_DISTANCE
           
static StandardDataType IVL_PQ_DRUG
           
static StandardDataType IVL_PQ_HEIGHTWEIGHT
           
static StandardDataType IVL_PQ_LAB
           
static StandardDataType IVL_PQ_TIME
           
static StandardDataType IVL_TS
           
static StandardDataType IVL_WIDTH
           
static StandardDataType IVL_WIDTH_TS_FULLDATE
           
static StandardDataType LIST
           
static StandardDataType LIST_TEL_PHONEMAIL
           
static StandardDataType MO
           
static StandardDataType MO_CAD
           
static StandardDataType ON
           
static StandardDataType PIVL
           
static StandardDataType PIVL_TS_DATETIME
           
static StandardDataType PN
           
static StandardDataType PN_BASIC
           
static StandardDataType PN_FULL
           
static StandardDataType PN_SEARCH
           
static StandardDataType PN_SIMPLE
           
static StandardDataType PQ
           
static StandardDataType PQ_BASIC
           
static StandardDataType PQ_DISTANCE
           
static StandardDataType PQ_DRUG
           
static StandardDataType PQ_HEIGHTWEIGHT
           
static StandardDataType PQ_LAB
           
static StandardDataType PQ_TIME
           
static StandardDataType QTY
           
static StandardDataType REAL
           
static StandardDataType REAL_CONF
           
static StandardDataType REAL_COORD
           
static StandardDataType RTO
           
static StandardDataType RTO_MO_CAD_PQ_BASIC
           
static StandardDataType RTO_PQ_DRUG_PQ_DRUG
           
static StandardDataType RTO_PQ_DRUG_PQ_TIME
           
static StandardDataType SC
           
static StandardDataType SET
           
static StandardDataType SET_II
           
static StandardDataType ST
           
static StandardDataType ST_LANG
           
static StandardDataType SXCM
           
static StandardDataType SXPR
           
static StandardDataType TEL
           
static StandardDataType TEL_EMAIL
           
static StandardDataType TEL_PHONE
           
static StandardDataType TEL_PHONEMAIL
           
static StandardDataType TEL_URI
           
static StandardDataType TN
           
static StandardDataType TS
           
static StandardDataType TS_DATE
           
static StandardDataType TS_DATETIME
           
static StandardDataType TS_FULLDATE
           
static StandardDataType TS_FULLDATETIME
           
static StandardDataType TS_FULLDATEWITHTIME
           
static StandardDataType URG
           
static StandardDataType URG_PQ
           
static StandardDataType URG_PQ_BASIC
           
static StandardDataType URG_PQ_DISTANCE
           
static StandardDataType URG_PQ_DRUG
           
static StandardDataType URG_PQ_HEIGHTWEIGHT
           
static StandardDataType URG_PQ_LAB
           
static StandardDataType URG_PQ_TIME
           
static StandardDataType URG_TS_DATE
           
static StandardDataType URL
           
 
Fields inherited from class ca.infoway.messagebuilder.lang.Enum
INNER_CLASS_SEPARATOR_CHAR, iToString, PACKAGE_SEPARATOR_CHAR
 
Method Summary
static StandardDataType convertSimpleXmlToDataType(String simpleXmlType)
          Obtains the datatype enum corresponding to a given simple xml type name.
static StandardDataType getByTypeName(String name)
          Determines the enum datatype for a given HL7 type name.
static StandardDataType getByTypeName(Typed typed)
          Determines the enum datatype for the given type (Typed) object.
 StandardDataType getRootDataType()
          Returns the root datatype of this data type.
 String getRootType()
          Returns the root datatype of this data type.
 String getSimpleXmlType()
          Returns the simple xml equivalent name for this enum.
 String getType()
          Obtains the type name.
 Hl7TypeName getTypeName()
          Gets the type name and parameter types.
 boolean isCoded()
          Determines if the enum represents a coded type.
static boolean isCollection(String dataTypeName)
          Determines if a given HL7 datatype name is a COLLECTION.
 boolean isEquivalent(StandardDataType dataType)
          Determines if the given datatype shares the same root HL7 datatype.
static boolean isList(String dataTypeName)
          Determines if a given HL7 datatype name is a LIST.
 boolean isPartOfCanadianSpec()
          Checks if this enum datatype is part of the Canadian datatype specs.
static boolean isSet(String dataTypeName)
          Determines if a given HL7 datatype name is a SET.
static boolean isSetOrList(String dataTypeName)
          Determines if a given HL7 datatype name is a LIST or SET.
 
Methods inherited from class ca.infoway.messagebuilder.lang.EnumPattern
getEnumConstants, isEnum, name, toString, valueOf, values
 
Methods inherited from class ca.infoway.messagebuilder.lang.Enum
compareTo, equals, getEnum, getEnumClass, getEnumList, getEnumMap, getName, getShortClassName, getShortClassName, hashCode, iterator, readResolve
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY

public static final StandardDataType ANY

ANY_LAB

public static final StandardDataType ANY_LAB

ANY_CA_IZ

public static final StandardDataType ANY_CA_IZ

ANY_PATH

public static final StandardDataType ANY_PATH

AD

public static final StandardDataType AD

AD_BASIC

public static final StandardDataType AD_BASIC

AD_FULL

public static final StandardDataType AD_FULL

AD_SEARCH

public static final StandardDataType AD_SEARCH

BL

public static final StandardDataType BL

ON

public static final StandardDataType ON

SC

public static final StandardDataType SC

EN

public static final StandardDataType EN

TN

public static final StandardDataType TN

QTY

public static final StandardDataType QTY

GTS

public static final StandardDataType GTS

GTS_BOUNDEDPIVL

public static final StandardDataType GTS_BOUNDEDPIVL

II

public static final StandardDataType II

II_TOKEN

public static final StandardDataType II_TOKEN

II_BUS

public static final StandardDataType II_BUS

II_PUBLIC

public static final StandardDataType II_PUBLIC

II_OID

public static final StandardDataType II_OID

II_VER

public static final StandardDataType II_VER

II_PUBLICVER

public static final StandardDataType II_PUBLICVER

II_BUS_AND_VER

public static final StandardDataType II_BUS_AND_VER

II_BUSVER

public static final StandardDataType II_BUSVER

CV

public static final StandardDataType CV

CD

public static final StandardDataType CD

CD_LAB

public static final StandardDataType CD_LAB

CE

public static final StandardDataType CE

CS

public static final StandardDataType CS

ST

public static final StandardDataType ST

ST_LANG

public static final StandardDataType ST_LANG

ED

public static final StandardDataType ED

ED_DOC

public static final StandardDataType ED_DOC

ED_DOC_OR_REF

public static final StandardDataType ED_DOC_OR_REF

ED_REF

public static final StandardDataType ED_REF

ED_DOC_REF

public static final StandardDataType ED_DOC_REF

ED_SIGNATURE

public static final StandardDataType ED_SIGNATURE

PN

public static final StandardDataType PN

PN_BASIC

public static final StandardDataType PN_BASIC

PN_SIMPLE

public static final StandardDataType PN_SIMPLE

PN_FULL

public static final StandardDataType PN_FULL

PN_SEARCH

public static final StandardDataType PN_SEARCH

IVL

public static final StandardDataType IVL

IVL_DATE

public static final StandardDataType IVL_DATE

IVL_DATETIME

public static final StandardDataType IVL_DATETIME

IVL_FULL_DATE

public static final StandardDataType IVL_FULL_DATE

IVL_FULL_DATE_TIME

public static final StandardDataType IVL_FULL_DATE_TIME

IVL_FULL_DATE_WITH_TIME

public static final StandardDataType IVL_FULL_DATE_WITH_TIME

IVL_TS

public static final StandardDataType IVL_TS

IVL_HIGH_TS_FULLDATE

public static final StandardDataType IVL_HIGH_TS_FULLDATE

IVL_WIDTH_TS_FULLDATE

public static final StandardDataType IVL_WIDTH_TS_FULLDATE

IVL_LOW_TS_DATE

public static final StandardDataType IVL_LOW_TS_DATE

IVL_LOW_TS_FULLDATE

public static final StandardDataType IVL_LOW_TS_FULLDATE

IVL_PQ

public static final StandardDataType IVL_PQ

IVL_PQ_BASIC

public static final StandardDataType IVL_PQ_BASIC

IVL_PQ_DRUG

public static final StandardDataType IVL_PQ_DRUG

IVL_PQ_TIME

public static final StandardDataType IVL_PQ_TIME

IVL_PQ_LAB

public static final StandardDataType IVL_PQ_LAB

IVL_PQ_HEIGHTWEIGHT

public static final StandardDataType IVL_PQ_HEIGHTWEIGHT

IVL_PQ_DISTANCE

public static final StandardDataType IVL_PQ_DISTANCE

IVL_WIDTH

public static final StandardDataType IVL_WIDTH

IVL_LOW

public static final StandardDataType IVL_LOW

IVL_HIGH

public static final StandardDataType IVL_HIGH

MO

public static final StandardDataType MO

MO_CAD

public static final StandardDataType MO_CAD

PIVL

public static final StandardDataType PIVL

PIVL_TS_DATETIME

public static final StandardDataType PIVL_TS_DATETIME

INT

public static final StandardDataType INT

INT_NONNEG

public static final StandardDataType INT_NONNEG

INT_POS

public static final StandardDataType INT_POS

PQ

public static final StandardDataType PQ

PQ_BASIC

public static final StandardDataType PQ_BASIC

PQ_DRUG

public static final StandardDataType PQ_DRUG

PQ_TIME

public static final StandardDataType PQ_TIME

PQ_LAB

public static final StandardDataType PQ_LAB

PQ_HEIGHTWEIGHT

public static final StandardDataType PQ_HEIGHTWEIGHT

PQ_DISTANCE

public static final StandardDataType PQ_DISTANCE

REAL

public static final StandardDataType REAL

REAL_COORD

public static final StandardDataType REAL_COORD

REAL_CONF

public static final StandardDataType REAL_CONF

RTO

public static final StandardDataType RTO

RTO_PQ_DRUG_PQ_TIME

public static final StandardDataType RTO_PQ_DRUG_PQ_TIME

RTO_PQ_DRUG_PQ_DRUG

public static final StandardDataType RTO_PQ_DRUG_PQ_DRUG

RTO_MO_CAD_PQ_BASIC

public static final StandardDataType RTO_MO_CAD_PQ_BASIC

TS

public static final StandardDataType TS

TS_DATE

public static final StandardDataType TS_DATE

TS_DATETIME

public static final StandardDataType TS_DATETIME

TS_FULLDATEWITHTIME

public static final StandardDataType TS_FULLDATEWITHTIME

TS_FULLDATE

public static final StandardDataType TS_FULLDATE

TS_FULLDATETIME

public static final StandardDataType TS_FULLDATETIME

TEL

public static final StandardDataType TEL

TEL_PHONEMAIL

public static final StandardDataType TEL_PHONEMAIL

TEL_PHONE

public static final StandardDataType TEL_PHONE

TEL_EMAIL

public static final StandardDataType TEL_EMAIL

TEL_URI

public static final StandardDataType TEL_URI

URG

public static final StandardDataType URG

URG_TS_DATE

public static final StandardDataType URG_TS_DATE

URG_PQ

public static final StandardDataType URG_PQ

URG_PQ_BASIC

public static final StandardDataType URG_PQ_BASIC

URG_PQ_DRUG

public static final StandardDataType URG_PQ_DRUG

URG_PQ_TIME

public static final StandardDataType URG_PQ_TIME

URG_PQ_LAB

public static final StandardDataType URG_PQ_LAB

URG_PQ_HEIGHTWEIGHT

public static final StandardDataType URG_PQ_HEIGHTWEIGHT

URG_PQ_DISTANCE

public static final StandardDataType URG_PQ_DISTANCE

URL

public static final StandardDataType URL

SXPR

public static final StandardDataType SXPR

SXCM

public static final StandardDataType SXCM

SET

public static final StandardDataType SET

SET_II

public static final StandardDataType SET_II

LIST

public static final StandardDataType LIST

LIST_TEL_PHONEMAIL

public static final StandardDataType LIST_TEL_PHONEMAIL

COLLECTION

public static final StandardDataType COLLECTION

BAG

public static final StandardDataType BAG

The BAG data type. Note that this data type is not a standard part of the pan-Canadian Data Types specification.

Method Detail

getTypeName

public Hl7TypeName getTypeName()

Gets the type name and parameter types.

Returns:
this enum's HL7TypeName, an objecting defining the type's name and parameter types.

getType

public String getType()

Obtains the type name.

Specified by:
getType in interface Typed
Returns:
the HL7 name of the data type (eg. "INT.NONNEG")

getRootDataType

public StandardDataType getRootDataType()

Returns the root datatype of this data type.

Returns:
the root data type of this data type, as an enum.

getRootType

public String getRootType()

Returns the root datatype of this data type.

Returns:
the root data type of this data type, as a string.

isCoded

public boolean isCoded()

Determines if the enum represents a coded type.

Returns:
whether or not the enum is a coded type.

isEquivalent

public boolean isEquivalent(StandardDataType dataType)

Determines if the given datatype shares the same root HL7 datatype.

Parameters:
dataType - the type to compare
Returns:
whether the datatypes are eqivalent, that is, do they share the same root HL7 datatype

isSetOrList

public static boolean isSetOrList(String dataTypeName)

Determines if a given HL7 datatype name is a LIST or SET.

Parameters:
dataTypeName - the HL7 name of the datatype to check
Returns:
whether the supplied HL7 datatype is a collection type

isSet

public static boolean isSet(String dataTypeName)

Determines if a given HL7 datatype name is a SET.

Parameters:
dataTypeName - the HL7 name of the datatype to check
Returns:
whether the supplied HL7 datatype is a SET type

isCollection

public static boolean isCollection(String dataTypeName)

Determines if a given HL7 datatype name is a COLLECTION.

Parameters:
dataTypeName - the HL7 name of the datatype to check
Returns:
whether the supplied HL7 datatype is a COLLECTION type

isList

public static boolean isList(String dataTypeName)

Determines if a given HL7 datatype name is a LIST.

Parameters:
dataTypeName - the HL7 name of the datatype to check
Returns:
whether the supplied HL7 datatype is a LIST type

getByTypeName

public static StandardDataType getByTypeName(Typed typed)

Determines the enum datatype for the given type (Typed) object.

Parameters:
typed - the object to get the type name from
Returns:
the type enum corresponding to the input parameter type

getByTypeName

public static StandardDataType getByTypeName(String name)

Determines the enum datatype for a given HL7 type name.

Parameters:
name - the HL7 name of a datatype
Returns:
the type enum corresponding to the input parameter name

isPartOfCanadianSpec

public boolean isPartOfCanadianSpec()

Checks if this enum datatype is part of the Canadian datatype specs.

Returns:
whether this enum datatype is part of the current (and possibly multiple previous) Canadian specs.

getSimpleXmlType

public String getSimpleXmlType()

Returns the simple xml equivalent name for this enum.

Returns:
the simple xml type name for this enum.

convertSimpleXmlToDataType

public static StandardDataType convertSimpleXmlToDataType(String simpleXmlType)

Obtains the datatype enum corresponding to a given simple xml type name.

Parameters:
simpleXmlType - the simple xml type name to convert
Returns:
the corresponding enum datatype


Copyright © 2013. All Rights Reserved.