Setup

A REST channel and an API key per monitoring vendor, the outgoing connections and the appliance mapping.

This page is the first of the Supply chain series. It covers the endpoint the vendors send to, the connections the services use and the configuration they read.

A channel per vendor

Each vendor gets credentials of its own, so that one vendor's access can be revoked or rotated without touching the others. For every vendor, there is an API key definition, created in the Dashboard under Security ▹ API keys, with the header the vendor sends the key in:

API key for a vendor

and a REST channel with that definition as its security. All the channels invoke the same service, because every vendor sends the same PQS E006 format:

NameURL pathSecurity
Cold Chain Vendor A/cold-chain/telemetry/vendor-aCold Chain Vendor A
Cold Chain Vendor B/cold-chain/telemetry/vendor-bCold Chain Vendor B

The vendor is given the full address of its channel, such as https://zato.example.com/cold-chain/telemetry/vendor-a, together with its key.

The outgoing connections

The services reach DHIS2 through REST outgoing connections using the DHIS2 security definition from DHIS2 security:

NameURL pathUsed by
DHIS2 Data Values/api/dataValueSetsWriting temperature readings
DHIS2 Events/api/tracker/eventsReading consignment receipts

Alarms reach the district through the District Alerts SMTP connection and the SMS Gateway REST connection, created as in Outbreak alerts, and the addresses of each district come from districts.ini described there. Receipts go to the warehouse system through a REST outgoing connection named Central Store, pointing to the endpoint of its API that records receipts.

The appliances

cold_chain.ini has a section per appliance, named after its serial number, the ASER field of each report. Each appliance has the facility it is in, its data element in the Temperature Monitoring Tool, the district notified of its alarms, and the label it has in messages:

# config/user-conf/cold_chain.ini

[appliances]

[[RF-0001-7734]]
label = Health Centre 12 - Vaccine refrigerator 1
org_unit = DiszpKrYNg8
data_element = Tv3nH8qLw2B
district = O6uvpzGd5pu

[[RF-0002-1185]]
label = Health Centre 12 - Vaccine refrigerator 2
org_unit = DiszpKrYNg8
data_element = Pk6xD1sRm9F
district = O6uvpzGd5pu

The same file has the six category option combinations of the Temperature Monitoring Tool, one per half of the day and measurement, and the time zone of the facilities, as hours from UTC:

[combos]
morning_minimum = Qa1bC2dE3fG
morning_current = Hi4jK5lM6nO
morning_maximum = Pq7rS8tU9vW
afternoon_minimum = Xy0zA1bC2dE
afternoon_current = Fg3hI4jK5lM
afternoon_maximum = No6pQ7rS8tU

[tmt]
utc_offset_hours = 2
afternoon_from_hour = 12
cache_seconds = 172800

Next

Temperature readings writes the readings of each report to the Temperature Monitoring Tool.

See also

FeatureWhat it does
REST channelsEndpoints that external systems call
REST authenticationAPI keys and other security definitions

Learn more