2024-04-18 18:57:55 -04:00
|
|
|
import tmp
|
2024-04-25 19:43:20 -04:00
|
|
|
|
|
|
|
|
webhook_payload:
|
2024-04-19 16:53:56 -04:00
|
|
|
[
|
2024-04-18 18:57:55 -04:00
|
|
|
|
2024-04-19 16:53:56 -04:00
|
|
|
{
|
|
|
|
|
id: dc9aafe3-eee7-4d50-a480-3bd9831b893a,
|
|
|
|
|
email: it,
|
|
|
|
|
type: person_properties,
|
|
|
|
|
attributes:
|
|
|
|
|
{
|
|
|
|
|
properties:
|
|
|
|
|
{
|
|
|
|
|
agency_name: 32,
|
|
|
|
|
agency_id: 323,
|
|
|
|
|
medicaid_id: 22222,
|
|
|
|
|
provider_id: 2123231234,
|
|
|
|
|
learner_role: Agency Billing,
|
|
|
|
|
learner_state: Ohio,
|
2024-04-30 17:39:45 -04:00
|
|
|
evv-selection: aw;jakkd'l,
|
2024-04-19 16:53:56 -04:00
|
|
|
oh_group_name: EVV,
|
|
|
|
|
ca_group_name: None,
|
|
|
|
|
cal_evv_id: None,
|
|
|
|
|
successfully_completed_secondary_registration: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-04-18 18:57:55 -04:00
|
|
|
|
|
|
|
|
for item in webhook_payload['payload']['array']:
|
2024-04-19 16:53:56 -04:00
|
|
|
evv = item['attributes']['properties']['oh_group_name']
|
2024-04-18 18:57:55 -04:00
|
|
|
state = item['attributes']['properties']['learner_state']
|
|
|
|
|
group_result = [ref_state for ref_state in tmp.REF if state in ref_state]
|
|
|
|
|
if len(group_result) > 1:
|
|
|
|
|
for group in group_result:
|
|
|
|
|
if evv in group:
|
2024-04-19 16:53:56 -04:00
|
|
|
group_uuid = group[2]
|
|
|
|
|
print(group_uuid)
|
2024-04-18 18:57:55 -04:00
|
|
|
else:
|
|
|
|
|
group_uuid = group_result[0][2]
|
|
|
|
|
print(group_uuid)
|