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.
-
You must provide the
type
parameter to specify which master data set to retrieve. -
The response will return a list of values and their corresponding codes.
-
All other HFR APIs will only accept the "code" for any field where master data is defined.
type
: (String, required) - The type of master data set you wish to retrieve. Accepted values can be found using theMaster Types API
.
fetch_master_data(type:)
@client.fetch_master_data(type: 'OWNER')
{
"type": "OWNER",
"data": [
{
"code": "G",
"value": "Government"
},
{
"code": "P",
"value": "Private"
},
{
"code": "PP",
"value": "Public-Private-Partnership"
}
]
}
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.
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.