Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7BiochemistryPivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Biochemistry Results Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SELECT
obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand All @@ -20,6 +21,6 @@ GROUP BY obr.ANIMAL_ID, obr.OBSERVATION_DATE_TM, obr.MESSAGE_ID, COALESCE (lp.Se

IN
(
select DISTINCT TestName as TEST_NAME from snprc_ehr.labwork_panels t
select DISTINCT ltrim(Rtrim(TestName)) as TEST_NAME from snprc_ehr.labwork_panels t
where t.includeInPanel = true AND t.ServiceId.Dataset='Biochemistry'
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!-- $S is the escape code for / -->
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="Id"/>
<column name="Date"/>
<column name="CREATININE::RESULT"/>
<column name="CREATININE::ABNORMAL_FLAGS"/>
<column name="GLUCOSE::RESULT"/>
<column name="GLUCOSE::ABNORMAL_FLAGS"/>
<column name="BUN$SCREAT RATIO::RESULT"/>
<column name="BUN$SCREAT RATIO::ABNORMAL_FLAGS"/>
<column name="TOTAL PROTEIN::RESULT"/>
<column name="TOTAL PROTEIN::ABNORMAL_FLAGS"/>
<column name="ALBUMIN::RESULT"/>
<column name="ALBUMIN::ABNORMAL_FLAGS"/>
<column name="GLOBULIN (CALC)::RESULT"/>
<column name="GLOBULIN (CALC)::ABNORMAL_FLAGS"/>
<column name="A$SG RATIO (CALC)::RESULT"/>
<column name="A$SG RATIO (CALC)::ABNORMAL_FLAGS"/>
<column name="ALT $S SGPT::RESULT"/>
<column name="ALT $S SGPT::ABNORMAL_FLAGS"/>
<column name="AST $S SGOT::RESULT"/>
<column name="AST $S SGOT::ABNORMAL_FLAGS"/>
<column name="ALK PHOSPHATASE::RESULT"/>
<column name="ALK PHOSPHATASE::ABNORMAL_FLAGS"/>
<column name="SODIUM::RESULT"/>
<column name="SODIUM::ABNORMAL_FLAGS"/>
<column name="POTASSIUM::RESULT"/>
<column name="POTASSIUM::ABNORMAL_FLAGS"/>
<column name="CHLORIDE::RESULT"/>
<column name="CHLORIDE::ABNORMAL_FLAGS"/>
<column name="CARBON DIOXIDE::RESULT"/>
<column name="CARBON DIOXIDE::ABNORMAL_FLAGS"/>
<column name="ANION GAP (CALC)::RESULT"/>
<column name="ANION GAP (CALC)::ABNORMAL_FLAGS"/>
<column name="COMMENT"/>
</columns>
<sorts>
<sort column="Id"/>
<sort column="Date" descending="true"/>
</sorts>
</customView>

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7CulturePivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Culture and Sensitivity Results Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
1 change: 1 addition & 0 deletions snprc_ehr/resources/queries/snprc_ehr/HL7CulturePivot.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SELECT
obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7HematologyPivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Hematology Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SELECT
obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7HistologyPivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Histology Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SELECT obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand Down
7 changes: 7 additions & 0 deletions snprc_ehr/resources/queries/snprc_ehr/HL7MiscPivot.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7MiscPivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Misc Tests Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
1 change: 1 addition & 0 deletions snprc_ehr/resources/queries/snprc_ehr/HL7MiscPivot.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SELECT obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7ParasitologyPivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Parasitology Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SELECT obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7SurveillancePivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Surveillance Pivot</tableTitle>
<columns>
<column columnName="PROCEDURE_NAME">
<isHidden>true</isHidden>
</column>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
select Id,
date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
Outdated
Comment thread
spamhurts marked this conversation as resolved.
Outdated
PROCEDURE_NAME,
PROCEDURE_ID,
COMMENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7UnknownPivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Unknown Panel Category Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
1 change: 1 addition & 0 deletions snprc_ehr/resources/queries/snprc_ehr/HL7UnknownPivot.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SELECT
obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand Down
7 changes: 7 additions & 0 deletions snprc_ehr/resources/queries/snprc_ehr/HL7Urinalysis.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="HL7UrinalysisPivot" tableDbType="NOT_IN_DB">
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Comment thread
spamhurts marked this conversation as resolved.
<tableTitle>Urinalysis Pivot</tableTitle>
<columns>
<column columnName="Key">
<isKeyField>true</isKeyField>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SELECT
obr.ANIMAL_ID as id,
obr.OBSERVATION_DATE_TM as date,
obr.ANIMAL_ID || '-' || CAST(obr.OBSERVATION_DATE_TM AS VARCHAR) as key,
Comment thread
spamhurts marked this conversation as resolved.
obr.MESSAGE_ID,
COALESCE (lp.ServiceId.ServiceName, obr.PROCEDURE_NAME) as PROCEDURE_NAME,
obr.PROCEDURE_ID,
Expand Down
10 changes: 10 additions & 0 deletions snprc_ehr/src/org/labkey/snprc_ehr/table/SNPRC_EHRCustomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public void doSharedCustomization(AbstractTableInfo ti)
{
ti.getMutableColumn("project").setLabel("Charge Id");
}

}

public UserSchema getEHRUserSchema(AbstractTableInfo ds, String name)
Expand Down Expand Up @@ -202,6 +203,14 @@ public void doTableSpecificCustomizations(AbstractTableInfo ti)
{
customizeTasks(ti);
}

// add assignments and age to hl7 pivot tables
if (ti.getName().toLowerCase().contains("hl7") && ti.getName().toLowerCase().contains("pivot")) {
UserSchema snprc_ehrSchema = getEHRUserSchema(ti, SNPRC_EHRSchema.NAME);
appendAssignmentAtTimeColumn(snprc_ehrSchema, ti, DATE_COLUMN);
appendAgeAtTimeColumn(snprc_ehrSchema, ti, DATE_COLUMN);
}

}

/**
Expand All @@ -225,6 +234,7 @@ private void addCalculatedColumns(AbstractTableInfo table)
appendAssignmentAtTimeColumn(ehrSchema, table, DATE_COLUMN);
appendAgeAtTimeColumn(ehrSchema, table, DATE_COLUMN);
}

}

/**
Expand Down
Loading