November 24, 20169 yr 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?
November 24, 20169 yr 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...
November 24, 20169 yr 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.
November 25, 20169 yr 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.)
November 25, 20169 yr 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...
November 27, 20169 yr Author Newbies Got it working now. Thanks so much for the insight. I will have lots more use for these script steps in future.
December 7, 20169 yr 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