9 Replies Latest reply on Jul 17, 2012 9:48 AM by philmodjunk

    Portal problem



      Portal problem


      Hi. I have three tables named Patient, CheckIn/Out and Clinical. The tables are related:

      Patient::pkpatientid = CheckIn/Out::fkpatientid

      Clinical::pkclinicalid = CheckIn/Out::fkclinicalid

      pk = Primary key

      fk = Foreign key

      There's a field called "Date" with auto-enter creation date. In the Clinical table layout, I want to put a portal to show the "Date" field from CheckIn/Out. So, I can show the dates that the patient has checked-in. For example, there is a patient record in the Patient table. The patient have already checked in for three times. So in the clinical layout, a portal will show the three dates he checked-in. How to do this? Do I need any occurrences?

      Thank you :)

        • 1. Re: Portal problem

          What does one record in Clinical represent? I thought maybe one record for each day until you indicated that you wanted to see different dates for a given patient.

          • 2. Re: Portal problem

            The date is in the CheckIn/Out table. Then, I set a script to create a new record in Clinical table. It means that One patient record has many records in CheckIn/Out and CheckIn/Out has one record  in Clinical. 

            • 3. Re: Portal problem

              I'm sorry but that makes no sense to me when I read it.

              Why do you need the clinical table?

              And your relationship does not match what you have just posted. It indicates that for one record in clinical, there could be many records in checkIn/Out. If there is only one record in clinical for any one record in checkin/out, there is no need for the clinical table as far as I can tell from what you have posted.

              • 4. Re: Portal problem

                The table structure goes like this:

                Patient::pkpatientid = CheckIn/Out::fkpatientid CheckIn/Out::fkclinicalid = Clinical::pkclinicalid 

                • 5. Re: Portal problem

                  WHich is a classic many to many relationship between patient and Clinical but is not consistent with "CheckIn/Out has one record  in Clinical" and does not answer the key question:

                  What is the purpose of the Clinical table?

                  • 6. Re: Portal problem

                    In the clinical table, there are treatments, charting and other clinical things. It's for managing the patient's treatment detail for one appointment. The CheckInOut table stores the patient's check in and appointments history. I've attached the relationship screenshot.

                    • 7. Re: Portal problem

                      You may find that this relationship has advantages:

                      PatientCheckInOut::__pkInOutID = PatientClinical::_fkInOutID so that you can use multiple records to document the clinical details of a given patient visit.

                      Since your relationship between clinical and checkin/out currently is one to one there is one and only one record from that table that you can display unless you define a new relationship that matches by different data. (This would also be true of the other relationship that I am suggesting may be useful.)

                      Example 1:

                      PatientClinical::anyField X AllPatientCheckInOut::anyfield

                      With a portal filter that filters to one specific _fkPatientID


                      PatientClinical::_fkPatientID = AllPatientCheckInOut::_fkPatientID

                      Either makes it possible to list all PatientCheckInOut records for one patient in a portal to AllPatientCheckInOut on the PatientClinical layout. Both require adding an new ocurrence of PatientCheckInOut to your relationship graph.

                      • 8. Re: Portal problem

                        Which table should I assign this layout? And which field so I need to filter?

                        • 9. Re: Portal problem

                          you indicated that you needed this on a layout based on PatientClinical.

                          A portal filter on example 1 would filter for a specific patientId in the AllPatientcheckInOut table occurrence.