Automatic Generation of TMP entries: Difference between revisions

m doesn't use laptop location info
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[CCMDB.mdb]] will automatically enter Tmp lines if the entry in s_tmp
[[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]].
* applies to this site
 
* applies to this program
== 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
* active = true
* auto_add_at_patient_creation = true
* auto_add_at_patient_creation = true


Further, the program can programmatically enter values for s_tmp entries. If we want to restrict ability to edit those, '''auto_cant_add_manually''' and/or '''auto_cant_edit''' can be set.
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".  


== [[S_Tmp]] table usage ==
[[Data Integrity Checks]] can be added to disallow sending with "not yet entered".
* '''auto_add_at_patient_creation''' - if true then the line is auto-added at patient creation time if applicable for a [[Laptop location]]
* '''auto_cant_add_manually''' - entry can't be ''added'' manually, ie. will show up in dropdowns
* '''auto_cant_edit''' - entry will not be visible in tmp tab to be ''edited'' manually


== Implementation ==
== entries generated programmatically ==
* Sub ''add_automatic_tmp_entries''
Tmp entries can be generated or updated in VBA using [[Function GenerUpdate_tmp_entry]].
* query ''s_tmp__auto_record_adder''


== Related articles ==  
== Related articles ==  
Line 20: Line 26:




[[Category: TmpV2]]
[[Category:Tmp Project Infrastructure]]
[[Category:CCMDB.accdb]]