Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle constraint bdl-4 not working #1250

Closed
gitrust opened this issue Mar 25, 2019 · 2 comments

Comments

@gitrust
Copy link

commented Mar 25, 2019

Describe the bug
I`ve implemented a FHIR server which is based on HAPI FHIR JaxRS implementation.
After searching for a Patient resource I get a Bundle response which does not validate.
The FHIR Validator prints the following message:

> java -jar org.hl7.fhir.validator.jar patientsearch.json

FHIR Validation tool Version 3.8.0-SNAPSHOT - Built 2019-02-11T12:49:16.829-05:00 - Git 7a8671008476
Arguments: patientsearch.json
  .. connect to tx server @ http://tx.fhir.org
  .. definitions from hl7.fhir.core#4.0.0
    (v4.0.0)
  .. validate [patientsearch.json]
Terminology server: Check for supported code systems for http://loinc.org
*FAILURE* validating patientsearch.json:  error:1 warn:2 info:0
  Error @ Bundle (line 1, col2) : entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited [entry.all(response.exists() = ((.type = 'batch-response') or (.type = 'transaction-response') or (.type = 'history')))]
  Warning @ Bundle.entry.resource.identifier.type : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/identifier-type (http://hl7.org/fhir/ValueSet/identifier-type, and a code should come from this value set unless it has no suitable code) (codes = http://loinc.org#76435-7)
  Warning @ Bundle.entry.resource : A resource should have narrative for robust management [text.div.exists()]

Here is the corresponding response JSON:

{
  "resourceType": "Bundle",
  "id": "0fc4ebff-c238-41c0-95b0-b52993ecbdb1",
  "meta": {
    "lastUpdated": "2019-03-25T10:03:36.384+01:00"
  },
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "http://localhost:9001/Patient?family=Doe"
    }
  ],
  "entry": [
    {
      "fullUrl": "http://localhost:9001/Patient/22b13c16-929e-410f-afb7-1487ae5cff12",
      "resource": {
        "resourceType": "Patient",
        "id": "22b13c16-929e-410f-afb7-1487ae5cff12",
        "meta": {
          "versionId": "0d8744fb-121e-43fd-9e57-c81f4530e6b5"
        },
        "extension": [
          {
            "url": "urn:oid:2.16.840.1.113883.5.104",
            "valueString": "2106-3"
          }
        ],
        "identifier": [
          {
            "use": "usual",
            "type": {
              "coding": [
                {
                  "system": "http://loinc.org",
                  "version": "2.64",
                  "code": "76435-7",
                  "display": "Patient identifier"
                }
              ]
            },
            "value": "AAA"
          }
        ],
        "active": true,
        "name": [
          {
            "text": "John Doe",
            "family": "Doe",
            "given": [
              "Max"
            ]
          }
        ]
      },
      "response": {
        "status": "200 OK",
        "etag": "W/\"0d8744fb-121e-43fd-9e57-c81f4530e6b5\""
      }
    }
  ]
}

Expected behavior
entry.response is prohibited for Bundle.type searchset

Environment :

@jamesagnew

This comment has been minimized.

Copy link
Owner

commented Mar 25, 2019

@petervanhoute thoughts?

@patrick-werner

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 2019

This issue is not specific to the JaxRS Implementation. hapi-jpa-example / starter also returns the response part which is not allowed in a search bundle rule (bdl-4).

So bdl-4 is working/evaluated, but hapi returns a non valid search bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.