From 9bf0ef5c2f883a860868bd68b1d65d64270060f6 Mon Sep 17 00:00:00 2001 From: Bruno Pacheco Date: Thu, 14 Nov 2024 15:40:39 +0100 Subject: [PATCH] feat: align beacon filters with Beacon Network options --- .../META-INF/resources/beacon-filters.json | 199 +++++++++++++----- .../quarkus/RetrieveFiltersTest.java | 11 +- 2 files changed, 145 insertions(+), 65 deletions(-) diff --git a/src/main/resources/META-INF/resources/beacon-filters.json b/src/main/resources/META-INF/resources/beacon-filters.json index dde25d5..ebbb908 100644 --- a/src/main/resources/META-INF/resources/beacon-filters.json +++ b/src/main/resources/META-INF/resources/beacon-filters.json @@ -2,16 +2,24 @@ { "source": "beacon", "type": "DROPDOWN", - "key": "ncit", - "label": "National Cancer Institute Thesaurus", + "key": "diseases", + "label": "Diseases", "values": [ { - "value": "NCIT:C25179", - "label": "Hospitalization" + "value": "NCIT:C4349", + "label": "Colon adenocarcinoma" }, { - "value": "NCIT:C171454", - "label": "Intensive Care Unit Stay" + "value": "NCIT:C7966", + "label": "Mucinous Adenocarcinoma of the Colon and Rectum" + }, + { + "value": "NCIT:C9383", + "label": "Rectal Adenocarcinoma" + }, + { + "value": "MONDO:0100096", + "label": "COVID-19" }, { "value": "NCIT:C14139", @@ -37,6 +45,10 @@ "value": "NCIT:C15289", "label": "Organ Transplantation" }, + { + "value": "NCIT:C3117", + "label": "Hypertension" + }, { "value": "NCIT:C3080", "label": "Congestive Heart Failure" @@ -61,91 +73,162 @@ }, { "source": "beacon", - "type": "FREE_TEXT", - "key": "BMI", - "label": "BMI in Kilograms per Square Meter", - "operators": [ - "=", - "!=", - ">", - "<", - "%" + "type": "DROPDOWN", + "key": "histopathology", + "label": "Histopathology", + "values": [ + { + "value": "ICD10:C18.2", + "label": "Ascending colon" + }, + { + "value": "ICD10:C18.6", + "label": "Descending colon" + }, + { + "value": "ICD10:C18.4", + "label": "Transverse colon" + }, + { + "value": "ICD10:C18.3", + "label": "Hepatic flexure" + }, + { + "value": "ICD10:C18.5", + "label": "Splenic flexure" + }, + { + "value": "ICD10:C18.7", + "label": "Sigmoid colon" + }, + { + "value": "ICD10:C18.0", + "label": "Caecum" + }, + { + "value": "NCIT:C27966", + "label": "Stage I" + }, + { + "value": "NCIT:C28054", + "label": "Stage II" + }, + { + "value": "NCIT:C27970", + "label": "Stage III" + }, + { + "value": "NCIT:C27971", + "label": "Stage IV" + } ] }, { "source": "beacon", - "type": "FREE_TEXT", - "key": "Height-standing", - "label": "Height-standing in Centimeters", - "operators": [ - "=", - "!=", - ">", - "<", - "%" + "type": "DROPDOWN", + "key": "treatment", + "label": "Treatment", + "values": [ + { + "value": "NCIT:C15313", + "label": "Radiation Therapy" + }, + { + "value": "NCIT:C15632", + "label": "Chemotherapy" + }, + { + "value": "NCIT:C505", + "label": "Fluorouracil" + }, + { + "value": "NCIT:C1181", + "label": "Oxaliplatin" + }, + { + "value": "NCIT:C1699", + "label": "Zoledronic Acid" + }, + { + "value": "NCIT:C62040", + "label": "Irinotecan" + } ] }, { "source": "beacon", - "type": "ENTRIES", - "key": "gene+aminoacid", - "label": "Mutations in:", - "entries": [ + "type": "DROPDOWN", + "key": "intervention", + "label": "Intervention", + "values": [ { - "key": "geneId", - "label": "gene" + "value": "NCIT:C25179", + "label": "Hospitalization" }, { - "key": "aminoacidChange", - "label": "aminoacid" + "value": "NCIT:C171454", + "label": "Intensive Care Unit Stay" + }, + { + "value": "SNOMED:52765003", + "label": "Intubation (procedure)" + }, + { + "value": "SNOMED:371907003", + "label": "Oxygen administration by nasal cannula" } ] }, { "source": "beacon", - "type": "ENTRIES", - "key": "gene", - "label": "Mutations in:", - "entries": [ + "type": "DROPDOWN", + "key": "sex", + "label": "Sex", + "values": [ { - "key": "geneId", - "label": "gene" + "value": "NCIT:C16576", + "label": "Female" + }, + { + "value": "NCIT:C20197", + "label": "Male" } ] }, + { + "source": "beacon", + "type": "FREE_TEXT", + "key": "diseases.ageOfOnset.iso8601duration", + "label": "Age", + "operators": [ + "=", + "!=", + ">", + "<", + "%" + ] + }, { "source": "beacon", "type": "ENTRIES", - "key": "bases", - "label": "Mutations in:", + "key": "genetic_mutation", + "label": "Genetic Mutation", "entries": [ { - "key": "alternateBases", - "label": "alternateBases" - }, - { - "key": "referenceBases", - "label": "referenceBases" - }, - { - "key": "start", - "label": "start" - }, - { - "key": "end", - "label": "end" + "key": "geneId", + "label": "gene" }, { - "key": "variantType", - "label": "type" + "key": "aminoacidChange", + "label": "aminoacid" } ] }, { "source": "beacon", "type": "ENTRIES", - "key": "bases+assembly", - "label": "Mutations in:", + "key": "genetic_variation", + "label": "Genetic Variation", "entries": [ { "key": "alternateBases", diff --git a/src/test/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/quarkus/RetrieveFiltersTest.java b/src/test/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/quarkus/RetrieveFiltersTest.java index cb298d7..b1901a1 100644 --- a/src/test/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/quarkus/RetrieveFiltersTest.java +++ b/src/test/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/quarkus/RetrieveFiltersTest.java @@ -47,12 +47,8 @@ void shouldRetrieveAllFilters_WhenAuthenticated() { .get("/api/v1/filters") .then() .statusCode(200) - .body("", hasSize(12)) .body("find { it.source == 'ckan' }.values", hasSize(greaterThan(0))) - .body("find { it.source == 'beacon' }.values", hasSize(greaterThan(0))) - .body("find { it.label == 'National Cancer Institute Thesaurus' }.values", hasSize( - greaterThan( - 0))); + .body("find { it.source == 'beacon' }.values", hasSize(greaterThan(0))); } @Test @@ -76,8 +72,9 @@ void shouldRetrievesBeaconFilteringTerms_WhenAuthenticated() { assertThat(actual) .containsExactlyInAnyOrder( - "ncit", "BMI", "Height-standing", "bases", "bases+assembly", "gene", - "gene+aminoacid" + "treatment", "genetic_variation", "sex", "histopathology", "diseases", + "intervention", + "diseases.ageOfOnset.iso8601duration", "genetic_mutation" ); } catch (Exception e) { throw new RuntimeException(e);