Refrigerator Types

Refrigerator Types represent the different models of refrigerators available. This is convenient for adding a new refrigerator to a health facility, as the model will already include information about the refrigerator that might not be obvious to the worker installing the unit. It also provides an easy reference if spare parts are needed or the model itself is needed for any reason.

Lists of Refrigerator Types

List of Refrigerator Types

Function

A List of Refrigerator Types is similar to a Lists of Refrigerators. It is launched by pressing the View Refrigerator Models button on the Region Menu.

The list portion contains each refrigerator type. Clicking that list item will open the Refrigerator Type Menu. The list can be searched by the refrigerator type ID, catalog ID, or the manufacturer. A substring of the search string can be provided and all matching records will be displayed.

The list items each show a picture of the refrigerator model to ease navigation and provide a more familiar reference than the model name.

This page is paginated by default to 10 refrigerator types per page. This can be adjusted to 20, 50, 100, or 1000 by selecting the option from the drop menu. To navigate between pages of refrigerator types, use the Next and Prev buttons.

Implementation

The refrigerator types list uses the files tables/refrigerator_types/html/regrigerator_types_list.html and tables/refrigerator_types/js/refrigerator_types.js similarly to the refrigerators list.

The key differences are the listQuery and searchParams variables that define the values that will populate the same user interface. This file's versions of listQuery performs a simple SELECT * from the Refrigerator Types table and this versions of searchParams searches for matching catalog ID, manufacturer, or model ID.

That logic that implements that user interface is discussed in The list_view_logic.js library.

Files

  • tables/refrigerator_types/html/refrigerator_types_list.html

  • tables/refrigerator_types/js/refrigerator_types_list.js

Forms

None

Database Tables

  • Refrigerator Types

Refrigerator Type Menu

Refrigerator Type Menu

Function

The Refrigerator Type Menu is a Detail View that lists all the model information about the particular refrigerator type, and shows a picture if available.

It also has a View all *Model ID* Refrigerators that shows the number of refrigerators in the region with this particular type. Tapping that button will launch a Lists of Refrigerators containing all refrigerators in that region of that type.

Implementation

The Detail View for a refrigerator type is defined by tables/refrigerator_types/html/refrigerator_types_detail.html. This file lists each user interface element (including all the data values of the refrigerator type as well as the buttons). These elements contain their labels, and the values are filled in by tables/refrigerator_types/js/refrigerator_types_detail.js.

After localizing its text, this JavaScript retrieves the refrigerator log data with the standard odkData.getViewData(...) call. It also makes an odkData.query(...) call to the Refrigerators table. The resulting data sets are combined to fill in the display fields on the detail view.

If the View all *Model ID* Refrigerators button is pressed, odkTables.launchHTML(...) is called to launch Lists of Refrigerators.

Files

  • tables/refrigerator_types/html/refrigerator_types_detail.html

  • tables/refrigerator_types/js/refrigerator_types_detail.js

  • assets/js/util.js

Forms

None

Database Tables

  • Refrigerator Types

  • Refrigerators