From 364adc59ef5dffbf58c6d25b0908c9b015e6c7ba Mon Sep 17 00:00:00 2001 From: Terry J Hawkins Date: Mon, 26 Aug 2024 08:43:31 -0500 Subject: [PATCH] TAC updates for new ERP system changes and misc bug fix (#750) * - Added new columns to ehr.project table to accommodate speedkeys. In the process the cost_account data that was currently being placed in the account column was moved to the new cost_account column, and the account_id data is now placed in the account field. Speedkey is in the speedkey column. - updated the source view to supply the new column data - updated the query metadata in demographicsParentStatus.query.xml to fix Issue 339: Incorrect links on parents - added default view for ehr.project table - added the ehr.project table to browse all datasets * - Updated ehr.project default vies --- .../resources/domain-templates/ehr.template.xml | 8 ++++++++ .../resources/queries/ehr/project/.qview.xml | 16 ++++++++++++++++ .../resources/queries/study/BrowseDataSets.sql | 2 ++ .../study/demographicsParentStatus.query.xml | 6 +----- .../source_queries/create_v_charge_account.sql | 5 ++++- 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 snprc_ehr/resources/queries/ehr/project/.qview.xml diff --git a/snprc_ehr/resources/domain-templates/ehr.template.xml b/snprc_ehr/resources/domain-templates/ehr.template.xml index a978f738..1cccb366 100644 --- a/snprc_ehr/resources/domain-templates/ehr.template.xml +++ b/snprc_ehr/resources/domain-templates/ehr.template.xml @@ -22,6 +22,14 @@ string 2 + + Cost Account + string + + + Speedkey + string + diff --git a/snprc_ehr/resources/queries/ehr/project/.qview.xml b/snprc_ehr/resources/queries/ehr/project/.qview.xml new file mode 100644 index 00000000..9a425c84 --- /dev/null +++ b/snprc_ehr/resources/queries/ehr/project/.qview.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/snprc_ehr/resources/queries/study/BrowseDataSets.sql b/snprc_ehr/resources/queries/study/BrowseDataSets.sql index 8ea1643b..ffa8aee8 100644 --- a/snprc_ehr/resources/queries/study/BrowseDataSets.sql +++ b/snprc_ehr/resources/queries/study/BrowseDataSets.sql @@ -68,3 +68,5 @@ UNION select 'snprc_ehr' as schema, 'ClinPath' as CategoryId,'Urinalysis Results' as Label, 'HL7UrinalysisPivot' as Name, true as ShowByDefault, true as isAnimal UNION select 'ehr' as schema, 'Colony Management' as CategoryId,'Kinship' as Label, 'kinship' as Name, true as ShowByDefault, true as isAnimal +UNION +select 'ehr' as schema, 'Colony Management' as CategoryId,'Project' as Label, 'project' as Name, true as ShowByDefault, false as isAnimal diff --git a/snprc_ehr/resources/queries/study/demographicsParentStatus.query.xml b/snprc_ehr/resources/queries/study/demographicsParentStatus.query.xml index 8b196c48..be8792e8 100644 --- a/snprc_ehr/resources/queries/study/demographicsParentStatus.query.xml +++ b/snprc_ehr/resources/queries/study/demographicsParentStatus.query.xml @@ -9,11 +9,7 @@ Parent Id - - study - animal - id - + ehr/participantView.view?participantId=${Parent_id} Status diff --git a/snprc_ehr/resources/source_queries/create_v_charge_account.sql b/snprc_ehr/resources/source_queries/create_v_charge_account.sql index 1761f808..1fa67bbe 100644 --- a/snprc_ehr/resources/source_queries/create_v_charge_account.sql +++ b/snprc_ehr/resources/source_queries/create_v_charge_account.sql @@ -30,7 +30,9 @@ ALTER VIEW [labkey_etl].[v_charge_account] AS SELECT ca.charge_id AS project, CASE WHEN vcs.charge_id IS NULL THEN 'True' ELSE 'False' END AS research, - ca.cost_account AS account, + ca.cost_account AS cost_account, + ca.account_id AS account, + pca.speedkey AS speedkey, ca.working_iacuc AS protocol, coalesce(right(ca.working_iacuc, 2), vcs.arc_species_code) as species, ca.start_date AS startdate, @@ -46,6 +48,7 @@ ALTER VIEW [labkey_etl].[v_charge_account] AS FROM dbo.charge_account AS ca LEFT OUTER JOIN dbo.TAC_COLUMNS AS tc ON tc.object_id = ca.object_id LEFT OUTER JOIN dbo.valid_charge_by_species AS vcs ON ca.charge_id = vcs.charge_id + LEFT OUTER JOIN dbo.prd_cost_account AS pca on pca.account_id = ca.account_id GO