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

✨ AD-2303 add amount and amount units to sample and bs and kf target #695

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions kf_lib_data_ingest/common/concept_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ class SAMPLE(PropertyMixin):
class EVENT_AGE(QuantityMixin):
pass

class QUANTITY(QuantityMixin):
pass

class VOLUME(QuantityMixin):
# Keeping for backwards compatability. Use QUANTITY instead.
pass

SPATIAL_DESCRIPTOR = None
Expand All @@ -186,8 +190,6 @@ class VOLUME(QuantityMixin):
EXTERNAL_COLLECTION_ID = None

class BIOSPECIMEN(SAMPLE):
class QUANTITY(QuantityMixin):
pass

class CONCENTRATION(QuantityMixin):
pass
Expand Down
16 changes: 16 additions & 0 deletions kf_lib_data_ingest/target_api_plugins/kids_first_dataservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,14 @@ def build_entity(cls, record, get_target_id_from_record):
record.get(CONCEPT.SAMPLE.VOLUME_UL)
or record.get(CONCEPT.BIOSPECIMEN.VOLUME_UL)
),
"amount": (
record.get(CONCEPT.SAMPLE.QUANTITY.VALUE)
or record.get(CONCEPT.BIOSPECIMEN.QUANTITY.VALUE)
),
"amount_units": (
record.get(CONCEPT.SAMPLE.QUANTITY.UNITS)
or record.get(CONCEPT.BIOSPECIMEN.QUANTITY.UNITS)
),
}
return {
**cls.get_key_components(record, get_target_id_from_record),
Expand Down Expand Up @@ -689,6 +697,14 @@ def build_entity(cls, record, get_target_id_from_record):
record.get(CONCEPT.SAMPLE.VOLUME_UL)
or record.get(CONCEPT.BIOSPECIMEN.VOLUME_UL)
),
"amount": (
record.get(CONCEPT.SAMPLE.QUANTITY.VALUE)
or record.get(CONCEPT.BIOSPECIMEN.QUANTITY.VALUE)
),
"amount_units": (
record.get(CONCEPT.SAMPLE.QUANTITY.UNITS)
or record.get(CONCEPT.BIOSPECIMEN.QUANTITY.UNITS)
),
"specimen_status": (record.get(CONCEPT.BIOSPECIMEN.STATUS)),
"visible": record.get(CONCEPT.BIOSPECIMEN.VISIBLE),
"visibility_comment": record.get(
Expand Down
Loading