Closed ruscoder closed 4 years ago
It can be something like .search(patient={'Patient.name': 'Ivan'})
or something else. Any ideas?
@mkizesov @ir4y
We can keep using Django way for chaining.
.search(patient__Patient__name = Ivan)
What do you think?
FHIR specification also supports GET /EpisodeOfCare?patient.name=Ivan
without specifying the target resource. But Aidbox requires the target resource type to be specified.
I like Django way more than I suggested. Let's implement it with the mandatory target resource type.
Some examples:
client.resources('EpisodeOfCare').search(patient__Patient__birth_date__gt='2010')
client.resources('EpisodeOfCare').search(patient__Patient__name='Ivan')
client.resources('EpisodeOfCare').search(patient__Patient__general_practitioner__Organization__name='Hospital')
There is only one disadvantage - too long kwarg name
Done in master branch
GET /EpisodeOfCare?patient:Patient.name=Ivan