(requests, attr_id, generator_params, case_trigger_info)
return response.json()["value"]
Sends a request to DHIS2 to generate a value for a generated
    attribute, like a unique ID. DHIS2 may require parameters to
    generate the value. Returns the value.

    Example value source::

        {
            "case_property": "dhis2_unique_id",
            "is_generated": True,
            "generator_params": {
                "ORG_UNIT_CODE": {
                    "case_owner_ancestor_location_field": "dhis2_org_unit_code"
                }
            }
        }
Sends a request to DHIS2 to generate a value for a generated
    attribute, like a unique ID. DHIS2 may require parameters to
    generate the value. Returns the value.
Sends a request to DHIS2 to generate a value for a generated attribute like a unique ID . DHIS2 may require parameters to generate the value . Returns the value .
def generate_value(requests, attr_id, generator_params, case_trigger_info):
    """
    Sends a request to DHIS2 to generate a value for a generated
    attribute, like a unique ID. DHIS2 may require parameters to
    generate the value. Returns the value.

    Example value source::

        {
            "case_property": "dhis2_unique_id",
            "is_generated": True,
            "generator_params": {
                "ORG_UNIT_CODE": {
                    "case_owner_ancestor_location_field": "dhis2_org_unit_code"
                }
            }
        }

    """
    params = {name: get_value(vsc, case_trigger_info) for name, vsc in generator_params.items()}
    response = requests.get(
        f"/api/trackedEntityAttributes/{attr_id}/generate",
        params=params, raise_for_status=True
    )
    return response.json()["value"]
def generate_value ( requests , attr_id , generator_params , case_trigger_info ) : params = { name : get_value ( vsc , case_trigger_info ) for name , vsc in generator_params . items ( ) } response = requests . get ( f"/api/trackedEntityAttributes/{attr_id}/generate" , params = params , raise_for_status = True ) return response . json ( ) [ "value" ]