Skip to content

Commit fb36c03

Browse files
Added docs for HFR utility apis
1 parent 74e4b22 commit fb36c03

File tree

8 files changed

+759
-0
lines changed

8 files changed

+759
-0
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Master Types API
2+
3+
This API retrieves the list of master data types used in the `Health Facility Registry (HFR)`. These master types are essential for various aspects of facility data, such as facility ownership, types of services, and systems of medicine.
4+
5+
## Notes
6+
7+
1. Create `@client` is an instance of the `ABDM::HFR` class from the `ABDM-ruby` gem Ex: `@client = ABDM::HFR.new`.
8+
9+
10+
2. This is a simple `GET` API with no parameters required.
11+
12+
3. The response contains a list of master data types along with their descriptions.
13+
14+
4. The `type` values in the response should be used in subsequent calls to the `Master Data API` to fetch specific details.
15+
16+
17+
## Request Body
18+
```ruby
19+
@client.fetch_master_types
20+
```
21+
22+
## Response Body
23+
```json
24+
{
25+
"masterTypes": [
26+
{
27+
"type": "MEDICINE",
28+
"desc": "System Of Medicine"
29+
},
30+
{
31+
"type": "OWNER",
32+
"desc": "Ownership Of Facility"
33+
},
34+
{
35+
"type": "OWNER-SUBTYPE",
36+
"desc": "Ownership Subtype Of Facility"
37+
},
38+
{
39+
"type": "CENTRAL-GOVERNMENT",
40+
"desc": "Ministries under Central Government"
41+
},
42+
{
43+
"type": "PROFIT-TYPE",
44+
"desc": "Types of Profit Facilities"
45+
},
46+
{
47+
"type": "NON-PROFIT-TYPE",
48+
"desc": "Types of Non Profit Facilities"
49+
},
50+
{
51+
"type": "FACILITY-TYPE",
52+
"desc": "Facility Type"
53+
},
54+
{
55+
"type": "TYPE-SERVICE",
56+
"desc": "Type of Service"
57+
},
58+
{
59+
"type": "SPECIALITIES",
60+
"desc": "Specialities offered with System of medicine"
61+
},
62+
{
63+
"type": "SALUTATION",
64+
"desc": "Salutation of Nodal Contacts"
65+
},
66+
{
67+
"type": "FACILITY-REGION",
68+
"desc": "Facility Region for Demographic details"
69+
},
70+
{
71+
"type": "SPECIALITY-TYPE",
72+
"desc": "Hospital Speciality Type"
73+
},
74+
{
75+
"type": "ADDRESS-PROOF",
76+
"desc": "Address Proof Types"
77+
},
78+
{
79+
"type": "FAC-STATUS",
80+
"desc": "Facility Operational Status"
81+
},
82+
{
83+
"type": "IT-EQUIPMENT",
84+
"desc": "IT Equipments available in the facility."
85+
},
86+
{
87+
"type": "GENERAL-INFO-OPTIONS",
88+
"desc": "Options available for questions related to Facility General Information."
89+
},
90+
{
91+
"type": "IMAGING",
92+
"desc": "Imaging Services offered by the facility"
93+
},
94+
{
95+
"type": "DIAGNOSTIC",
96+
"desc": "Diagnostic Lab services offered by the facility"
97+
},
98+
{
99+
"type": "DAYS-OF-OPERATION",
100+
"desc": "Days of Operation offered by the facility"
101+
},
102+
{
103+
"type": "FACILITY-SUB-TYPE",
104+
"desc": "Facility Sub Type corresponding to Facility Type offered by Facility"
105+
},
106+
{
107+
"type": "SOURCE",
108+
"desc": "Source available for facility"
109+
}
110+
]
111+
}
112+
```
113+
114+
Once you have retrieved the master types, you can use these values in further calls to the **Master Data API** to fetch detailed information about each master type (e.g., systems of medicine, facility types, ownership types, etc.).
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Master Data API
2+
3+
The `Master Data API` allows you to retrieve a list of specific master data sets based on the master type provided. These master data sets include facility ownership types, systems of medicine, facility types, and other key datasets that are used throughout the HFR APIs.
4+
5+
## Notes
6+
7+
1. You must provide the `type` parameter to specify which master data set to retrieve.
8+
9+
2. The response will return a list of values and their corresponding codes.
10+
11+
3. All other HFR APIs will only accept the "code" for any field where master data is defined.
12+
13+
14+
## Parameters
15+
16+
- `type`: (String, required) - The type of master data set you wish to retrieve. Accepted values can be found using the `Master Types API`.
17+
18+
19+
## Method
20+
```ruby
21+
fetch_master_data(type:)
22+
```
23+
24+
25+
## Request Body
26+
```ruby
27+
@client.fetch_master_data(type: 'OWNER')
28+
```
29+
30+
31+
## Response Body
32+
33+
```json
34+
{
35+
"type": "OWNER",
36+
"data": [
37+
{
38+
"code": "G",
39+
"value": "Government"
40+
},
41+
{
42+
"code": "P",
43+
"value": "Private"
44+
},
45+
{
46+
"code": "PP",
47+
"value": "Public-Private-Partnership"
48+
}
49+
]
50+
}
51+
```
52+
53+
In the above response, the master data set for `OWNER` returns a list of ownership types with their corresponding codes, which you will use in the facility registration process.
54+
55+
56+
Now that you have fetched the master data, you can use these codes in further API calls that require specific data types, such as ownership, systems of medicine, facility types, etc.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# LGD States API
2+
3+
The `LGD States API` fetches the Local Government Directory (LGD) codes for all states and their districts as per [https://lgdirectory.gov.in](https://lgdirectory.gov.in). This is used in the HFR system to define and validate demographic data for healthcare facilities.
4+
5+
6+
## Notes
7+
8+
1. This is a basic GET API and no parameters are required.
9+
10+
2. The response provides a list of all states with their LGD code and a sub-list of districts and their LGD codes.
11+
12+
3. All HFR APIs will only accept the `code` for demographic fields where master data is defined.
13+
14+
15+
## Request Body
16+
```ruby
17+
@client.fetch_lgd_states
18+
```
19+
20+
## Response Body
21+
```json
22+
[
23+
{
24+
"code": "35",
25+
"name": "ANDAMAN AND NICOBAR ISLANDS",
26+
"districts": [
27+
{
28+
"code": "603",
29+
"name": "NICOBARS"
30+
},
31+
{
32+
"code": "632",
33+
"name": "NORTH AND MIDDLE ANDAMAN"
34+
},
35+
{
36+
"code": "602",
37+
"name": "SOUTH ANDAMANS"
38+
}
39+
]
40+
},
41+
{
42+
"code": "28",
43+
"name": "ANDHRA PRADESH",
44+
"districts": [
45+
{
46+
"code": "745",
47+
"name": "Alluri Sitharama Raju"
48+
},
49+
{
50+
"code": "744",
51+
"name": "Anakapalli"
52+
},
53+
{
54+
"code": "502",
55+
"name": "Ananthapuramu"
56+
},
57+
{
58+
"code": "753",
59+
"name": "Annamayya"
60+
}
61+
]
62+
},
63+
//...other states and districts
64+
]
65+
```
66+
67+
Now that you have retrieved the LGD codes, you can use these codes in subsequent API calls that require state and district demographic data for facility registration or updates.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Facility Type API
2+
3+
The `Facility Type API` allows you to fetch the master data set for facility types, filtered by ownership and system of medicine. This data is critical for registering a healthcare facility in the HFR system.
4+
5+
## Notes
6+
7+
1. You must provide the required parameters such as `ownership_code` to retrieve relevant facility types.
8+
9+
2. Optionally, you can filter facility types based on the system of medicine using `system_of_medicine_code`. If there are multiple systems of medicine, send a comma-separated string of codes.
10+
11+
## Parameters
12+
13+
- `ownership_code`: (String, required) - The ownership classification of the facility. Accepted codes can be retrieved using the `Master Data API` with `type=OWNER`.
14+
- `system_of_medicine_code`: (String, optional) - The system of medicine followed by the facility. Accepted codes can be found using the `Master Data API` with `type=MEDICINE`. If the facility practices multiple systems, pass a comma-separated string of codes.
15+
16+
17+
## Method
18+
```ruby
19+
fetch_facility_type(
20+
ownership_code:,
21+
system_of_medicine_code:
22+
)
23+
```
24+
25+
26+
## Request Body
27+
```ruby
28+
@client.fetch_facility_type(
29+
ownership_code: 'G',
30+
system_of_medicine_code: 'D'
31+
)
32+
```
33+
34+
## Response Body
35+
```json
36+
{
37+
"type": "FACILITY-TYPE",
38+
"data": [
39+
{
40+
"code": "2",
41+
"value": "Primary Health Centre"
42+
},
43+
{
44+
"code": "1",
45+
"value": "Sub Centre"
46+
},
47+
{
48+
"code": "11",
49+
"value": "Pharmacy"
50+
},
51+
{
52+
"code": "7",
53+
"value": "Dental College"
54+
},
55+
{
56+
"code": "8",
57+
"value": "Dental Hospital"
58+
},
59+
{
60+
"code": "16",
61+
"value": "Dental Clinic"
62+
},
63+
{
64+
"code": "102",
65+
"value": "Health and Wellness Centre"
66+
},
67+
{
68+
"code": "38",
69+
"value": "Other Facility"
70+
}
71+
]
72+
}
73+
```
74+
75+
After fetching the relevant facility types, use these codes in the subsequent API requests for facility registration or updates.
76+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Get Owner Subtypes API
2+
3+
The `Get Owner Subtypes API` allows you to retrieve a list of ownership subtypes and further subtypes, based on the `ownership_code` provided. If a valid `owner_subtype_code` is passed, you will get the next level of subtypes.
4+
5+
6+
## Notes
7+
- `ownership_code` is a mandatory parameter.
8+
- You can optionally provide `owner_subtype_code` to retrieve a list of subtypes under a specific ownership type.
9+
10+
11+
## Parameters
12+
13+
1. `ownership_code`: (String, required) - The ownership classification of the facility. Accepted codes can be retrieved using the `Master Data API` with `type=OWNER`.
14+
15+
2. `owner_subtype_code`: (String, optional) - The ownership subtype code under a specific ownership. Use the `Get Owner Subtypes API` to retrieve valid subtype codes.
16+
17+
18+
## Method
19+
```ruby
20+
fetch_owner_subtypes(
21+
ownership_code:,
22+
owner_subtype_code:
23+
)
24+
```
25+
26+
27+
## Request Body
28+
```ruby
29+
@client.fetch_owner_subtypes(
30+
ownership_code: 'P',
31+
owner_subtype_code: ''
32+
)
33+
```
34+
35+
36+
## Response Body
37+
```json
38+
{
39+
"type": "OWNER-SUBTYPE",
40+
"data": [
41+
{
42+
"code": "P",
43+
"value": "Profit"
44+
},
45+
{
46+
"code": "NP",
47+
"value": "Not for Profit"
48+
}
49+
]
50+
}
51+
```
52+

0 commit comments

Comments
 (0)