NUBIC/ncs_navigator_core — pull request #232 by yipdw (2013-06-20 22:59:27+00:00)
Title: Export answers of -1, -2, etc. as MDES-coded dates / times (develop)

This addresses https://code.bioinformatics.northwestern.edu/issues/issues/show/4379.

Previously, the instrument warehouse code passed answers of -1, -2, etc. straight through to the MDES warehouse. In places where dates or times were expected, this caused a format validation failure.

This PR codes -x as 9xxx-9x-9x (for dates) and 9x:9x (for times), using the "9-followed-by-the-code" notation described in the MDES spreadsheets. Currently, it does so by first trying the value as-is. If that's valid, we accept it. Otherwise, we generate possibilities based on the validation format and try those.

This PR is for the `develop` branch. The PBS maintenance branch needs this as well; that PR is tracked as #231.