Stream: hapi
Topic: validation
Josh Mandel (Aug 18 2016 at 14:24):
@James Agnew Reading http://hapifhir.io/doc_validation.html I don't see any mention of using the $validate
operation. Is it the case that users can POST a StructureDefinition to a HAPI server and then $validate
new content against it? Is there a write-up anywhere of how this should work?
James Agnew (Aug 26 2016 at 11:31):
Hi @Josh Mandel ,
Yeah, really nothing about the public server is documented very well at this point.
What you're describing should work though. Basically when validating a resource, if the validator needs any profile resources (StructureDefinitions, ValueSets, etc.) it will look for them first in the ones that are bundled with HAPI (basically all of the ones that also come in the validator pack from the spec) and then looks in the local database.
Martijn Harthoorn (Sep 01 2016 at 08:40):
James, did you know that we have used HAPI as an example validator behind Simplifier at the moment?
James Agnew (Sep 01 2016 at 16:33):
Sure did! I've had some conversations about Peter Hendricks about it... Although I haven't seen it in action yet :)
Josh Mandel (Sep 16 2016 at 18:58):
@James Agnew when I try to validate this document (and, well, any document-type bundle I can come up with) in the validator at https://fhirtest.uhn.ca/validate, I get
{ "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;\">error</td><td>[]</td><td><pre>Unexpected failure while validating resource</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": "error", "code": "processing", "diagnostics": "Unexpected failure while validating resource" } ] }
Is this a known issue?
James Agnew (Sep 27 2016 at 21:43):
Hey @Josh Mandel just catching up on Zulip. Yup, this was a bug in the validator. Looks like it's fixed already in RI SVN, so I'm copying that fix over now.
Validating it now gives lots of other interesting errors, but they all appear to be legitimate, at least at a quick glance.
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "Unable to resolve the target of the reference in the bundle (Composition Subject)", "location": [ "Bundle.entry[0].resource.resource.subject.reference" ] }, { "severity": "error", "code": "processing", "diagnostics": "Relative Reference appears inside Bundle whose entry is missing a fullUrl", "location": [ "Bundle.entry:0" ] }, { "severity": "error", "code": "processing", "diagnostics": "The fullUrl element must be present when a resource is present, and not present otherwise [fullUrl.empty() xor resource.exists()]", "location": [ "Bundle.entry" ] }, { "severity": "error", "code": "processing", "diagnostics": "Resource requires an id, but none is present", "location": [ "Bundle.entry.resource" ] }, { "severity": "warning", "code": "processing", "diagnostics": "Error unable to find code system http://loinc.org validating CodeableConcept", "location": [ "Bundle.entry.resource.type" ] }, { "severity": "error", "code": "processing", "diagnostics": "Bundle entry missing fullUrl", "location": [ "Bundle.entry" ] }, { "severity": "error", "code": "processing", "diagnostics": "Relative Reference appears inside Bundle whose entry is missing a fullUrl", "location": [ "Bundle.entry.resource.subject" ] }, { "severity": "error", "code": "processing", "diagnostics": "Bundle entry missing fullUrl", "location": [ "Bundle.entry" ] }, { "severity": "error", "code": "processing", "diagnostics": "Relative Reference appears inside Bundle whose entry is missing a fullUrl", "location": [ "Bundle.entry.resource.subject" ] } ] }```
Last updated: Apr 12 2022 at 19:14 UTC