Smile CDR v2024.11.PRE
On this page:

6.12.1Searching For Data

 

This section contains information about methods for searching for data in the CDR.

6.12.2FHIR Search Extensions

 

In addition to implementing most of the FHIR Search specification, Smile CDR implements the following extensions:

6.12.2.1`_source`

An additional search parameter called _source can be used to search for resources based on information about the system or request that created the resource. See Storing Source Information.

6.12.2.2`%now`

Date searches can be performed relative to "now" using the %now parameter value. For example, to search for Procedures with a date later than now, you can search for /Procedure?date=ge%now.

Note the '%' would need to be URL escaped so the actual URL will be /Procedure?date=ge%25now

The way this works is Smile substitutes %now with the current date and time in the standard FHIR format yyyy-MM-ddTHH:mm:ss before submitting it to the FHIR Storage module.

6.12.2.3`%today`

Similarly date searches can be performed relative to 'today' using the '%today' parameter value. '%today' works the same as '%now' except that it searches as a 'date' type as opposed to a 'dateTime' type.

6.12.3Unsupported Search Parameters

 

Smile CDR does not currently support the _containedType FHIR Search parameter, or the _contained=both directive. See Index Contained for information on indexing contained resources.

6.12.4Limitations

 

6.12.4.0.1Type modifier restriction for contained resources

Smile CDR searches may not correctly process :[type] modifiers if the resource indicated by the modified search parameter is a contained resource. For example, consider the following search. http://localhost:8000/Observation?subject:Patient.organization.name=HealthOrg

Suppose Observation/A has a reference to Device/B, which in turn has a reference to Organization/C, and Organization/C has the name "HealthOrg". In this case, Observation/A will not be included in the search result, because the subject search parameter is restricted to Patient resources. However, if Observation/D has a reference to #contained-device, which also refers to Organization/C, then Observation/D will be included in the search result, because we can not apply the type restriction to contained resources.

6.12.5SearchParameter types for Component of Composite SearchParameters

 

Composite and Combo SearchParameters are composed of other SearchParameters which are listed under the component element of the SearchParameter. Smile Digital Health support subsets of SearchParameterTypes for composed SearchParameters which will differ based on the containing SearchParameter definition (see sp_unique extension) and whether Indexing of Search Parameters is enabled.

The following table lists supported Types for contained SearchParameters based on the containing composed SearchParameter. Note the limitations described in the following section as well.

Containing composed SP / Contained SP TypeStringTokenDateQuantityUriNumberReference
Combo Unique
Combo Non-Unique
Composite with full text indexing
Composite without full text indexing

6.12.5.1Limitations

  • Partitioning: Combo Unique search parameters are not partition-aware. This means that uniqueness will be enforced globally (i.e. not on a per-partition basis) and the uniqueness constraint on the HFJ_IDX_CMP_STRING_UNIQ table does not incorporate the partition ID.
  • Token: Tokens will only be indexed if the element value includes both a system and a value, except in cases where the system is implicit because the element is of type code and has a required terminology binding (e.g. Patient.gender).
  • Date/Time: Date and DateTime types will only be indexed if the date has DAY precision (ie. yyyy-MM-dd)
  • Reference: References will only be indexed if the element value is exactly in the form [resourceType]/[id]. Searches will only leverage the index if the search URL is also in this exact form.