(
    case: Union[CommCareCase, CommCareCaseSQL],
    resource_type: FHIRResourceType,
    case_block: Optional[dict] = None,
    form_question_values: Optional[dict] = None,
)
return CaseTriggerInfo(
        domain=case.domain,
        case_id=case.case_id,
        type=case.type,
        name=case.name,
        owner_id=case.owner_id,
        modified_by=case.modified_by,
        updates={**case_create, **case_update},
        created='create' in case_block if case_block else None,
        closed='close' in case_block if case_block else None,
        extra_fields=extra_fields,
        form_question_values=form_question_values,
    )
Returns ``CaseTriggerInfo`` instance for ``case``.

    Ignores case properties that aren't in the Data Dictionary.

    ``CaseTriggerInfo`` packages case (and form) data for use by
    ``ValueSource``.
Returns ``CaseTriggerInfo`` instance for ``case``.
Returns CaseTriggerInfo instance for case .
def get_case_trigger_info(
    case: Union[CommCareCase, CommCareCaseSQL],
    resource_type: FHIRResourceType,
    case_block: Optional[dict] = None,
    form_question_values: Optional[dict] = None,
) -> CaseTriggerInfo:
    """
    Returns ``CaseTriggerInfo`` instance for ``case``.

    Ignores case properties that aren't in the Data Dictionary.

    ``CaseTriggerInfo`` packages case (and form) data for use by
    ``ValueSource``.
    """
    if case_block is None:
        case_block = {}
    else:
        assert case_block['@case_id'] == case.case_id
    if form_question_values is None:
        form_question_values = {}

    case_create = case_block.get('create') or {}
    case_update = case_block.get('update') or {}
    case_property_names = _get_case_property_names(resource_type)
    extra_fields = {
        # CouchDB (via jsonobject) casts case properties as `Decimal`,
        # `date`, `time` and `datetime` but SQL stores them as `str`.
        p: _str_or_none(case.get_case_property(p))  # Standardize.
        for p in case_property_names
    }
    return CaseTriggerInfo(
        domain=case.domain,
        case_id=case.case_id,
        type=case.type,
        name=case.name,
        owner_id=case.owner_id,
        modified_by=case.modified_by,
        updates={**case_create, **case_update},
        created='create' in case_block if case_block else None,
        closed='close' in case_block if case_block else None,
        extra_fields=extra_fields,
        form_question_values=form_question_values,
    )
def get_case_trigger_info ( case : Union [ CommCareCase , CommCareCaseSQL ] , resource_type : FHIRResourceType , case_block : Optional [ dict ] = None , form_question_values : Optional [ dict ] = None , ) -> CaseTriggerInfo : if case_block is None : case_block = { } else : assert case_block [ '@case_id' ] == case . case_id if form_question_values is None : form_question_values = { } case_create = case_block . get ( 'create' ) or { } case_update = case_block . get ( 'update' ) or { } case_property_names = _get_case_property_names ( resource_type ) extra_fields = { # CouchDB (via jsonobject) casts case properties as `Decimal`, # `date`, `time` and `datetime` but SQL stores them as `str`. p : _str_or_none ( case . get_case_property ( p ) ) # Standardize. for p in case_property_names } return CaseTriggerInfo ( domain = case . domain , case_id = case . case_id , type = case . type , name = case . name , owner_id = case . owner_id , modified_by = case . modified_by , updates = { * * case_create , * * case_update } , created = 'create' in case_block if case_block else None , closed = 'close' in case_block if case_block else None , extra_fields = extra_fields , form_question_values = form_question_values , )