diff --git a/kf_lib_data_ingest/common/concept_schema.py b/kf_lib_data_ingest/common/concept_schema.py index ed35de1a..82568c92 100644 --- a/kf_lib_data_ingest/common/concept_schema.py +++ b/kf_lib_data_ingest/common/concept_schema.py @@ -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 @@ -186,8 +190,6 @@ class VOLUME(QuantityMixin): EXTERNAL_COLLECTION_ID = None class BIOSPECIMEN(SAMPLE): - class QUANTITY(QuantityMixin): - pass class CONCENTRATION(QuantityMixin): pass diff --git a/kf_lib_data_ingest/target_api_plugins/kids_first_dataservice.py b/kf_lib_data_ingest/target_api_plugins/kids_first_dataservice.py index 43a633d2..6903630a 100644 --- a/kf_lib_data_ingest/target_api_plugins/kids_first_dataservice.py +++ b/kf_lib_data_ingest/target_api_plugins/kids_first_dataservice.py @@ -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), @@ -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(