Profiles & Operations > Operation: Search Organization
Search Organization
The Search Organization Restful operation issues a parameterized query that results in a searchset Bundle that contains all Organization resources that match the search parameters. This operation supports retrieval of a set of results using the following search criteria:
Query Search Parameters | Type | Description | Usage Note |
---|---|---|---|
name (Organization.name) |
string | ||
type (Organization.type.coding) |
token | The organization type | |
telecom (Organization.telecom) |
token | By combined telecom type (e.g. phone, email) with telecom value (e.g. phone number, email address) | |
address Organization.address |
string | A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text | |
lhin Location.extension:LHIN-code |
token | The numeric LHIN code for this location | |
registration-subclass Organization.extension:registration-subclass |
The Organization's registration subclass as per the extension binding | ||
_count | integer | The count parameter returns the results of search in a series of pages. This parameter instructs the server on how many resources are to be returned in a single page. |
Specification
This FHIR Search Organization operation is based on the HL7 R4 Restful Search operation.
Organization Search Request
The Organization Search Request is an HTTP GET or POST operation. The syntax of the request is as follows:
POST [base]/Organization/_search
(with parameters passed in the HTTP Body)
Or alternatively,
GET [base]/Organization?param1=value1¶m2=value2%...
Organization Search Response
The Organization Search operation will return a FHIR Bundle (Bundle.type = searchset), containing the the search result entries for for Organization FHIR resources
- Command 'pagelink' could not render: Page not found.
General
Search.Mode
The base FHIR specification states that while Search must return the requested resource type, HealthcareService, the server may also choose to return additional relevant resources. In the case of PHSD, the server will also return the Practitioner, PractitonerRole, Location, and Organization resources that are associated to the HealthcareService search results.
The element Bundle.entry[x].search.mode will be used to distinguish between which resources are being returned as a direct result of the search (value="match") vs inclusion for relevance (value="include"). Similarly, this may also be used to indicate OperationOutcome resources that were included (value="outcome").
Example Search Queries
Search by Organization Type
[base]/Organization?type=http://ehealthontario.ca/fhir/CodeSystem/ppr-provider-organization-role-type|LTC
Search by Address
`[base]/Organization?address=Markham
Expected Behavior
See Response Handling page for additional response handling behaviour.
Legend |
---|
code = OperationOutcome.issue.code |
severity = OperationOutcome.issue.severity |
details.coding.code=OperationOutcome.issue.details.coding.code |
details.coding.display=OperationOutcome.issue.details.coding.display |
details.text = OperationOutcome.issue.details.coding.text |
HTTP Status | Scenario Description | severity | code | details.coding.code | details.coding.display | details.text |
---|---|---|---|---|---|---|
200 OK | At least one Organization resource matching the specified search criteria is found | HTTP 200 | OK. Returns a search result Bundle containing Organization resources that match the search criteria. | |||
200 OK | No Organization resources matching the specified search criteria are found. Returns an search result Bundle with zero search results. Also returns an OperationOutcome resource with a warning indicating no summaries were found. | warning | not-found | |||
400 Bad Request | Missing security token | error | required | Missing required security token: PIN | ||
400 Bad Request | POST operation contains incorrect header value for "Content-Type" - should be "application/fhir+json" | error | invalid | |||
400 Bad Request | When there was syntactical error such as a missing or invalid header, a missing or invalid URL parameter, a request body that can't be parsed or doesn't conform to the basic FHIR JSON/XML syntax rules, etc. Returns an OperationOutcome resource indicating an issue. The client must fix the request and try again. | error | invalid | Will vary depending on the error | ||
401 Unauthorized | Failed authentication | error | security | Authorization is required for the interaction that was attempted | ||
406 Not Acceptable | The Accept header requested a format that the server does not support | error | not-supported | |||
422 Unprocessible Entity | FHIR validation errors such as invalid code, wrong date format, or violation of LOB defined business rules | Will vary depending on the error | Will vary depending on the error | OH-defined error code | OH-defined errror message | |
429 Too Many Requests | Rate Limit | error | throttled | Too Many Requests | ||
500 Internal Server Error | PHSD API validates the request but cannot return a valid response due to internal issues. | fatal | exception | Internal Error | ||
503 Service Unavailable | Indicates that the services has been temporarily taken down (on purpose) | |||||
504 Gateway Timeout | Downstream system(s) did not return timely response | error | timeout |
Organization search response:
Examples of a Organization Search Response(bundle) for Search by Identifier can be found below
Example of Operation Outcome