Write a Python function to parse a deeply nested JSON payload from a third-party healthcare API and flatten it into a relational format for Heliosx Group.
Implement flatten_healthcare_payload(payload). The input is a JSON-compatible Python value. Return a list containing one dictionary, where nested object keys use dot notation and array elements use zero-based bracket indices. Preserve scalar values and input traversal order. Represent a root scalar with the key $; preserve empty objects and arrays as values.
dict, list, or scalar.list[dict] containing one flattened row.def flatten_healthcare_payload(payload):