Skip to content

Commit

Permalink
fix for duckdb using duckdb specific cdmconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
brandantck committed May 9, 2024
1 parent 824d18f commit 74f6d21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ export const translateHanaToPostgres = (
temp = temp.replace(/TO_BIGINT(\(\"[\w]*\"\))/gi, "$1::bigint");
temp = temp.replace(/TO_DOUBLE(\(\"[\w]*\"\))/gi, "$1::double precision");
temp = temp.replace(/TO_DECIMAL(\([\w]*\))/gi, "$1::decimal");
temp =
dialect === "POSTGRES"
? temp.replace(/UPPER(\(\"[\w]*\"\.\"[\w]*\"\))/gi, "UPPER($1::varchar)")
: temp;
temp = temp.replace(
/UPPER(\([\"\w.]{2,}\))/gi,
"UPPER($1::varchar)",
);
temp = temp.replace(/to_nvarchar/gi, "");
temp = temp.replace(/nvarchar/gi, "VARCHAR");
temp = temp.replace(/\(SYSUUID\)/gi, "uuid_generate_v4()");
Expand Down
2 changes: 1 addition & 1 deletion services/query-gen-svc/src/api/controllers/cohort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function generateQuery(req: IMRIRequest, res, next) {
COHORT_START_DATE)
WITH cohortdata AS (
SELECT
"pTable"."PATIENT_ID" AS SUBJECT_ID,
"pTable".${placeholderMap["@PATIENT.PATIENT_ID"]} AS SUBJECT_ID,
%(cohortDefinitionId)f AS COHORT_DEFINITION_ID,
TO_DATE(%(cohortStartDateString)s, 'YYYY-MM-DD HH24:MI:SS') AS COHORT_START_DATE
${queryResponse.queryObject.queryString})
Expand Down

0 comments on commit 74f6d21

Please sign in to comment.