Dropdown-like user experience for tmp projects

From CCMDB Wiki
Revision as of 23:34, 23 October 2025 by Ttenbergen (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page explains how to set up a new tmp project that works like a dropdown or selection box.

The Entity–attribute–value model of the L Tmp V2 table provides a mechanism to store temporary data. It always stores a project and an item, and can store other data types as well as detailed in L_TmpV2 table.

The generic GUI in Patient Viewer Tab Tmp implements the project and item fields as drop-downs, where entering a "project" value updates the dropdown options available in the item field. The initial intent (which remains an alternative use) was to allow several values per product (like gadget shape and gadget colour), but it turns out this also allows us to use the "item" as a dropdown value for the "project" it belongs to.

To set up a dropdown, enter multiple lines in the s_tmp table that have the same value for "study" (corresponds to "project") and the options in the "value" (corresponds to "item") field. The dropdown list can be sorted by entering a sort index in s_tmp.order. Collectors can then enter a project and then an item.

See the s_tmp table for examples.

Example:   

Let's say you want to collect a gadget colour and a gadget shape. You could set this up as

  • Project gadget, item colour, write the colour in the comment field
  • Project gadget, item shape, write the shape in the comment field

or you could set it up as

  • Project gadget_colour
    • items "red", "green", etc
  • Project gadget_shape
    • items "round", "flat", etc

The second options would feel like a dropdown to the collector.

This can be combined with Automatic Generation of TMP entries#using tmp entries to generate a dropdown-like user experience for temporary projects to add an item "not entered yet" when new admissions are entered. Data Integrity Checks can be added to disallow sending with "not yet entered".\

implementation

This is driven by some code that updates the dropdown source for the item combobox when the project combobox triggers a change event. This happens both in Patient Viewer Tab Tmp and in TmpV2 editor form.

Related articles

Related articles: