Stream: hapi
Topic: profile validation issue on HAPI 5.0.0
Job Schipper (May 15 2020 at 13:32):
I'm getting a strange result when validating a Patient resource against a profile on HAPI 5.0.0 (public test server):
curl -X POST \
'http://hapi.fhir.org/baseDstu3/Patient/$validate' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"resourceType": "Patient",
"meta": {
"profile": [
"http://fhir.nl/fhir/StructureDefinition/nl-core-patient"
]
},
"birthDate": "1996-11-23"
}'
gives response:
{
"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>[Patient.birthDate, Line 9, Col 2]</td><td><pre>This element is not allowed by the profile http://fhir.nl/fhir/StructureDefinition/nl-core-patient</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": "This element is not allowed by the profile http://fhir.nl/fhir/StructureDefinition/nl-core-patient",
"location": [
"Patient.birthDate",
"Line 9, Col 2"
]
}
]
}
As far as I can tell, patient.birthDate should be allowed in the profile, Patient.birthDate
is available in the differential.element[]
curl -X GET \
http://hapi.fhir.org/baseDstu3/StructureDefinition/nl-core-patient \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
Any idea what's going on here?
Grahame Grieve (May 15 2020 at 17:40):
you'll have to post the particular version of that profile that the server has so I can look at it
Job Schipper (May 16 2020 at 12:56):
@Grahame Grieve
curl -X GET \
http://hapi.fhir.org/baseDstu3/StructureDefinition/nl-core-patient \
-H 'Cache-Control: no-cache' \
-H 'Postman-Token: 3095eead-ce35-845e-8805-97ec445d3364'
response: (too big to paste fully, but you can try the above curl request as it is a public server)
{
"resourceType": "StructureDefinition",
"id": "nl-core-patient",
"meta": {
"extension": [
{
"url": "http://hapifhir.io/fhir/StructureDefinition/resource-meta-source",
"valueUri": "#wffxp4ixe6AQSRW6"
}
],
"versionId": "4",
"lastUpdated": "2020-05-15T10:58:55.491+00:00"
},
"url": "http://fhir.nl/fhir/StructureDefinition/nl-core-patient",
...
"differential": {
"element": [
...
{
"id": "Patient.birthDate",
"path": "Patient.birthDate",
"short": "Patients date of birth. The date of birth is mandatory for a patient. An incomplete date, e.g. only year or only year + month, is permitted.",
"alias": [
"Geboortedatum"
],
"mapping": [
{
"identity": "hcim-patient-v2.0.1-2015EN",
"map": "NL-CM:0.1.10",
"comment": "DateOfBirth"
},
{
"identity": "hcim-patient-v3.0-2016EN",
"map": "NL-CM:0.1.10",
"comment": "DateOfBirth"
},
{
"identity": "hcim-patient-v3.1-2017EN",
"map": "NL-CM:0.1.10",
"comment": "DateOfBirth"
}
]
},
...
]
Grahame Grieve (May 16 2020 at 20:32):
@Mark Iantorno this works for me fine when I extract out these resources and run them in the validator directly. So I'm mystified as to why this error would arise here. Is it possible that HAPI is serving up the wrong version of the profile internally?
Mark Iantorno (May 16 2020 at 20:34):
I can look into it for sure. The wrapper in HAPI doesn't include all the fields that the wrapper in the core validator does. I noticed this when I was doing my first attempt at test migration. It may be related to that. But I would have to look as there is a lot going on under the hood.
Mark Iantorno (May 16 2020 at 20:35):
I'm stepping away for today, but I can look into it on Monday if that's okay?
Grahame Grieve (May 16 2020 at 20:36):
there is indeed a lot. We might have to debug it together; the cause of the problem is that there's no match for dateOfBirth in InstanceValidator.assignChildren, but it clearly exists in the profile in question; so I assume it's not getting served up the profile in question correctly
Job Schipper (May 17 2020 at 09:53):
thanks for looking into this!
Job Schipper (May 19 2020 at 09:13):
any new findings?
James Agnew (May 19 2020 at 19:32):
@Job Schipper are you able to replicate this on hapi.fhir.org? That might be helpful to help us create a test case
Job Schipper (May 25 2020 at 13:42):
@James Agnew I was, the example i posted was using that server. However, I just re-ran it and now the validation passes. Has there been a release in the meantime?
James Agnew (May 25 2020 at 20:29):
Quite possibly- We redeploy fairly frequently and it's entirely possible that this has been fixed.
Last updated: Apr 12 2022 at 19:14 UTC