9 Replies Latest reply on May 3, 2013 2:56 PM by KatG

    How to Create a Dwindling Value List

    KatG

      Title

      How to Create a Dwindling Value List

      Post

           Hello

           I have been able to create a wound list for each of my patients when I see them for the first time. I can also add to the list as need be.   I use the list as a value list so I only see the problems for that patient on that given encounter date. One patient many have many wounds to be examined during one encounter.  I would like the list I have created with the WOUND table to become a dwindling value list. I tried to read other threads but couldn't wrap my head around it. Not even remotely sure how to go about this. Screen shot of the table relationships attached.

           Thanks

           Kat

      list_1.JPG

        • 1. Re: How to Create a Dwindling Value List
          philmodjunk

               What version of FileMaker are you using?

               FileMaker 12 introduced the ExecuteSQL function which in turn makes for simpler set ups to support dwindling type conditional value lists.

               More questions:

               As I take it, a patient's wounds are listed in Wound Exam and you record each time you examine a wound for a given patient in encounter_wound. Is that correct?

               If so, you need a dwindiling value list on a field in encounter_wound that dwindles by one wound ID each time you select one from the value list.

          • 2. Re: How to Create a Dwindling Value List
            KatG

            What version of FileMaker are you using?      FM 12

                 Each wound name is a record in the WOUND table.  (those are the only records on that table) list the wound "names" so it woild have its own serial number.  WOUND::woundname

                 Each Wound EXAM (record) has a Wound Name field with a drop down menu that has a value list  and the values come from the Wound::woundname field but only show related to the Patient.

            In each Encounter for that Patient, I may examine 1 wound or 10 wounds, I never know. This list has saved me a great deal of time.

            If so, you need a dwindiling value list on a field in encounter_wound that dwindles by one wound ID each time you select one from the value list.

                 I think so, but not sure how to go about it. Do I need a global field or a calculation field ? ( and i als need this to be temporary, for the next encounter, I would need to see the whole list)

                 Thanks!

            • 3. Re: How to Create a Dwindling Value List
              philmodjunk

                   First, to be sure that I have the full picture: Each time you examine a patient's wound, you create a new related record Wound Exam via the encounter_Wound Exam table occurrence. Correct?

                   It's kind of like filling out an invoice, but instead of a portal that lists items purchased, the portal lists wounds that you examined and you wouldn't log the examination of the same wound twice during the same patient encounter.

                   Assuming that this is correct, I'm going to spell out the "before FileMaker 12" steps for doing this. They'll still work in FileMaker 12 and I think that they'll be slightly easier to understand.

                   Diminishing value lists are conditional value lists that use an "exclusion list" field that lists all previously selected values as one of the match fields in the relationship that the conditional value list uses to determine which values appear in the value list.

                   Our first need then is to create that exclusion list. Define a calculation field, cExcludeList, with this calculation:

                   List ( Encounter_Wound Exam::Wound Name ) & ¶ & "zzzz"

                   Select Text as the result type and be sure to clear the "do not evaluate if all referenced fields are empty". We need this field to always have a value, even if no records for the current encounter have yet been created. You can use any text you want in place of "zzz" as long as it is text that you never ever use as the name of a wound.

                   Now you can make a new table occurrence of Wound, named encounter_Wound|DimList and link it like this:

                   Encounter::ID_PTkf = encounter_Wound|DimList::ID_PTfk AND
                   Encounter::cExcludeList ≠ encounter_Wound|DimList::Wound Name

                   Define your value list to list Wound Name(s) from encounter_Wound|DimList; Include only related values starting from Encounter.

                   The final detail is to use the OnObjectSave script trigger on your dop down list field to perform a script with Refresh Window to make sure that the list updates to properly "dwindle" each time you select a value from the list.

                   This each of these lists works off of a list generated in a record in Encounter, the list will start with full list of patient wounds for each new encounter record.

              • 4. Re: How to Create a Dwindling Value List
                KatG
                /files/3ee513a506/up1.JPG 759x768
                • 5. Re: How to Create a Dwindling Value List
                  KatG

                       I'm trying to upload multiple screen shots , this goes wth the previous comment

                  • 6. Re: How to Create a Dwindling Value List
                    philmodjunk

                         To answer your first question: the calculation does need to be defined in the encounter table. No the value list does not originate from the encounter table. You are defining a relationship that only matches to values that have not yet been selected in a record of Encounter_Wound Exam for the current encounter. The conditional value list should then list only unselected values for the current encounter.

                         Make sure that the result type for cExcludeList is set for Text, not number.

                         Can you doubleclick the relationship line linking Encounter to Encounter_Wound|DimList and upload a screen shot of that dialog?

                    • 7. Re: How to Create a Dwindling Value List
                      KatG

                           I hope this comes out clear. Thanks, Phil!

                      • 8. Re: How to Create a Dwindling Value List
                        philmodjunk

                             Well this time I was the student.

                             I reproduced your relationships and made the following findings:

                             If I specified Encounters as the "starting from" table occurrence, I had to use Refresh Window[Flush cached Join results] to get the value list to update with each new selection. That may work just fine, but in some circumstances, it can produce undesirable delays in getting the screen to refresh. I tried a number of tricks including a commit records and including a field in the relationship that matched with the X operator but still had to use the flush option in the script step to get an updated value list.

                             I then switched to Specifying Encouter_Wound Exam as the starting from table, reasoning that the change in starting point was what was forcing the needed update. I found that this worked and that I didn't need the script trigger to get an update, but there is one key limitation to keep in mind. I couldn't get the value list to populate at all until there was data present in at least one field in the portal row. I was first testing with just a single field, the wound name in the portal and found that I couldn't get any value list at all. Once I added a "condition" field and entered data into it first, then the value list correctly deployed and updated when I entered the drop down field.

                        • 9. Re: How to Create a Dwindling Value List
                          KatG

                               You're creating an FM monster, Phil! You're too good! :) I know what you mean about the empty value list, what I usually do is "open" the records first (I have a button with  script you and Sorbsbuster helped me write) This is somewhat further complicated buy the fact that I have this set up to only show me active records with the corresponding creation date (another little feature you and Sorbsbuster and DaSaint helped me with, S Chamblee deserves more than an honorable mention also :)  I even managed to format a tab set up to black out the tab if there is no wound exam active and I know at glance when I am finished...all of this accomplished because of all your help! Thank you, thank you, thank you!