medplum.searchResources() throws Error on React Na...
# support
j
I'm searching for resources using the following query, and always getting the following error. Query:
Copy code
const patients = await medplum.searchResources('Patient', 'name=Alice')
Error:
Copy code
Error: Unknown search parameter: _
Error: Unknown search parameter: _
    at construct (native)
    at apply (native)
    at _construct
It reacts correct when I put a search param that doesn't fit at all (e.g.
encounter
within
Patient
), but if I put in the correct param it always says
_
is unknown
r
Hi @jasonwa.ng , what version of the Medplum SDK are you using?
Also, is this from inside a brower, or in a server side application?
j
"@medplum/core": "2.2.5"
this is inside a react native application
r
@jasonwa.ng , off the top of my head I' not sure what's going on here. Are you able to repro in a .ts script (e.g. with ts-node) or in a browser environment? I'm worried that this is a bad interaction with RN
@jasonwa.ng - as a sanity check: are you having htis problem if you make a "curl" request, or if you use
ts-node
?
r
Hi everyone, I'm facing the same issue with React Native, using
medplum-react-native-example
. Versions:
Copy code
"@medplum/core": "3.0.0",
    "@medplum/expo-polyfills": "3.0.0",
    "@medplum/fhirtypes": "3.0.0",
    "@medplum/react-hooks": "3.0.0",
Same issue using 3.0.1, downgraded to test if issue still happens but it still there.
Copy code
try {
                    const profile = (await medplum.getProfileAsync()) as Patient;
                    const params = `patient=${getReferenceString(profile)}`;
                    const observations: Observation[] = await medplum.searchResources('Observation', params)
                    console.log(JSON.stringify(observations));
                  } catch (err) {
                    console.error(err);
                  }
getting
[Error: Unknown search parameter: _]
any clue about how to mitigate this issue or what I might be doing wrong?
r
Update: we've filed an issue here to look into this: https://github.com/medplum/medplum/issues/3856
It would help us troubleshoot if you could share as much detail about your environment as possible: - Medplum Version - Emulator environment: (web, iOs, android, etc.) - Are you using expo? - Are you using our expo-polyfills library ?
150 Views