Automatic Generation of TMP entries: Difference between revisions

From CCMDB Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 12: Line 12:
* '''auto_cant_edit'''
* '''auto_cant_edit'''


=== using this to generate a "dropdown" like user experience for temporary fields ===
=== using tmp entries to generate a dropdown-like user experience for temporary projects ===
Let's say you want to add a project "colour" with options "red" and "green". To make it easy for collectors to enter this, you could automatically generate a tmp entry by adding to s_tmp line with study (ie L_TmpV2.project) entry "colour", with value (ie L_TmpV2.item) "not yet entered", and with active = true auto_add_at_patient_creation = true.
This can be used in conjunction with [[Dropdown-like user experience for tmp projects]] to create a number of entries you want collectors to action.
Then add two more lines to s_tmp with auto_add_at_patient_creation ='''false''' (those should not be entered automatically) and values "red" and "green".  
Let's say you want to add a project "colour" with options "red" and "green". To make it easy for collectors to enter this, you could automatically generate a [[s_tmp]].value entry "not yet entered" with auto_add_at_patient_creation = true.
After entering a new admission, the collector will see an entry "colour"-"not yet entered", where the "not yet entered" is a dropdown box with options "green" and "red".  


After entering a new admission, the collector will see an entry "colour"-"not yet entered", where the "not yet entered" is a dropdown box with options "green" and "red". The dropdown list can be sorted by entering a sort index in s_tmp.order.
[[Data Integrity Checks]] can be added to disallow sending with "not yet entered".
 
[[Data Integrity Checks]] can be added to disallow sending with "not yet entered".  


== entries generated programmatically ==
== entries generated programmatically ==

Latest revision as of 22:49, 23 October 2025

CCMDB.mdb has the following mechanisms to facilitate or automate the generation of entries in the L TmpV2 table to facilitate Tmp Project Collection under the Entity–attribute–value model of the L Tmp V2 table.

entries generated at record creation time

Adding a patient triggers Sub add_automatic_tmp_entries, which adds a tmp entry for each record in s_tmp table that matches the new admission based on

  • s_tmp.hosp = s_dispo.Site
  • s_tmp.program = s_dispo.Program
  • active = true
  • auto_add_at_patient_creation = true

To restrict ability to edit those from the data collector GUI in Patient Viewer Tab Tmp set the applicable parameter in s_tmp table to true:

  • auto_cant_add_manually
  • auto_cant_edit

using tmp entries to generate a dropdown-like user experience for temporary projects

This can be used in conjunction with Dropdown-like user experience for tmp projects to create a number of entries you want collectors to action. Let's say you want to add a project "colour" with options "red" and "green". To make it easy for collectors to enter this, you could automatically generate a s_tmp.value entry "not yet entered" with auto_add_at_patient_creation = true. After entering a new admission, the collector will see an entry "colour"-"not yet entered", where the "not yet entered" is a dropdown box with options "green" and "red".

Data Integrity Checks can be added to disallow sending with "not yet entered".

entries generated programmatically

Tmp entries can be generated or updated in VBA using Function GenerUpdate_tmp_entry.

Related articles

Related articles: