diff --git a/GenotypeAssays/test/src/org/labkey/test/tests/external/labModules/GenotypeAssaysTest.java b/GenotypeAssays/test/src/org/labkey/test/tests/external/labModules/GenotypeAssaysTest.java index ffc0aeac9..771c4e5bc 100644 --- a/GenotypeAssays/test/src/org/labkey/test/tests/external/labModules/GenotypeAssaysTest.java +++ b/GenotypeAssays/test/src/org/labkey/test/tests/external/labModules/GenotypeAssaysTest.java @@ -182,6 +182,7 @@ private void beadStudioImportTest() Ext4FieldRef.getForLabel(this, "Run Description").setValue("Description"); + waitForElement(Ext4Helper.Locators.ext4Button("Download Example Data")); File exampleData = clickAndWaitForDownload(Ext4Helper.Locators.ext4Button("Download Example Data")); waitAndClick(Ext4Helper.Locators.radiobutton(this, "File Upload")); diff --git a/PMR/build.gradle b/PMR/build.gradle index dccb30067..f33b6455c 100644 --- a/PMR/build.gradle +++ b/PMR/build.gradle @@ -9,6 +9,7 @@ dependencies { BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:premiumModules:dataintegration", depProjectConfig: "published", depExtension: "module") BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:DiscvrLabKeyModules:discvrcore", depProjectConfig: "published", depExtension: "module") BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:onprcEHRModules:GeneticsCore", depProjectConfig: "published", depExtension: "module") + BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:BimberLabKeyModules:primeseq", depProjectConfig: "published", depExtension: "module") BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":server:modules:DiscvrLabKeyModules:Studies", depProjectConfig: "apiJarFile") BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":server:modules:premiumModules:dataintegration", depProjectConfig: "apiJarFile") diff --git a/PMR/resources/etls/pmr-datasets.xml b/PMR/resources/etls/pmr-datasets.xml deleted file mode 100644 index a0fc89c53..000000000 --- a/PMR/resources/etls/pmr-datasets.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - PRIMe_Datasets - PRIMe Dataset Data - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Id - date - parent - relationship - method - objectid - created - modified - - - - - - - - - - - - - - - Id - date - date_type - birth_condition - dam - gender - weight - wdate - type - species - geographic_origin - sire - estimated - conception - conceptualDay - objectid - created - modified - - - - - - - - - - - - - - - - - - - - - diff --git a/PMR/resources/etls/pmr-demographics.xml b/PMR/resources/etls/pmr-demographics.xml deleted file mode 100644 index 03b2bf94e..000000000 --- a/PMR/resources/etls/pmr-demographics.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - PRIMe_Demographics - PRIMe Demographics Data - - - - - Id - date - gender - species - geographic_origin - birth - death - status - calculated_status - QCState/Label - objectid - created - modified - - - - - - - - - - - - - - - - - - - - - - diff --git a/PMR/resources/etls/pmrClinicalData.xml b/PMR/resources/etls/pmrClinicalData.xml index 591827c32..735c44f24 100644 --- a/PMR/resources/etls/pmrClinicalData.xml +++ b/PMR/resources/etls/pmrClinicalData.xml @@ -6,18 +6,91 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PMR/resources/etls/prime-birth.xml b/PMR/resources/etls/prime-birth.xml new file mode 100644 index 000000000..4556dba00 --- /dev/null +++ b/PMR/resources/etls/prime-birth.xml @@ -0,0 +1,66 @@ + + + PRIME_Birth_Data + PRIMe Birth Data + + + + + Id + date + date_type + birth_condition + dam + gender + weight + wdate + type + species + geographic_origin + sire + estimated + conception + conceptualDay + objectid + created + QCState/Label + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-blooddraws.xml b/PMR/resources/etls/prime-blooddraws.xml new file mode 100644 index 000000000..13abeaa15 --- /dev/null +++ b/PMR/resources/etls/prime-blooddraws.xml @@ -0,0 +1,52 @@ + + + PRIME_Blood_Data + PRIMe Blood Data + + + Copy to target + + + Id + date + reason + quantity + objectid + QCState/Label + created + modified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-chemistryResults.xml b/PMR/resources/etls/prime-chemistryResults.xml new file mode 100644 index 000000000..0c0cd1c92 --- /dev/null +++ b/PMR/resources/etls/prime-chemistryResults.xml @@ -0,0 +1,55 @@ + + + PRIME_ChemistryResults_Data + PRIMe Chemistry Results Data + + + + + Id + date + ageAtTime + testId + result + units + runid + objectid + created + modified + QCState/Label + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-clinpathRuns.xml b/PMR/resources/etls/prime-clinpathRuns.xml new file mode 100644 index 000000000..f6afe0b27 --- /dev/null +++ b/PMR/resources/etls/prime-clinpathRuns.xml @@ -0,0 +1,56 @@ + + + PRIME_ClinpathRuns_Data + PRIMe ClinpathRuns Data + + + + + Id + date + type + tissue + units + servicerequested + collectionMethod + method + objectid + created + modified + QCState/Label + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-demographics.xml b/PMR/resources/etls/prime-demographics.xml new file mode 100644 index 000000000..87fb1a758 --- /dev/null +++ b/PMR/resources/etls/prime-demographics.xml @@ -0,0 +1,61 @@ + + + PRIME_Demographics_Data + PRIMe Demographics Data + + + Copy to target + + + Id + date + gender + geographic_origin + birth + death + species + status + calculated_status + objectid + QCState/Label + created + modified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-hematologyResults.xml b/PMR/resources/etls/prime-hematologyResults.xml new file mode 100644 index 000000000..9df7326e3 --- /dev/null +++ b/PMR/resources/etls/prime-hematologyResults.xml @@ -0,0 +1,55 @@ + + + PRIME_HematologyResults_Data + PRIMe Hematology Results Data + + + + + Id + date + ageAtTime + testId + result + units + runid + objectid + created + modified + QCState/Label + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-histology.xml b/PMR/resources/etls/prime-histology.xml new file mode 100644 index 000000000..27a21350b --- /dev/null +++ b/PMR/resources/etls/prime-histology.xml @@ -0,0 +1,54 @@ + + + PRIME_Histology_Data + PRIMe Histology Data + + + + + Id + date + ageAtTime + sort_order + tissue + codes + objectid + created + modified + QCState/Label + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-microbiology.xml b/PMR/resources/etls/prime-microbiology.xml new file mode 100644 index 000000000..194c4d83e --- /dev/null +++ b/PMR/resources/etls/prime-microbiology.xml @@ -0,0 +1,55 @@ + + + PRIME_Microbiology_Data + PRIMe Microbiology Data + + + + + Id + date + ageAtTime + tissue + organism + quantity + runid + objectid + created + modified + QCState/Label + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-parentage.xml b/PMR/resources/etls/prime-parentage.xml new file mode 100644 index 000000000..30f46b3f7 --- /dev/null +++ b/PMR/resources/etls/prime-parentage.xml @@ -0,0 +1,58 @@ + + + PRIME_Parentage_Data + PRIMe Parentage Data + + + Copy to target + + + Id + date + enddate + parent + relationship + method + objectid + QCState/Label + created + modified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-pathologyDiagnoses.xml b/PMR/resources/etls/prime-pathologyDiagnoses.xml new file mode 100644 index 000000000..428ef6e3a --- /dev/null +++ b/PMR/resources/etls/prime-pathologyDiagnoses.xml @@ -0,0 +1,53 @@ + + + PRIME_PathologyDiagnoses_Data + PRIMe Pathology Diagnoses Data + + + + + Id + date + ageAtTime + sort_order + codes + objectid + created + modified + QCState/Label + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/etls/prime-weight.xml b/PMR/resources/etls/prime-weight.xml new file mode 100644 index 000000000..435679e81 --- /dev/null +++ b/PMR/resources/etls/prime-weight.xml @@ -0,0 +1,55 @@ + + + PRIME_Weight_Data + PRIMe Weight Data + + + Copy to target + + + Id + date + weight + objectid + QCState/Label + created + modified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + primaryKey + + + + diff --git a/PMR/resources/referenceStudy/study/datasets/datasets_manifest.xml b/PMR/resources/referenceStudy/study/datasets/datasets_manifest.xml index a57ce797a..6ee27d416 100644 --- a/PMR/resources/referenceStudy/study/datasets/datasets_manifest.xml +++ b/PMR/resources/referenceStudy/study/datasets/datasets_manifest.xml @@ -28,10 +28,25 @@ - + - + + + + + + + + + + + + + + + + @@ -67,5 +82,11 @@ + + + + + + diff --git a/PMR/resources/referenceStudy/study/datasets/datasets_metadata.xml b/PMR/resources/referenceStudy/study/datasets/datasets_metadata.xml index 042e53ace..f279b1638 100644 --- a/PMR/resources/referenceStudy/study/datasets/datasets_metadata.xml +++ b/PMR/resources/referenceStudy/study/datasets/datasets_metadata.xml @@ -187,7 +187,7 @@ integer urn:ehr.labkey.org/#Project - + varchar @@ -423,114 +423,6 @@ Weight - - - - varchar - http://cpas.labkey.com/Study#ParticipantId - - ptid - - - - timestamp - http://cpas.labkey.com/Study#VisitDate - http://cpas.labkey.com/Study#VisitDate - - - timestamp - urn:ehr.labkey.org/#EndDate - - - varchar - - - integer - urn:ehr.labkey.org/#Project - - - entityid - urn:ehr.labkey.org/#ObjectId - true - - - varchar - - - varchar - - - varchar - - - double - - - varchar - - - timestamp - - - Labwork -
- - - - varchar - http://cpas.labkey.com/Study#ParticipantId - - ptid - - - - timestamp - http://cpas.labkey.com/Study#VisitDate - http://cpas.labkey.com/Study#VisitDate - - - varchar - - - double - - - varchar - - - double - - - double - - - varchar - - - varchar - - - entityid - urn:ehr.labkey.org/#ObjectId - true - - - varchar - - - integer - urn:ehr.labkey.org/#Project - - - timestamp - urn:ehr.labkey.org/#EndDate - - - varchar - - - Lab Results -
@@ -1044,4 +936,501 @@ Kinship
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + timestamp + urn:ehr.labkey.org/#EndDate + + + varchar + + + varchar + + + integer + urn:ehr.labkey.org/#Project + + + varchar + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + varchar + + + varchar + + + varchar + + + varchar + + + varchar + + + varchar + + + varchar + + + double + + + varchar + + + varchar + + + timestamp + + + varchar + + + Clinpath Runs +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + varchar + + + double + + + varchar + + + double + + + double + + + varchar + + + varchar + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + varchar + + + integer + urn:ehr.labkey.org/#Project + + + timestamp + urn:ehr.labkey.org/#EndDate + + + varchar + + + Hematology Results +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + varchar + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + varchar + + + integer + urn:ehr.labkey.org/#Project + + + timestamp + urn:ehr.labkey.org/#EndDate + + + double + + + varchar + + + varchar + + + varchar + + + varchar + + + Parasitology Results +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + varchar + + + double + + + varchar + + + double + + + double + + + double + + + varchar + + + varchar + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + integer + urn:ehr.labkey.org/#Project + + + timestamp + urn:ehr.labkey.org/#EndDate + + + varchar + + + double + + + varchar + + + double + + + double + + + varchar + + + Urinalysis Results +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + varchar + + + double + + + double + + + varchar + + + varchar + + + integer + urn:ehr.labkey.org/#Project + + + integer + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + varchar + + + timestamp + urn:ehr.labkey.org/#EndDate + + + timestamp + urn:ehr.labkey.org/#DateRequested + + + varchar + + + varchar + + + timestamp + + + Blood Draws +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + integer + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + integer + urn:ehr.labkey.org/#Project + + + integer + + + Pathology Diagnoses +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + integer + + + varchar + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + integer + urn:ehr.labkey.org/#Project + + + timestamp + urn:ehr.labkey.org/#EndDate + + + varchar + + + varchar + + + integer + + + Histology +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + varchar + + + varchar + + + varchar + + + varchar + + + integer + urn:ehr.labkey.org/#Project + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + varchar + + + Microbiology Results +
+ + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + ptid + + + + timestamp + http://cpas.labkey.com/Study#VisitDate + http://cpas.labkey.com/Study#VisitDate + + + varchar + + + double + + + varchar + + + double + + + double + + + varchar + + + varchar + + + entityid + urn:ehr.labkey.org/#ObjectId + true + + + varchar + + + integer + urn:ehr.labkey.org/#Project + + + timestamp + urn:ehr.labkey.org/#EndDate + + + varchar + + + varchar + + + Chemistry Results +
diff --git a/PMR/src/org/labkey/pmr/PMRController.java b/PMR/src/org/labkey/pmr/PMRController.java index 69487b75d..8dfab686a 100644 --- a/PMR/src/org/labkey/pmr/PMRController.java +++ b/PMR/src/org/labkey/pmr/PMRController.java @@ -52,9 +52,9 @@ public static class ImportStudyAction extends ConfirmAction @Override public ModelAndView getConfirmView(Object o, BindException errors) throws Exception { - setTitle("Import mGAP Study"); + setTitle("Import PMR Study"); - return new HtmlView(HtmlString.unsafe("This will import the default mGAP study in this folder and set the EHRStudyContainer property to point to this container. Do you want to continue?")); + return new HtmlView(HtmlString.unsafe("This will import the default PMR study in this folder and set the EHRStudyContainer property to point to this container. Do you want to continue?")); } @Override diff --git a/SivStudies/resources/data/reports.tsv b/SivStudies/resources/data/reports.tsv index 65f6076a1..c9ba1c207 100644 --- a/SivStudies/resources/data/reports.tsv +++ b/SivStudies/resources/data/reports.tsv @@ -7,7 +7,8 @@ query Clinical study hematologyPivot CBC/Hematology query Study Design study assignment Project/Study Assignment query Research study flow Flow Cytometry query Research study outcomes Study Outcomes/Phenotypes -query Research study genetics Genetic Data / MHC +query Research study pvl_outcomes Study PVL-Based Outcomes +query Research study genetics Genetic Data / MHC query Clinical study procedures Procedures query Research study viralLoads Viral Loads query General study samples Samples diff --git a/SivStudies/resources/queries/study/demographics/.qview.xml b/SivStudies/resources/queries/study/demographics/.qview.xml index 677d864d0..36ef67231 100644 --- a/SivStudies/resources/queries/study/demographics/.qview.xml +++ b/SivStudies/resources/queries/study/demographics/.qview.xml @@ -13,7 +13,7 @@ - + diff --git a/SivStudies/resources/queries/study/demographics/Expanded.qview.xml b/SivStudies/resources/queries/study/demographics/Expanded.qview.xml index 8d3c3e733..1598334f0 100644 --- a/SivStudies/resources/queries/study/demographics/Expanded.qview.xml +++ b/SivStudies/resources/queries/study/demographics/Expanded.qview.xml @@ -7,7 +7,7 @@ - + diff --git a/SivStudies/resources/queries/study/demographicsChallengeAndArt.query.xml b/SivStudies/resources/queries/study/demographicsChallengeAndArt.query.xml index 8e3ec5353..135d018b6 100644 --- a/SivStudies/resources/queries/study/demographicsChallengeAndArt.query.xml +++ b/SivStudies/resources/queries/study/demographicsChallengeAndArt.query.xml @@ -14,6 +14,9 @@ ART + + Infection Date + allInfections diff --git a/SivStudies/resources/queries/study/demographicsChallengeAndArt.sql b/SivStudies/resources/queries/study/demographicsChallengeAndArt.sql index ea898b425..4e4f9fc73 100644 --- a/SivStudies/resources/queries/study/demographicsChallengeAndArt.sql +++ b/SivStudies/resources/queries/study/demographicsChallengeAndArt.sql @@ -8,6 +8,10 @@ SELECT WHEN t.category = 'ART' THEN (cast(month(t.date) as varchar) || '/' || cast(dayofmonth(t.date) as varchar) || '/' || cast(year(t.date) as varchar) || ' (' || t.treatment || ')') ELSE NULL END, char(10)) as allART, + min(CASE + WHEN t.category = 'SIV Infection' THEN t.date + ELSE NULL + END) as infectionDate, FROM study.treatments t GROUP BY t.Id \ No newline at end of file diff --git a/SivStudies/resources/queries/study/demographicsProjects.query.xml b/SivStudies/resources/queries/study/demographicsProjects.query.xml index fc8f02e91..ec3dddc09 100644 --- a/SivStudies/resources/queries/study/demographicsProjects.query.xml +++ b/SivStudies/resources/queries/study/demographicsProjects.query.xml @@ -14,6 +14,9 @@ All Studies + + Subgroups/Treatments + RhCMV Vaccines? diff --git a/SivStudies/resources/queries/study/demographicsProjects.sql b/SivStudies/resources/queries/study/demographicsProjects.sql index e01f2a073..853db7d13 100644 --- a/SivStudies/resources/queries/study/demographicsProjects.sql +++ b/SivStudies/resources/queries/study/demographicsProjects.sql @@ -3,6 +3,7 @@ SELECT count(s.Id) as totalProjects, group_concat(DISTINCT s.study, char(10)) as allStudies, group_concat(DISTINCT s.category, char(10)) as categories, + group_concat(DISTINCT s.subgroup, char(10)) as subgroups, GROUP_CONCAT(distinct CASE WHEN s.category = 'RhCMV-Vaccines' THEN 'Yes' ELSE null END, char(10)) as rhCmvVaccines, GROUP_CONCAT(distinct CASE WHEN s.category = 'SIV/ART' THEN 'Yes' ELSE null END, char(10)) as sivArt diff --git a/SivStudies/resources/queries/study/duplicateInfectionDates.query.xml b/SivStudies/resources/queries/study/duplicateInfectionDates.query.xml new file mode 100644 index 000000000..8ea99a2c4 --- /dev/null +++ b/SivStudies/resources/queries/study/duplicateInfectionDates.query.xml @@ -0,0 +1,12 @@ + + + + + Duplicate Infection Dates + + + +
+
+
+
diff --git a/SivStudies/resources/queries/study/duplicateInfectionDates.sql b/SivStudies/resources/queries/study/duplicateInfectionDates.sql new file mode 100644 index 000000000..a9f1a8acd --- /dev/null +++ b/SivStudies/resources/queries/study/duplicateInfectionDates.sql @@ -0,0 +1,10 @@ +SELECT +t.Id, +t.date, +'SIV Infection' as category + +FROM study.treatments t +WHERE t.category = 'SIV Infection' + +GROUP BY t.Id, t.date +HAVING count(*) > 1 \ No newline at end of file diff --git a/SivStudies/resources/queries/study/infectionAnchorDateDiscordance.query.xml b/SivStudies/resources/queries/study/infectionAnchorDateDiscordance.query.xml new file mode 100644 index 000000000..2d5c8bab7 --- /dev/null +++ b/SivStudies/resources/queries/study/infectionAnchorDateDiscordance.query.xml @@ -0,0 +1,17 @@ + + + + + Discordant Infection Dates + + + Date (Treatments Table) + + + Date (Anchor Dates Table) + + +
+
+
+
diff --git a/SivStudies/resources/queries/study/infectionAnchorDateDiscordance.sql b/SivStudies/resources/queries/study/infectionAnchorDateDiscordance.sql new file mode 100644 index 000000000..c19cd0943 --- /dev/null +++ b/SivStudies/resources/queries/study/infectionAnchorDateDiscordance.sql @@ -0,0 +1,16 @@ +SELECT + t.Id, + 'SIV Infection' as category, + t.date as treatmentTableDate, + t2.date as subjectAnchorDatesTableDate + +FROM study.treatments t +FULL JOIN studies.subjectAnchorDates t2 ON ( + t.category = 'SIV Infection' AND + t2.subjectId = t.Id AND + t2.eventLabel = 'SIV Infection' +) + +WHERE t2.date != t.date OR + t2.date IS NULL OR + t.date IS NULL \ No newline at end of file diff --git a/SivStudies/resources/queries/study/pvl_outcomes.query.xml b/SivStudies/resources/queries/study/pvl_outcomes.query.xml new file mode 100644 index 000000000..e06038802 --- /dev/null +++ b/SivStudies/resources/queries/study/pvl_outcomes.query.xml @@ -0,0 +1,30 @@ + + + + + + + + Date + Date + + + Outcome/Phenotype + + + Numeric Value + + + String Value + + + Comments + + + Data Source + + +
+
+
+
diff --git a/SivStudies/resources/queries/study/pvl_outcomes/.qview.xml b/SivStudies/resources/queries/study/pvl_outcomes/.qview.xml new file mode 100644 index 000000000..05ad5dcfa --- /dev/null +++ b/SivStudies/resources/queries/study/pvl_outcomes/.qview.xml @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/SivStudies/resources/referenceStudy/study/datasets/datasets_manifest.xml b/SivStudies/resources/referenceStudy/study/datasets/datasets_manifest.xml index 715134ec4..12d37227d 100644 --- a/SivStudies/resources/referenceStudy/study/datasets/datasets_manifest.xml +++ b/SivStudies/resources/referenceStudy/study/datasets/datasets_manifest.xml @@ -46,5 +46,8 @@ + + + diff --git a/SivStudies/resources/referenceStudy/study/datasets/datasets_metadata.xml b/SivStudies/resources/referenceStudy/study/datasets/datasets_metadata.xml index 47f66507d..5eb90a75a 100644 --- a/SivStudies/resources/referenceStudy/study/datasets/datasets_metadata.xml +++ b/SivStudies/resources/referenceStudy/study/datasets/datasets_metadata.xml @@ -517,4 +517,36 @@ Outcomes/Phenotypes + + + + varchar + http://cpas.labkey.com/Study#ParticipantId + + + timestamp + http://cpas.labkey.com/laboratory#sampleDate + + + varchar + + + entityid + true + + + varchar + + + double + + + varchar + + + varchar + + + PVL Outcomes +
diff --git a/SivStudies/resources/views/studiesAdmin.html b/SivStudies/resources/views/studiesAdmin.html index b17398a9c..fb5e91025 100644 --- a/SivStudies/resources/views/studiesAdmin.html +++ b/SivStudies/resources/views/studiesAdmin.html @@ -24,6 +24,9 @@ items: [{ name: 'Import/Re-import Study and Reference Data', url: LABKEY.ActionURL.buildURL('sivstudies', 'importStudy.view') + },{ + name: 'Notification Admin', + url: LABKEY.ActionURL.buildURL('ldk', 'notificationAdmin.view') }] }] }] diff --git a/SivStudies/src/org/labkey/sivstudies/SivStudiesModule.java b/SivStudies/src/org/labkey/sivstudies/SivStudiesModule.java index 4bedeb33e..72d8b6e83 100644 --- a/SivStudies/src/org/labkey/sivstudies/SivStudiesModule.java +++ b/SivStudies/src/org/labkey/sivstudies/SivStudiesModule.java @@ -20,8 +20,10 @@ import org.jetbrains.annotations.Nullable; import org.labkey.api.data.Container; import org.labkey.api.ldk.ExtendedSimpleModule; +import org.labkey.api.ldk.notification.NotificationService; import org.labkey.api.module.ModuleContext; import org.labkey.api.studies.StudiesService; +import org.labkey.sivstudies.notification.SivStudiesDataValidationNotification; import org.labkey.sivstudies.study.ArtInitiationEventProvider; import org.labkey.sivstudies.study.SivInfectionEventProvider; @@ -56,6 +58,7 @@ public void doStartupAfterSpringConfig(ModuleContext moduleContext) { StudiesService.get().registerEventProvider(new SivInfectionEventProvider()); StudiesService.get().registerEventProvider(new ArtInitiationEventProvider()); + NotificationService.get().registerNotification(new SivStudiesDataValidationNotification()); } @Override diff --git a/SivStudies/src/org/labkey/sivstudies/notification/SivStudiesDataValidationNotification.java b/SivStudies/src/org/labkey/sivstudies/notification/SivStudiesDataValidationNotification.java new file mode 100644 index 000000000..314c662a0 --- /dev/null +++ b/SivStudies/src/org/labkey/sivstudies/notification/SivStudiesDataValidationNotification.java @@ -0,0 +1,125 @@ +package org.labkey.sivstudies.notification; + +import org.jetbrains.annotations.Nullable; +import org.labkey.api.data.Container; +import org.labkey.api.data.TableInfo; +import org.labkey.api.data.TableSelector; +import org.labkey.api.ldk.notification.AbstractNotification; +import org.labkey.api.module.ModuleLoader; +import org.labkey.api.query.QueryService; +import org.labkey.api.query.UserSchema; +import org.labkey.api.security.User; +import org.labkey.sivstudies.SivStudiesModule; + +import java.util.Date; + +public class SivStudiesDataValidationNotification extends AbstractNotification +{ + public SivStudiesDataValidationNotification() + { + super(ModuleLoader.getInstance().getModule(SivStudiesModule.class)); + } + + @Override + public String getName() + { + return "SIV Studies Validation"; + } + + @Override + public String getCategory() + { + return "Studies"; + } + + @Override + public String getCronString() + { + return "0 0 6 * * ?"; + } + + @Override + public String getScheduleDescription() + { + return "every day at 6:00AM"; + } + + @Override + public String getDescription() + { + return "SIV Study Data Validation Alerts"; + } + + @Override + public String getEmailSubject(Container c) + { + return "SIV Study Data Validation: " + c.getName(); + } + + @Override + public @Nullable String getMessageBodyHTML(Container c, User u) + { + StringBuilder msg = new StringBuilder(); + Date now = new Date(); + + duplicateInfectionCheck(c, u, msg); + + if (!msg.isEmpty()) + { + msg.insert(0, "This email contains a series of automatic alerts about the SIV study data. It was run on: " + getDateFormat(c).format(now) + " at " + AbstractNotification._timeFormat.format(now) + ".

"); + } + + return msg.toString(); + } + + private TableInfo getTableInfo(User u, Container c, String schemaName, String queryName) + { + UserSchema us = QueryService.get().getUserSchema(u, c, schemaName); + if (us == null) + { + throw new IllegalStateException("Missing user schema: " + schemaName); + } + + TableInfo ti = us.getTable(queryName); + if (ti == null) + { + throw new IllegalStateException("Missing table: " + schemaName + "." + queryName); + } + + return ti; + } + + private void duplicateInfectionCheck(Container c, User u, StringBuilder msg) + { + String schemaName = "study"; + String queryName = "duplicateInfectionDates"; + + TableInfo ti = getTableInfo(u, c, schemaName, queryName); + + TableSelector ts = new TableSelector(ti); + long count = ts.getRowCount(); + if (count > 0) + { + msg.append("WARNING: There are ").append(count).append(" duplicate infection date records
\n"); + msg.append("

Click here to view them
\n\n"); + msg.append("


\n\n"); + } + } + + private void infectionAnchorDateDiscordance(Container c, User u, StringBuilder msg) + { + String schemaName = "study"; + String queryName = "infectionAnchorDateDiscordance"; + + TableInfo ti = getTableInfo(u, c, schemaName, queryName); + + TableSelector ts = new TableSelector(ti); + long count = ts.getRowCount(); + if (count > 0) + { + msg.append("WARNING: There are ").append(count).append(" records with discordant treatment and anchor date SIV infection records
\n"); + msg.append("

Click here to view them
\n\n"); + msg.append("


\n\n"); + } + } +} diff --git a/SivStudies/src/org/labkey/sivstudies/query/SivStudiesCustomizer.java b/SivStudies/src/org/labkey/sivstudies/query/SivStudiesCustomizer.java index ebaeb3322..9d82243ac 100644 --- a/SivStudies/src/org/labkey/sivstudies/query/SivStudiesCustomizer.java +++ b/SivStudies/src/org/labkey/sivstudies/query/SivStudiesCustomizer.java @@ -293,6 +293,13 @@ private void appendPvlColumns(DatasetTable ds, String subjectColName, String dat newColOOR.setHidden(true); ti.addColumn(newColOOR); + + String nameHasPvl = name + "HasPvl"; + SQLFragment sqlHasPvl = new SQLFragment("(SELECT CASE WHEN count(*) > 0 THEN " + ti.getSqlDialect().getBooleanTRUE() + " ELSE " + ti.getSqlDialect().getBooleanFALSE() + " END as expr FROM studydataset." + tableName + " t WHERE t.participantid = " + ExprColumn.STR_TABLE_ALIAS + ".participantid AND t.sampletype = 'Plasma' AND t.target = 'SIV')"); + ExprColumn newColHasPvl = new ExprColumn(ti, nameHasPvl, sqlHasPvl, JdbcType.DOUBLE, subjectCol, dateCol); + newColHasPvl.setDescription("Displays whether this animal has any positive SIV PVLs"); + newColHasPvl.setLabel("Has Positive SIV PVL?"); + ti.addColumn(newColHasPvl); } } diff --git a/mGAP/resources/etls/clinicalData.xml b/mGAP/resources/etls/clinicalData.xml index 1cdc49ba8..e4801d7ef 100644 --- a/mGAP/resources/etls/clinicalData.xml +++ b/mGAP/resources/etls/clinicalData.xml @@ -3,23 +3,6 @@ ClinicalData EHR Clinical Data - - - - Id - date - ageAtTime - testId - result - units - runid - objectid - - - - - - @@ -33,111 +16,40 @@ avgKinship objectid + + + - - - - Id - date - ageAtTime - tissue - organism - quantity - runid - objectid - - - + + + + + + + + - - - - - - Id - date - ageAtTime - weight - objectid - - - - - - - - - - Id - date - ageAtTime - type - tissue - units - servicerequested - collectionMethod - method - objectid - - - - - - - - - - Id - date - ageAtTime - testid - result - units - runid - objectid - - - - - - - - - - Id - date - ageAtTime - sort_order - codes - objectid - - - - - - - - - - Id - date - ageAtTime - sort_order - tissue - codes - objectid - - - - - + + + + + - + + + + + + + primaryKey + + + diff --git a/mGAP/resources/etls/project_usage.xml b/mGAP/resources/etls/project_usage.xml deleted file mode 100644 index 67df09b66..000000000 --- a/mGAP/resources/etls/project_usage.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - Project Usage - Project Usage Data - - - Copy to local table - - - subjectId - project - groupname - startdate - enddate - comment - - - - - - - - - - - - diff --git a/mGAP/resources/queries/mGAP/sequenceDatasetsSource.query.xml b/mGAP/resources/queries/mGAP/sequenceDatasetsSource.query.xml new file mode 100644 index 000000000..3f4433200 --- /dev/null +++ b/mGAP/resources/queries/mGAP/sequenceDatasetsSource.query.xml @@ -0,0 +1,10 @@ + + + + + mGAP Sequence Datasets + +
+
+
+
\ No newline at end of file diff --git a/mGAP/resources/queries/mGAP/sequenceDatasetsSource.sql b/mGAP/resources/queries/mGAP/sequenceDatasetsSource.sql index 0093ffe3f..e7484ab09 100644 --- a/mGAP/resources/queries/mGAP/sequenceDatasetsSource.sql +++ b/mGAP/resources/queries/mGAP/sequenceDatasetsSource.sql @@ -4,7 +4,8 @@ SELECT r.totalForwardReads as totalReads, r.sraRuns as sraAccession, r.subjectId as originalId, - (SELECT s.center FROM mgap.subjectssource s WHERE s.subjectName = am.externalAlias) as center + (SELECT s.center FROM mgap.subjectssource s WHERE s.subjectName = am.externalAlias) as center, + CASE WHEN (SELECT s.subjectName FROM mgap.subjectssource s WHERE s.subjectName = am.externalAlias) IS NULL THEN true ELSE false END as missingDemographics FROM sequenceanalysis.sequence_readsets r JOIN mgap.animalMapping am ON (r.subjectId = am.subjectname) diff --git a/mGAP/resources/queries/mGAP/subjectsSource.query.xml b/mGAP/resources/queries/mGAP/subjectsSource.query.xml index 6185f7741..7d580fa2b 100644 --- a/mGAP/resources/queries/mGAP/subjectsSource.query.xml +++ b/mGAP/resources/queries/mGAP/subjectsSource.query.xml @@ -2,6 +2,7 @@ + mGAP Subject/Demographics Source DatasubjectName
diff --git a/mGAP/resources/queries/mGAP/subjectsSource.sql b/mGAP/resources/queries/mGAP/subjectsSource.sql index 3a1ed394c..ce5a82461 100644 --- a/mGAP/resources/queries/mGAP/subjectsSource.sql +++ b/mGAP/resources/queries/mGAP/subjectsSource.sql @@ -10,9 +10,15 @@ SELECT WHEN s.Id IS NOT NULL THEN 'ONPRC' ELSE NULL END as center, d.status as status, - m.subjectname as originalId + m.subjectname as originalId, + p1.externalAlias as sire, + coalesce(s.Id.parents.sire, d.sire) as originalSire, + p2.externalAlias as dam, + coalesce(s.Id.parents.dam, d.dam) as originalDam, FROM mgap.animalMapping m LEFT JOIN "/Internal/PMR/".study.demographics s ON (m.subjectname = s.Id) LEFT JOIN mgap.demographics d ON (m.subjectname = d.subjectname) +LEFT JOIN mgap.animalMapping p1 ON (p1.subjectname = coalesce(s.Id.parents.sire, d.sire)) +LEFT JOIN mgap.animalMapping p2 ON (p2.subjectname = coalesce(s.Id.parents.dam, d.dam)) WHERE (s.Id IS NOT NULL OR d.subjectname IS NOT NULL) \ No newline at end of file diff --git a/mGAP/resources/schemas/mgap.xml b/mGAP/resources/schemas/mgap.xml index caed3fa92..ff56af1ae 100644 --- a/mGAP/resources/schemas/mgap.xml +++ b/mGAP/resources/schemas/mgap.xml @@ -291,6 +291,7 @@ laboratory subjects subjectname +
diff --git a/mGAP/resources/views/login.html b/mGAP/resources/views/login.html index 471911cf3..ead854e20 100644 --- a/mGAP/resources/views/login.html +++ b/mGAP/resources/views/login.html @@ -1,14 +1,30 @@