|
| 1 | +# Search For Facility API |
| 2 | + |
| 3 | +This API provides a list of facilities present in the Health Facility Registry (HFR) system based on search criteria. It returns basic details such as Facility ID, Name, and demographic information. |
| 4 | + |
| 5 | +## Important Notes: |
| 6 | +- You can search using either a specific Facility ID or other search criteria. |
| 7 | +- If you use a Facility ID, other search parameters are ignored. |
| 8 | +- Without a Facility ID, all required parameters must be provided. |
| 9 | +- Data must be in the specified format for each field. |
| 10 | +- Certain demographic details need LGD Codes (Local Government Directory). Visit [LG Directory](https://lgdirectory.gov.in/) for more details. |
| 11 | +- The API performs a fuzzy match on facility names and an exact match on other attributes. |
| 12 | +- Results are paginated. By default, the first page with 10 records is returned, unless specified otherwise. |
| 13 | +- Use this API to find registered facilities and avoid creating duplicates through other APIs. |
| 14 | + |
| 15 | +## Parameters: |
| 16 | + |
| 17 | +- `ownership_code`: (String, required if `facilityId` is not present) - Ownership of the facility to be searched. Accepted codes are specified in the `getmaster-data` API with type=`OWNER`. |
| 18 | + |
| 19 | +- `state_lgd_code`: (String, required if `facilityId` is not present) - State of the facility. The value should be from LGD. |
| 20 | + |
| 21 | +- `district_lgd_code`: (String, optional) - District of the facility. The value should be from LGD. |
| 22 | + |
| 23 | +- `subdistrict_lgd_code`: (String, optional) - Sub-district of the facility. The value should be from LGD. |
| 24 | + |
| 25 | +- `pincode`: (String, optional) - Pin code of the facility. Must be a valid 6-digit number. |
| 26 | + |
| 27 | +- `facilityName`: (String, required if `facilityId` is not present) - Name of the facility being searched. Can be a full or partial name. |
| 28 | + |
| 29 | +- `facility_id`: (String, optional) - 12-character Facility ID allotted to each facility at the time of submission. If present, only details for this facility are returned. |
| 30 | + |
| 31 | +- `page`: (Integer, optional) - Page number of results to be retrieved. Default is 1. |
| 32 | + |
| 33 | +- `results_per_page`: (Integer, optional) - Number of facilities to return per page. Default is 10. |
| 34 | + |
| 35 | + |
| 36 | +### Method |
| 37 | +```ruby |
| 38 | +search_facility( |
| 39 | + ownership_code:, |
| 40 | + state_lgd_code:, |
| 41 | + district_lgd_code:, |
| 42 | + subdistrict_lgd_code: , |
| 43 | + pincode:, |
| 44 | + facility_name:, |
| 45 | + facility_id:, |
| 46 | + page:, |
| 47 | + results_per_page: |
| 48 | +) |
| 49 | +``` |
| 50 | + |
| 51 | + |
| 52 | +## Request Body: |
| 53 | + |
| 54 | +```ruby |
| 55 | +@client.search_facility( |
| 56 | + ownership_code: 'P', |
| 57 | + state_lgd_code: '3', |
| 58 | + pincode: '160059', |
| 59 | + facility_name: 'Orthopedics Center', |
| 60 | + page: 1, |
| 61 | + results_per_page: 2 |
| 62 | +) |
| 63 | +``` |
| 64 | + |
| 65 | +## Response Body: |
| 66 | +```json |
| 67 | +{ |
| 68 | + "facilities": [ |
| 69 | + { |
| 70 | + "facilityId": "IN0310000334", |
| 71 | + "facilityName": "Orthopedics Center", |
| 72 | + "facilityStatus": "Submitted", |
| 73 | + "ownership": "Private", |
| 74 | + "ownershipCode": "P", |
| 75 | + "systemOfMedicineCode": "M", |
| 76 | + "systemOfMedicine": "Modern Medicine(Allopathy)", |
| 77 | + "facilityTypeCode": "5", |
| 78 | + "facilityType": "Hospital", |
| 79 | + "stateName": "PUNJAB", |
| 80 | + "stateLGDCode": "3", |
| 81 | + "districtName": "S.A.S Nagar", |
| 82 | + "districtLGDCode": "608", |
| 83 | + "subDistrictName": "SAS Nagar (Mohali)", |
| 84 | + "subDistrictLGDCode": "267", |
| 85 | + "villageCityTownName": null, |
| 86 | + "villageCityTownLGDCode": "39232", |
| 87 | + "address": "Bluemed Clinic, ", |
| 88 | + "pincode": "160059", |
| 89 | + "latitude": "30.704649", |
| 90 | + "longitude": "76.717873" |
| 91 | + } |
| 92 | + ], |
| 93 | + "message": "Request processed successfully", |
| 94 | + "totalFacilities": 1, |
| 95 | + "numberOfPages": 1 |
| 96 | +} |
| 97 | +``` |
0 commit comments