AnsweredAssumed Answered

How to create multiple portal records based on lookup of last record

Question asked by toddderek on Mar 22, 2018
Latest reply on May 2, 2018 by toddderek

I'm working on creating a Patient Visit database.

I have a table called Patient Visit. I also have a table called Assessment which has a Description, Assessment Code and Assessment. The Assessment table has an established relationship with Patient Visit table based on Patient Visit ID.

If I create a new Patient Visit record (the first for that patient ID:PVR0001), and then add new Assessment line items through the portal see example below:

Description 1, Assessment Code 1, Assessment 1

Description 2, Assessment Code 2, Assessment 2

Description 3, Assessment Code 3, Assessment 3

 

Now, I want to create a new follow up Patient visit record (patient ID: PVR0002. This time I want to create new records based on all of the past assessment related records

Description 1, Assessment Code 1, Assessment 1

Description 2, Assessment Code 2, Assessment 2

Description 3, Assessment Code 3, Assessment 3

 

and then let's say I manually add another related record on the PVR0002 to the assessment portal.

Description 4, Assessment Code 4, Assessment 4

 

Then next time I create a new patient visit record ID: PVR0003, I want to create new records based on all of the past assessment related records (not the first PVR0001, but just the last one which in this case PVR0002).

So the expected result would be:

Description 1, Assessment Code 1, Assessment 1

Description 2, Assessment Code 2, Assessment 2

Description 3, Assessment Code 3, Assessment 3

Description 4, Assessment Code 4, Assessment 4

 

What's the best way to do this?

 

Thanks for your help in advance!

Outcomes