Lightmatter / welkin-health

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

adding support for nested objects on resources #25

Closed edcohen08 closed 2 years ago

edcohen08 commented 2 years ago

Support for nested resource on responses e.g.

Encounter(Resource):
    ....
    nested_objects = {'userRelatedToCalendarEvent': User}

encounter = patient.Encounter(id="abcdef").get(related_data=True)
user = encounter.userRelatedToCalendarEvent
<welkin.models.user.User object>
codecov[bot] commented 2 years ago

Codecov Report

Merging #25 (8fb03f7) into develop (71a7a04) will increase coverage by 0.16%. The diff coverage is 94.73%.

@@             Coverage Diff             @@
##           develop      #25      +/-   ##
===========================================
+ Coverage    92.13%   92.29%   +0.16%     
===========================================
  Files           20       20              
  Lines          801      818      +17     
===========================================
+ Hits           738      755      +17     
  Misses          63       63              
Impacted Files Coverage Δ
welkin/models/base.py 81.81% <90.00%> (+0.40%) :arrow_up:
test/test_encounters.py 96.96% <100.00%> (+0.41%) :arrow_up:
welkin/models/encounter.py 92.68% <100.00%> (+2.68%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.