MCI Search API
Business rules for MCI search (API side)
Rules -
A search request can be run using ONLY the following search parameters or combination of search parameters.
- ID
- Combination of Multiple IDs
- One or more ID + One or more patient detail.
- Name + Address
- Name + Phone number
- Address + Phone number
- Address + Name
- Phone number
- Household code
Note -
- IDs - Include - NID/UID/BRN/HID
- Patient details - Name, Address, Phone number
- Name -
- Given Name
- Given Name + Last Name
- Address - Minimum - Division + District + Upazilla
- Phone number - Minimum 'number' field
- For a search request, if the number of results are less than or equal to N, then all the results are returned.
- For a search request, if the number of results are more than N, then only the first N results is returned along with a message stating, "please narrow down your search".
- The number 'N' is configurable.
Accepted Search Parameter -
Search Parameter | URL | Description |
---|---|---|
HID | Search can be done with the help of HID. | |
NID,BRN & UID | /api/v1/patients?nid=19905678901234567 /api/v1/patients?bin_brn=13455678901234567&uid=34567834562 | Search can be done using both single and multiple IDs. NID must be 13/17 characters; BRN must be 17 characters; UID must be 11 characters. |
/api/v1/patients?nid=19905678901234567&present_address=100409 | ID can be individually used for searching a patient. In addition, ID can be combined with Present Address to search a patient. | |
Present Address | Address must be minimum 6 geocode which indicates address from Division to Upazilla level. | |
Address can be 8 geocode which indicates address up to city corporation level. | ||
Address can be maximum 10 geocode which is up to ward/union level. | ||
Name & Address | /api/v1/patients?given_name=Alif khan&present_address=557364 | Both Given name and Surname must be combined with Present Address. Both Given Name and Surname must be the exact word (case insensitive) to search a patient. |
Phone number & Address | Phone number must be combined with Present Address. Phone no. must be the minimum requirement to search a patient by Phone Number. In addition, search can be done using Country Code, Area Code and Extension with Phone No. | |
Household code | /api/v1/patients?household_code=132452213123 | Household code must be only number and there is no length restriction as of now |
Sample Request & Response -
Success response:
- Search by ID
a. Single ID-
Request :http://192.168.1.68:8081/api/v1/patients?nid=19905678901234567(Search request when result is less than or equal to N)
Response:"http_status": 200,
"results": [
{
"hid": "5927205714962415617",
"nid": "19905678901234567",
"uid": "02701230123",
"bin_brn": "76543210123456789",
"name_bangla": "রাফান জামান আয়মান",
"given_name": "Alif Zaman",
"sur_name": "Aymaan",
"date_of_birth": "1990-02-28",
"gender": "M",
"occupation": "02",
"edu_level": "15",
"relations": [
{
"id": "ea252a51-4015-4412-9706-bb526c1df559",
"type": "FTH",
"hid": "5911276753547952129",
"nid": "1951557890163",
"uid": "09811217611",
"bin_brn": "76545678901633456",
"name_bangla": "মোঃ সাকিব আলী খান",
"given_name": "Md. Sakib Ali",
"sur_name": "Khan"
},
{
"id": "65fcfbd7-0ffb-4a53-bc35-b1e7f07f781b",
"type": "SPS",
"hid": "5911276753547952129",
"nid": "1990567890163",
"uid": "38761111111",
"bin_brn": "52345678901633456",
"name_bangla": "মেহজাবীন খান",
"given_name": "Mehzabin",
"sur_name": "Khan",
"marriage_id": "12345678",
"relational_status": "3"
}
],
"place_of_birth": "Narayanganj",
"religion": "1",
"blood_group": "5",
"nationality": "bangladeshi",
"disability": "0",
"ethnicity": "11",
"present_address": {
"address_line": "xyz",
"division_id": "55",
"district_id": "73",
"upazilla_id": "64",
"holding_number": "Level 2,Taj Garden,House no.4/k",
"street": "Plot 51,Satmasjid Road",
"area_mouja": "Dhanmondi",
"village": "Lalmatia",
"post_office": "Mohammadpur",
"post_code": "1207",
"city_corporation_id": "50",
"country_code": "050"
},
"primary_contact": "Farzana Zebin",
"phone_number": {
"country_code": "008",
"area_code": "02",
"number": "12",
"extension": "0984"
},
"primary_contact_number": {
"country_code": "008",
"number": "123456789012"
},
"permanent_address": {
"address_line": "xyz",
"division_id": "10",
"district_id": "04",
"upazilla_id": "09",
"union_id": "06",
"holding_number": "2/KA Palace House",
"street": "Road no.27",
"area_mouja": "Dhanmondi",
"village": "Lalmatia",
"post_office": "Mohammadpur",
"post_code": "1225",
"city_corporation_id": "20",
"country_code": "050"
},
"marital_status": "2",
"is_alive": "1",
"created": "2014-10-28T07:29:00",
"modified": "2014-10-28T07:29:00"
}
]
}
b. Multiple IDs-
Request : http://192.168.1.68:8081/api/v1/patients?nid=19903456789045678&bin_brn=99345765432123456
Search by Phone number & Address
a. Only number of phone number
Request :http://192.168.1.68:8081/api/v1/patients?phone_no=9678909&present_address=100419 (Search request when result is zero)
Response:
"http_status": 200,
"results": []
b. Multiple fields of phone number
Search by Name & Address
a. Name and AddressRequest :http://192.168.1.68:8081/api/v1/patients?given_name=Alif khan&present_address=55736450 (Search request when result is more than N)
Response:
{
"http_status": 200,
"results": [
{
"hid": "5927208601419513857",
"nid": "19905678901234567",
"name_bangla": "রাফান জামান আয়মান",
"given_name": "Alif khan",
"sur_name": "Aymaan",
"date_of_birth": "1990-02-28",
"gender": "M",
"occupation": "02",
"edu_level": "15",
"relations": [
{
"id": "c2d112f5-4c67-49b4-8a7c-98b20e98f95f",
"type": "MTH",
"hid": "5911276753547952129",
"nid": "1960567890163",
"uid": "03689119011",
"bin_brn": "92345678901633456",
"name_bangla": "শবনম চৌধুরী",
"given_name": "Shabnam",
"sur_name": "Chowdhury"
},
{
"id": "0171348c-4fd8-49fe-bd9a-d38494bde3c4",
"type": "SPS",
"hid": "5911276753547952129",
"nid": "1990567890163",
"uid": "38761111111",
"bin_brn": "52345678901633456",
"name_bangla": "মেহজাবীন খান",
"given_name": "Mehzabin",
"sur_name": "Khan",
"marriage_id": "12345678",
"relational_status": "3"
}
],
"place_of_birth": "Narayanganj",
"religion": "1",
"blood_group": "5",
"nationality": "bangladeshi",
"disability": "0",
"ethnicity": "11",
"present_address": {
"address_line": "xyz",
"division_id": "55",
"district_id": "73",
"upazilla_id": "64",
"holding_number": "Level 2,Taj Garden,House no.4/k",
"street": "Plot 51,Satmasjid Road",
"area_mouja": "Dhanmondi",
"village": "Lalmatia",
"post_office": "Mohammadpur",
"post_code": "1207",
"city_corporation_id": "50",
"country_code": "050"
},
"primary_contact": "Farzana Zebin",
"phone_number": {
"country_code": "008",
"area_code": "02",
"number": "12",
"extension": "0984"
},
"primary_contact_number": {
"country_code": "008",
"number": "123456789012"
},
"permanent_address": {
"address_line": "xyz",
"division_id": "10",
"district_id": "04",
"upazilla_id": "09",
"union_id": "06",
"holding_number": "2/KA Palace House",
"street": "Road no.27",
"area_mouja": "Dhanmondi",
"village": "Lalmatia",
"post_office": "Mohammadpur",
"post_code": "1225",
"city_corporation_id": "20",
"country_code": "050"
},
"marital_status": "2",
"is_alive": "1",
"created": "2014-10-28T07:40:28",
"modified": "2014-10-28T07:40:28"
},
{
"hid": "5927205714962415617",
"nid": "19905678901234567",
"name_bangla": "রাফান জামান আয়মান",
"given_name": "Alif Zaman",
"sur_name": "Aymaan",
"date_of_birth": "1990-02-28",
"gender": "M",
"occupation": "02",
"edu_level": "15",
"relations": [
{
"id": "ea252a51-4015-4412-9706-bb526c1df559",
"type": "FTH",
"hid": "5911276753547952129",
"nid": "1951557890163",
"uid": "09811217611",
"bin_brn": "76545678901633456",
"name_bangla": "মোঃ সাকিব আলী খান",
"given_name": "Md. Sakib Ali",
"sur_name": "Khan"
},
],
"place_of_birth": "Narayanganj",
"religion": "1",
"blood_group": "5",
"nationality": "bangladeshi",
"disability": "0",
"ethnicity": "11",
"present_address": {
"address_line": "xyz",
"division_id": "55",
"district_id": "73",
"upazilla_id": "64",
"holding_number": "Level 2,Taj Garden,House no.4/k",
"street": "Plot 51,Satmasjid Road",
"area_mouja": "Dhanmondi",
"village": "Lalmatia",
"post_office": "Mohammadpur",
"post_code": "1207",
"city_corporation_id": "50",
"country_code": "050"
},
"primary_contact": "Farzana Zebin",
"phone_number": {
"country_code": "008",
"area_code": "02",
"number": "12",
"extension": "0984"
},
"primary_contact_number": {
"country_code": "008",
"number": "123456789012"
},
"permanent_address": {
"address_line": "xyz",
"division_id": "10",
"district_id": "04",
"upazilla_id": "09",
"union_id": "06",
"holding_number": "2/KA Palace House",
"street": "Road no.27",
"area_mouja": "Dhanmondi",
"village": "Lalmatia",
"post_office": "Mohammadpur",
"post_code": "1225",
"city_corporation_id": "20",
"country_code": "050"
},
"marital_status": "2",
"is_alive": "1",
"created": "2014-10-28T07:29:00",
"modified": "2014-10-28T07:29:00"
.........
.........
.........
}
],
"additional_info": {
"note": "There are more record for this search criteria. Please narrow down your search"
}
}
Error:
Only NameRequest :http://192.168.1.68:8081/api/v1/patients?sur_name=Alif khan (Invalid Search request)
Response:
{
"error_code": 1000,
"http_status": 400,
"message": "validation error",
"errors": [
{
"code": 1006,
"message": "Invalid search parameter"
}
]
}