# Organization _search

`POST /Organization/_search`

This resource defines a group of individuals or clinicians that form an organization of some kind. An organization record may consist of multiple organizations, like an umbrella healthcare organization with multiple physical locations. 

You can review, retrieve, create, update, or delete organization records. The create and update options are available for organizations within the Carequality Interoperability Network as well.

> **Supported fields and schema examples**
>
> We support any valid FHIR field. However, we only display fields we’ve defined in our schema, which are usually based on what’s included in the U.S. Core profile. We recommend relying on U.S. Core requirements. 
>
> Our schema examples show the shape and possibility of each FHIR resource; they aren’t code for real-time API calls. We don’t currently recommend copying and pasting these schema examples for your API calls. [Consider reviewing FHIR API actions](/fhir-api-actions) for realistic examples for particular use cases.

### \_search

Query for organization records. 

> **Flexible FHIR queries, different query parameters**
>
> FHIR queries are a flexible option with parameters to refine your search. The response returns a bundle of resources, known as a `searchset` bundle type. [Learn about bundles and bundle types](https://docs.redoxengine.com/permalink/23Q1Oku3NdxxvwYnQGJVrg) in our FHIR glossary.
>
> We add a `required` label only to query parameters _a FHIR server requires if you query it directly_. Remember that Redox <u>**data on demand**</u> isn’t a FHIR server, and your connection may not be either.
>
> _Query parameters vary between sites._ Work with your connection to find out which query parameters they require for a successful search.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | Array of string | No | The name of the organization |
| `address-city` | Array of string | No | A city specified in an address |
| `address-state` | Array of string | No | A state specified in an address |
| `address-postalcode` | Array of string | No | A postalCode (in the US, a ZIP code) specified in an address |
| `name-searchtype` | Array of string | No | NameSearch type - exact or partOf |
| `radius` | Array of string | No | The radius, in miles, to search for organizations around the provided ZipCode. |
| `index` | Array of string | No | The index to return results starting from. Used for paged results |
| `limit` | Array of string | No | The maximum results you want in the response. default: 500 |
| `active` | Array of string | No | If organization is considered active. If true, only active organizations will be returned, default is true. |

## Request example

_Generated from the schema: the values are placeholders, not a real payload._

```bash
curl 'https://api.redoxengine.com/fhir/R4/{destinationSlug}/{environmentFlag}/Organization/_search' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'name=string' \
--data-urlencode 'address-city=string' \
--data-urlencode 'address-state=string' \
--data-urlencode 'address-postalcode=string' \
--data-urlencode 'name-searchtype=string' \
--data-urlencode 'radius=string' \
--data-urlencode 'index=string' \
--data-urlencode 'limit=string' \
--data-urlencode 'active=string'
```

## Responses

### 200

Search results (Bundle)

Response to an Organization search operation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: Bundle |
| `type` | string | Yes | Identifies this bundle as a response to a search. Value: searchset |
| `total` | number | Yes | The total number of matches |
| `entry` | Array of Organization or Other | No | A resource matching the search criteria or related to a matching resource |
| `entry[] (Organization).resource` | object | Yes | A grouping of people or organizations with a common purpose |
| `entry[] (Organization).resource.resourceType` | string | Yes | Identifies the type of the resource. Value: Organization |
| `entry[] (Organization).resource.active` | boolean | Yes | Whether the organization's record is still in active use. |
| `entry[] (Organization).resource.name` | string | Yes | A name associated with the organization. |
| `entry[] (Organization).resource.id` | string | No | The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. |
| `entry[] (Organization).resource.identifier` | Array of NPI or Other | No | Identifier for the organization that is used to identify the organization across multiple disparate systems. |
| `entry[] (Organization).resource.identifier[] (NPI).system` | string | Yes | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. Value: http://hl7.org/fhir/sid/us-npi |
| `entry[] (Organization).resource.identifier[] (NPI).extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (String).valueString` | string | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (NPI).extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (Organization).resource.identifier[] (NPI).use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `entry[] (Organization).resource.identifier[] (NPI).value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `entry[] (Organization).resource.identifier[] (Other).extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (String).valueString` | string | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `entry[] (Organization).resource.identifier[] (Other).extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (Organization).resource.identifier[] (Other).use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `entry[] (Organization).resource.identifier[] (Other).system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `entry[] (Organization).resource.identifier[] (Other).value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `entry[] (Organization).resource.type` | Array of object | No | The kind(s) of organization that this is. |
| `entry[] (Organization).resource.type[].coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Organization).resource.type[].coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Organization).resource.type[].coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Organization).resource.type[].text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (Organization).resource.telecom` | Array of object | No | A contact detail for the organization. |
| `entry[] (Organization).resource.telecom[].system` | string | No | Telecommunications form for contact point - what communications system is required to make use of the contact. Possible values: phone, fax, email, pager, url, sms, other |
| `entry[] (Organization).resource.telecom[].value` | string | No | The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). |
| `entry[] (Organization).resource.telecom[].use` | string | No | Identifies the purpose for the contact point. Possible values: home, work, temp, old, mobile |
| `entry[] (Organization).resource.address` | Array of object | No | An address for the organization. |
| `entry[] (Organization).resource.address[].line` | Array of string | No | This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information. |
| `entry[] (Organization).resource.address[].city` | string | No | The name of the city, town, suburb, village or other community or delivery center. |
| `entry[] (Organization).resource.address[].state` | string | No | Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes). |
| `entry[] (Organization).resource.address[].postalCode` | string | No | A postal code designating a region defined by the postal service. |
| `entry[] (Organization).resource.address[].country` | string | No | Country - a nation as commonly understood or generally accepted. |
| `entry[] (Organization).resource.address[].use` | string | No | The purpose of this address. Possible values: home, work, temp, old, billing |
| `entry[] (Organization).resource.address[].district` | string | No | The name of the administrative area (county). |
| `entry[] (Organization).resource.partOf` | object | No | The organization of which this organization forms a part. Must be a resource of type `Organization`. |
| `entry[] (Organization).resource.partOf.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (Organization).search` | object | Yes | Information about the search process that lead to the creation of this entry. |
| `entry[] (Organization).search.mode` | string | Yes | Identifies the Organization as matching the search parameters. Value: match |
| `entry[] (Other).search` | object | Yes | Information about the search process that lead to the creation of this entry. |
| `entry[] (Other).search.mode` | string | No | Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. Possible values: match, include, outcome - why this is in the result set |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "resourceType": "Bundle",
  "type": "searchset",
  "total": 0,
  "entry": [
    {
      "resource": {
        "resourceType": "Organization",
        "id": "86336b7d-af6c-3f75-b2f5-7437732b471d",
        "extension": [
          {
            "url": "http://synthetichealth.github.io/synthea/utilization-encounters-extension",
            "valueInteger": 507
          },
          {
            "url": "http://synthetichealth.github.io/synthea/utilization-procedures-extension",
            "valueInteger": 0
          },
          {
            "url": "http://synthetichealth.github.io/synthea/utilization-labs-extension",
            "valueInteger": 0
          },
          {
            "url": "http://synthetichealth.github.io/synthea/utilization-prescriptions-extension",
            "valueInteger": 0
          }
        ],
        "identifier": [
          {
            "system": "https://github.com/synthetichealth/synthea",
            "value": "86336b7d-af6c-3f75-b2f5-7437732b471d"
          }
        ],
        "active": true,
        "type": [
          {
            "coding": [
              {
                "code": "prov",
                "system": "http://terminology.hl7.org/CodeSystem/organization-type",
                "display": "Healthcare Provider"
              }
            ],
            "text": "Healthcare Provider"
          }
        ],
        "name": "HSHS ST CLARE MEMORIAL HOSPITAL",
        "telecom": [
          {
            "system": "phone",
            "value": "9208463444"
          }
        ],
        "address": [
          {
            "line": [
              "855 S MAIN ST"
            ],
            "city": "OCONTO FALLS",
            "state": "WI",
            "postalCode": "541541282",
            "country": "US"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}
```

### 400

Request could not be processed or failed validation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: OperationOutcome |
| `issue` | Array of object | Yes | A structured respresentation of the error that occurred |
| `issue[].severity` | string | Yes | Generally `error` or `fatal` Possible values: fatal, error, warning, information |
| `issue[].code` | string | Yes | A FHIR category code that describes the general type of issue. See http://hl7.org/fhir/ValueSet/issue-type for details |
| `issue[].id` | string | No | If the error occurs in the RedoxEngine, this corresponds to an Error record in the organization. |
| `issue[].details` | object | No | Additional details about the error. This may be a text description of the error or a system code that identifies the error. |
| `issue[].details.coding` | Array of object | No | A more granular FHIR code for the specific error. Typically from http://hl7.org/fhir/ValueSet/operation-outcome |
| `issue[].details.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `issue[].details.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `issue[].details.text` | string | No | A human-readable interpretation of the issue code |
| `issue[].diagnostics` | string | No | Additional diagnostic information about the issue. |

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "invalid",
      "details": {
        "coding": [
          {
            "code": "MSG_BAD_SYNTAX",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid content found in request body."
      }
    }
  ]
}
```

### 401

Authorization is required

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "unknown",
      "details": {
        "coding": [
          {
            "code": "MSG_AUTH_REQUIRED",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid authorization token"
      }
    }
  ]
}
```

### 500

Internal server error

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "processing",
      "details": {
        "coding": [
          {
            "code": "MSG_RESOURCE_ID_FAIL",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Unable to allocate resource id."
      }
    }
  ]
}
```

### 503

Service unavailable

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "transient",
      "details": {
        "text": "System is unable to process this message at this time."
      }
    }
  ]
}
```
