Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Newbies

I'm a dentist. I'm trying to generate written treatment plans for patients to have as a treatment estimate and for our records.

People have 32 teeth, therefore I have setup a field (ToothNumber), displayed as a checkbox set utilizing a value list = 1 through 32. When I click my CROWN script button, it opens a selection window wherein I choose the tooth number from said field (1-32), the material the crown is to be made of (porcelain, gold, zirconia, etc.), whether I want to use lab-processed temporary crowns, and so forth. 

If I have only one tooth number checked and run through my nested IF statements, which looks up the official description for the type of crown, the ADA code, the fee, the time required, etc., it all works fine. If I have more than one tooth number selected in the checkbox set, it only returns one line for the first tooth checked. 

The IF statement looks something like: If TOOTH NUMBER = 2 and CROWN MATERIAL = porcelain and LAB TEMP CROWN = "Yes" then it adds a line on the treatment items table which looks up appropriate description, ADA code and fee, so the patient has a copy and so do we. And we're both on the same page regarding what they want to accomplish. 

Am I using the wrong method for displaying and relating my selections? If so, what's the best way to accomplish this. Also, I want to avoid repeating the same sequence for each tooth number, i.e., I'd rather LOOP to advance through tooth 1 through 32. Any ideas? 

OK, a checkbox set is a visual display of a list of checked items. So, if you checked tooth 3, 7, 10 it is stored as

3
7
10

So your looping script needs to run for each of these listed values. You use the GetValue function to grab each of them.

Pseudo-code

Set Variable [$list; Table::ToothList ]
Set Variable [$count; ValueCount ( $list)]
Set Variable $i //Counter for the loop iterations
Loop
  Set Variable [$whichTooth; GetValue [ $list, $i ]
   Perform Script [ Your script, passing the value of $whichTooth ]
  Set Variable [$i; $i + 1 ]
  Exit Loop If [ $i > $ count]
Loop

So it runs the script for each checked tooth...

  • Author
  • Newbies

Thanks, Webko. I'll give it a try. 

My wife and I come to your country once or twice a year, mostly Melbourne but also Brisbane and Sydney. It's always a treat to be there, even in winter, getting us out of the oppressive Florida heat and humidity. 

  • Author
  • Newbies

All right. I tried a number of iterations of your suggested script, but can't get the treatment line items which are tooth-number dependent to display on the treatment list. I'm attaching screen shots of both the Loop section with preceding Set Variable steps, and the window where the teeth and materials are selected. Here's how I interpreted it:

(I trust you'll let me know when the meter is running and I owe you a fee for helping me.)

Screen Shot 2016-11-24 at 10.16.56 PM.png

Screen Shot 2016-11-24 at 10.18.37 PM.png

Off top of my head - $count should be a count of how many items are in the $list - so, as I wrote it, not all the possible values

$whichTooth will be set to the current value depending on the position in the list (determined by $i) - so no need for the If statement

Have a look at those first - I'm about to finish up for the week, so if you're still having issues Sunday your time, post a zipped copy of the file here for people to look at...

  • Author
  • Newbies

Got it working now. Thanks so much for the insight. I will have lots more use for these script steps in future. 

  • 2 weeks later...

Also, don't forget to add a commit after the set of 'set field' steps. You don't need one for each just one after the group before you do something else.


Sent from my iPhone using Tapatalk

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.