How to Trigger Secondary Form Based on Selection

I'm doing some semi-real world testing of an internal app to help information flow a bit faster in the clinic I'm working with. The providers get a list daily for their hospital rounds. The lists come from a few sources, depending on which hospital they will be visiting.

The phase of the app i'm working on is meant to be a replacement for the printed lists they currently carry around. Someone back at the clinic (currently me) will ensure that the IN HOSPITAL view is properly loaded with correct information for who they are needing to see today, sorted by hospital and subsequently by room number ascending so they can easily go down their list and mark patients as seen for the day, as well as document any notes that may need to be sent back to other entities to speed up billing time, as opposed to waiting until the end of the day for the provider to gather all the hand written notes to get back to another department.

Anyways, on to my question. There are two main views in the app current, the All Patients view, ang the In Hospital view. The All Patients view has a form to add patients, but the In Hospital view also has one that requires less information, but dumps back to the same Patients dataset. The providers need the ability to quickly enter a new person if they need to see someone who is not on their list, like if someone was admitted after the day's list was printed.

One of the columns in the Patient dataset is a Yes/No type for "In Hospital," and this status puts the patient in the In Hospital view/slice.

I created an action to add hospital admissions to another table that is related to the patient record by way of Ref, so we can keep a historical record of the admission/discharge cycle. All this data is already kept in the hospital systems, but i figure why not maintain this stuff locally as well for our own tracking.  Anyways, that action is able to be performed when viewing a patient record, and pressing the button calls a LINKTOFORM() action and feeds the _patientIdentifier key to tie the record back to the patient.

What I am wanting to see if I can accomplish is, let's say the provider needs to add a patient. I'd like for them to be able to add the hospital admission record in the same step, so that once they toggle In Hospital to YES and save the patient record, the LINKTOFORM() action that is called by pressing the button while viewing a record is triggered, and they can immediately attach an admission record and capture the hospital and room number.

The way it is now, they add the record, which takes them back to the In Patient view, then subsequently click the Add Hospital Visit button to track the rest.

Sorry to be so wordy, hopefully i explained this well enough.

This is the limited Provider Add Patient form:

Screenshot 2022-03-17 09.15.47.png

 

Once the patient is added and flagged as In Hospital it shows in their view, and the list looks something like this (fake patient data, no sensitive information included in this post)

Screenshot 2022-03-17 09.26.54.png

That button I have circled is one they can press to add a Hospital Admission, which brings up this form:
Screenshot 2022-03-17 09.30.01.png

So, to summarize, i'd like a way to combine these forms. If the provider is adding a patient, it will definitely be while they are In Hospital, so ideally, i'd like this next step to be automatic for the Provider Add Patient option.

If you have read this far, God bless you, you may take the rest of the day off with pay.

Solved Solved
0 4 256
1 ACCEPTED SOLUTION

Try below and see if it is what you seek.

Create an action like this for your first patients table.

You can copy whatever cols to the subsequent form by specifying them within LINKFORM.

"second_table_Form" here should be replaced with your Hospital Admission table's form view,

and [flag] with your  [In Hospital] flag

TeeSee1_0-1647580925721.png

and attach it to your Provider Add Patient form in here

TeeSee1_1-1647581074392.png

View solution in original post

4 REPLIES 4

Try below and see if it is what you seek.

Create an action like this for your first patients table.

You can copy whatever cols to the subsequent form by specifying them within LINKFORM.

"second_table_Form" here should be replaced with your Hospital Admission table's form view,

and [flag] with your  [In Hospital] flag

TeeSee1_0-1647580925721.png

and attach it to your Provider Add Patient form in here

TeeSee1_1-1647581074392.png

THANK YOU!

So it appears I already have the function built in to facilitate all this, i just didn't know about the Form Saved event action. So much to learn. It works perfectly, I did as you mentioned and change the event action to call the "Add Hospital Visit" action next.

Hmmm... I have stumbled across a problem that I can't figure a way out of at present. This works, however, if the provider goes to edit an existing patient record to add a photo or something, it ends up adding another row to the hospital visit table.

I can't seem to find a way to make this action only happen when its a new record, but not when editing a record ๐Ÿค”

The problem is that the same view is used both for adding and editing.

You can control of the action of the LINKTOFORM by distinguishing whether the row in the current form is a new one or an existing one.

I did not know how to do it but found this Q&A. (I was going to suggest creating two forms ๐Ÿ˜…, you truly learn something new everyday!)

https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Different-view-for-add-vs-edit/m-p/331552

You can utilize this.

BTW, I had misunderstood the purpose of the In-Hospital flag. I must've had too much wine when I first read your epic ๐Ÿ˜. So the flag condition was not really necessary. Use the criteria above instead!

Top Labels in this Space