nrsmoll@gmail.com

Automatic updating an autocalculation field

Discussion created by nrsmoll@gmail.com on Dec 22, 2015
Latest reply on Dec 22, 2015 by macwombat

Hi,

 

I am using Filemaker pro 14, I feel that there may be a simple solution.

It is a medical database. I have a parent table named "patientID" and a child table named "procedure". It is a one-to-many relationship.

I need to get the latest date from a particular patient's set of procedures and put it into a field on the patientID field so that I can calculate future follow-up dates. Ultimately, I would like to be able to input a date range and see which patients are due for follow-up, but this is not the scope of this question.

 

Right now, my problem is in getting the auto-calculation field to update when new data has been input.

 

My current less than ideal solution is a loop to "refresh" all values" and it takes way too much computation. I'm sure there is a simpler method, and I was hoping you could help me:

 

Show All Records

Go to Record/Request/Page [First]

Loop

Set variable [mrn$ ; value: patientID::mrn]

Perform Find [restore] (I find all procedure records that match the MRN)

Set variable [ $lastprocedure ; Value: Max ( Procedure::dateofprocedure ) ]

Perform Find [restore] (I find all matching records in the patientID table, which should only be one record)

Set Field [patientID::latestproceduredate; $lastprocedure]

Go to Record/Request/Page [Next; Exit after last]

End Loop

 

The idea is that I go through each patient, find the latest procedure date, then copy that into a field in my patientID field.

Ideally, is there a way for the fields to auto-update? They don't seem to update with me unselecting the field or clicking elsewhere.

Outcomes