Tuesday, October 9, 2012

Ticking away the moments that make up the health record

For the purposes of illustrating precision in HL7v3 Time elements (TS), no time zone information is represented. As a nice bonus, this format is easily sortable as Strings or char arrays.
HL7 TSMeaning
20121031235959001October 31, 2012, 999 milliseconds before midnight
20121031235959October 31, 2012, one second before midnight
201210312359...and again one minute before midnight
20121031Any time on the day of October 31, 2012
201210October 1-31, 2012
20121October 1 - December 31, 2012 (technically valid, but never used this way)
2012January 1 - December 31, 2012
20Sometime in the 21st century

Get it? It's a regular expression with assumed wildcard at the end.