{"action":"created","issue":{"url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/381","repository_url":"https://api.github.com/repos/jamesagnew/hapi-fhir","labels_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/381/comments","events_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/381/events","html_url":"https://github.com/jamesagnew/hapi-fhir/issues/381","id":159233916,"number":381,"title":"Invalid date parses as valid date","user":{"login":"cjlint","id":7268202,"avatar_url":"https://avatars.githubusercontent.com/u/7268202?v=3","gravatar_id":"","url":"https://api.github.com/users/cjlint","html_url":"https://github.com/cjlint","followers_url":"https://api.github.com/users/cjlint/followers","following_url":"https://api.github.com/users/cjlint/following{/other_user}","gists_url":"https://api.github.com/users/cjlint/gists{/gist_id}","starred_url":"https://api.github.com/users/cjlint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjlint/subscriptions","organizations_url":"https://api.github.com/users/cjlint/orgs","repos_url":"https://api.github.com/users/cjlint/repos","events_url":"https://api.github.com/users/cjlint/events{/privacy}","received_events_url":"https://api.github.com/users/cjlint/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-06-08T18:04:37Z","updated_at":"2016-06-10T23:08:43Z","closed_at":null,"body":"See the following code block:\r\n\r\n```\r\nimport ca.uhn.fhir.context.FhirContext;\r\nimport ca.uhn.fhir.model.dstu2.resource.Patient;\r\nimport ca.uhn.fhir.parser.IParser;\r\n\r\npublic class DateParsingError {\r\n    public static void main(String[] args) {\r\n        IParser parser = FhirContext.forDstu2().newJsonParser();\r\n        String jsonPatient =\r\n                \"{\\\"resourceType\\\": \\\"Patient\\\", \\\"birthDate\\\": \\\"9999-99-99\\\"}\";\r\n        Patient p = parser.parseResource(Patient.class, jsonPatient);\r\n\r\n        // prints \"Thu Jun 07 00:00:00 EDT 10007\"\r\n        System.out.println(p.getBirthDate());\r\n    }\r\n}\r\n```\r\n\r\nThe invalid date 9999-99-99 gets parsed as a valid date, \"Thu Jun 07 00:00:00 EDT 10007\". It seems that this was supposed to be fixed in issue #50 \r\n\r\nEDIT: This is what's in my pom.xml:\r\n```\r\n        <dependency>\r\n            <groupId>ca.uhn.hapi.fhir</groupId>\r\n            <artifactId>hapi-fhir-base</artifactId>\r\n            <version>1.5</version>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>ca.uhn.hapi.fhir</groupId>\r\n            <artifactId>hapi-fhir-structures-dstu2</artifactId>\r\n            <version>1.5</version>\r\n        </dependency>\r\n```"},"comment":{"url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/comments/225316694","html_url":"https://github.com/jamesagnew/hapi-fhir/issues/381#issuecomment-225316694","issue_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/381","id":225316694,"user":{"login":"jamesagnew","id":3465117,"avatar_url":"https://avatars.githubusercontent.com/u/3465117?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesagnew","html_url":"https://github.com/jamesagnew","followers_url":"https://api.github.com/users/jamesagnew/followers","following_url":"https://api.github.com/users/jamesagnew/following{/other_user}","gists_url":"https://api.github.com/users/jamesagnew/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesagnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesagnew/subscriptions","organizations_url":"https://api.github.com/users/jamesagnew/orgs","repos_url":"https://api.github.com/users/jamesagnew/repos","events_url":"https://api.github.com/users/jamesagnew/events{/privacy}","received_events_url":"https://api.github.com/users/jamesagnew/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T23:08:42Z","updated_at":"2016-06-10T23:08:42Z","body":"I figure the best thing to do is leave Date as the native type, but add an additional method to `BaseDateTimeDt` that lets you access the extra precision if you need to.\r\n\r\nTo like if you parse `2000-01-01T12:00:44.123456789` you'd still get a `Date` that contains the 123ms but you could also call `getFractionalSeconds()` or something to get the extra precision if you need it.\r\n\r\nThoughts? For that matter, any opinions on what to call the `getFractionalSeconds() method, and what it should return? Internally I'm just storing the fraction as a `long` right now until settling this, but maybe a BigDecimal would make more sense?\r\n\r\nSo like perhaps it would be called `BigDecimal getFractionalSeconds()` and if you called it for the example above it would return `0.123456789`. Or should it return `44.123456789`? And is that the right name? "}}
{"actor":{"display_login":"jamesagnew"}}