Pattern Matching Map

Is the key for ocr content dynamic or static, e.g. "ocr" or :ocr ?

If it is dynamic, you can use is_map_key/2 guard, but I really doubt it because it seems you’re using Phoenix and it’s unlikely to have dynamic field names in general.