Lightmatter / welkin-health

A Python wrapper of the Welkin Health API
https://welkin.readthedocs.io
Other
4 stars 3 forks source link

Request responses should parse internal dicts into Resource instances #79

Open samamorgan opened 1 year ago

samamorgan commented 1 year ago

The JSON structure of many responses include additional objects that this library isn't fully parsing, creating a slightly awkward situation where we're using both dot notation and dict key lookups.

# Pseudo-code
encounter = Patient().Encounter().get()

status = encounter.jsonBody["status"]
status = encounter.jsonBody.status  # AttributeError

The response parser should also attempt to resolve nested dict and list into Collection and Resource