Data source/RO.TR/data model/entity/STARE FIRMA/mapping/CDQ/transformation

From CDQ
Jump to navigation Jump to search


Part of Hierarchical relation between two concepts of the CDQ Data Model. Data source RO.TR
Mapping source The source of a data model mapping. RO.TR STARE_FIRMABUSINESS_PARTNER_STATUS_TYPE
Transformation type A type of a transformation applied to a data model mapping. CUSTOM
Transformation parameter A transformation parameter is an action proccessed by a data model transformation. n/a
Description Informal and comprehensive human-readable definition of a concept. n/a

Transformation code Any code (in Python, JAVA or other) that will transform values for a given data source attributes.

def transform(raw_data):
    split = raw_data.split(",")
    if any(element in split for element in ["1048", "1054", "1139"]):
        return "ACTIVE"
    elif any(element in split for element in ["1074", "1084"]):
        return "INACTIVE"
    elif "1070" in split:
        return "DISSOLVED"
    elif "1052" in split:
        return "IN_LIQUIDATION"
    elif any(element in split for element in ["1049", "1054", "1055", "1094", "1098", "1100", "1105", "1107", "1113", "1114", "1119", "1133"]):
        return "INSOLVENCY"
    else:
        return "ACTIVE"