Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Oct 19, 2024
1 parent fba99c9 commit c4621e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions operators/manual_data_entry/mde_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def mde_organization_flow():
def mde_id(*args):
return 'mde:' + hasher(*map(str, args))

def mde_branch_id(row):
return mde_id(row['organization'], row['operating_unit'], row.get('address'), row.get('geocode'))
def mde_branch_id(row, prefix=''):
return mde_id(row['organization'], row['operating_unit'], row.get(prefix + 'address'), row.get(prefix + 'geocode'))

def branch_updater():
def func(row):
Expand Down Expand Up @@ -236,7 +236,7 @@ def mde_service_flow(data_sources, source_id, branch_ids):
'Service Website': 'urls',
}),
DF.add_field('operating_unit', 'string', lambda r: r.get('Org Short Name') or r.get('Org Name')),
DF.add_field('branch_id', 'string', lambda r: branch_ids[mde_branch_id(r)]),
DF.add_field('branch_id', 'string', lambda r: branch_ids[mde_branch_id(r, prefix='branch_')]),
DF.add_field('data', 'object', lambda r: dict(
name=r['name'],
description=r.get('description'),
Expand Down

0 comments on commit c4621e5

Please sign in to comment.