2 Replies Latest reply on Mar 10, 2014 5:05 PM by MichaelPoling

    Merge Fields and portals

    MichaelPoling

      Title

      Merge Fields and portals

      Post

           Hi there, I'm trying to get a letter to autofill but am only partially successful.  Half of the fields are from a  table ObjectiveAssessment and another from table SubjectiveHistory.

           SubjectiveHistory collects it's data input from a portal, as there are multiple Episodes and it houses the primary EpisodeID key.

           Table Demographics houses a foreign key __kf_EpisodeID that allows the Episode to be changed to enter data in the ObjectiveAssessment

           What I am running into is when I change the EpisodeID, only the ObjectiveAssessment table data changes in the Merge Fields that I have used in the letter (located on a separate layout), but not the SubjectiveHistory fields. On the portal for SubjectiveHistory, I have a button on each row that allows you to set that row as the current episode.  This works fine when I look at the tab controls for ObjectiveAssessment and ProgressNotes, which change perfectly each time you select a different EpisodeID, so I know that part is working.

            I have a Pop-up defined with a value list that shows the EpisodeID's for each patient and allows you to change them right on the letter (hidden from printing), but only the Objective Assessment stuff changes with this method as well.  

           Any ideas why the Merge fields work with ObjectiveAssessment and not SubjectiveHistory?  Is it because SubjectiveHistory is collected via a portal?  I would have thought selecting the EpisodeID manually would handle that?

           Thanks

           Mike

      Screen_Shot_2014-03-10_at_1.31.59_PM.png

        • 1. Re: Merge Fields and portals
          philmodjunk
               

                    What I am running into is when I change the EpisodeID, only the ObjectiveAssessment table data changes in the Merge Fields that I have used in the letter (located on a separate layout), but not the SubjectiveHistory fields.

               Which is perfectly consistent with the current design of your relationships. The link between Demographics and SubjectiveHistory is by Patient ID so changing the Episode ID (I'd name that field in demographics "selectedEpisondeID" BTW to make it's function more obvious.) will not change how it links to data in SubjectivHistory.

               But you are not limited to a single Tutorial: What are Table Occurrences? box for each table. You can use the duplicate button (two green plus signs) to make a new occurrence of SubjectiveHistory and link it to ObjectiveAssessment by EpisodeID. Your merge fields can then be replaced with merge fields that refer to fields from this new occurrence of SubjectiveHistory instead of the current occurrence.

          • 2. Re: Merge Fields and portals
            MichaelPoling

                 Brilliant!  Thanks!!

                 M