I have a database with patient and multiple visits and multiple ImageA, ImageB and ImageC table. The patient visit was divided into 3 visit types: baseline, followup1 and followup2. For each visit type, I need to choose a combination of ImageA, ImageB and ImageC across different visits. Each patient will have their overall review for each visit type, which combines the individual review of ImageA, ImageB and ImageC and gives overall review of diagnosis.
My first question is how to choose a group of ImageA, ImageB ad ImageC across different visits within the same visittype? I tried to use the last() function, but it will not distinguish visit types.
The second question is how to show the right child record? On the overall review layout, I would like to show the corresponding review of ImageA, ImageB and ImageC for reference purpose. If I put the fields from table ImageA, table ImageB and table Image C directly on the overall layout, it will show the first record of the ImageA, ImageB, and ImageC correspondingly. Since I might have multiple ImageA for the same visitType, how do I show the correct record on the overall review layout? There are multiple fields to show at ImageA, ImageB and ImageC. Do I have to use portal for each field? How do I identifiy the combination of ImageA, ImageB and ImageC?
Thank you for your help,