FHIR Chat · Bundle $validate error: "Failed to call access method: ... · hapi

Stream: hapi

Topic: Bundle $validate error: "Failed to call access method: ...


view this post on Zulip Job Schipper (Jun 16 2020 at 10:18):

Hi,

I'm running the HAPI jpa server version 5.0.2, and when I'm running into an issue when I run the following:

curl -X POST \
  'https://hapifhir-acc.mcapp.nl/hapi-fhir-jpaserver/fhir/Bundle/$validate' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 2eca19eb-9ebf-8442-ca6a-9de44f4a7cdf' \
  -d '{"resourceType":"Bundle","entry":[{"fullUrl":"urn:uuid:5ee894a3cee7b5.87207907","request":{"method":"POST","url":"Organization"},"resource":{"resourceType":"Organization","meta":{"profile":["http:\/\/fhir.nl\/fhir\/StructureDefinition\/nl-core-organization"],"tag":[{"code":"epd:finaltest123","system":"https:\/\/source-id.medicore.nl\/"}]},"identifier":[{"system":"https:\/\/unique-id.medicore.nl\/","value":"epd:finaltest123"}],"name":"JWZ"}}],"type":"transaction"}'

(please note: the server above is not reachable from the public internet)

As a result, It gives me the following validation error:

{
    "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>Failed to call access method: org.hl7.fhir.exceptions.DefinitionException: Attempt to a slice an element that does not repeat: Extension.valueCodeableConcept/valueCodeableConcept from http://nictiz.nl/fhir/StructureDefinition/code-specification in http://fhir.nl/fhir/StructureDefinition/nl-core-contactpoint</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": "Failed to call access method: org.hl7.fhir.exceptions.DefinitionException: Attempt to a slice an element that does not repeat: Extension.valueCodeableConcept/valueCodeableConcept from http://nictiz.nl/fhir/StructureDefinition/code-specification in http://fhir.nl/fhir/StructureDefinition/nl-core-contactpoint"
        }
    ]
}

It tries to validate this (readable) bundle, that contains 1 Organization resource:

{
    "resourceType": "Bundle",
    "entry": [{
        "fullUrl": "urn:uuid:5ee894a3cee7b5.87207907",
        "request": {
            "method": "POST",
            "url": "Organization"
        },
        "resource": {
            "resourceType": "Organization",
            "meta": {
                "profile": ["http:\/\/fhir.nl\/fhir\/StructureDefinition\/nl-core-organization"],
                "tag": [{
                    "code": "epd:finaltest123",
                    "system": "https:\/\/source-id.medicore.nl\/"
                }]
            },
            "identifier": [{
                "system": "https:\/\/unique-id.medicore.nl\/",
                "value": "epd:finaltest123"
            }],
            "name": "JWZ"
        }
    }],
    "type": "transaction"
}

Now first of all, I'm not sure what to make of the "failed to call access method ... " error. Is this a bug in HAPI? Or is it a profile issue as suggested by the second part of the error message?

Secondly, when I take the Organization resource from the Bundle, and validate it directly against the Organization endpoint, it passes:

curl -X POST \
  'https://hapifhir-acc.mcapp.nl/hapi-fhir-jpaserver/fhir/Organization/$validate' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 1cd25175-ad8c-6b65-eed6-14dbd1e8ab22' \
  -d '{
            "resourceType": "Organization",
            "meta": {
                "profile": ["http:\/\/fhir.nl\/fhir\/StructureDefinition\/nl-core-organization"],
                "tag": [{
                    "code": "epd:finaltest123",
                    "system": "https:\/\/source-id.medicore.nl\/"
                }]
            },
            "identifier": [{
                "system": "https:\/\/unique-id.medicore.nl\/",
                "value": "epd:finaltest123"
            }],
            "name": "JWZ"
        }'
{
    "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>[Organization.identifier[0], Line 10, Col 29]</td><td><pre>This element does not match any known slice defined in the profile http://fhir.nl/fhir/StructureDefinition/nl-core-organization</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": "processing",
            "diagnostics": "This element does not match any known slice defined in the profile http://fhir.nl/fhir/StructureDefinition/nl-core-organization",
            "location": [
                "Organization.identifier[0]",
                "Line 10, Col 29"
            ]
        }
    ]
}

Any idea what is going on here? All help is very much appreciated :)

view this post on Zulip Job Schipper (Jun 16 2020 at 15:34):

Since the field that the validation error is about is part of the Organization resource (and not the Bundle), it must be that either the Bundle $validate (1st request) is failing unjustly, or that the Organization $validate (2nd request) is passing unjustly

view this post on Zulip Job Schipper (Jun 18 2020 at 09:00):

Anyone?

view this post on Zulip Job Schipper (Jun 19 2020 at 07:26):

@James Agnew any idea?

view this post on Zulip James Agnew (Jun 22 2020 at 13:01):

Well the key bit of the error message is probably this part:

: Attempt to a slice an element that does not repeat: Extension.valueCodeableConcept/valueCodeableConcept from http://nictiz.nl/fhir/StructureDefinition/code-specification in http://fhir.nl/fhir/StructureDefinition/nl-core-contactpoint"

I'm assuming there is probably an error in the profile you're using.

view this post on Zulip Job Schipper (Jun 23 2020 at 12:20):

@James Agnew thanks for confirming!


Last updated: Apr 12 2022 at 19:14 UTC