granadaCoder
granadaCoder

Reputation: 27852

Rest Query on the Patient Resource for Finding BOTH/ALL Given Name(s)

How do I search for a person with BOTH given names I provide?

I have the following 2 patients who are "close". Everything (in the Human Name area) is the same except one of the GivenNames are the same. Note "Apple" vs "Banana".

{
    "resourceType": "Bundle",
    "id": "269caf66-0ccc-43e7-b9a5-f16f84db0149",
    "meta": {
        "lastUpdated": "2019-11-20T19:30:26.858917+00:00"
    },
    "type": "searchset",
    "link": [
        {
            "relation": "self",
            "url": "https://localhost:44348/Patient?given=Jingerheimer"
        }
    ],
    "entry": [
        {
            "fullUrl": "https://localhost:44348/Patient/504f6bd3-e9b4-4846-8948-97bf09c70722",
            "resource": {
                "resourceType": "Patient",
                "id": "504f6bd3-e9b4-4846-8948-97bf09c70722",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2019-11-20T19:26:11.005+00:00"
                },
                "identifier": [
                    {
                        "system": "ssn",
                        "value": "111-11-1111"
                    },
                    {
                        "system": "uuid",
                        "value": "da55d068e0784b359fa97498a11543c5"
                    }
                ],
                "name": [
                    {
                        "family": "Smith",
                        "given": [
                            "John",
                            "Apple",
                            "Jingerheimer"
                        ]
                    }
                ]
            },
            "search": {
                "mode": "match"
            }
        },
        {
            "fullUrl": "https://localhost:44348/Patient/10054ce9-6141-4eca-bc5b-0978f8c8afcb",
            "resource": {
                "resourceType": "Patient",
                "id": "10054ce9-6141-4eca-bc5b-0978f8c8afcb",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2019-11-20T19:26:48.962+00:00"
                },
                "identifier": [
                    {
                        "system": "ssn",
                        "value": "222-22-2222"
                    },
                    {
                        "system": "uuid",
                        "value": "52d09f9436d44591816fd229dd139523"
                    }
                ],
                "name": [
                    {
                        "family": "Smith",
                        "given": [
                            "John",
                            "Banana",
                            "Jingerheimer"
                        ]
                    }
                ]
            },
            "search": {
                "mode": "match"
            }
        }
    ]
}

One has GivenNames that include "Apple". The other includes GivenNames that include "Banana".

This search works fine:

https://localhost:44348/Patient/?given=Jingerheimer

What I have tried is:

https://localhost:44348/Patient/?given=Jingerheimer&given=Apple

but that gives me no results.

Note, omitting "given=Jingerheimer" is not an option....that filters a bunch of others.

I'm trying to get

"Has BOTH of the given names I provide"

Upvotes: 0

Views: 126

Answers (1)

Mirjam Baltus
Mirjam Baltus

Reputation: 2299

Your syntax is correct, so I think the server does not handle the search correctly. Can you check the self link for your second search to see if it reflects the search you performed? Does the result Bundle have an OperationOutcome detailing something went wrong? If all that seems okay, you'll need to check your server's code.

Upvotes: 2

Related Questions