From dccb93940db11d7931ff7b0a3c418419805af88e Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Tue, 12 Nov 2024 16:34:28 -0500 Subject: [PATCH] Add configuration files and HTTP requests setup Included configuration properties for development environments in `application-bdc-dev.properties` and added a sample `weights.csv` file. Also, created HTTP request scripts for dictionary API and provided Docker commands for local development in the README. --- dictionaryweights/README.md | 11 +++++++++++ .../main/resources/application-bdc-dev.properties | 9 +++++++++ dictionaryweights/weights.csv | 7 +++++++ dictonaryReqeust.http | 15 +++++++++++++++ src/main/resources/application-bdc-dev.properties | 14 ++++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 dictionaryweights/README.md create mode 100644 dictionaryweights/src/main/resources/application-bdc-dev.properties create mode 100644 dictionaryweights/weights.csv create mode 100644 dictonaryReqeust.http create mode 100644 src/main/resources/application-bdc-dev.properties diff --git a/dictionaryweights/README.md b/dictionaryweights/README.md new file mode 100644 index 0000000..39e6352 --- /dev/null +++ b/dictionaryweights/README.md @@ -0,0 +1,11 @@ +## Docker commands for local development +### Docker build +```bash +docker build --no-cache --build-arg SPRING_PROFILE=bdc-dev -t weights:latest . +``` + +### Docker run +You will need a local weights.csv file. +```bash + docker run --rm -t --name dictionary-weights --network=host -v ./weights.csv:/weights.csv weights:latest +``` \ No newline at end of file diff --git a/dictionaryweights/src/main/resources/application-bdc-dev.properties b/dictionaryweights/src/main/resources/application-bdc-dev.properties new file mode 100644 index 0000000..5b79313 --- /dev/null +++ b/dictionaryweights/src/main/resources/application-bdc-dev.properties @@ -0,0 +1,9 @@ +spring.application.name=dictionaryweights +spring.main.web-application-type=none + +spring.datasource.url=jdbc:postgresql://localhost:5432/dictionary_db?currentSchema=dict +spring.datasource.username=username +spring.datasource.password=password +spring.datasource.driver-class-name=org.postgresql.Driver + +weights.filename=/weights.csv \ No newline at end of file diff --git a/dictionaryweights/weights.csv b/dictionaryweights/weights.csv new file mode 100644 index 0000000..d3cc913 --- /dev/null +++ b/dictionaryweights/weights.csv @@ -0,0 +1,7 @@ +concept_node.DISPLAY,2 +concept_node.CONCEPT_PATH,2 +dataset.FULL_NAME,1 +dataset.DESCRIPTION,1 +parent.DISPLAY,1 +grandparent.DISPLAY,1 +concept_node_meta_str,1 \ No newline at end of file diff --git a/dictonaryReqeust.http b/dictonaryReqeust.http new file mode 100644 index 0000000..ec3f071 --- /dev/null +++ b/dictonaryReqeust.http @@ -0,0 +1,15 @@ +# curl 'https://dev.picsure.biodatacatalyst.nhlbi.nih.gov/picsure/proxy/dictionary-api/concepts?page_number=1&page_size=1' +# -H 'origin: https://dev.picsure.biodatacatalyst.nhlbi.nih.gov' +# -H 'referer: https://dev.picsure.biodatacatalyst.nhlbi.nih.gov/' +# --data-raw '{"facets":[],"search":"","consents":[]}' +POST http://localhost:80/concepts?page_number=1&page_size=100 +Content-Type: application/json + +{"facets":[],"search":"age","consents":[]} + +### + +POST http://localhost:80/search +Content-Type: application/json + +{"query":{"searchTerm":"AGEDIANA","includedTags":[],"excludedTags":[],"returnTags":"true","offset":0,"limit":5}} \ No newline at end of file diff --git a/src/main/resources/application-bdc-dev.properties b/src/main/resources/application-bdc-dev.properties new file mode 100644 index 0000000..219dfbb --- /dev/null +++ b/src/main/resources/application-bdc-dev.properties @@ -0,0 +1,14 @@ +spring.application.name=dictionary +spring.datasource.url=jdbc:postgresql://localhost:5432/dictionary_db?currentSchema=dict +spring.datasource.username=username +spring.datasource.password=password +spring.datasource.driver-class-name=org.postgresql.Driver +server.port=80 + +dashboard.columns={abbreviation:'Abbreviation',name:'Name',clinvars:'Clinical Variables'} +dashboard.column-order=abbreviation,name,clinvars +dashboard.nonmeta-columns=abbreviation,name +dashboard.enable.extra_details=true +dashboard.enable.bdc_hack=true + +filtering.unfilterable_concepts=stigmatized \ No newline at end of file