Closed motey closed 4 years ago
Attaching error log:
Traceback (most recent call last):
File "/media/bleimehl/Daten_Linux/Repos/git/dzdgitlab/fhir2neo4j/try-resolve-ref.py", line 25, in <module>
loop.run_until_complete(main())
File "/usr/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "/media/bleimehl/Daten_Linux/Repos/git/dzdgitlab/fhir2neo4j/try-resolve-ref.py", line 20, in main
patient = await obser.subject.to_resource()
File "/home/bleimehl/.local/lib/python3.7/site-packages/fhirpy/base/lib.py", line 374, in to_resource
return await self.client.resources(self.resource_type).search(id=self.id).get()
File "/home/bleimehl/.local/lib/python3.7/site-packages/fhirpy/base/lib.py", line 270, in get
res_data = await searchset.fetch()
File "/home/bleimehl/.local/lib/python3.7/site-packages/fhirpy/base/lib.py", line 215, in fetch
bundle_data = await self.client._fetch_resource(self.resource_type, self.params)
File "/home/bleimehl/.local/lib/python3.7/site-packages/fhirpy/base/lib.py", line 89, in _fetch_resource
return await self._do_request("get", path, params=params)
File "/home/bleimehl/.local/lib/python3.7/site-packages/fhirpy/base/lib.py", line 86, in _do_request
raise OperationOutcome(await r.text())
fhirpy.base.exceptions.OperationOutcome: {
"resourceType": "OperationOutcome",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Unknown search parameter "id". Value search parameters for this search are: [_id, _language, active, address, address-city, address-country, address-postalcode, address-state, address-use, addresscontenttype, birthdate, death-date, deceased, email, eyecolour, family, gdaddresstype, gender, general-practitioner, given, identifier, language, link, middlename, mothersMaidenName, name, organization, phone, phonetic, race, sex, telecom]</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
},
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "Unknown search parameter \"id\". Value search parameters for this search are: [_id, _language, active, address, address-city, address-country, address-postalcode, address-state, address-use, addresscontenttype, birthdate, death-date, deceased, email, eyecolour, family, gdaddresstype, gender, general-practitioner, given, identifier, language, link, middlename, mothersMaidenName, name, organization, phone, phonetic, race, sex, telecom]"
}
]
}
Thanks for pointing this out. I think it's a bug according to FHIR spec https://www.hl7.org/fhir/search.html#id It worked for us because our FHIR server accept both id and _id params. Feel free to provide a merge request!
I am trying to resolve references from a resource, with
AsyncReference.to_resource()
This seems to fail.example
It looks like a typo on line
https://github.com/beda-software/fhir-py/blob/f85b7d5d2614cf23436680bce537a8c64bd1f0ab/fhirpy/base/lib.py#L355
because when changing the line
to
it seems to work. Im just starting to work with fhir, and do not have a good overview of the subject matter. Do I use the function in a wrong way? Is the fhir test server data corrupt? If i found a bug, i can provide a merge request.