(domain, item)
return mu_ref[0].get('MeasurementUnitOID') if mu_ref else None
Return the measurement unit OID for the given Item, or None
Return the measurement unit OID for the given Item, or None
Return the measurement unit OID for the given Item or None
def get_item_measurement_unit(domain, item):
    """
    Return the measurement unit OID for the given Item, or None
    """
    xml = get_study_metadata(domain)
    mu_ref = xml.xpath(
        './odm:Study/odm:MetaDataVersion/odm:ItemDef[@OID="{}"]/odm:MeasurementUnitRef'.format(item.item_oid),
        namespaces=odm_nsmap)
    return mu_ref[0].get('MeasurementUnitOID') if mu_ref else None
def get_item_measurement_unit ( domain , item ) : xml = get_study_metadata ( domain ) mu_ref = xml . xpath ( './odm:Study/odm:MetaDataVersion/odm:ItemDef[@OID="{}"]/odm:MeasurementUnitRef' . format ( item . item_oid ) , namespaces = odm_nsmap ) return mu_ref [ 0 ] . get ( 'MeasurementUnitOID' ) if mu_ref else None