Administrator Options

Administrator Options are available when the authenticated user is a Table Administrator. They provide the admin with enhanced permissions, including viewing the entire data set, creating data visualizations, deleting records, and adding new health facilities.

Administrator Options Menu

Main Menu with Administrator Option Administrator Options

Function

The Administrator Options Menu is the hub that launches the special actions the administrator can perform. It is only accessible by authenticated Table Administrators. This screen is accessed by pressing the Administrator Options button the main menu.

The administrator has access the full hierarchy of regions. Above the Administrator Options button is the list of all the highest tier regions. Tapping any of those individual options will filter the data into that region. They admin can keep advancing through the regions until they reach the leaf tiers, which is the same Regions interface.

Implementation

This screen is shown the assets/index.html and /assets/menu.js execute the authentication code and find a user that is a Table Administrator. This will trigger the function showSubregionButtonsAndTitle(...) to show the top level regions (see Regions for details), and the addMenuButton(...) function to add the Administrator Options Button.

When the Administrator Options button is pressed, the function odkTables.launchHTML(...) launches assets/coldchaindemo.html. This file defines the four option buttons, and assets/js/coldchandemo.js handles logic that they trigger.

Files

  • assets/index.html

  • assets/js/menu.js

  • assets/js/util.js

  • assets/coldchaindemo.html

  • assets/js/coldchaindemo.js

Forms

None

Database Tables

  • Health Facility

View Health Facilities

View Health Facilities

Function

The administrator can view the full list of health facilities, unfiltered by region. This gives the administrator full control investigate, modify, or delete any facility in the data set. They can choose to find a facility with one of two methods:

  • Filter By Type:

    View Health Facilities By Type

    This option presents an interface similar to the Filter Health Facilities By Type option in the Lists of Health Facilities. This version functions the same, but includes all facilities in the system. Selecting a type brings up the normal Map View list.

  • Search By Name/ID:

    Search Health Facilities

    This interface presents a search list that looks and behaves the same as Lists of Refrigerators. It includes Delete buttons on each entry. The search box accepts facility ID and facility names.

Implementation

The root level HTML file for this option is assets/filterHealthFacilities.html. It defines the two buttons and assets/js/filterHealthFacilities.js handles their logic.

  • Filter By Type: uses odkTables.launchHTML(...) to launch assets/filterHealthFacilitiesByType.html and assets/js/filterHealthFacilitiesByType.js. This JavaScript file uses util.getFacilityTypesByDistrict(...) from assets/js/util.js to create the facility type buttons and add their facility counts. Tapping one of the facility type buttons will use odkTables.openTableToMapView(...) to launch Lists of Health Facilities. This workflow is similar to the Filter Health Facilities By Type option on that screen.

  • Search By Name/ID: uses odkTables.launchHTML(...) to launch tables/health_facility/html/health_facility_lists.html and tables/health_facility/html/health_facility_lists.js. These files use the same search list pattern found in Lists of Refrigerators. See The list_view_logic.js library for details on how assets/js/list_view_logic.js renders this user interface. The listQuery value selects all health facilities from the Health Facility table. The searchParams sets the search fields to facility ID and facility name.

Files

  • assets/filterHealthFacilities.html

  • assets/js/filterHealthFacilities.js

  • assets/filterHealthFacilitiesByType.html

  • assets/js/filterHealthFacilitiesByType.js

  • tables/health_facility/html/health_facility_list.html

  • tables/health_facility/js/health_facility_list.js

  • assets/js/list_view_logic.js

  • assets/js/util.js

Forms

None

Database Tables

  • Health Facility

Inventory

Inventory

Function

The Inventory option provides two visualizations of the state of the data set, both of which can be customized to chosen parameters.

  • Refrigerator Age

    Inventory Graph By Refrigerator Age

    The refrigerator age visualization presents a bar chart of the current stock of refrigerators, grouped by age. This can be useful as an assessment of the quality of the stock and as an estimate of maintenance demands. This graph can be filtered by region, facility type, and power source. With this option the administrator might compare the age distribution of refrigerators in the North and the South regions when allocating upgrade budgets.

  • Facility Grid Power Available

    Inventory Graph BY Grid Power

    The grid power visualization presents a pie chart comparing the ratios of power options available. This can be filtered by region and facility type.

The data sets to be graphed are filtered with a set of drop menus that can be chosen to specify the desired data set.

Inventory Filter

Implementation

The root level HTML file for this option is assets/filterInventory.html. It defines the two buttons and assets/js/filterInventory.js handles their logic.

Refrigerator Age uses odkTables.launchHTML(...) to launch assets/filterFrigInventoryForAge.html an assets/js/filterFrigInventoryForAge.js. The HTML file defines the three drop menus. The values specified by these drop menus are read and used as query parameter arguments when launching assets/graphFrigInventoryForAge.html and assets/js/graphFrigInventoryForAge.js. This JavaScript file uses query parameters provided the caller to construct a SQL query run an odkData.query(...) call on the Health Facility table. The result of this call are used to construct a new query that finds refrigerators that match health facilities with an odkData.arbitraryQuery(...) call on the Refrigerators table. When these results return, the frigHistogramByAge() function uses that data and the D3 library to render the bar chart.

Facility Grid Power Available follows the same pattern as Refrigerator Age to present drop menus and use their values as query parameters. The file that renders this graph is assets/js/graphFacilityInventoryForGridPower.js. This file also operates similarly to graphFrigInventoryForAge.js but only performs a single query on the Health Facilities table. That data set is used, along with D3 by the displayHealthFacilityGridPower() function to render the pie chart.

Files

  • assets/filterInventory.html

  • assets/js/filterInventory.js

  • assets/filterFrigInventoryForAge.html

  • assets/js/filterFrigInventoryForAge.js

  • assets/filterFacilityInventoryForGridPower.html

  • assets/js/filterFacilityInventoryForGridPower.js

  • assets/graphFrigInventoryForAge.html

  • assets/js/graphFrigInventoryForAge.js

  • assets/graphFacilityInventoryForGridPower.html

  • assets/js/graphFacilityInventoryForGridPower.js

  • assets/js/util.js

Forms

None

Database Tables

  • Health Facility

  • Refrigerators

Refrigerator Types

Refrigerator Types

The Refrigerator types list is identical to the interface presented in the Lists of Refrigerator Types guide. The button is included here as a convenience. See the linked documentation for details.

Add Health Facility

Add Health Facility

Function

The Add Health Facility interface provides a method for an administrator to add a new health facility to the data set. The administrator must specify the region that should contain the facility (the region must be a leaf tier, it cannot contain other regions). When the Add Facility button is pressed, a form is launched to fill in the details of the facility.

Implementation

The root level HTML file for this option is assets/addHealthFacility.html. It defines the button and drop menu and assets/js/addHealthFacility.js handles their logic.

The JavaScript file reads the value from the drop menu and uses it to construct the defaults argument to odkTables.addRowWithSurvey(...). The variable also includes the group permissions. The form launched is tables/health_facility/forms/health_facility/health_facility.xlsx

This form resembles many of the other forms in this application. Mostly select_one prompts are grouped into screens. The region choices are populated by a query from the queries worksheet. The settings, properties, and model worksheets all contain their typical values, setting the form and table IDs, setting the default view files, and mapping to the database, respectively. The properties file includes security properties including unverifiedUserCanCreate and defaultAccessOnCreation that restrict which users can use this form.

Files

  • assets/addHealthFacility.html

  • assets/js/addHealthFacility.js

  • assets/js/util.js

  • tables/health_facility/forms/health_facility/health_facility.xlsx

Forms

  • Health Facility with form ID health_facility

Database Tables

  • Health Facility