Difference between revisions of "Data source/PEPPOL/data model/businessEntity/entity/id/3/scheme/mapping/CDQ/transformation"
Jump to navigation
Jump to search
(Template parameters updated.) |
(Template parameters updated.) |
||
Line 1: | Line 1: | ||
{{Data model transformation | {{Data model transformation | ||
| data source = Data source/PEPPOL | | data source = Data source/PEPPOL | ||
− | | transformation type = | + | | transformation type = CUSTOM_TRANSFORMATION |
| transformation code = def transform(raw_data): | | transformation code = def transform(raw_data): | ||
− | names = raw_data.split( | + | names = [elem.upper().strip() for elem in raw_data.split(';')] |
− | if | + | if names[0] == 'CBE': |
− | + | result = names[1] + '_ENT_NO' | |
− | elif | + | elif names[0] == 'KVK': |
− | + | result = 'KVK_NL' | |
− | elif | + | elif names[0] == 'GLN': |
− | + | result = 'GS1_GLN' | |
− | elif | + | elif names[0] == 'CVR': |
− | + | result = 'CVR_DK' | |
− | elif | + | elif names[0] == 'EN': |
− | + | result = names[1] + '_ENT_NO' | |
− | elif | + | elif names[0] == 'ORG': |
− | + | result = names[1] + '_ORG_ID' | |
− | elif | + | elif names[0] == 'SIRENE': |
− | + | result = 'FR_SIREN' | |
− | elif | + | elif names[0] == 'SIRET': |
− | + | result = 'FR_SIRET' | |
− | elif | + | elif names[0] == '0007' and names[1]=='SE': |
− | + | result = 'SE_ORG_ID' | |
− | elif | + | elif names[0] == 'ORGNR' and names[1]=='SE': |
− | + | result = 'SE_ORG_ID' | |
+ | elif names[0] == 'ORGNR' and names[1]=='NO': | ||
+ | result = 'NO_ORGID' | ||
+ | elif names[0] == 'ORGNR' and names[1]=='FI': | ||
+ | result = 'BIC_FI' | ||
+ | elif names[0] == 'ORGNR' and names[1]=='UK': | ||
+ | result = 'ID_CRN' | ||
+ | elif names[0] == 'ORGNR' and names[1]=='DK': | ||
+ | result = 'CVR_DK' | ||
+ | elif names[0] == 'VAT' and names[1]=='NO': | ||
+ | result = 'VAT_ID_NO' | ||
+ | elif names[0] == 'VAT': | ||
+ | result = 'EU_VAT_ID_' + names[1] | ||
else: | else: | ||
− | + | result = names[0] | |
+ | return result | ||
+ | |||
| sources = Data source/PEPPOL/data model/businessEntity/entity/id/3/scheme/mapping/CDQ | | sources = Data source/PEPPOL/data model/businessEntity/entity/id/3/scheme/mapping/CDQ | ||
}} | }} |
Latest revision as of 10:30, 16 May 2025
Part of Hierarchical relation between two concepts of the CDQ Data Model. | Data source PEPPOL |
---|---|
Mapping source The source of a data model mapping. | PEPPOL entity_id_3_scheme , entity_countrycode ↣ IDENTIFIER_TYPE
|
Transformation type A type of a transformation applied to a data model mapping. | CUSTOM_TRANSFORMATION"CUSTOM_TRANSFORMATION" is not in the list (UPPER_CASE, LOWER_CASE, CUSTOM) of allowed values for the "Has transformation type" property.
|
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):
names = [elem.upper().strip() for elem in raw_data.split(';')]
if names[0] == 'CBE':
result = names[1] + '_ENT_NO'
elif names[0] == 'KVK':
result = 'KVK_NL'
elif names[0] == 'GLN':
result = 'GS1_GLN'
elif names[0] == 'CVR':
result = 'CVR_DK'
elif names[0] == 'EN':
result = names[1] + '_ENT_NO'
elif names[0] == 'ORG':
result = names[1] + '_ORG_ID'
elif names[0] == 'SIRENE':
result = 'FR_SIREN'
elif names[0] == 'SIRET':
result = 'FR_SIRET'
elif names[0] == '0007' and names[1]=='SE':
result = 'SE_ORG_ID'
elif names[0] == 'ORGNR' and names[1]=='SE':
result = 'SE_ORG_ID'
elif names[0] == 'ORGNR' and names[1]=='NO':
result = 'NO_ORGID'
elif names[0] == 'ORGNR' and names[1]=='FI':
result = 'BIC_FI'
elif names[0] == 'ORGNR' and names[1]=='UK':
result = 'ID_CRN'
elif names[0] == 'ORGNR' and names[1]=='DK':
result = 'CVR_DK'
elif names[0] == 'VAT' and names[1]=='NO':
result = 'VAT_ID_NO'
elif names[0] == 'VAT':
result = 'EU_VAT_ID_' + names[1]
else:
result = names[0]
return result
names = [elem.upper().strip() for elem in raw_data.split(';')]
if names[0] == 'CBE':
result = names[1] + '_ENT_NO'
elif names[0] == 'KVK':
result = 'KVK_NL'
elif names[0] == 'GLN':
result = 'GS1_GLN'
elif names[0] == 'CVR':
result = 'CVR_DK'
elif names[0] == 'EN':
result = names[1] + '_ENT_NO'
elif names[0] == 'ORG':
result = names[1] + '_ORG_ID'
elif names[0] == 'SIRENE':
result = 'FR_SIREN'
elif names[0] == 'SIRET':
result = 'FR_SIRET'
elif names[0] == '0007' and names[1]=='SE':
result = 'SE_ORG_ID'
elif names[0] == 'ORGNR' and names[1]=='SE':
result = 'SE_ORG_ID'
elif names[0] == 'ORGNR' and names[1]=='NO':
result = 'NO_ORGID'
elif names[0] == 'ORGNR' and names[1]=='FI':
result = 'BIC_FI'
elif names[0] == 'ORGNR' and names[1]=='UK':
result = 'ID_CRN'
elif names[0] == 'ORGNR' and names[1]=='DK':
result = 'CVR_DK'
elif names[0] == 'VAT' and names[1]=='NO':
result = 'VAT_ID_NO'
elif names[0] == 'VAT':
result = 'EU_VAT_ID_' + names[1]
else:
result = names[0]
return result