Stream: IG creation
Topic: decimal error in Location example
Eric Haas (Jul 23 2019 at 22:41):
This is a brand new error that cropped up today.
I get the following error in this IG: http://build.fhir.org/ig/HL7/davinci-alerts/branches/master/index.html
Location/hl7east: Location.position.longitude error The value '-72.519854' is not a valid decimal
are there some new requriements for decimals like these?
Grahame Grieve (Jul 24 2019 at 12:04):
I don't see this?
Grahame Grieve (Jul 24 2019 at 12:05):
not when building locally anyway. do you see it locally?
Grahame Grieve (Jul 24 2019 at 12:09):
@James Agnew this looks like some Java localization issue to me. Here's the code in question:
public static boolean isDecimal(String string) { if (isBlank(string)) { return false; } boolean havePeriod = false; for (char next : string.toCharArray()) { if (next == '.') { if (havePeriod) { return false; } havePeriod = true; } else if (!Character.isDigit(next)) { return false; } } return true; }
Grahame Grieve (Jul 24 2019 at 12:09):
is there some localization issue there I can't see?
Rick Geimer (Jul 24 2019 at 15:57):
That code seems to fail on "-" (the leading minus sign) based on my eyeball parser. I guess it expects decimals to be positive?
Eric Haas (Jul 24 2019 at 18:56):
Also in my local machine as well
Eric Haas (Jul 24 2019 at 18:57):
Only cropped up yesterday with a ig pub update
James Agnew (Jul 24 2019 at 20:07):
Yeah, I'd agree with Rick. That code won't understand the -
and will return false as a result.
Grahame Grieve (Jul 24 2019 at 21:37):
duh. foolish on my part. But I didn't think in that direction since I didn't get the error. Not sure why not. I've fixed, will release shortly
Last updated: Apr 12 2022 at 19:14 UTC