Jump to content

creating report from portal


swf

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

Recommended Posts

I have a database of patients. The table patients is linked in a one to many relationship to medications (each patient may be on many medications). I created a portal in my patient layout to enter/view/edit medications. (ie keep an accurate medication list). Next to each medication is a checkbox field for active so old and inactive medications can be sorted to the bottom. All I want to do is to print a patients active medication list. Each time I generate a report it prints all my patients unless I manually limit my set to the current patient.

I want to have one button that will print the active medications of the patient I am working on. Also, If I run a report that will limit me to the current patient how can filemaker know who I am working on without having to manually enter it. Thank you for any advice

Link to comment
Share on other sites

A couple ways to do this. You might want to ONLY show Active Medications in the portal. So, when you uncheck an Active checkbox (number field in Medications, with Boolean value list, 1), and click outside the portal, that medication disappears from the portal.

That makes sense. You could also have the full relationship also, so you could go to all of the patient's medications; if you wanted to see them, or turn one back on.

In Medications create a calculation field:

Case ( Active=1, PatientID, "")

Target that with a relationship from Patients and you'll only see the Active meds.

Then you could print the Patient record with the portal; assuming that the portal fits on 1 page. Otherwise it's no-go to print it from the Patient table; portals print badly over page breaks.

When you Print, check under where it says "Copies and Pages," to drop down to the "FileMaker." Then you'll get a panel for FileMaker Print settings (one of the disadvantages of OS X being so sleek; it hides the FileMaker print settings).

Choose "Current Record." Best to create a script for this, unless you want to do it over and over.

An alternative is to Print from the Medications table. From the Patient record, use the step:

Go To Related Record [ MedicationsActive, Show only related, a layout to print from ]

This layout should show the Patient info at the top, as related fields back to the Patient table. The Print setting for this would be "Records being browsed" (not Current Record), because now you're in the "many" Medications table. Once again, best to script printing.

Link to comment
Share on other sites

I realized that with my "Active only" portal you would no longer be able to enter new records into the portal; because the right side is a calculation field. You could script a new record in the portal.

But there's a better way to do it in 7. Which is to not make a calculation field. Just make it a regular field, but have it auto-enter the calculation; and uncheck "do not allow replacing of field's contents", so it updates if you uncheck Active later.

Then there's a problem with the plain PatientID field in that table. Because it's not the target of the portal's relationship, it does not get populated. The solution is to make it auto-enter the other PatientID_Active field, so it also gets the PatientID when you enter into the portal. But do NOT uncheck "do not allow replacing..."

So it gets the ID, and keeps the ID even if you uncheck Active later.

Anyone see a problem with this. It seems good to me, but I haven't used it yet.

PatientsMeds.zip

Link to comment
Share on other sites

Thank you. Your suggestions are terrific.

I tried both and would prefer the second approach to print from the medications table. This first approach is great in that the inactive medications disappear but I am afraid the end user may lose a medication and not be able to get it back and get flustered. With the second approach I will just sort the inactive meds to the bottom. Now with regard to printing. I wrote the script to show related records in the medicine table for printing and it worked. However, it is still showing me active and inactive records for a single patient. Do I need restrict my set to find active patients then print or did I set it up wrong. Hope I was clear. Thanks again

Link to comment
Share on other sites

Here's another example. If you're worried about the InActive Meds (though I would think you'd want a new record for new dates), then you can show them in their own portal; you can toggle them back and forth.

In this case the PatientID in PatientMeds IS a calculation; because you never need to create "new" inactive meds.

You can go directly to the Active Meds, using the Active relationship.

Finally, I brought the Med Name into the join table, as a Lookup. You may want it there eventually. Or just the ID, either way.

PatientsMedsAE.zip

Link to comment
Share on other sites

This topic is 6635 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
×
×
  • Create New...

Important Information

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