Clientmodule from Sero. We're also going to be using a library called
Chalkto print information about our queries.
baseUrlof the FHIR API and destructuring the operations we will use (
read). Then, we make a search for Humana's
InsurancePlanresources. We use
nextbecause Sero generates yields paginated results for searches through an iterator and a generator function.
PractitionerRole, which is a FHIR Resource that defines specializations.
searchTypeoperation accepts a object as a second argument and automatically URI encodes the values to generate the API request. We're using quotes around the
:cannot be used in a symbol.
next()to return the first page of results. From the results, we try to find an eligible
Practitionerin step 2, we can make a query to retrieve their individual information including NPI:
chalkto log our queries and the final result to console.