(
    observations: List[dict],
    mappings: Dict[str, List[ObservationMapping]],
    case_attrs: CaseAttrs,
)
return case_block_kwargs, case_blocks
Traverse a tree of observations, and return the ones mapped to case
    properties.
Traverse a tree of observations, and return the ones mapped to case
    properties.
Traverse a tree of observations and return the ones mapped to case properties .
def get_case_block_kwargs_from_observations(
    observations: List[dict],
    mappings: Dict[str, List[ObservationMapping]],
    case_attrs: CaseAttrs,
) -> Tuple[dict, List[CaseBlock]]:
    """
    Traverse a tree of observations, and return the ones mapped to case
    properties.
    """
    case_block_kwargs, case_blocks = get_case_block_kwargs_from_concepts(
        observations,
        mappings,
        case_attrs,
        uuid_func=lambda obs: obs.get('concept', {}).get('uuid'),
        fallback_value_func=lambda obs: obs.get('value'),
    )

    for obs in observations:
        if obs.get('groupMembers'):
            more_kwargs, more_case_blocks = get_case_block_kwargs_from_observations(
                obs['groupMembers'],
                mappings,
                case_attrs,
            )
            deep_update(case_block_kwargs, more_kwargs)
            case_blocks.extend(more_case_blocks)

    return case_block_kwargs, case_blocks
def get_case_block_kwargs_from_observations ( observations : List [ dict ] , mappings : Dict [ str , List [ ObservationMapping ] ] , case_attrs : CaseAttrs , ) -> Tuple [ dict , List [ CaseBlock ] ] : case_block_kwargs , case_blocks = get_case_block_kwargs_from_concepts ( observations , mappings , case_attrs , uuid_func = lambda obs : obs . get ( 'concept' , { } ) . get ( 'uuid' ) , fallback_value_func = lambda obs : obs . get ( 'value' ) , ) for obs in observations : if obs . get ( 'groupMembers' ) : more_kwargs , more_case_blocks = get_case_block_kwargs_from_observations ( obs [ 'groupMembers' ] , mappings , case_attrs , ) deep_update ( case_block_kwargs , more_kwargs ) case_blocks . extend ( more_case_blocks ) return case_block_kwargs , case_blocks