healthyregions / SDOHPlace

Landing page and data discovery application for SDOH Place Project.
https://sdohplace.org
GNU General Public License v3.0
1 stars 1 forks source link

Variables and labels within Details component #382

Open mradamcox opened 3 days ago

mradamcox commented 3 days ago

There are a few small changes @Makosak and I had discussed that we should implement on the frontend.

  1. We have added new field called "Featured variable" which is applicable to a handful of different metadata records.
    • In Solr, this variable is named sdoh_featured_variable_s and it's alias is featured_variable (I don't recall if aliases are used on the frontend, but just in case).
    • Please add this variable with label "Featured variable:" above the Methods Variables and Data Variables in the item details component--only show it if a value is present in the record.
  2. Change label of "Methods Variable" to "Measures and data input:"
  3. Change label of "Data Variables" to "What's in this dataset..."

Once we have a PR for this, we can solicit feedback for these labels from others, and perhaps they will be updated a bit.

pengyin-shan commented 3 days ago

@mradamcox , I noticed that the sdoh_featured_variable_s field is missing in both aardvark_schema.json and sdohplace_schema.json. I can add this field to sdohplace_schema.json. Just to confirm, should it be similar to:

  data_usage_notes": {
    "label": "Data Usage Notes",
    "uri": "sdoh_data_usage_notes_s",
    "data_type": "string",
    "multiple": false,
    "obligation": "optional",
    "controlled": false,
    "controlled_options": [],
    "schema": "SDOH Place",
    "display_group": "SDOH Place Project",
    "slug": "data-usage-notes",
    "widget": "text-area.html"
  }

right?

mradamcox commented 3 days ago

Ah, good catch. I forgot we have those schema files in this repo as well. Are they used for lookups? Here is the current schema file that we use in the metadata manager: https://github.com/healthyregions/SDOHPlace-MetadataManager/blob/main/manager/metadata/schemas/sdohplace.json.

Honestly it would be best to perhaps download that file into this repo at build time, so are not storing two versions of the schema in different places. Also, I'm sure we are no longer (or shouldn't be, at least) using the aardvark_schema.json file in this repo, and it can be removed.

Edit: You'll notice the shape of the schema file is a little different now, but the fields themselves still have all the same attributes.

pengyin-shan commented 3 days ago

Ah I see. Yes, there's a lookup to retrieve the corresponding variables from the schema file in the metadata folder. I can change it to fetch from https://github.com/healthyregions/SDOHPlace-MetadataManager/blob/main/manager/metadata/schemas/sdohplace.json if necessary, although it may introduce some data loading time. I don't think any modifications to the Solr object are needed, as all previous attributes are still present.

mradamcox commented 3 days ago

Sounds good, I'll leave it up to you whether to fetch the file now or not, what ever is quickest. We can also just look at this in the future to find a strategy for de-duplication, no need to take care of that now.