Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

need to print what I see in a portal


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

Recommended Posts

Posted

I am stuck on what seems to be an easy layout. I have a table of medical patients and within that are two portals, one for medication allergies (each patient can have many allergies) and below that a portal for their medications. In the medication portal there is an active checkbox and the portal sorts active to top and inactive to the bottom. (again each patient can have many medications). All I want to do is on that same page have 1 button that will create a report that I can print with patient being worked on at the top, then allergies and then only the active medications. Would appreciate any ideas. I will attach a sample file without any real patient data. Thanks

patientsCopy.zip

Posted

What you need is a similar portal, but with an AND match on the Active field. In this case I created a "constant" calculation, =1, to add to the left side of the relationship.

I also added a little script to print from there. It creates a new window to do the printing. It sets the PatientID into a global field, then uses that to isolate the current record. So it can print only 1 record, without losing the found set; or relying on setting the Printer settings to Current Record (which I couldn't do reliably for your PC from my Mac). You can toss it if you don't need it.

I modified the portal so that it would fit on one page. Font sizes can be considerably smaller and still print fine.

You had a button to delete the portal row at the top of the page. I consider this dangerous, as you could easily delete the wrong row; so I removed it and put a little trash can in the row itself.

patients2.zip

Posted

Thank you. An excellent solution. Let me recap so that I understand. You created a new layout with new portal relationships. The medication portal will only show the active medications because it has to match both the patient id AND active=1. You did this by adding a constant field always equal to "1". Then you load the patient being worked on into a global field so that it stores the current patient.

My only concern is that you are still printing from a portal. What happens if the patient has 10 allergies (only 9 show up in the portal). It is like a screen dump of what you see but more data could be there and not showing. It is rare but some patients may have that many allergies.

Thanks.

Posted

The following is my method of printing portal data.

Create a temp print field in a single record TO.

script:

go to field Drug_Reactions::DrugNameField,

go to portal row first

Loop

setfield(TempPrintField,

Case(TempPrintField is empty; Drug_Reactions::DrugNameField & "-"&Drug_Reactions::DrugReaction; TempPrintField &"PP"& Drug_Reactions::DrugNameField&"-"& Drug_Reactions::DrugReaction)

Go to next row

End loop exit after last

go to layout "print portal" (no layout formating or visible portal but has the temp print field expanded so that there is more than enough length to accomodate the maximal number of lines of data possilbe and formated for sliding and printing (if necessary for headers and other labels).

page set up

print

go to original layout

(PP is ment to be the paragraph mark)

The result is you see the portal rows highlight momentarily as the loop loops (an entertaining bit of drama) and you have your print. You shouldn't see the shift to the other layout and back. This has worked for me for the last several years on my EMR. My patient data sheet has a field for the PMH list, another for the meds list and a third for the drug reactions list, all populated with scrips as above.

Good luck.

Posted

I forgot to mention that the portal is set to show the acitve data (manipulating the matchfield) before the transfer of data to the temp print field. You could also just add the script step: if status = inactive go to next portal row, but this would slow the process down.

This topic is 7185 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.