Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions BaseStudy/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import org.labkey.gradle.util.BuildUtils

plugins {
id 'org.labkey.build.module'
}

dependencies {
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:DiscvrLabKeyModules:Studies", depProjectConfig: "published", depExtension: "module")
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:DiscvrLabKeyModules:discvrcore", 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:LabDevKitModules:laboratory", depProjectConfig: "apiJarFile")
BuildUtils.addLabKeyDependency(project: project, config: "implementation", depProjectPath: ":server:modules:LabDevKitModules:LDK", depProjectConfig: "apiJarFile")

BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:LabDevKitModules:laboratory", depProjectConfig: "published", depExtension: "module")
BuildUtils.addLabKeyDependency(project: project, config: "modules", depProjectPath: ":server:modules:LabDevKitModules:LDK", depProjectConfig: "published", depExtension: "module")
}
7 changes: 7 additions & 0 deletions BaseStudy/module.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ModuleClass: org.labkey.basestudy.BaseStudyModule
Label: Base Study Module
Description: A module designed to support study modules
License: Apache 2.0
LicenseURL: http://www.apache.org/licenses/LICENSE-2.0
ManageVersion: false
SupportedDatabases: mssql, pgsql
11 changes: 11 additions & 0 deletions BaseStudy/resources/data/amount_units.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
value
g
IU
U
mEq
mg
no units
ug
units
L/min
%
6 changes: 6 additions & 0 deletions BaseStudy/resources/data/calculated_status_codes.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
value
Alive
Dead
No Record
Shipped
Unknown
12 changes: 12 additions & 0 deletions BaseStudy/resources/data/conc_units.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
value denominator numerator
g/ml mL g
g/tsp tsp g
IU/ml mL IU
mEq/ml mL mEq
mg/capsule capsule(s) mg
mg/ml mL mg
mg/piece piece(s) mg
mg/tablet tablet(s) mg
mg/tsp tsp mg
ug/ml mL ug
units/ml mL units
11 changes: 11 additions & 0 deletions BaseStudy/resources/data/dosage_units.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
value numerator denominator
g/kg g kg
IU/kg IU kg
mEq/kg mEq kg
mg/animal mg
mg/kg mg kg
ml/kg ml kg
no units
ounces/kg ounces kg
ug/kg ug kg
units/kg units kg
4 changes: 4 additions & 0 deletions BaseStudy/resources/data/gender_codes.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
value meaning origgender
f Female f
m Male m
u Unknown
4 changes: 4 additions & 0 deletions BaseStudy/resources/data/geographic_origins.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
value
Indian
Chinese
Hybrid
61 changes: 61 additions & 0 deletions BaseStudy/resources/data/labwork_types.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
value title units sort_order category
GLUC Glucose mg/dL 1 Chemistry
BUN Blood urea nitrogen mg/dL 2 Chemistry
CREAT Creatinine mg/dL 3 Chemistry
CPK Creatine phosphokinase U/L 4 Chemistry
CHOL Cholesterol mg/dl 5 Chemistry
TRIG Triglyceride mg/dL 6 Chemistry
SGOT Serum glutamic oxaloacetic transaminase IU/L 7 Chemistry
LDL Low-Density Lipoprotein mg/dL 8 Chemistry
LDH Lactate dehydrogenase IU/L 9 Chemistry
TB Total Bilirubin mg/dL 10 Chemistry
GGT Gamma-glutamyltransferase IU/L 11 Chemistry
SGPT Serum glutamic pyruvic transaminase IU/L 12 Chemistry
TP Total Protein g/dL 13 Chemistry
ALB Albumin g/dL 14 Chemistry
ALKP Alkaline Phosphatase IU/L 15 Chemistry
CA Calcium mg/dL 16 Chemistry
PHOS Phosphorus mg/dL 17 Chemistry
FE Iron ?g/dL 18 Chemistry
K Potassium mmol/L 20 Chemistry
UA Uric Acid mg/dL 22 Chemistry
A/P Albumin/Protein Ratio ratio 999 Chemistry
B/C BUN/Creatinine Ratio ratio 999 Chemistry
CL Chloride mEq/L 999 Chemistry
FIBR Fibrinogen mg/dL 999 Chemistry
HDL High-Density Lipoprotein mg/dL 999 Chemistry
WBC White Blood Cells 10^3/uL 1 Hematology
NEUT% Neutrophils % 2 Hematology
BAND% Bands 3 Hematology
LYMPH% Lymphocytes % 4 Hematology
MONO% Monocytes % 5 Hematology
EOS% Eosinophils % 6 Hematology
BASO% Basophils % 7 Hematology
HCT Hematocrit % 8 Hematology
HGB Hemoglobin 9 Hematology
RBC Red Blood Cells 10^6/uL 10 Hematology
MCV Mean corpuscular volume fL 11 Hematology
MCH Mean corpuscular hemoglobin picograms 12 Hematology
MCHC Mean corpuscular hemoglobin concentration g/dL 13 Hematology
RETIC Reticulocytes % 14 Hematology
PLT Platelets 10^3/uL 15 Hematology
MYELO Myelocytes % 999 Hematology
MPV Mean platelet volume fl 999 Hematology
Anisocytosis Anisocytosis 999 Hematology
GLOB Globulin g/dL 999 Hematology
Hypochromic RBC Hypochromic RBC 999 Hematology
LUC Large unstained cells 999 Hematology
Macrocytic RBC Macrocytic RBC 999 Hematology
METAMYELO Metamyelocytes % 999 Hematology
Microcytic RBC Microcytic RBC 999 Hematology
NRBC Nucleated red blood cells 999 Hematology
PCV Packed cell volume % 999 Hematology
Polychromasia RBC Polychromasia RBC 999 Hematology
MPMN Neutrophils 999 Hematology
SEDRate Sedimentation rate 999 Hematology
RDW % 999 Hematology
NEUT# Neutrophil # 10^3/uL 16 Hematology
LYMPH# Lymphocyte # 10^3/uL 17 Hematology
MONO# Monocyte # 10^3/uL 18 Hematology
EOS# Eosinophil # 10^3/uL 19 Hematology
BASO# Basophil # 10^3/uL 20 Hematology
11 changes: 11 additions & 0 deletions BaseStudy/resources/data/lookup_sets.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
setname label keyfield titleColumn
amount_units Amount Units unit
calculated_status_codes Calculated Status Codes code
conc_units Concentraiton Units unit
dosage_units Dosage Units unit
gender_codes Gender Codes
geographic_origins Geographic Origins origin
routes Routes route
volume_units Volume Units unit
labwork_types Lab Tests test title
vl_sample_types Lab Tests test
22 changes: 22 additions & 0 deletions BaseStudy/resources/data/reports.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
reporttype category schemaname queryname viewname reporttitle subjectfieldname
query General study additionalDatatypes Additional Data
query Clinical study weight Weights
query Clinical study treatments Treatments/Medications
query Clinical study chemistryPivot Blood Chemistry
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 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
query Research study immunizations Immunizations
query General study flags Flags/Misc Information
query General study demographics Demographics
query General study demographics Project Summary Project Summary
query General study demographics MHC Type MHC Typing
query General study demographics Expanded Expanded Information
query Study Design studies timepointToDate Timepoints subjectId
query Study Design studies subjectAnchorDates Anchor Dates subjectId
24 changes: 24 additions & 0 deletions BaseStudy/resources/data/routes.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
value title
IM
intracardiac
intracarotid
intracorneal Intracorneal
intracranial
IP intraperitoneal
ID
INH
IT
IV
CRI
IVAG
oral
PO
rectal
Spillage
SQ
OU
OD
OS
topical
topical (eye)
topical (skin)
10 changes: 10 additions & 0 deletions BaseStudy/resources/data/species.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
common_name scientific_name id_prefix mhc_prefix blood_per_kg max_draw_pct blood_draw_interval cites_code dateDisabled
Baboon 60 0.2 30
Cotton-top Tamarin Saguinus oedipus so Saoe 60 0.2 30
Cynomolgus Macaca fascicularis cy Mafa 60 0.2 30
Marmoset Callithrix jacchus cj Caja 60 0.15 30
Pigtail Macaca Nemestrina Mane 60 0.2 30
Rhesus Macaca mulatta r|rh Mamu 60 0.2 30
Sooty Mangabey Cercocebus atys Ceat 60 0.2 30
Stump Tailed Macaca Arctoides Maar 60 0.2 30
Vervet Chlorocebus sabaeus ag Chsa 60 0.2 30
3 changes: 3 additions & 0 deletions BaseStudy/resources/data/vl_sample_types.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
value
Plasma
Cells
13 changes: 13 additions & 0 deletions BaseStudy/resources/data/volume_units.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
value
capsule(s)
cup
drop(s)
cube
mL
mL/hr
no units
ounce(s)
pan
piece(s)
tablet(s)
tsp
11 changes: 11 additions & 0 deletions BaseStudy/resources/queries/laboratory/reports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function afterInsert() {
org.labkey.api.laboratory.LaboratoryService.get().clearDataProviderCache();
}

function afterUpdate() {
org.labkey.api.laboratory.LaboratoryService.get().clearDataProviderCache();
}

function afterDelete() {
org.labkey.api.laboratory.LaboratoryService.get().clearDataProviderCache();
}
34 changes: 34 additions & 0 deletions BaseStudy/resources/queries/study/additionalDatatypes.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="additionalDatatypes" tableDbType="TABLE">
<columns>
<column columnName="Id">

</column>
<column columnName="date">

</column>
<column columnName="category">
<columnTitle>Category</columnTitle>
</column>
<column columnName="accessions">
<columnTitle>Accession #(s)</columnTitle>
<displayColumnFactory>
<className>org.labkey.studies.query.AccessionsDisplayColumnFactory</className>
</displayColumnFactory>
</column>
<column columnName="dataSource">
<columnTitle>Data Source</columnTitle>
</column>
<column columnName="description">
<columnTitle>Description</columnTitle>
</column>
<column columnName="comments">
<columnTitle>Comments</columnTitle>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
49 changes: 49 additions & 0 deletions BaseStudy/resources/queries/study/assignment.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="assignment" tableDbType="TABLE" useColumnOrder="true">
<columns>
<column columnName="Id"/>
<column columnName="date">
<columnTitle>Start Date</columnTitle>
<formatString>Date</formatString>
</column>
<column columnName="enddate">
<columnTitle>End Date</columnTitle>
<formatString>Date</formatString>
</column>
<column columnName="study">
<columnTitle>Study Name</columnTitle>
</column>
<column columnName="cohortId">
<columnTitle>Cohort ID</columnTitle>
<fk>
<fkDbSchema>studies</fkDbSchema>
<fkTable>studyCohorts</fkTable>
<fkColumnName>rowId</fkColumnName>
<fkDisplayColumnName>studyAndCohort</fkDisplayColumnName>
</fk>
</column>
<!-- Deprecated -->
<column columnName="subgroup">
<columnTitle>Sub-Group</columnTitle>
</column>
<!-- Deprecated -->
<column columnName="cohortAlias">
<columnTitle>Cohort Alias</columnTitle>
</column>
<column columnName="dataSource">
<columnTitle>Data Source</columnTitle>
</column>
<column columnName="category">
<columnTitle>Category</columnTitle>
</column>
<column columnName="description">
<columnTitle>Description</columnTitle>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
20 changes: 20 additions & 0 deletions BaseStudy/resources/queries/study/chemistryPivot.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="chemistryPivot" tableDbType="TABLE">
<tableTitle>Chemistry Results</tableTitle>
<javaCustomizer class="org.labkey.sivstudies.query.SivStudiesCustomizer"/>
<columns>
<column columnName="Id">
<conceptURI>http://cpas.labkey.com/Study#ParticipantId</conceptURI>
<fk>
<fkDbSchema>study</fkDbSchema>
<fkTable>animal</fkTable>
<fkColumnName>Id</fkColumnName>
</fk>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
24 changes: 24 additions & 0 deletions BaseStudy/resources/queries/study/chemistryPivot.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
SELECT
b.Id,
b.date,
b.method,
b.test,
group_concat(b.result) as result

FROM (SELECT
b.Id,
b.date,
b.test,
b.method,
CASE
WHEN b.result IS NULL THEN b.qualresult
ELSE CAST(CAST(b.result AS float) AS VARCHAR)
END as result
FROM study.labwork b
WHERE b.test.category = 'Chemistry' AND b.test.sort_order != 999
) b

GROUP BY b.id, b.date, b.test, b.method
PIVOT result BY test IN (select value from studies.labwork_types t WHERE t.sort_order != 999 AND t.category = 'Chemistry' order by sort_order)


Loading