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

multiple identifier search does not work #1223

Closed
mingdatacom opened this issue Mar 4, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@mingdatacom
Copy link

commented Mar 4, 2019

Hello All,

In HAPI FHIR 3.6 this worked
http://hapi.fhir.org/baseDstu3/Organization?identifier=FDS-BusinessId%7C965214&identifier=2.16.840.1.113883.3.79%7C1000005
returned Bundle with 1 result

In HAPI FHIR 3.7 Bundle with 0 result
Was there a change in the spec or is there a bug?

Thanks,

@jamesagnew

This comment has been minimized.

Copy link
Owner

commented Mar 4, 2019

Having multiple identifier parameters is an AND search, so that will only match organizations that have both of those identifiers. Are you sure you aren't looking for an OR search? e.g.

http://hapi.fhir.org/baseDstu3/Organization?identifier=FDS-BusinessId%7C965214,2.16.840.1.113883.3.79%7C1000005

@dmitchellmim

This comment has been minimized.

Copy link

commented Mar 4, 2019

I think it's an issue with all AND searches. There are countless patients on the test server named John Smith, but Patient?name=john&name=smith returns 0 results. Patient?given=john&name=smith and Patient?name=john&family=smith return paged results; it only fails when using name for both.

@mingdatacom

This comment has been minimized.

Copy link
Author

commented Mar 5, 2019

Yes we are looking for an AND search i.e an organization having both these identifiers, this is the result using one identifier (http://hapi.fhir.org/baseDstu3/Organization?identifier=FDS-BusinessId%7C965214) :

"entry": [
    {
      "fullUrl": "http://hapi.fhir.org/baseDstu3/Organization/941836",
      "resource": {
        "resourceType": "Organization",
        "id": "941836",
        "meta": {
          "versionId": "22",
          "lastUpdated": "2019-03-01T19:54:12.052+00:00"
        },
        "identifier": [
          {
            "system": "FDS-BusinessId",
            "value": "965214"
          },
          {
            "system": "2.16.840.1.113883.3.79",
            "value": "1000005"
          },
          {
            "system": "http://hl7.org/fhir/sid/us-npi"
          }
        ],
        "active": true,
        "name": "Engage Demo Pharmacy",
        "telecom": [
          {
            "system": "phone",
            "value": "410-867-5309",
            "use": "work",
            "rank": 1
          }
        ],
        "address": [
          {
            "text": "  , , "
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
@mingdatacom

This comment has been minimized.

Copy link
Author

commented Mar 5, 2019

Steps to verify it works on 3.6:

  1. Download https://github.com/jamesagnew/hapi-fhir/releases/download/v3.6.0/hapi-fhir-3.6.0-cli.zip
  2. Extract and execute hapi-fhir-cli run-server -v dstu3
  3. Create organization create-organization-2.txt
curl -vX POST http://localhost:8080/baseDstu3/Organization --header "Content-Type: application/json" -d @create-organization-2.txt
  1. Search organization
curl -s "http://localhost:8080/baseDstu3/Organization?identifier=FDS-BusinessId%7C965214&identifier=2.16.840.1.113883.3.79%7C1000005"  
{
"resourceType": "Bundle",
"id": "3788da5b-c68a-410d-af62-b5064e3091fd",
"meta": {
  "lastUpdated": "2019-03-05T08:51:53.517+08:00"
},
"type": "searchset",
"total": 1,
"link": [
  {
    "relation": "self",
    "url": "http://localhost:8080/baseDstu3/Organization?identifier=FDS-BusinessId%7C965214&identifier=2.16.840.1.113883.3.79%7C1000005"
  }
],
"entry": [
  {
    "fullUrl": "http://localhost:8080/baseDstu3/Organization/9952",
    "resource": {
      "resourceType": "Organization",
      "id": "9952",
      "meta": {
        "versionId": "1",
        "lastUpdated": "2019-03-05T08:51:05.376+08:00"
      },
      "identifier": [
        {
          "system": "FDS-BusinessId",
          "value": "965214"
        },
        {
          "system": "2.16.840.1.113883.3.79",
          "value": "1000005"
        },
        {
          "system": "http://hl7.org/fhir/sid/us-npi"
        }
      ],
      "active": true,
      "name": "Engage Demo Pharmacy",
      "telecom": [
        {
          "system": "phone",
          "value": "410-867-5309",
          "use": "work",
          "rank": 1
        }
      ],
      "address": [
        {
          "text": "  , , "
        }
      ]
    },
    "search": {
      "mode": "match"
    }
  }
]
}
@jamesagnew

This comment has been minimized.

Copy link
Owner

commented Mar 9, 2019

Confirmed and fixed in #1231

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