From bf902adeeb7683d3a6e44f6b5c3aff9173ebdbda Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Tue, 3 Dec 2024 15:48:21 -0500 Subject: [PATCH] KPMP-5702: Remove value labels --- src/helpers/dataHelper.js | 28 +++++++------- src/helpers/dataHelper.test.js | 68 ++++++++++++++++------------------ 2 files changed, 46 insertions(+), 50 deletions(-) diff --git a/src/helpers/dataHelper.js b/src/helpers/dataHelper.js index 188dba9..7d7c87a 100644 --- a/src/helpers/dataHelper.js +++ b/src/helpers/dataHelper.js @@ -60,18 +60,18 @@ export const mapSummaryKeysToPresentationStyle = (data) => { export const mapClinicalKeysToPresentationStyle = (data) => { const result = {}; - result['A1c %']= ""; - result['Albuminuria (mg)'] = ""; - result['Baseline eGFR (ml/min/1.73m2)'] = ""; - result['Diabetes Duration (Years)'] = ""; + result['A1c']= ""; + result['Albuminuria'] = ""; + result['Baseline eGFR'] = ""; + result['Diabetes Duration'] = ""; result['Diabetes History'] = ""; - result['Hypertension Duration (years)'] = ""; + result['Hypertension Duration'] = ""; result['Hypertension History'] = ""; result['KDIGO Stage'] = ""; result['RAAS Blockade'] = ""; - result['Proteinuria (mg)'] = ""; + result['Proteinuria'] = ""; result['Race'] = ""; - result['Age (Years)'] = ""; + result['Age'] = ""; result['Sample Type'] = ""; result['Sex'] = ""; result['Protocol'] = ""; @@ -81,22 +81,22 @@ export const mapClinicalKeysToPresentationStyle = (data) => { return result; } if (data.a1c) { - result['A1c %'] = data.a1c ? data.a1c : ""; + result['A1c'] = data.a1c ? data.a1c : ""; } if (data.albuminuria) { - result['Albuminuria (mg)'] = data.albuminuria ? data.albuminuria : ""; + result['Albuminuria'] = data.albuminuria ? data.albuminuria : ""; } if (data.baselineEgfr) { - result['Baseline eGFR (ml/min/1.73m2)'] = data.baselineEgfr ? data.baselineEgfr.replace(' ml/min/1.73m2', '') : ""; + result['Baseline eGFR'] = data.baselineEgfr ? data.baselineEgfr : ""; } if (data.diabetesDuration) { - result['Diabetes Duration (Years)'] = data.diabetesDuration ? data.diabetesDuration.replace(' Years', '') : ""; + result['Diabetes Duration'] = data.diabetesDuration ? data.diabetesDuration : ""; } if (data.diabetesHistory) { result['Diabetes History'] = data.diabetesHistory ? data.diabetesHistory : ""; } if (data.hypertensionDuration) { - result['Hypertension Duration (years)'] = data.hypertensionDuration ? data.hypertensionDuration.replace(' Years', '') : ""; + result['Hypertension Duration'] = data.hypertensionDuration ? data.hypertensionDuration : ""; } if (data.hypertensionHistory) { result['Hypertension History'] = data.hypertensionHistory ? data.hypertensionHistory : ""; @@ -108,13 +108,13 @@ export const mapClinicalKeysToPresentationStyle = (data) => { result['RAAS Blockade'] = data.onRaasBlockade ? data.onRaasBlockade : ""; } if (data.proteinuria) { - result['Proteinuria (mg)'] = data.proteinuria ? data.proteinuria : ""; + result['Proteinuria'] = data.proteinuria ? data.proteinuria : ""; } if (data.race) { result['Race'] = data.race ? data.race : ""; } if (data.ageBinned) { - result['Age (Years)'] = data.ageBinned ? data.ageBinned.replace(' Years', '') : ""; + result['Age'] = data.ageBinned ? data.ageBinned : ""; } if (data.sampleType) { diff --git a/src/helpers/dataHelper.test.js b/src/helpers/dataHelper.test.js index 57f3d06..7f85cfc 100644 --- a/src/helpers/dataHelper.test.js +++ b/src/helpers/dataHelper.test.js @@ -98,23 +98,22 @@ describe('dataHelper', () => { }; const clinicalMappingResult = mapClinicalKeysToPresentationStyle(clinicalUnmapped); const expectedClinicalMapping = { - 'A1c %': "test-a1c", - 'Albuminuria (mg)': 'test-albuminuria', - 'Baseline eGFR (ml/min/1.73m2)': 'test-baseline_egfr', - 'Diabetes Duration (Years)': 'test-diabetes_duration', + 'A1c': "test-a1c", + 'Albuminuria': 'test-albuminuria', + 'Baseline eGFR': 'test-baseline_egfr', + 'Diabetes Duration': 'test-diabetes_duration', 'Diabetes History': 'test-diabetes_history', - 'Hypertension Duration (years)': 'test-hypertension_duration', + 'Hypertension Duration': 'test-hypertension_duration', 'Hypertension History': 'test-hypertension_history', 'KDIGO Stage': 'testdkigo_stage', 'RAAS Blockade': 'test-on_raas_blockade', - 'Proteinuria (mg)': 'proteinuria', + 'Proteinuria': 'proteinuria', 'Race': 'test-race', - 'Age (Years)': 'test-Age', + 'Age': 'test-age', 'Sample Type': 'test-sample_type', 'Sex': 'test-sex', 'Protocol': 'test-protocol', - 'Tissue Source': 'test-tissue_source', - 'Age (Years)': 'test-age' + 'Tissue Source': 'test-tissue_source' } expect(clinicalMappingResult).toEqual(expectedClinicalMapping); }), @@ -125,23 +124,22 @@ describe('dataHelper', () => { }; const clinicalMappingResult = mapClinicalKeysToPresentationStyle(clinicalUnmapped); const expectedClinicalMapping = { - 'A1c %': "test-a1c", - 'Albuminuria (mg)': 'test-albuminuria', - 'Baseline eGFR (ml/min/1.73m2)': '', - 'Diabetes Duration (Years)': '', + 'A1c': "test-a1c", + 'Albuminuria': 'test-albuminuria', + 'Baseline eGFR': '', + 'Diabetes Duration': '', 'Diabetes History': '', - 'Hypertension Duration (years)': '', + 'Hypertension Duration': '', 'Hypertension History': '', 'KDIGO Stage': '', 'RAAS Blockade': '', - 'Proteinuria (mg)': '', + 'Proteinuria': '', 'Race': '', - 'Age (Years)': '', + 'Age': '', 'Sample Type': '', 'Sex': '', 'Protocol': '', - 'Tissue Source': '', - 'Age (Years)': '' + 'Tissue Source': '' }; expect(clinicalMappingResult).toEqual(expectedClinicalMapping); }), @@ -149,23 +147,22 @@ describe('dataHelper', () => { let clinicalUnmapped = {}; const clinicalMappingResult = mapClinicalKeysToPresentationStyle(clinicalUnmapped); const expectedClinicalMapping = { - 'A1c %': "", - 'Albuminuria (mg)': '', - 'Baseline eGFR (ml/min/1.73m2)': '', - 'Diabetes Duration (Years)': '', + 'A1c': "", + 'Albuminuria': '', + 'Baseline eGFR': '', + 'Diabetes Duration': '', 'Diabetes History': '', - 'Hypertension Duration (years)': '', + 'Hypertension Duration': '', 'Hypertension History': '', 'KDIGO Stage': '', 'RAAS Blockade': '', - 'Proteinuria (mg)': '', + 'Proteinuria': '', 'Race': '', - 'Age (Years)': '', + 'Age': '', 'Sample Type': '', 'Sex': '', 'Protocol': '', - 'Tissue Source': '', - 'Age (Years)': '' + 'Tissue Source': '' }; expect(clinicalMappingResult).toEqual(expectedClinicalMapping); }), @@ -173,23 +170,22 @@ describe('dataHelper', () => { let clinicalUnmapped = null; const clinicalMappingResult = mapClinicalKeysToPresentationStyle(clinicalUnmapped); const expectedClinicalMapping = { - 'A1c %': "", - 'Albuminuria (mg)': '', - 'Baseline eGFR (ml/min/1.73m2)': '', - 'Diabetes Duration (Years)': '', + 'A1c': "", + 'Albuminuria': '', + 'Baseline eGFR': '', + 'Diabetes Duration': '', 'Diabetes History': '', - 'Hypertension Duration (years)': '', + 'Hypertension Duration': '', 'Hypertension History': '', 'KDIGO Stage': '', 'RAAS Blockade': '', - 'Proteinuria (mg)': '', + 'Proteinuria': '', 'Race': '', - 'Age (Years)': '', + 'Age': '', 'Sample Type': '', 'Sex': '', 'Protocol': '', - 'Tissue Source': '', - 'Age (Years)': '' + 'Tissue Source': '' }; expect(clinicalMappingResult).toEqual(expectedClinicalMapping); })