In short
- Search blood banks over UHI by state and district, or by a location and radius.
- Keep
request_idfrom Search Blood Banks and pass it to Get Blood Banks. - Tell the user to check with the blood bank before they visit.
When to use this
Your user needs a blood group and component, and wants to know which blood banks hold it. You search across blood banks on the Unified Health Interface (UHI) by state and district, or by a location and a radius around it. Availability is updated periodically, so tell the user to check with the blood bank before they visit.Before you start
- A Bearer token. Both operations use the
authApiKeyscheme. See Authorization. - The blood group and blood component the user needs.
- Either the state and district, or the user’s latitude, longitude and a search radius.
- The patient headers, if your integration sends them.
Sequence
Steps
1
Start the search
Send
search_type, blood_group and blood_component to Search Blood Banks. All three are required. For a district search, also send state and district. For a location search, send search_type location, location with lat and long, and radius with value and unit, for example km.Keep request_id from the response. status is SUCCESS or FAILURE; on FAILURE, check the request.2
Read the results
Call Get Blood Banks with
request_id. The response carries status and data, which holds context, message.catalog with the matching blood banks, and error_code if the search failed. Show each blood bank’s name, contact details and availability.State you must persist
When it fails
Both operations returnGenericError with code, error and source_error on a 4XX or 5XX. A failure in the search itself comes back in data.error_code with code and message. See Errors.
Test it
The testing page has the sandbox base URL, credentials and the happy path for every journey.- District search with a test state, district, blood group and component; receive
request_idandSUCCESS - Get Blood Banks with that
request_id; results list at least one blood bank - Location search with a test latitude, longitude and a 10 km radius
- Failure: a search without
blood_groupreturns a 4XX

