From 052d83e8652cda77174cc4dd3a0e491d9900153f Mon Sep 17 00:00:00 2001 From: Newatia Date: Thu, 7 Jul 2022 17:05:57 -0400 Subject: [PATCH] added Field Name Decorator --- .../AdverseEventFieldNameDecorator.java | 36 +++++++++++++++++++ .../main/resources/adverse-events-core.conf | 16 ++++++--- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/AdverseEventFieldNameDecorator.java diff --git a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/AdverseEventFieldNameDecorator.java b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/AdverseEventFieldNameDecorator.java new file mode 100644 index 0000000..eb9b37a --- /dev/null +++ b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/AdverseEventFieldNameDecorator.java @@ -0,0 +1,36 @@ +package gov.hhs.gsrs.adverseevents; + +import ix.core.FieldNameDecorator; + +import java.util.HashMap; +import java.util.Map; + +public class AdverseEventFieldNameDecorator implements FieldNameDecorator { + + private static final Map displayNames; + + static { + Map m = new HashMap<>(); + + m.put("root_name", "Ingredient Name"); + m.put("root_adverseEvent", "Adverse Event"); + m.put("root_routeOfAdmin", "Route of Administration"); + m.put("root_ptTermMeddra", "PT Term Meddra"); + m.put("root_dmeReactions", "DME Reactions"); + m.put("root_ptTerm", "PT Term"); + m.put("root_species", "Species"); + m.put("root_primSoc", "Prim SOC"); + + displayNames = m; + } + + @Override + public String getDisplayName(String field) { + String fdisp = displayNames.get(field); + if (fdisp == null) { + return field; + } + return fdisp; + } + +} diff --git a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/resources/adverse-events-core.conf b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/resources/adverse-events-core.conf index d0fe040..148ca26 100644 --- a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/resources/adverse-events-core.conf +++ b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/resources/adverse-events-core.conf @@ -1,5 +1,7 @@ include "gsrs-core.conf" +##******* SUBSTANCE CONFIG BEGIN ************** + #ix.structure{ # base = ${ix.home}/structure #} @@ -51,9 +53,6 @@ ix.core.exactsearchfields=[ } ] - - - ix.structure{ base = ${ix.home}/structure } @@ -553,4 +552,13 @@ gsrs.validators.substances += #} ## Disable MOLWITCH -gsrs.substances.molwitch.enabled=false \ No newline at end of file +gsrs.substances.molwitch.enabled=false + +##******* SUBSTANCE CONFIG END ****************** + +##******* ADVERSE EVENT CONFIG BEGIN ************** + +#Allows deep analysis of fields to do suggestions +ix.index.deepfieldsraw = "gov.hhs.gsrs.adverseevents.adverseeventpt.models.AdverseEventPt;gov.hhs.gsrs.adverseevents.adverseeventdme.models.AdverseEventDme;gov.hhs.gsrs.adverseevents.adverseeventcvm.models.AdverseEventCvm" + +##******* ADVERSE EVENT CONFIG END *************** \ No newline at end of file