Programmatically setting QC states

LabKey Support Forum (Inactive)
Programmatically setting QC states balter  2016-10-16 16:25
Status: Closed
 
We have a goal to set as many configurations as possible through the code base. I explain this more here:

https://www.labkey.org/home/Support/Developer%20Forum/announcements-thread.view?rowId=13677

I've studied the pages on setting the QC states through the GUI

https://www.labkey.org/home/Documentation/wiki-page.view?name=datasetQualityControl

and linked pages.

I located the XML schema for QC states https://www.labkey.org/download/schema-docs/xml-schemas/schemas/study_xsd/elements/qcStates.html, but I can't figure out how I would use this to make the sort of configurations in the GUI.

Is there a way to specify the QC states in a configuration file? Can it be done by querying the database. Would it need to be done with java code?
 
 
Jon (LabKey DevOps) responded:  2016-10-26 22:41
Hi Ariel,

The XML in question is tied to the study.xml file that gets exported out of the system with a study archive. If you actually download the importable study from our demo study tutorial (https://www.labkey.org/home/Documentation/wiki-page.view?name=setupDemoStudy), you will see something like this:

  <qcStates file="quality_control_states.xml"/>

And the study will show you a "quality_control_states.xml" file with the following:

<?xml version="1.0" encoding="UTF-8"?>
<studyqc xmlns="http://labkey.org/study/xml/qcStates">
  <showPrivateDataByDefault>true</showPrivateDataByDefault>
  <blankQCStatePublic>true</blankQCStatePublic>
  <insertUpdateDefault>Not Yet Reviewed</insertUpdateDefault>
  <qcstates>
    <qcstate name="Not Yet Reviewed" description="Data that has not been reviewed by the committee." public="true"/>
    <qcstate name="Reviewed - Passed" description="Data that has cleared the qc committee criteria." public="true"/>
    <qcstate name="Reviewed - Rejected" description="Data that has failed the qc committee criteria." public="true"/>
  </qcstates>
</studyqc>

This however wouldn't be a GUI setting (except for the standard GUI for the QCStates as described here: https://www.labkey.org/home/Documentation/wiki-page.view?name=manageQC).

Does that make sense?

Regards,

Jon