cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
90 stars 23 forks source link

Feature request: Hidden slots & values when exporting #337

Open Takadonet opened 1 year ago

Takadonet commented 1 year ago

Is it possible in schema_enums/schema_slots tsv files that you can have a hidden column(s) with default value(s) that are sent when an user clicks on export/save as?

Example : Column lab_received with value 3453 for each rows when exporting/save as.

I know this can be done in the export.js to each specific template . Issue with that approach is that someone with knowledge of JavaScript has to add theses values in. Our goal is to have a non IT background for creating/editing all values schema_enums/schema_slots** files to be exported from DH. It becomes less magic** from their point of view since they can see in the schema tsv files that the values are there.

ddooley commented 1 year ago

First, possibly we could use LinkML's facility for default values for fields. One issue is whether people are allowed to keep a field empty, which would clash with adding a default value for any existing records. Possibly we only have the default value thing kick in for newly added records. See https://github.com/cidgoh/DataHarmonizer/issues/316

Second, we should find out if LinkML wants to add UI annotations to slots such as "hidden field". This and the above function could accomplish what you want without any custom coding.