8 Replies Latest reply on Nov 22, 2009 4:28 PM by DRR

    Newbie find script help



      Newbie find script help


      Using Filemaker Pro 10 on a mac for personal use on my MacBook Pro.

      I have developed a medical "record" for my practice. It has a face sheet layout page where basic demographics are placed, including the name of the patient. Tabs across the top take you to other layouts that include progress notes that have (and will) be written for each session, background paperwork, labs etc.

      The problem is that if I pull up John Smith on the face page, I want to be able to have a find performed on the other tabs/layouts that I enter so that it only shows "John Smith's" information. I have played with the script upon entering each layout, find scripts etc., but cannot seem to make it work. I'm sure this is easy stuff for you folks and I have put in a lot of effort on my own already. Just stuck here. 

        • 1. Re: Newbie find script help

          There are a couple of ways, but try this one for starters:


          - Assuming you are looking at a Medical Details record.  The person's name is John Smith, with another field in the Patient Table as his Unique ID.

          - You should have a relationship between this Patient Table and, say, the Progress Notes Table (assuming you are keeping them in different tables!), linked by PatientID = PatientID

          - Attach a script to the button that you want to take you to the new layout (and Table?) and use the script step 'Go To Related Records...'.  Select the option to only show those records related to the current record (John Smith's) as defined by that PatientID = PatientID relationship.

          - Choose to display it on your intended destination layout which will be, of course, based on the Progress Notes Table.


          If you want more detail, just say.




          • 2. Re: Newbie find script help
               I appreciate your assistance and thoughtful response. It sounds as if I am going to need to break out each of the tabs or layouts out into their own table in order for this approach to work. I am going to do some more learning but am vague on how when I make or create a new record in the face sheet page (and a new ID number gets generated and attached to it), a whole new group of empty layouts get linked to that and await data for the "John Smith" chart. After all, the Progress note tab will collect new notes (new records) with every visit. 
            • 3. Re: Newbie find script help

              Let's just take the idea of the 'Progress Notes' as an example.  The others are just more examples of the same thing.  I would recommend that you have:

              - A Table that is your Patient Record: their name, address, DOB, contact numbers, allergies, next of kin, etc.

              - A separate Table that is Progress Notes.


              You could create a new patient who at that moment has not attended, so has no record in the Progress Notes Table.

              When the patient attends you call up their Patient Record and create a new Progress Notes record with their PatientID.

              When they attend a second time you create another (separate) Progress Notes record, and so on.

              You don't have to create anything - like Progress Reports - in anticipation of them attending.


              If you make the Patient Record layout have a portal on it (in its own tab, by all means) called 'Progress Reports' and link it via the relationship PatientID:: PatientID between the two tables, you will be able to see the list of all of that patient's Progress Reports.


              It is usual to create in the Progress Reports Table a ReportDescription field as well as a ReportDetail field and then show in the portal listing just the ReportDescription field, like an e-mail title.  Then you can create a button (tied to a script) that when you click on the report in the portal it takes you over to the Progress Report Table and displays the full text of the report.


              If you keep a patient's Progress Reports in the same table as their Patient Details it will work very easily - but only at first.  Your 'tabs' would just take you from a layout that shows the patient's name, address, etc to a layout in the same table that showed you their Progress Notes.  But you only have one Patient Record, so you only have the potential for one Progress Notes record - the same record as the Patient's.  So, when they attended a second time the only thing you could do is type more notes into the same Progress Report.  Very limiting.


              Use the power of Filemaker's relationship management to break out all of those things that even one day you may want to search for, sort by, isolate, print, etc separately - charts, progress notes, referrals, x-rays results, etc.



              • 4. Re: Newbie find script help
                   Thanks. I thought I would have to approach it this way. I guess I am stuck on the complexities now of the find script. I have set a layout script that is to run on entry into the Progress notes layout page, but here is where I get lost. Should the script simply be Find[], or should it be set[] to some cell and then do a find. There just isn't a lot written on how to do this script, especially on how one uses the unique ID and patient name to base the search and find on.
                • 5. Re: Newbie find script help

                  The good news is that you're making things too hard for yourself - Filemaker will cover the basics of the stuff you're trying to do.


                  Can you just confirm some of my assumptions about the work you have already done:


                  - You have a Patient Table with the patient's details held there, including a unique PatientID

                  - You have a separate Table where you hold each of the Progress Reports, each report allocated to a PatientID

                  - You are looking at one patient's record in the Patient Table, and you want to click on a button and see their Progress Reports.



                  If all of that is the case you do not have to worry about running scripts on layout entry etc.  You will be able to drive everything you want from one button on the Patient's Record in the Patient's Table.



                  • 6. Re: Newbie find script help

                    Yes, I have one table that is the "patient chart" that includes name, dob, address etc and a unique ID field that is made with every new record. I have a second table that is "progress notes" that includes some similar fields (patient name, dob) and other fields unique to the progress note (diagnoses, medications, and progress note text). Now, I'm not sure I did this correctly but I simply made a copy of the unique id field and put it also on the progress note layout. Since I already have data from another program, I have been able to play with it some.

                    I made a new record, patient Aaron Apple for instance, and he was given the id 0000001. I went over to the progress notes layout and imported his 10 progress notes. All of those notes that were imported had his name in the name field and all had exactly the same ID of 0000001. Went back to patient chart layout and made a new record for Brian Brown, he gets assigned 0000002 and did the same step over in the progress note layout in terms of importing his notes. 7 or 8 were imported and all now have the Id field of 0000002. 

                    So, how do I make it so that when I go back to Aaron Apple's face sheet page or "patient chart" page and then jump over to progress notes that only his progress notes are shown? Seems like this should be simple, but I just can't get my head around how to make FM do that. 

                    • 7. Re: Newbie find script help

                      One thing first: you don't have to (read: 'shouldn't'!) replicate the same details in the Progress Report that are already in the Patient Record.  So if you have the Patient Name, DOB, etc in their Patient Record, then do NOT create those as fields in the Progress Record.  You will have a relationship between the two tables linked by the Patient ID, so: 

                      - Go to the Progress Report layout. 

                      - Add a field. 

                      - Change the source (top of the 'Specify Field...' dialogue box) and change its source to be the Patient Table via the relationship by Patient ID :: Patient ID. 

                      - Then just plonk any or all of the Patient's already-entered details on to the layout from the Patient's Record table.


                      That way you have no chance of entering the wrong patient's name, you don't have to double-enter, and everything is working in a truly relational manner.


                      Now: your original problem:

                      - Go to the Patient's Record layout.

                      - Open Scriptmaker.

                      - Choose the script step 'Go To Related Record...'

                      - Set the options to choose the related records via the Patient ID :: Patient ID relationship

                      - Select the option to show related records for 'This record only'

                      - Set it (back at the top) to display the results on the Progress Report layout.

                      - Put a button on your Patient Record and attach this script to it.


                      Clicking that button on any patient's record will take you over to the Progress Report layout and show you all, and only, that patients's progress reports.



                      • 8. Re: Newbie find script help
                           Thanks. That works! Now I have to just do the same things for the other layouts, creating separate tables for them, and having a unique patient id assigned to each that way.