hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.05k stars 1.33k forks source link

valueTime allows minutes as 24:99 #781

Closed eevaturkka closed 6 years ago

eevaturkka commented 7 years ago

This resource is created without errors against the Hapi testserver:

{
  "resourceType": "Observation",
   "language": "fi",  
    "status": "final",
  "category": [{
    "coding": [
      {
        "system": "http://hl7.org/fhir/observation-category",
   "version": "1",
        "code": "vital-signs",
        "display": "Vital Sign"
      }
    ]
  }],
  "code": {
    "coding": [
      {
        "system": "http://foo.org",
        "code": "8302-2",
        "display": "Body height"
      }
    ]
  },
  "subject": {
    "reference": "Patient/328686"
  },
  "effectiveDateTime": "2017-06-12",
  "issued": "2017-06-12T10:00:00.936+02:00",
  "performer": [{
    "reference": "Patient/328686"
  }],
  "valueTime": "24:99"
}

valueTime should be:

A time during the day, with no date specified (can be converted to a Duration since midnight). Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. The time "24:00" is not allowed, and neither is a time zone Regex: ([01][0-9]|2[0-3]):[0-5][0-9]:[0-5]0-9?

eevaturkka commented 7 years ago

Here's the result:

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">INFORMATION</td><td>[]</td><td><pre>Successfully created resource &quot;Observation/328690/_history/1&quot; in 62ms</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td style=\"font-weight: bold;\">INFORMATION</td>\n\t\t\t\t<td>[]</td>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t<td><pre>No issues detected during validation</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "information",
      "code": "informational",
      "diagnostics": "Successfully created resource \"Observation/328690/_history/1\" in 62ms"
    },
    {
      "severity": "information",
      "code": "informational",
      "diagnostics": "No issues detected during validation"
    }
  ]
}
timirahikainen commented 6 years ago

This issue has been fixed. Atleast getting error now

{         "severity": "error",         "code": "processing",         "diagnostics": "Not a valid time",         "location