TB GeneXpert - Health Facilities
Health facility-level endpoints for TB GeneXpert analytics. These endpoints provide data grouped by requesting facility (health facility that sent the sample), including sample counts, positivity, gender and age disaggregation, drug resistance profiling, specimen types, rejection analysis, and turnaround time metrics.
Common parameters
Most facility-level endpoints accept a common set of query parameters for filtering results by date range, geography, and aggregation level.
- Name
interval_dates- Type
- JSON array
- Description
Date range filter as a JSON array with two dates in
YYYY-MM-DDformat:["2025-01-01","2025-12-31"]. Defaults to the last 12 months if not provided.
- Name
province- Type
- string
- Description
Filter by province name. Supports multi-select by passing the parameter multiple times.
- Name
district- Type
- string
- Description
Filter by district name. Supports multi-select by passing the parameter multiple times.
- Name
health_facility- Type
- string
- Description
Filter by a specific health facility name.
- Name
facility_type- Type
- string
- Description
Grouping level for aggregated results. Accepted values:
"province","district","health_facility".
- Name
disaggregation- Type
- string
- Description
Enable or disable data disaggregation. Accepted values:
"True"or"False".
- Name
genexpert_result_type- Type
- string
- Description
Filter by cartridge type. Accepted values:
"Ultra 6 Cores","XDR 10 Cores".
Request with parameters
curl -G https://api.openldr.org.mz/tb/gx/facilities/registered_samples/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "province=Maputo Cidade" \
--data-urlencode "district=KaMpfumo" \
--data-urlencode "facility_type=health_facility" \
--data-urlencode "disaggregation=True" \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Registered samples
Returns the total number of registered GeneXpert samples grouped by requesting health facility.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Registered_Samples- Type
- integer
- Description
Total number of registered samples for this facility.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/registered_samples/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{
"Requesting_Facility": "CS Machava II",
"Registered_Samples": 342
},
{
"Requesting_Facility": "CS 1 de Junho",
"Registered_Samples": 287
}
]
Registered samples by month
Returns the total number of registered GeneXpert samples aggregated by month.
- Name
Month- Type
- integer
- Description
The month number (1-12).
- Name
Month_Name- Type
- string
- Description
Full name of the month.
- Name
Year- Type
- integer
- Description
The year of the record.
- Name
Registered_Samples- Type
- integer
- Description
Total number of registered samples for this month.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/registered_samples_by_month/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Month": 1, "Month_Name": "January", "Year": 2025, "Registered_Samples": 2870 },
{ "Month": 2, "Month_Name": "February", "Year": 2025, "Registered_Samples": 2640 }
]
Tested samples
Returns tested GeneXpert samples grouped by requesting health facility, with detected and not detected breakdowns.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Analysed_Samples- Type
- integer
- Description
Total number of samples analyzed.
- Name
Detected_Samples- Type
- integer
- Description
Number of samples with MTB detected.
- Name
Not_Detected_Samples- Type
- integer
- Description
Number of samples with MTB not detected.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Analysed_Samples": 310, "Detected_Samples": 47, "Not_Detected_Samples": 263 },
{ "Requesting_Facility": "CS 1 de Junho", "Analysed_Samples": 265, "Detected_Samples": 38, "Not_Detected_Samples": 227 }
]
Tested samples by month
Returns tested GeneXpert samples aggregated by month, with detected and not detected breakdowns.
- Name
Month- Type
- integer
- Description
The month number (1-12).
- Name
Month_Name- Type
- string
- Description
Full name of the month.
- Name
Year- Type
- integer
- Description
The year of the record.
- Name
Analysed_Samples- Type
- integer
- Description
Total number of samples analyzed.
- Name
Detected_Samples- Type
- integer
- Description
Number of samples with MTB detected.
- Name
Not_Detected_Samples- Type
- integer
- Description
Number of samples with MTB not detected.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_by_month/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Month": 1, "Month_Name": "January", "Year": 2025, "Analysed_Samples": 2650, "Detected_Samples": 398, "Not_Detected_Samples": 2252 },
{ "Month": 2, "Month_Name": "February", "Year": 2025, "Analysed_Samples": 2480, "Detected_Samples": 362, "Not_Detected_Samples": 2118 }
]
Tested samples disaggregated
Returns tested GeneXpert samples grouped by requesting facility with full disaggregation including gender, age group, and positivity breakdown.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Analysed_Samples- Type
- integer
- Description
Total number of samples analyzed.
- Name
Detected_Samples- Type
- integer
- Description
Number of samples with MTB detected.
- Name
Not_Detected_Samples- Type
- integer
- Description
Number of samples with MTB not detected.
- Name
Female- Type
- integer
- Description
Number of female patient samples.
- Name
Male- Type
- integer
- Description
Number of male patient samples.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_disaggregated/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Analysed_Samples": 310, "Detected_Samples": 47, "Not_Detected_Samples": 263, "Female": 142, "Male": 168 },
{ "Requesting_Facility": "CS 1 de Junho", "Analysed_Samples": 265, "Detected_Samples": 38, "Not_Detected_Samples": 227, "Female": 118, "Male": 147 }
]
Tested samples disaggregated by gender
Returns tested GeneXpert samples grouped by requesting facility with gender-specific positivity breakdown.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Female_Detected- Type
- integer
- Description
Number of MTB detected results from female patients.
- Name
Female_Not_Detected- Type
- integer
- Description
Number of MTB not detected results from female patients.
- Name
Male_Detected- Type
- integer
- Description
Number of MTB detected results from male patients.
- Name
Male_Not_Detected- Type
- integer
- Description
Number of MTB not detected results from male patients.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_disaggregated_by_gender/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Female_Detected": 18, "Female_Not_Detected": 124, "Male_Detected": 29, "Male_Not_Detected": 139 },
{ "Requesting_Facility": "CS 1 de Junho", "Female_Detected": 14, "Female_Not_Detected": 104, "Male_Detected": 24, "Male_Not_Detected": 123 }
]
Tested samples disaggregated by age
Returns tested GeneXpert samples grouped by requesting facility and age group.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Age_Group- Type
- string
- Description
Age group label (e.g.,
"0-4","5-14","15-24","25-34","35-44","45-54","55-64","65+").
- Name
Analysed_Samples- Type
- integer
- Description
Total number of samples analyzed for this age group.
- Name
Detected_Samples- Type
- integer
- Description
Number of samples with MTB detected.
- Name
Not_Detected_Samples- Type
- integer
- Description
Number of samples with MTB not detected.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_disaggregated_by_age/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Age_Group": "25-34", "Analysed_Samples": 85, "Detected_Samples": 14, "Not_Detected_Samples": 71 },
{ "Requesting_Facility": "CS Machava II", "Age_Group": "35-44", "Analysed_Samples": 72, "Detected_Samples": 12, "Not_Detected_Samples": 60 }
]
Tested samples by sample types
Returns tested sample counts grouped by requesting facility and specimen type.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Sample_Type- Type
- string
- Description
The specimen type (e.g.,
"Sputum","Feces","Urine","Blood","Other").
- Name
Total- Type
- integer
- Description
Total number of samples of this type from this facility.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_by_sample_types/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Sample_Type": "Sputum", "Total": 275 },
{ "Requesting_Facility": "CS Machava II", "Sample_Type": "Feces", "Total": 22 }
]
Tested samples types disaggregated by age
Returns tested sample counts grouped by requesting facility, specimen type, and age group.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Sample_Type- Type
- string
- Description
The specimen type.
- Name
Age_Group- Type
- string
- Description
Age group label.
- Name
Total- Type
- integer
- Description
Total number of samples for this combination.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_types_disaggregated_by_age/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Sample_Type": "Sputum", "Age_Group": "25-34", "Total": 78 },
{ "Requesting_Facility": "CS Machava II", "Sample_Type": "Feces", "Age_Group": "0-4", "Total": 15 }
]
Tested samples disaggregated by drug type
Returns tested sample counts grouped by requesting facility and drug resistance type.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Drug_Type- Type
- string
- Description
The drug being tested for resistance (e.g.,
"Rifampicin","Isoniazid","Fluoroquinolona","Ethionamide","Amikacin").
- Name
Resistant- Type
- integer
- Description
Number of samples with resistance detected.
- Name
Susceptible- Type
- integer
- Description
Number of samples with no resistance detected.
- Name
Indeterminate- Type
- integer
- Description
Number of samples with indeterminate resistance results.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_disaggregated_by_drug_type/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Drug_Type": "Rifampicin", "Resistant": 3, "Susceptible": 42, "Indeterminate": 2 },
{ "Requesting_Facility": "CS 1 de Junho", "Drug_Type": "Rifampicin", "Resistant": 2, "Susceptible": 34, "Indeterminate": 2 }
]
Tested samples disaggregated by drug type by age
Returns tested sample counts grouped by requesting facility, drug resistance type, and age group.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Drug_Type- Type
- string
- Description
The drug being tested for resistance.
- Name
Age_Group- Type
- string
- Description
Age group label.
- Name
Resistant- Type
- integer
- Description
Number of resistant samples.
- Name
Susceptible- Type
- integer
- Description
Number of susceptible samples.
- Name
Indeterminate- Type
- integer
- Description
Number of indeterminate samples.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/tested_samples_disaggregated_by_drug_type_by_age/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Drug_Type": "Rifampicin", "Age_Group": "25-34", "Resistant": 1, "Susceptible": 12, "Indeterminate": 1 },
{ "Requesting_Facility": "CS Machava II", "Drug_Type": "Rifampicin", "Age_Group": "35-44", "Resistant": 1, "Susceptible": 10, "Indeterminate": 0 }
]
Rejected samples
Returns the total number of rejected GeneXpert samples grouped by requesting health facility.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Rejected_Samples- Type
- integer
- Description
Total number of rejected samples for this facility.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/rejected_samples/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Rejected_Samples": 32 },
{ "Requesting_Facility": "CS 1 de Junho", "Rejected_Samples": 22 }
]
Rejected samples by month
Returns the number of rejected GeneXpert samples aggregated by month.
- Name
Month- Type
- integer
- Description
The month number (1-12).
- Name
Month_Name- Type
- string
- Description
Full name of the month.
- Name
Year- Type
- integer
- Description
The year of the record.
- Name
Rejected_Samples- Type
- integer
- Description
Total number of rejected samples for this month.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/rejected_samples_by_month/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Month": 1, "Month_Name": "January", "Year": 2025, "Rejected_Samples": 145 },
{ "Month": 2, "Month_Name": "February", "Year": 2025, "Rejected_Samples": 118 }
]
Rejected samples by reason
Returns rejected sample counts grouped by requesting facility and rejection reason.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
Rejection_Reason- Type
- string
- Description
The reason for sample rejection.
- Name
Rejected_Samples- Type
- integer
- Description
Number of samples rejected for this reason.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/rejected_samples_by_reason/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "Rejection_Reason": "Insufficient sample volume", "Rejected_Samples": 12 },
{ "Requesting_Facility": "CS Machava II", "Rejection_Reason": "Sample leaked during transport", "Rejected_Samples": 8 }
]
Rejected samples by reason by month
Returns rejected sample counts grouped by rejection reason and aggregated by month.
- Name
Month- Type
- integer
- Description
The month number (1-12).
- Name
Month_Name- Type
- string
- Description
Full name of the month.
- Name
Year- Type
- integer
- Description
The year of the record.
- Name
Rejection_Reason- Type
- string
- Description
The reason for sample rejection.
- Name
Rejected_Samples- Type
- integer
- Description
Number of samples rejected for this reason in the month.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/rejected_samples_by_reason_by_month/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Month": 1, "Month_Name": "January", "Year": 2025, "Rejection_Reason": "Insufficient sample volume", "Rejected_Samples": 32 },
{ "Month": 1, "Month_Name": "January", "Year": 2025, "Rejection_Reason": "Sample leaked during transport", "Rejected_Samples": 18 }
]
TRL samples by days
Returns the TAT segment averages grouped by requesting health facility. TAT is measured in four segments: collection to reception, reception to registration, registration to analysis, and analysis to validation.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
colheita_recepcao- Type
- float
- Description
Average days from sample collection to laboratory reception.
- Name
recepcao_registo- Type
- float
- Description
Average days from laboratory reception to registration.
- Name
registo_analise- Type
- float
- Description
Average days from registration to analysis.
- Name
analise_validacao- Type
- float
- Description
Average days from analysis to result validation.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/trl_samples_by_days/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "colheita_recepcao": 2.8, "recepcao_registo": 0.4, "registo_analise": 0.9, "analise_validacao": 0.3 },
{ "Requesting_Facility": "CS 1 de Junho", "colheita_recepcao": 4.1, "recepcao_registo": 0.6, "registo_analise": 1.5, "analise_validacao": 0.5 }
]
TRL samples by days by month
Returns the TAT segment averages aggregated by month.
- Name
Month- Type
- integer
- Description
The month number (1-12).
- Name
Month_Name- Type
- string
- Description
Full name of the month.
- Name
Year- Type
- integer
- Description
The year of the record.
- Name
colheita_recepcao- Type
- float
- Description
Average days from sample collection to laboratory reception.
- Name
recepcao_registo- Type
- float
- Description
Average days from laboratory reception to registration.
- Name
registo_analise- Type
- float
- Description
Average days from registration to analysis.
- Name
analise_validacao- Type
- float
- Description
Average days from analysis to result validation.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/trl_samples_by_days_by_month/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Month": 1, "Month_Name": "January", "Year": 2025, "colheita_recepcao": 2.5, "recepcao_registo": 0.5, "registo_analise": 0.9, "analise_validacao": 0.2 },
{ "Month": 2, "Month_Name": "February", "Year": 2025, "colheita_recepcao": 2.2, "recepcao_registo": 0.4, "registo_analise": 0.7, "analise_validacao": 0.2 }
]
TRL samples avg by days
Returns the distribution of samples grouped by total turnaround time day ranges, broken down by requesting health facility.
- Name
Requesting_Facility- Type
- string
- Description
Name of the health facility that requested the test.
- Name
less_7- Type
- integer
- Description
Number of samples with total TAT less than 7 days.
- Name
between_7_15- Type
- integer
- Description
Number of samples with total TAT between 7 and 15 days.
- Name
between_16_21- Type
- integer
- Description
Number of samples with total TAT between 16 and 21 days.
- Name
greater_21- Type
- integer
- Description
Number of samples with total TAT greater than 21 days.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/trl_samples_avg_by_days/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Requesting_Facility": "CS Machava II", "less_7": 210, "between_7_15": 62, "between_16_21": 25, "greater_21": 13 },
{ "Requesting_Facility": "CS 1 de Junho", "less_7": 168, "between_7_15": 55, "between_16_21": 28, "greater_21": 14 }
]
TRL samples avg by days by month
Returns the distribution of samples grouped by total turnaround time day ranges, aggregated by month.
- Name
Month- Type
- integer
- Description
The month number (1-12).
- Name
Month_Name- Type
- string
- Description
Full name of the month.
- Name
Year- Type
- integer
- Description
The year of the record.
- Name
less_7- Type
- integer
- Description
Number of samples with total TAT less than 7 days.
- Name
between_7_15- Type
- integer
- Description
Number of samples with total TAT between 7 and 15 days.
- Name
between_16_21- Type
- integer
- Description
Number of samples with total TAT between 16 and 21 days.
- Name
greater_21- Type
- integer
- Description
Number of samples with total TAT greater than 21 days.
Request
curl -G https://api.openldr.org.mz/tb/gx/facilities/trl_samples_avg_by_days_by_month/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
--data-urlencode 'interval_dates=["2025-01-01","2025-12-31"]' \
--data-urlencode "genexpert_result_type=Ultra 6 Cores"
Response
[
{ "Month": 1, "Month_Name": "January", "Year": 2025, "less_7": 1920, "between_7_15": 450, "between_16_21": 180, "greater_21": 100 },
{ "Month": 2, "Month_Name": "February", "Year": 2025, "less_7": 1850, "between_7_15": 410, "between_16_21": 145, "greater_21": 75 }
]