41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
import tmp
|
|
|
|
webhook_payload = {
|
|
"payload": {
|
|
"array": [
|
|
{
|
|
"id": "e134030d-a2a9-4de2-b4d5-87081feee18a",
|
|
"email": "gwalden@sandata.com",
|
|
"type": "person_properties",
|
|
"attributes": {
|
|
"properties": {
|
|
"agency_name": "Test 2",
|
|
"agency_id": "Test 2",
|
|
"medicaid_id": "54321",
|
|
"provider_id": "0987654321",
|
|
"learner_role": "Agency Billing",
|
|
"learner_state": "Tennessee",
|
|
"oh_group_name": "ST - OH ODM Agency Provider",
|
|
"evv_alt_for_ca_oh": "",
|
|
"successfully_completed_secondary_registration": True,
|
|
"cal_evv_id": None
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"params": {}
|
|
}
|
|
|
|
for item in webhook_payload['payload']['array']:
|
|
evv = item['attributes']['properties']['evv_alt_for_ca_oh']
|
|
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:
|
|
print(group)
|
|
else:
|
|
group_uuid = group_result[0][2]
|
|
print(group_uuid)
|