SMART on FHIR Python Client 4.2.0
 
Loading...
Searching...
No Matches
fhirclient.models.fhirsearch.FHIRSearch Class Reference

Create a FHIR search from NoSQL-like query structures. More...

Public Member Functions

 __init__ (self, resource_type, struct=None)
 
 construct (self)
 Constructs the URL with query string from the receiver's params.
 
 include (self, reference_field, reference_model=None, reverse=False)
 Add a resource to be included in the search results.
 
 perform (self, server)
 Construct the search URL and execute it against the given server.
 
 perform_resources (self, server)
 Performs the search by calling perform, then extracts all Bundle entries and returns a list of Resource instances.
 

Public Attributes

 resource_type
 
 params
 
 wants_expand
 
 includes
 

Detailed Description

Create a FHIR search from NoSQL-like query structures.

Constructor & Destructor Documentation

◆ __init__()

fhirclient.models.fhirsearch.FHIRSearch.__init__ (   self,
  resource_type,
  struct = None 
)

Member Function Documentation

◆ construct()

fhirclient.models.fhirsearch.FHIRSearch.construct (   self)

Constructs the URL with query string from the receiver's params.

◆ include()

fhirclient.models.fhirsearch.FHIRSearch.include (   self,
  reference_field,
  reference_model = None,
  reverse = False 
)

Add a resource to be included in the search results.

Includes will fetch additional resources referred to by the search results, or additional resources which themselves refer to the search results (reverse include). Recursive or iterative includes are not supported. Provides a fluent interface to allow method chaining.

To include Patient resources when searching Observations: ‘s = FHIRSearch(Observation).include('subject’) To include Observation resources when searching Patients: s = FHIRSearch(Patient).include('subject', Observation, reverse=True)`

Parameters
reference_fieldThe name of the search parameter (must be FHIRReference type)
reference_modelThe type of the source resource from which the join comes (only used for reverse includes)
reverseWhether this is a reverse include
Returns
s This FHIRSearch instance

◆ perform()

fhirclient.models.fhirsearch.FHIRSearch.perform (   self,
  server 
)

Construct the search URL and execute it against the given server.

Parameters
serverThe server against which to perform the search
Returns
s A Bundle resource

◆ perform_resources()

fhirclient.models.fhirsearch.FHIRSearch.perform_resources (   self,
  server 
)

Performs the search by calling perform, then extracts all Bundle entries and returns a list of Resource instances.

Parameters
serverThe server against which to perform the search
Returns
s A list of Resource instances

Member Data Documentation

◆ includes

fhirclient.models.fhirsearch.FHIRSearch.includes

◆ params

fhirclient.models.fhirsearch.FHIRSearch.params

◆ resource_type

fhirclient.models.fhirsearch.FHIRSearch.resource_type

◆ wants_expand

fhirclient.models.fhirsearch.FHIRSearch.wants_expand

The documentation for this class was generated from the following file: