7 Replies Latest reply on Apr 3, 2013 9:26 AM by philmodjunk

    How to navigate between two tables with portal

    micromd

      Title

      How to navigate between two tables with portal

      Post

           I am designing an electronic medical record for a surgeon who has both office visit records and hospital admission records.

           Each hospital record has multiple hospital visits. All these records are in chronological order for each patient  i.e. when there an office visit, there is no hospital addmission or vice versa. For example, the listing as follows:

           Office visit 01/10/2013

           Office visit 12/10/2012

           Office visit 10/12/2012

           Hospital admission 09/10/2012 which has multiple hospital visits

           Office visit 08/14/2012

           Office visit 05/22/2012

           Hospital admission 02/10/2012

            

           I would appreciate it very much if someone can help me to create a portal so that when a portal row is chosen, the corresponding office visit record or hospital record will show up. My relationships of the tables are as shown below:

            

      Relationships.jpg

        • 1. Re: How to navigate between two tables with portal
          philmodjunk

               This is a portal to MedicalRecord_list?

               And either HospitalAdmissionID or OfficeVisitID contains a value but not both?

               Where/how do you want to display the Visit information of the clicked portal row?

               On  different layout? In a second portal? in a new window that pops up?

          • 2. Re: How to navigate between two tables with portal
            micromd

                 To: PhilModJunk:

                 Yes, the MedicalRecord_list is a portal (just like a file cabinet with folders for hospital admissions and single sheets for just office visits all in a chronological order) so that when a portal row with the office visit is chosen, another layout or window for that particular office visit will show up.

                 When a portal row (in the MedicalRecord_list) with the hospital admission is chosen, another layout for the particular admission will show up with a new portal showing the various hospital visits for that admission. That is from one portal to another layout with a new new portal.

                 On second thought, I believe I shoud just create a field as a flag for either office visit or hospital admission in the MedicalRecord_list. Do you agree?

                 Stephen

            • 3. Re: How to navigate between two tables with portal
              philmodjunk

                   The fact that only one of the two key fields will contain data on any given record in the portal will serve the same functionas your flag field will it not?

                   This script can check that field and go to the new layout with the hospital visits portal on it:

                   If [ Not IsEmpty ( HospitalAdmission::HospitalAdmissionID ) // a hospital admission record exists ]
                      Go To Related Record [Show only related records; From table: HospitalAdmission; Using layout: "HospitalAdmission" (HospitalAdmission) ]
                   Else
                      Go To Related Record [Show only related records; From table: Medical Record_List; Using layout: "Office Visits" (Medical Record_List ) ]
                   End IF

                    

              • 4. Re: How to navigate between two tables with portal
                micromd

                     To: PhilModJunk:

                     Thanks for the script.

                     I have revised the relationships. Kindly inform me if the following relationships would work:

                • 5. Re: How to navigate between two tables with portal
                  philmodjunk

                       My script was written so that it should work without any need to change your relaitonships. It did assume the presence of a different layout for showing the Office visits.

                       I do not see any need for adding a join table named Office_Visit Cabinet. It does not make sense to me to have a many to many relationship between office visit records and MedicalRecord_List.

                  • 6. Re: How to navigate between two tables with portal
                    micromd

                         To: PhilModJunk

                         Thank you for the information

                         I am not that good with the Relationships Graph.

                         Please inform me what I write below is what I understand from your comments

                         1   The first Relationships diagram that I sent you is the correct one

                         2   MedicalRecord_List table functions as a joint table between PatientData and the OfficeVisit tables

                         3   MedicalRecord_List table functions as a table with a portal between PatientData and HospitalAdmission tables (using Go To Related Record step)

                         4   MedicalRecord_List table requires both HospitalAdmissionID and OfficeVisitID for navigation to the proper HospitalAdmission Folder and the OfficeVisit record

                         5   HospitalAdmission table has a portal to all the hospital visits for that HospitalAdmissionID

                          

                         Stephen

                    • 7. Re: How to navigate between two tables with portal
                      philmodjunk

                           1) I can't tell you that it's "correct", but I can tell you that it was the one for which I posted a suggested script.

                           2) In theory yes, but in practice, it looks like you will have one or zero office visit records that link to any given MedicalRecord_List record. That's not quite the typical "many to many" relationship that requires a join table. You need it here for the relationship to Hospital Admissions.

                           3) The portal should refer to MedicalRecord_List, the layout should be based on PatientData

                           4) It looks like you need one or the other, but not both which is how I understood this statement:

                           

                                when there an office visit, there is no hospital addmission or vice versa

                           That strikes me as unusual as I have had family members that went to the doctor and the doctor promptly admitted them to the hospital when he determined that the problem was much more severe than my relative had assumed when they went to the doctor. But it's what you specified.

                           5) Don't know if it does or not. It's something that you can set up if you need it as your relationships support that option. (As an alternative, a portal to HospitalVisits placed on the PatientData layout will list all hospital visits for that patient and can be filtered to list only those for a specified admission.)