Skip to content

Commit 80872d0

Browse files
committed
[SHARE- ][Fix] Add department affiliations on PIs
1 parent a968655 commit 80872d0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

providers/gov/nih/normalizer.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,15 @@ class PIContactAgent(Parser):
189189
schema = 'Person'
190190

191191
name = ctx.PI_NAME
192-
related_agents = tools.Map(tools.Delegate(FullIsAffiliatedWith), ctx['org_ctx'])
192+
related_agents = tools.Concat(
193+
tools.Map(tools.Delegate(FullIsAffiliatedWith), ctx['org_ctx']),
194+
tools.Map(tools.Delegate(DeptIsAffiliatedWith), RunPython('if_dept', ctx))
195+
)
196+
197+
def if_dept(self, ctx):
198+
if ctx['org_ctx']['ORG_DEPT']:
199+
return {**ctx['org_ctx'], 'hash_breaker': True}
200+
return None
193201

194202
class Extra:
195203
pi_id = RunPython(filter_nil, ctx.PI_ID)

0 commit comments

Comments
 (0)