A list of example search clauses for some common use-cases of the Practitioner Search endpoint. Please note that these are just examples, and you can search using the full Elasticsearch Query DSLI. When composing your search query, you'll be searching on the practitioner object, which matches up with the full Orderly Response object body (described in all Orderly Provider Directory API reference endpoints). You can see an example of this object below, note how each query example on the page references a path on this object.

{
    "npi": 1003868211,
    "fName": "John",
    "lName": "Glenn",
    "mName": "A",
    "gender": "Male",
    "entityType": 1,
    "languages": [
      "English",
      "Spanish"
    ],
    "credentials": [
        "MD"
    ],
    "emails": [
        "[email protected]"
    ],
    "specialties": [
        "Cardiovascular Disease Physician",
        "Internal Medicine Physician"
    ],
    "addresses": [
        {
            "address1": "111 Some St",
            "city": "Denver",
            "state": "CO",
            "zipCode": "802222761",
            "phone": "1234567890",
            "fax": "1234567890",
            "isPrimary": true,
            "insurances": []
        }
    ],
    "specialtyDetails": [
        {
            "specialtyName": "Cardiovascular Disease Physician",
            "taxonomyType": "NUCC",
            "taxonomyCode": "207RC0000X",
            "is_primary": true
        },
        {
            "specialtyName": "Internal Medicine Physician",
            "taxonomyType": "NUCC",
            "taxonomyCode": "207R00000X",
            "is_primary": false
        }
    ],
    "facilityAttributions": [
        {
            "npi": 1417946021,
            "name": "Saint Joseph Hospital"
        },
        {
            "npi": 1326015777,
            "name": "National Jewish Health"
        }
    ],
    "updatedAt": "2022-05-17T00:00:00.000+00:00",
    "lastAuditUpdate": "2022-05-25T00:00:00Z",
    "lastAuditVerify": "2022-06-30T00:00:00Z",
    "active": true,
    "person": true
}

Search by Practitioner Specialty

"query": {
  "nested": {
    "path": "practitioner.specialties",
      "query": {
        "bool": {
          "should": [
            { "match": { "practitioner.specialties.taxonomyName": "Dentist" } }
          ]
        }
      },
        "score_mode": "avg"
  }

}

Search By Practice Location

"query": {
  "nested": {
    "path": "practitioner.addresses",
      "query": {
        "bool": {
          "must": [
            { "match": { "practitioner.addresses.addr1": "1400 Jackson St" } }
          ]
        }
      },
        "score_mode": "avg"
  }
},

Search By Credential

"query": {
   "bool": {
     "should": [
       { "match": { "practitioner.credentials": "MD" } },
       { "match": { "practitioner.credentials": "DO" } }
     ]
   }
 }

Search By Exact Name

"query":{
  "bool":{
    "must":[
      {
        "match":{
          "practitioner.firstName": "Michele"
        }
      },
      {
        "match":{
          "practitioner.lastName": "Sibel"
        }
      }
    ]
  }
}