Linking 2 or more projects

1,699 views
Skip to first unread message

Guillermo Palchik

unread,
May 26, 2019, 11:48:30 PM5/26/19
to redcap open
I’d like to create a project that has demographic information for patients and have it be a parent database to other REDCap projects that I would create in the future. These newer child projects would pipe data from the demographics (parent database) and that way I could avoid data duplicates of having the same patient in each project.
Is there an easy way to accomplish that?
G

Luke Stevens

unread,
May 30, 2019, 5:15:38 PM5/30/19
to Guillermo Palchik, redcap open

Hello Guillermo,

 

Basically the answer is no, you can't have data from one project displayed within another. It's a good idea for an external module though!

 

There is an external module for "Cross Project Piping", which I thought would do what you need, but reading the docs for it it looks like it copies data from a field in a source project to a field with the same name in the destination project. I'm not sure whether the destination value will get changed if you update the value in the source project. I suspect not. Perhaps that might still be useful to you.

 

Regards,

Luke

 

Luke Stevens
Data Management Coordinator
Clinical Epidemiology & Biostatistics (CEBU)
Murdoch Children's Research Institute
The Royal Children's Hospital, 50 Flemington Road
Parkville, Victoria 3052 Australia
T   +61 3 9345 6552
E   luke.s...@mcri.edu.au
W  mcri.edu.au

--
You received this message because you are subscribed to the Google Groups "redcap open" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redcap_open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redcap_open/f4469c41-10bb-4686...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



This e-mail and any attachments to it (the "Communication") are, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Murdoch Children’s Research Institute (MCRI) ABN 21 006 566 972 or any of its related entities. MCRI does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication.

(Peter MacIsaac)

unread,
May 30, 2019, 5:25:29 PM5/30/19
to redcap open
Guillermo,

I have implemented a couple of "projects" where we collect demographic data and "register" the patient in one project and pipe that data into "child projects"   so the subject has the same ID in different projects.  That way the demographics can be updated in one place.  

I have not had the opportunity yet to use the cross project piping - agree with Luke that you should explore that.

Peter MacIsaac

Tom Maloney

unread,
May 30, 2019, 5:35:14 PM5/30/19
to Luke Stevens, Guillermo Palchik, redcap open
Sounds like an API job running on an external system. That would need APItokens for eac project- essentially one that would read the demographics. The other to update the related records in the data project. One obvious hurdle is whether this imposes delays or complexity triggering the external job.

Does anyone who's done/tried this have any hard won advice to share, or is it straightforward?

-Tom

Luke Stevens

unread,
May 30, 2019, 5:50:45 PM5/30/19
to Tom Maloney, Guillermo Palchik, redcap open

I think the first question is whether Guillermo actually wants the data from the source project to be copied into the destination project, or whether he prefers it just _displayed_.

 

If the former, then yes, some process that migrates data across from source to destination would be required – either an external process using API calls or a custom REDCap module would be fine, depending on what is easier for whoever has to create it.

 

If the latter, then I would use the JavaScript injector module to include a function that does an API call to the source project to read the data for the corresponding record, and just displays the results on the page as required.

 

FWIW, here's an example of an in-survey function that looks up a survey link from another project (a partially completed survey corresponding to a record matching some code entered).

 

Luke

 

(function($, window, document, token) {

       var recordLinks = {};

       var url = "https://redcap.mcri.edu.au/api/";

      

    var lookupCode = function() {

        var code = $('input[name=findcode').val();

        if (code==='') {

            alert('Enter the code to find.'); return false;

        }

       var recordRequestData = {

            token: token,

            content: "record",

            format: "json",

            fields: "record_id",

            filterLogic: "[uniquecode]='"+code+"' and [survey_complete]<>'2'"

        };

 

       $.post( url, recordRequestData, function( data ) {

            if (data && data.length>0) {

                //console.log(data);

                var rec = data[0].record_id;

                var link = recordLinks[rec];

                $('#result').html('<a href="'+link+'" target="_blank">'+link+'</a>');

            } else {

                $('#result').html("An incomplete survey with the unique code \"<span style='font-family:monospace !important;color:gray;'>"+code+"</span>\" was not found.");

            }

        });

    };

   

       var linksRequestData = {

           token: token,

        content: "participantList",

        format: "json",

        instrument: "survey",

        event: ""

       };

       $.post( url, linksRequestData, function( data ) {

        if (data && data.length>0) {

            data.forEach(function(thisPt) {

                if (thisPt.record!=='') {

                    recordLinks[thisPt.record] = thisPt.survey_link;

                }

            });

            //console.log(recordLinks);

            $('#lookupBtn')

                .click(function() {

                    lookupCode()

                })

                .prop('disabled', false);

            $('#result').html("");

        }

    });

}(window.jQuery, window, document, token));

Rick Watts

unread,
May 31, 2019, 11:09:48 AM5/31/19
to redcap open
I agree with Luke. It looks like the use case is for piping the data not copying the data. That said, I have only very rudimentary programming skills and i have successfully implemented data entry triggers that copy data from one project to another, or from one record to another, I was impressed at how rapidly the code executes. My DETs run on a separate server within the same data centre as our REDcap host and can retrieve data from a record, process it, and write it back to REDCap, faster than a user can move between two REDCap pages. Of course, if the DET were running on a server outside of our data centre there may be some latency issues that would slow it down.

Rick.

To unsubscribe from this group and stop receiving emails from it, send an email to redca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redcap_open/f4469c41-10bb-4686-aa5b-73ea6c32b3d2@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

This e-mail and any attachments to it (the "Communication") are, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Murdoch Children’s Research Institute (MCRI) ABN 21 006 566 972 or any of its related entities. MCRI does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication.

--
You received this message because you are subscribed to the Google Groups "redcap open" group.

To unsubscribe from this group and stop receiving emails from it, send an email to redca...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "redcap open" group.

To unsubscribe from this group and stop receiving emails from it, send an email to redca...@googlegroups.com.

Florence Breslin

unread,
Jan 21, 2022, 3:16:11 PM1/21/22
to redcap open
Hello Peter, I have been reviewing this old chat because i need to setup exactly what I think you described. I want subjects to consent and enter demographic data into one project, then be directed (by survey end) to 2nd project which will collect their data, using the same ID number. Is that what you did and can you share more about how that works for you?

Thank you, 
Florence Breslin

Amit Tandon

unread,
Jan 23, 2022, 3:08:44 AM1/23/22
to redcap open
Even Ricks solution seems interesting. If you all share your solutions, we can implement it in our cases as required

Peter Macisaac (POP)

unread,
Jan 24, 2022, 8:07:54 AM1/24/22
to Florence Breslin, redcap open
Yes Florence that is what we did.

However to make this process necessary/justified  you need to have a one is to many relationship between the participant and projects they are involved in - otherwise what you want -  REDCap does very well out of the box.  Might be useful to describe why you think standard project won’t work for you.

In my project we had 2 use cases:

1.   Created a family record for collecting family related data and family visit records and then within each family created a child registration (repeating form).  The child ID. (Family id_child number) was then piped into the URL for the child record in project 2.

2.  A gastro entomology department wants do recruit subjects for mulitplestudies -  the Master Participant Index project registered these and kept track of what projects they enrolled in then created the participant in the redcap project for each study using the patients MPI number.


The use case you  described doesn’t describe the case for using this complex  approach

So what is the approach

However to answer your question you create a custom URL in the first project   that opens the second project in the correct form and with the participant ID already populated.

Try looking at how the URL of a redcap form for a participant looks and you will see all the metadata in there.  PID, project ID etc

The URL is really an API to create a new record in another project. I had to learn a little HTML to be able to do smart things like open the new redcap record in project 2 in a new tab.

While I haven’t done this there are now extensions that support cross project exchange of data so that demographic data you enter in the first project can also be transferred to the second to avoid having to enter duplicate data.

Happy to talk you through it if the above is not clear - email me directly pe...@macisaacinformatics.org

Peter






In brief you create the patient ID in 

--
You received this message because you are subscribed to the Google Groups "redcap open" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redcap_open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redcap_open/06a425d7-c1c7-4e3d-84fb-b8a48ce7d1fbn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages