Skip to content

Demo prompts

This page describes prompts to be used in demos in the AP prod environment.

Data browser text-to-SQL queries

Select schema PEPFAR.

Tell me the ID and name of data elements related to HIV and TB.
Tell me about data elements of value type number and aggregation type sum.
Give me an overview of programs and their program stages and data elements. Include the data element value type and aggregation type. Order by program and program stage.
Give me the sum of data values for data items related to HTS_TST and TX_CURR by quarter and OU national level. Include the data item. Show me the 50 highest values in descending order.
Give me the sum of data values for data items related to HTS_TST and TX_CURR by quarter and OU national level. Include the data item. Include last 5 years. Order by data value descending.
Give me a list of regions (OU national) and the number of sites (org units) which have at last 200 people on treatment, defined as 'TX_CURR'. Include the average number of people on treatment per org unit, rounded to nearest number.

Select reasoning level THINKING.

Tell me about the most significant data outliers across time.

* Use the "PT Quarterly" column as the time dimension. 
* Use the Modified Z-Score statistical method for identifying the outliers.
* Return only up to the 200 most significant outliers.
* Order by Modified Z-Score largest value first.
Show me outlier data for facilities for Kenya for data item TX_NEW.

* Facilities are at OU level 4, provinces are at OU subnational.
* Include data item, province, facility, quarter and data value.
* Find facilities where the TX_NEW count in any single quarter of 2021 spiked by more than 2.5 standard deviations compared to the trailing 8 quarter average of the facility.
Tell me the percentage of women who know their HIV status at antenatal care (PMTCT_STAT) compared to antenatal first visits (ANC1), by quarters of 2020 and 2021 at sub-national level for Tanzania.

Script editor text-to-Python scripts

Outlier detection

Write an outlier detection script that:

1. Retrieves data for HIV testing
2. Identifies outliers in the dataset
3. Prints the outliers to the console

* Use the following SQL query to retrieve data:

```
SELECT d.DataItem, d."PT Quarterly", d.OrgUnitID, d.OrgUnitName, d.Value
FROM pepfar.data d WHERE d.DataItem = 'HTS_TST_POS' LIMIT 20000;
```

* Use the "Modified Z-Score" statistical method for identifying the outliers.
* Return only up to the 200 most significant outliers.
* Print the outliers to the console in a table using the "tabulate" package.

Data connector

Fetch indicator data from the World Bank Data API.

* Use these indicator codes: "NY.GDP.PCAP.KD", "NY.GDP.MKTP.KD.ZG", "SP.DYN.LE00.IN".
* Retrieve data for these country codes: "KEN", "TZA", "UGA".
* Render countries on columns, and indicators on rows. Sort data by year.
* Handle non-existing indicators.
* Print data to the console with the tabulate package.

Forecasting

Fetch country population data from the World Bank Data API for Tanzania.

* Order data by year.
* Provide a forecast for the population for the next 10 years.
* Print data as a table.
* Use readable numbers with no decimals.
* Use thousand separator for population, not for year.

Convo

Log in with username bao-convo.

Tell me numbers for TX_NEW, TX_NET_NEW and TX_RTT for year 2020 for Tanzania, Kenya, Uganda and Mozambique only.
Show me the number of PMTCT_ART and PMTCT_EID for the quarters of 2020 and 2021, for Tanzania, Kenya and Mozambique only.
Tell me the number of PMTCT_EID for the quarters of 2020 and 2021, for Tanzania, Kenya and Mozambique.