Jump to content

Don't go back to last layout if no records found.


Mental
 Share

This topic is 6439 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

I'm a newbie trying to make a script and, after a few days of messing with it, am in need of some help. I'm making a Medical Record script for my summer camp kids which has 3 tables. Demographics, Encounters, and Medications log. My script uses the patients name as the constraining information and goes to each table, looks for the patient, and then prints the data. What I should end up with is the demographics cover sheet showing name, age, etc.; a list of all meds I've given and a list of all encounters. It works fine if the patient has atleast one record in each table, but if they don't, it goes back to the last table and prints it again. So, I start with demographics, it find the patient, prints all their background info, then it looks for encounters, doesn't find any, returns to demographics, and prints the form again. I'd like it to just print an encounter list with no records and move on. Sorry for the long winded explanation, I don't have the FM lingo down quite yet. smile.gif

Randall

Link to comment
Share on other sites

Randall:

Welcome to the Forums. You need to put Set Error Caputure [on] before each find, then check to see if there is a found item before you print, so each Print statement would be within an If statement:

If [Get(FoundCount)>0]

Print[]

End If

What's happening currently is that you're getting no found set, then the Print statement kicks in, and it just prints whatever it sees...

-Stanley

Link to comment
Share on other sites

Thanks for the quick response!

The script works but too late. As soon as it realizes that there are no records matching the search it goes right back to the original layout which, of coures, has a find value of >0 so it prints it.

Link to comment
Share on other sites

Using

If [not IsEmpty( Encounters::serial )]

Go to Related Record [show, Encounters]

Perform Script [External, Print]

End If

from the Demographics file would prevent even going to the Encounters file if there are no related records. And a find isn't necessary if you have a valid relationship.

Link to comment
Share on other sites

This topic is 6439 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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