Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: json fields charts and search #498

Merged
merged 22 commits into from
Apr 24, 2024
Merged

Conversation

v-rocheleau
Copy link
Contributor

@v-rocheleau v-rocheleau commented Apr 8, 2024

Allows the use of JSONField with array values for public charts and search.

String field props

mapping : must end at the JSONField's name
group_by (NEW) : mapping-like path pointing to the element key within the JSONField

Number field props

mapping : must end at the JSONField's name
group_by (NEW) : mapping-like path pointing to the element key within the JSONField
group_by_value (NEW) : value to perform grouping on (e.g. only get measurements where assay/id is equal to "NCIT:C200479")
value_mapping (NEW) : mapping-like path pointing to the number key for elements of the JSONField

Example fields config

{
    "fields": {
        "diagnostic_markers": {
            "mapping": "individual/phenopackets/biosamples/diagnostic_markers",
            "group_by": "label",
            "title": "Diagnostic Markers",
            "description": "Markers used for diagnosis",
            "datatype": "string",
            "config": {
                "enum": null
            }
        },
        "measurement_type": {
            "mapping": "individual/phenopackets/measurements",
            "group_by": "assay/label",
            "title": "Measurement types",
            "description": "types of measurements performed",
            "datatype": "string",
            "config": {
                "enum": null
            }
        },
        "measurement_tumor_length": {
            "mapping": "individual/phenopackets/measurements",
            "group_by": "assay/id",
            "group_by_value": "NCIT:C200479",
            "value_mapping": "value/quantity/value",
            "title": "Tumor lengths",
            "description": "measured tumor lengths in millimeters",
            "datatype": "number",
            "config": {
                "minimum": 0,
                "maximum": 200,
                "bin_size": 20,
                "taper_left": 0,
                "taper_right": 200,
                "units": "mm"
            }
        }
    }
}

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.25%. Comparing base (2b4b8d5) to head (32f31e5).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #498      +/-   ##
===========================================
+ Coverage    88.10%   88.25%   +0.15%     
===========================================
  Files          128      128              
  Lines         4572     4632      +60     
  Branches       671      683      +12     
===========================================
+ Hits          4028     4088      +60     
  Misses         390      390              
  Partials       154      154              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidlougheed
Copy link
Member

this will need to be reconciled with #496 which moves a lot of functions around

@v-rocheleau v-rocheleau marked this pull request as ready for review April 15, 2024 20:21
@davidlougheed davidlougheed changed the title fix: json fields charts and search feat: json fields charts and search Apr 22, 2024
@davidlougheed
Copy link
Member

@v-rocheleau COMPUTED_PROPERTY_PREFIX is still present twice - can you consolidate this? (it might be from before)

Copy link
Member

@davidlougheed davidlougheed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@v-rocheleau v-rocheleau merged commit f4911c8 into develop Apr 24, 2024
7 checks passed
@v-rocheleau v-rocheleau deleted the fix/json-field-stats branch April 24, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants