Stream: implementers
Topic: HAPI and birthDate validation
Robert Lichtenberger (Nov 24 2016 at 13:00):
I've just tried to validate some patients with HAPI and got this:
Warning!
Error: HTTP 412 Precondition Failed: The value '0608-08-08' does not have a valid year
While the year 608 is admittedly somewhat strange it is nevertheless possible for a historical patient to be born on that day. Also the spec at http://hl7.org/fhir/2016Sep/datatypes.html#date says the regexp is: -?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)? and
public static void main(String[] args) {
boolean x = "0608-08-08".matches("-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?");
System.out.println(x);
}
gives true.
Is there something in the spec that I missed? Or does HAPI perform some additional checks that go beyond the spec?
Last updated: Apr 12 2022 at 19:14 UTC