Skip to content

Commit

Permalink
Merge pull request #1383 from pascagihozo/develop
Browse files Browse the repository at this point in the history
additional labs column in csv routine expoert
  • Loading branch information
mozzy11 authored Jan 9, 2025
2 parents fb57bf7 + 207f025 commit eba3d71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ protected void appendOtherDiseaseCrosstab(Date lowDate, Date highDate, SQLConsta

protected void defineBasicColumns() {
add("accession_number", "LABNO", NONE);
add("lab_unit", "LAB_UNIT", NONE);
add("national_id", "IDENTIFIER", NONE);
add("gender", "SEX", NONE);
add("birth_date", "BIRTHDATE", DATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ protected void appendResultCrosstab(java.sql.Date lowDate, java.sql.Date highDat
+ " join clinlims.sample AS s on s.id = si.samp_id \n"
+ " join clinlims.test_result AS tr on r.test_result_id = tr.id \n"
+ " join clinlims.test AS t on tr.test_id = t.id \n"
+ " join clinlims.test_section ts on t.test_section_id = ts.id \n"
+ " left join sample_projects sp on si.samp_id = sp.samp_id \n" + "\n"
+ " WHERE sp.id IS NULL AND s.entered_date >= date(''" + formatDateForDatabaseSql(lowDate)
+ "'') AND s.entered_date <= date(''" + formatDateForDatabaseSql(highDate) + " '') " + "\n "
Expand Down Expand Up @@ -631,7 +632,11 @@ protected void appendObservationHistoryCrosstab(java.sql.Date lowDate, java.sql.
}

protected void appendCrosstabPreamble(SQLConstant listName) {
query.append(", \n\n ( SELECT s.id AS samp_id, " + listName + ".* " + " FROM sample AS s LEFT JOIN \n ");
query.append(", \n\n ( SELECT s.id AS samp_id, " + " (SELECT ts.name FROM clinlims.test_section ts "
+ " JOIN clinlims.test t ON t.test_section_id = ts.id "
+ " JOIN clinlims.analysis a ON a.test_id = t.id "
+ " WHERE a.sampitem_id = si.id LIMIT 1) as lab_unit, " + listName + ".* " + " FROM sample AS s "
+ " LEFT JOIN sample_item si ON s.id = si.samp_id " + " LEFT JOIN \n ");
}

protected void appendCrosstabPostfix(java.sql.Date lowDate, java.sql.Date highDate, SQLConstant listName) {
Expand Down

0 comments on commit eba3d71

Please sign in to comment.