AnsweredAssumed Answered

Popover question

Question asked by dsimonson on Mar 9, 2015
Latest reply on Mar 11, 2015 by dsimonson

Title

Popover question

Post

Here is what I want to do:  on an iPad, when the user taps on a specific area (in this case, the anesthesia gases area), I want a popover to show that will allow them to enter an observation - basically, to enter or change the parameters of a particular anesthetic gas.  

The problem is that this requires that before the popover presents itself (OnObjectEnter?), I need a script trigger to run that 

1.  goes over to the OBS_GASES table layout

2.  checks to see if there was a previous record entered for that fk_surgery_id

3.  If there is, duplicates it (to allow for simpler data entry)

4.  If not, creates a new one with the current time in the time_obs_gas field

5.  Returns to the original layout and popover, and presents the fields from the new or duplicated record in the popover for the user to fill in 

6.  Exits the script

 

Here is what I have now that doesn’t work.  Note that I am trying to make sure I don’t get an endless loop by setting a $$EXIT at the beginning (I read a post about how to use this and OnObjectExit), I am also utterly confused how to make that work.  

 

Trigger - Enter Gas Observation (runs on entering the popover)

If [ $$EXIT = "True" ] 

Exit Script [ ] 

End If 

Set Variable [ $$EXIT; Value:0 ] 

Perform Script [ “Allow User Abort” ] 

Perform Script [ “Set Error Capture” ] 

Set Variable [ $SurgeryID; Value:SURGERIES::_pk_surgery_id ] 

Go to Layout [ “Enter Gases - Landscape” (surgeries_OBS_GASES) ] 

Go to Record/Request/Page [ Last ]

If [ surgeries_OBS_GASES::_fk_surgery_id= $SurgeryID ] 

Duplicate Record/Request Else 

New Record/Request 

Set Field [ surgeries_OBS_GASES::_fk_surgery_id; $SurgeryID ] End If 

Go to Layout [ “Anesthesia Record” (SURGERIES) ] Go to Object [ Object Name: "Popover - Enter Gases" ] 

 

Here is my endless-loop prevention script:

Script Triggers: Trigger - Enter Gas Observation Exit 

If [ $$EXIT=0 ] 

Set Variable [ $$EXIT; Value:"True" ] 

Exit Script [ Result: 0 ] 

End If 

Thanks!

Dan
--
Dan Simonson, CRNA, MHPA
2607 S. Manito Blvd.
Spokane, WA 99203

<dsimonson@mac.com>
H. (509) 747-0819
C. (509) 981-6274 

 

Outcomes