Multiple demographics datasets

LabKey Support Forum
Multiple demographics datasets Sev  2018-05-22 10:38
Status: Closed
 

Hello

Our users have requested that we hide demographics data from all but a small set of admin users for our LabKey instance. To strike a balance between setting up this level of security and still being able to use datasets that refer back to the participantid in the Demographics table, we have created a separate AdminDemographics dataset to supplement the Demographics dataset. AdminDemographics contains PHI such as MRN, Names, Birth dates, etc and the Demographics dataset contains only the participant ID column. We keep these in sync with triggers.

We created the AdminDemographics dataset via:
CREATE TABLE LIKE studydataset.demographics INCLUDING ALL
We registered it with LabKey as a dataset with the additional key column field set to the _key column in the dataset, marked as system managed. When we rolled this out, however, LabKey had assigned the MRN column to this additional key and marked it as System Managed, see attached screenshot.

The impact of this was that MRN was not allowed to be set by users when adding new records, breaking the ability to add new patients to the system. We were able to correct this by manually resetting the additional key column back to none. I also noticed if I select the 'Demographic Data' check box the MRN is settable on insert.

My questions:

  1. Why was MRN assigned to a system managed additional key column? Is 'MRN' some kind of reserved column name that gets auto assigned? The _key column exists distinct of the MRN column in the dataset.
  2. Besides enforcing zero or 1 row per participant as described here, what impact does checking the 'Demographic Data' option have on the system? Apart from making MRN settable when adding new records we want to know what else is going on so we can test thoroughly.

EDIT: I attached csv files for the admindemographics entries in the study.dataset and exp.domaindescriptor tables in case that is helpful

Thanks!

Sev

 
 
Jon (LabKey DevOps) responded:  2018-06-01 23:26
Hi Sev,

I'm a little confused with this part:

"We created the AdminDemographics dataset via: CREATE TABLE LIKE studydataset.demographics INCLUDING ALL We registered it with LabKey as a dataset with the additional key column field set to the _key column in the dataset, marked as system managed..."

Am I correct in thinking you actually created this demographics dataset not via the UI, but directly in the database?

Regards,

Jon
 
Sev responded:  2018-06-04 08:43
Hi Jon!

Thanks for the response. Yes, we did create the table directly in the database.

Thanks

Sev
 
Jon (LabKey DevOps) responded:  2018-06-22 21:07
Hi Sev,

Thanks for confirming.

This is something that is not typically done, so I don't believe this would be properly supported within LabKey without some odd side-effects like what you're seeing here.

Let me see what, if anything, can be done to give you a good direction to go in by asking our developers.

Thank you for your patience.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2018-06-29 13:03
Hi Sev,

I've confirmed that this kind of setup is not supported and it's a bit of a surprise that it worked as a dataset at all.

We recommend creating datasets via the UI and populating it via TSV upload, ETL, or via some other data input method. Beyond this, we can't guarantee how the application will behave.

Regards,

Jon
 
Sev responded:  2018-07-02 08:52
Thanks Jon, thats good to know. Appreciate the follow up!