diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md index 46310f9c51f..8bdc247c5d6 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/docs/server_jpa/schema.md @@ -262,6 +262,11 @@ a [Resource Client ID Strategy](/apidocs/hapi-fhir-storage/undefined/ca/uhn/fhir of [ANY](/apidocs/hapi-fhir-storage/undefined/ca/uhn/fhir/jpa/api/config/JpaStorageSettings.ClientIdStrategyEnum.html#ANY) the server will create a Forced ID for all resources (not only resources having textual IDs). +The **HFJ_RESOURCE** table now has a FHIR_ID column. +This column is always populated; both for server-assigned ids and for client-assigned ids. +As of Hapi release 6.10, this column is used in place of the **HFJ_FORCED_ID** table for id search and sort. +A future version of Hapi will stop populating the **HFJ_FORCED_ID** table. + ## Columns @@ -526,6 +531,15 @@ The following columns are common to **all HFJ_SPIDX_xxx tables**. This is the name of the resource being indexed. + + + + + + + @@ -550,12 +564,13 @@ The following columns are common to **all HFJ_SPIDX_xxx tables**. # HFJ_SPIDX_DATE: Date Search Parameters -For any FHIR Search Parameter of type *date* that generates a database index, a row in the *HFJ_SPIDX_DATE* table will be created. +For any FHIR Search Parameter of type [*date*](https://www.hl7.org/fhir/search.html#date) that generates a database index, a row in the `HFJ_SPIDX_DATE` table will be created. +Range queries with Date parameters (e.g. `Observation?date=ge2020-01-01`) will query the HASH_IDENTITY, SP_VALUE_LOW_DATE_ORDINAL and/or SP_VALUE_HIGH_DATE_ORDINAL columns. +Range queries with DateTime parameters (e.g. `Observation?date=ge2021-01-01T10:30:00`) will query the HASH_IDENTITY, SP_VALUE_LOW and/or SP_VALUE_HIGH columns. +Sorting is done by the SP_VALUE_LOW column. ## Columns -The following columns are common to **all HFJ_SPIDX_xxx tables**. -
HASH_IDENTITYLong + A hash of SP_NAME and RES_TYPE. Used to narrow the table to a specific SearchParameter during sorting, and some queries. +
SP_UPDATED
@@ -617,3 +632,294 @@ The following columns are common to **all HFJ_SPIDX_xxx tables**.
+ +# HFJ_SPIDX_NUMBER: Number Search Parameters + +FHIR Search Parameters of type [*number*](https://www.hl7.org/fhir/search.html#number) produce rows in the `HFJ_SPIDX_NUMBER` table. +Range queries and sorting use the HASH_IDENTITY and SP_VALUE columns. + +## Columns + + + + + + + + + + + + + + + + + + + + +
NameRelationshipsDatatypeNullableDescription
SP_VALUEDoubleNot nullable + This is the value extracted by the SearchParameter expression. +
+ + + +# HFJ_SPIDX_QUANTITY: Quantity Search Parameters + +FHIR Search Parameters of type [*quantity*](https://www.hl7.org/fhir/search.html#quantity) produce rows in the `HFJ_SPIDX_QUANTITY` table. +Range queries (e.g. `Observation?valueQuantity=gt100`) with no units provided will query the HASH_IDENTITY and SP_VALUE columns. +Range queries (e.g. `Observation?valueQuantity=gt100||mmHg`) with a unit but not unit-sytem provided will use the HASH_IDENTITY_AND_UNITS and SP_VALUE columns. +Range queries (e.g. `Observation?valueQuantity=gt100|http://unitsofmeasure.org|mmHg`) with a full system and unit will use the HASH_IDENTITY_SYS_UNITS and SP_VALUE columns. +Sorting is done via the HASH_IDENTITY and SP_VALUE columns. + +## Columns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameRelationshipsDatatypeNullableDescription
HASH_IDENTITY_AND_UNITSLong + A hash like HASH_IDENTITY that also includes the SP_UNITS column. +
HASH_IDENTITY_SYS_UNITSLong + A hash like HASH_IDENTITY that also includes the SP_SYSTEM and SP_UNITS columns. +
SP_SYSTEMString + The system of the quantity units. e.g. "http://unitsofmeasure.org". +
SP_UNITSString + The units of the quantity. E.g. "mg". +
SP_VALUEDouble + This is the value extracted by the SearchParameter expression. +
+ +# HFJ_SPIDX_QUANTITY_NRML: Normalized Quantity Search Parameters + +Hapi Fhir supports searching by normalized units when enabled (see https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-jpaserver-model/ca/uhn/fhir/jpa/model/entity/StorageSettings.html#getNormalizedQuantitySearchLevel()). +When this feature is enabled, each row stored in HFJ_SPIDX_QUANTITY to also store a row in HFJ_SPIDX_QUANTITY_NRML in canonical UCUM units. +E.g. a weight recorded in an Observation as +``` +"valueQuantity" : { + "value" : 172, + "unit" : "lb_av", + "system" : "http://unitsofmeasure.org", + "code" : "[lb_av]" + }, + ``` +would match the search `Observation?valueQuantity=172`, +but would also match the search `Observation?valueQuantity=78|http://unitsofmeasure.org|kg`. +The row in HFJ_SPIDX_QUANTITY would contain the value 172 pounds, while the HFJ_SPIDX_QUANTITY_NRML table would hold the equivalent 78 kg value. +Only value searches that provide fully qualified units are eligible for normalized searches. +Sorting only uses the HFJ_SPIDX_QUANTITY table. + +## Columns + +Same as HFJ_SPIDX_QUANTITY above, except the SP_VALUE, SP_SYSTEM, and SP_UNITS columns hold the converted value in canonical units instead of the value extracted by the SearchParameter. +This table is only used for range queries with a unit which can be converted to canonical units. + + +# HFJ_SPIDX_STRING: String Search Parameters + +FHIR Search Parameters of type [*string*](https://www.hl7.org/fhir/search.html#string) produce rows in the `HFJ_SPIDX_STRING` table. +The default string search matches by prefix, ignoring case or accents. This uses the HASH_IDENTITY column and a LIKE prefix clause on the SP_VALUE_NORMALIZED columns. +The `:exact` string search matches exactly. This uses only the HASH_EXACT column. +Sorting is done via the HASH_IDENTITY and SP_VALUE_NORMALIZED columns. + +## Columns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameRelationshipsDatatypeNullableDescription
HASH_EXACTLong + A hash like HASH_IDENTITY that also includes the SP_VALUE_EXACT column. +
SP_VALUE_NORMALIZEDString + An UPPERCASE string with accents removed. +
SP_VALUE_EXACTString + The extracted string unchanged. +
+ +# HFJ_SPIDX_TOKEN: Token Search Parameters + +FHIR Search Parameters of type [*token*](https://www.hl7.org/fhir/search.html#token) extract values of type Coding, code, and others. +These produce rows in the `HFJ_SPIDX_TOKEN` table. +The default token search accepts three parameter formats: matching the code (e.g. `Observation?code=15074-8`), +matching both system and code (e.g. `Observation?code=http://loinc.org|15074-8`), +or matching a system with any code (e.g. `Observation?http://loinc.org|`). +All three are exact searches and use the hashes: HASH_VALUE, HASH_SYS_AND_VALUE, and HASH_SYS respectively. +Sorting is done via the HASH_IDENTITY and SP_VALUE columns. + +## Columns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameRelationshipsDatatypeNullableDescription
HASH_VALUELong + A hash like HASH_IDENTITY that also includes the SP_VALUE column. +
HASH_SYS_AND_VALUELong + A hash like HASH_IDENTITY that also includes the SP_SYSTEM and SP_VALUE columns. +
HASH_SYSLong + A hash like HASH_IDENTITY that also includes the SP_SYSTEM column. +
SP_SYSTEMString + The system of the code. +
SP_VALUEString + This is the bare code value. +
+ + +# HFJ_SPIDX_URI: URI Search Parameters + +FHIR Search Parameters of type [*uri*](https://www.hl7.org/fhir/search.html#uri) produce rows in the `HFJ_SPIDX_URI` table. +The default uri search matches the complete uri. This uses the HASH_URI column for an exact match. +A uri search with the `:above` modifier will match any prefix. This also uses the HASH_URI column, but also tests hashes of every prefix of the query value. +A uri search with the `:below` modifier will match any extension. This query uses the HASH_IDENTITY and a LIKE prefix match of the SP_URI column. +Sorting is done via the HASH_IDENTITY and SP_URI columns. + +## Columns + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameRelationshipsDatatypeNullableDescription
HASH_URILong + A hash like HASH_IDENTITY that also includes the SP_URI column. +
SP_URIString + The uri string extracted by the SearchParameter. +
+