Funzioni di ricerca FHIR avanzate

Questa pagina spiega come cercare risorse FHIR utilizzando una funzionalità di query più avanzata disponibile tramite il metodo projects.locations.datasets.fhirStores.fhir.search. Questa guida presuppone che tu abbia già familiarità con i contenuti della ricerca di risorse FHIR.

Bundle FHIR di esempio

Gli esempi in questa pagina utilizzano un bundle FHIR JSON fornito per mostrare i risultati delle funzionalità avanzate di ricerca FHIR. Salva il file r4_bundle.json sulla tua macchina per utilizzarlo negli esempi.

Esegui il bundle FHIR di esempio

Per eseguire il bundle FHIR di esempio in un datastore FHIR, consulta Esecuzione di un bundle. Il datastore FHIR deve avere le seguenti impostazioni:

Modificatori di ricerca delle stringhe

Per impostazione predefinita, una ricerca per stringa utilizza la corrispondenza del prefisso con maiuscole/minuscole e senza distinzione tra maiuscole e minuscole. La punteggiatura e gli spazi vuoti aggiuntivi vengono ignorati.

Sono disponibili i seguenti modificatori:

  • :contains corrisponde alle risorse con il valore specificato in qualsiasi punto della stringa, ad esempio name:contains=eve corrisponde a Evelyn e Severine.
  • :exact corrisponde all'intera stringa, inclusi maiuscole e minuscole e gli accenti, ad esempio name:exact=Eve non corrisponde a eve o Evelyn.

Espandi la seguente sezione per vedere un esempio di utilizzo dei modificatori di stringa di ricerca:

Esempi di modificatori di ricerca di stringhe

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


Nel seguente esempio viene utilizzata la query Patient?name:contains=eve.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?name:contains=eve"

PowerShell


Nel seguente esempio viene utilizzata la query Patient?name:contains=eve.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?name:contains=eve" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient2",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Mountain View",
            "district": "KW",
            "line": [
              "1800 Amphibious Blvd"
            ],
            "period": {
              "start": "2000-01-01"
            },
            "text": "1800 Amphibious Blvd",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1989-03-11",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "FR",
                  "display": "jkl",
                  "system": "123"
                },
                {
                  "code": "french",
                  "display": "mno",
                  "system": "456"
                }
              ],
              "text": "pqr"
            }
          }
        ],
        "deceasedBoolean": false,
        "gender": "female",
        "id": "patient2",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "tag2",
              "display": "Tag Two",
              "system": "tag-system"
            },
            {
              "code": "tag|tag3",
              "display": "Tag Three",
              "system": "other"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "name": [
          {
            "family": "Lee",
            "given": [
              "Jane",
              "Evelyne"
            ],
            "use": "usual"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "0982344522"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "jane@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient1",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Mountain View",
            "district": "KW",
            "line": [
              "1800 Amphibious Blvd"
            ],
            "period": {
              "start": "1974-12-25"
            },
            "text": "1800 Amphibious Blvd",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1974-12-25",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "ENG",
                  "display": "def",
                  "system": "123"
                },
                {
                  "code": "english",
                  "display": "ghi",
                  "system": "456"
                }
              ],
              "text": "abc"
            }
          }
        ],
        "deceasedBoolean": false,
        "gender": "male",
        "id": "patient1",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "tag1",
              "display": "Tag One",
              "system": "tag-system"
            },
            {
              "code": "tag2",
              "display": "Tag Two",
              "system": "other-system"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "name": [
          {
            "family": "Lee",
            "given": [
              "Alex",
              "Cleve"
            ],
            "text": "Alex Lee",
            "use": "usual"
          },
          {
            "given": [
              "Joe"
            ],
            "use": "nickname"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "0982344522"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "alex@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "relation": "search",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?name%3Acontains=eve"
    },
    {
      "relation": "first",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?name%3Acontains=eve"
    },
    {
      "relation": "self",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?name%3Acontains=eve"
    }
  ],
  "resourceType": "Bundle",
  "total": 2,
  "type": "searchset"
}

Comparatori e precisione per numeri, date e quantità

I valori utilizzati in una ricerca numerica o per data dipendono dalla precisione del valore del parametro. Ad esempio, il numero 7.00 ha un intervallo implicito compreso tra 6.995 e 7.005 escluso. La data 2015-08-12 ha un intervallo compreso tra 2015-08-12T00:00:00 e 2015-08-13T00:00:00 esclusi.

La precisione influisce sui risultati restituiti per i confronti di uguaglianza. Ad esempio, un valore di 7.03 in una risorsa corrisponde alla ricerca di value=7.0, ma non alla ricerca di value=7.00.

Tutti i valori in virgola mobile clinicamente significativi in FHIR sono rappresentati da tipi come Decimal e Quantity, che registrano la precisione del valore archiviato. Fanno eccezione alcuni campi che utilizzano numeri interi semplici, ad esempio per rappresentare una posizione in una sequenza, e le ricerche in questi campi sono corrispondenze numeriche esatte.

I seguenti prefissi si applicano ai confronti numerici rispetto a un valore singleton. Se non vengono specificati prefissi, il valore predefinito è eq.

  • eq: uguale, il valore memorizzato esatto rientra nell'intervallo definito dalla precisione del valore del parametro
  • ne: diverso da eq, il contrario
  • gt: il valore esatto memorizzato è maggiore del valore esatto del parametro
  • lt: il valore memorizzato esatto è inferiore al valore esatto del parametro
  • ge: il valore memorizzato esatto è maggiore o uguale al valore esatto del parametro
  • le: il valore memorizzato esatto è inferiore o uguale al valore esatto del parametro

I valori delle date hanno un intervallo implicito basato sul livello di specificità del valore (un anno, un mese, un giorno). Altri tipi di dati, come Intervallo e Periodo, contengono limiti superiori e inferiori espliciti. I seguenti prefissi si applicano ai confronti di intervalli. Se non vengono specificati prefissi, il valore predefinito è eq.

  • eq: uguale a, l'intervallo del valore parametro contiene completamente l'intervallo del target
  • ne: diverso da eq, il contrario
  • gt: maggiore di, l'intervallo sopra il valore parametro si sovrappone all'intervallo del target
  • lt: minore di, l'intervallo sotto il valore parametro si sovrappone all'intervallo del target
  • ge: maggiore o uguale a
  • le: minore o uguale a
  • sa: l'intervallo del valore del parametro inizia dopo l'intervallo target
  • eb: l'intervallo del valore del parametro termina prima dell'intervallo target

Comparatori e precisione per campioni di numeri, date e quantità

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


L'esempio seguente utilizza la query _lastUpdated=gt2018-01-01 per cercare risorse Paziente con un valore _lastUpdated maggiore di (gt) 2018-01-01.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_lastUpdated=gt2018-01-01"

PowerShell


L'esempio seguente utilizza la query _lastUpdated=gt2018-01-01 per cercare risorse Paziente con un valore _lastUpdated maggiore di (gt) 2018-01-01.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_lastUpdated=gt2018-01-01" | Select-Object -Expand Content

La query _lastUpdated=gt2018-01-01 restituisce le risorse Pazienti aggiornate dal 1° gennaio 2018. Se hai creato tutte le risorse nel datastore FHIR dopo questa data, il server restituisce tutte le risorse. Per visualizzare un sottoinsieme di risorse, imposta una data successiva all'ultimo aggiornamento di alcune risorse.

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient3",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Lisbon",
            "district": "KW",
            "line": [
              "Avenida da Pastelaria, 1903"
            ],
            "period": {
              "start": "1980-01-01"
            },
            "text": "Avenida da Pastelaria, 1903",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1980-01-01",
        "deceasedBoolean": false,
        "id": "patient3",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "tag3",
              "display": "Tag $3",
              "system": "other|tag"
            },
            {
              "code": "code,4",
              "display": "Tag 4",
              "system": "system"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "name": [
          {
            "family": "Smith",
            "given": [
              "Mary"
            ],
            "text": "Smith, Mary",
            "use": "usual"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "1110891111"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "mary@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient2",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Mountain View",
            "district": "KW",
            "line": [
              "1800 Amphibious Blvd"
            ],
            "period": {
              "start": "2000-01-01"
            },
            "text": "1800 Amphibious Blvd",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1989-03-11",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "FR",
                  "display": "jkl",
                  "system": "123"
                },
                {
                  "code": "french",
                  "display": "mno",
                  "system": "456"
                }
              ],
              "text": "pqr"
            }
          }
        ],
        "deceasedBoolean": false,
        "gender": "female",
        "id": "patient2",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "tag2",
              "display": "Tag Two",
              "system": "tag-system"
            },
            {
              "code": "tag|tag3",
              "display": "Tag Three",
              "system": "other"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "name": [
          {
            "family": "Lee",
            "given": [
              "Jane",
              "Evelyne"
            ],
            "use": "usual"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "0982344522"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "jane@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
      "resource": {
        "address": [
          {
            "country": "US",
            "line": [
              "907 Arlo Cliffs",
              "Suite 984"
            ],
            "postalCode": "XXXXX"
          }
        ],
        "birthDate": "1940-12-01",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "en-US",
                  "display": "English (United States)",
                  "system": "urn:ietf:bcp:47"
                }
              ]
            }
          }
        ],
        "deceasedDateTime": "2009-07-26T12:01:23-05:00",
        "extension": [
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "2106-3",
                  "display": "White",
                  "system": "http://hl7.org/fhir/v3/Race"
                }
              ],
              "text": "race"
            }
          },
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "2186-5",
                  "display": "Nonhispanic",
                  "system": "http://hl7.org/fhir/v3/Ethnicity"
                }
              ],
              "text": "ethnicity"
            }
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/birthPlace",
            "valueAddress": {
              "city": "Tama",
              "country": "US",
              "postalCode": "52339",
              "state": "Iowa"
            }
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
            "valueString": "Farrah Feeney"
          },
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
            "valueCode": "M"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired",
            "valueBoolean": false
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-actor-FictionalPerson-extension",
            "valueBoolean": true
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-FathersName-extension",
            "valueHumanName": {
              "text": "Christopher Diaz"
            }
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-SocialSecurityNumber-extension",
            "valueString": "999-16-9041"
          }
        ],
        "gender": "male",
        "generalPractitioner": [
          {
            "reference": "Organization/9fb51c89-1453-406c-8357-578311b43a91"
          }
        ],
        "id": "8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
        "identifier": [
          {
            "system": "https://github.com/synthetichealth/synthea",
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          },
          {
            "system": "http://hl7.org/fhir/sid/us-ssn",
            "type": {
              "coding": [
                {
                  "code": "SB",
                  "system": "http://hl7.org/fhir/identifier-type"
                }
              ]
            },
            "value": "999169041"
          },
          {
            "system": "urn:oid:2.16.840.1.113883.4.3.25",
            "type": {
              "coding": [
                {
                  "code": "DL",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "S99992205"
          },
          {
            "system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
            "type": {
              "coding": [
                {
                  "code": "PPN",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "X12551631X"
          },
          {
            "system": "http://hospital.smarthealthit.org",
            "type": {
              "coding": [
                {
                  "code": "MR",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          }
        ],
        "maritalStatus": {
          "coding": [
            {
              "code": "S",
              "system": "http://hl7.org/fhir/v3/MaritalStatus"
            }
          ],
          "text": "S"
        },
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-PersonOfRecord"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "multipleBirthBoolean": false,
        "name": [
          {
            "family": "Diaz",
            "given": [
              "Christopher"
            ],
            "prefix": [
              "Mr."
            ],
            "use": "official"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "system": "phone",
            "use": "home",
            "value": "434-100-2918 x800"
          }
        ],
        "text": {
          "div": "
Generated by Synthea. Version identifier: 2dd4c1c37e2743d14e5073c7b5e42899a3e51531
", "status": "generated" } }, "search": { "mode": "match" } }, { "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient1", "resource": { "active": false, "address": [ { "city": "Mountain View", "district": "KW", "line": [ "1800 Amphibious Blvd" ], "period": { "start": "1974-12-25" }, "text": "1800 Amphibious Blvd", "type": "both", "use": "home" } ], "birthDate": "1974-12-25", "communication": [ { "language": { "coding": [ { "code": "ENG", "display": "def", "system": "123" }, { "code": "english", "display": "ghi", "system": "456" } ], "text": "abc" } } ], "deceasedBoolean": false, "gender": "male", "id": "patient1", "meta": { "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ", "tag": [ { "code": "tag1", "display": "Tag One", "system": "tag-system" }, { "code": "tag2", "display": "Tag Two", "system": "other-system" } ], "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA" }, "name": [ { "family": "Lee", "given": [ "Alex", "Cleve" ], "text": "Alex Lee", "use": "usual" }, { "given": [ "Joe" ], "use": "nickname" } ], "resourceType": "Patient", "telecom": [ { "rank": 1, "system": "phone", "use": "home", "value": "0982344522" }, { "rank": 2, "system": "email", "use": "home", "value": "alex@example.com" } ] }, "search": { "mode": "match" } } ], "link": [ { "relation": "search", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_lastUpdated=gt2018-01-01" }, { "relation": "first", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_lastUpdated=gt2018-01-01" }, { "relation": "self", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_lastUpdated=gt2018-01-01" } ], "resourceType": "Bundle", "total": 4, "type": "searchset" }

I parametri di ricerca dei token si applicano ai casi in cui un valore non è una stringa arbitraria, ma piuttosto un'entità in un sistema di denominazione. La corrispondenza delle stringhe su un parametro del token è esatta.

La maggior parte delle ricerche di token si applica a tipi di dati complessi che contengono un system, ovvero un URI che indica il sistema di denominazione da cui prende il valore code. Queste ricerche supportano le seguenti sintassi dei valori:

  • [parameter]=[code] corrisponde al valore code indipendentemente da system
  • [parameter]=[system]|[code] deve corrispondere sia al system che al code specificato
  • [parameter]=|[code] corrisponde a code quando il valore system è vuoto
  • [parameter]=[system]| corrisponde a qualsiasi code con il valore system specificato

Esistono diversi modificatori che attivano la funzionalità di ricerca dei token alternativi:

  • :not nega le condizioni di corrispondenza di una ricerca di token
  • :text esegue una ricerca per stringa (non esatta) nel campo text o display associato al codice, anziché nel valore del codice stesso
  • :above prende un parametro solo nel formato [system]|[code] e corrisponde alle risorse in cui il codice nella risorsa sostituisce il parametro di query. Per utilizzare questo modificatore, il system specificato deve esistere nel datastore FHIR come risorsa CodeSystem.
  • :below è come :above, ma corrisponde se il codice nella risorsa è riassunto dal parametro di query.
  • :in utilizza un singolo parametro utilizzando la sintassi del parametro di riferimento, ad esempio code:in=ValueSet/1234. Il riferimento deve fare riferimento a una risorsa ValueSet all'interno dello stesso datastore FHIR. Il modificatore corrisponde a qualsiasi codice all'interno dell'elemento ValueSet di riferimento.
  • :not-in nega le condizioni di :in

Le ricerche di token si applicano anche a campi booleani e URI e a determinati campi stringa in cui è consentita solo la corrispondenza esatta. In questi casi, l'unico formato di parametro è [parameter]=[value].

Esempi di ricerca di token

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


L'esempio seguente utilizza la query Patient?_tag=tag-system|tag2 per cercare le risorse Paziente con i valori system e code specificati.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_tag=tag-system|tag2"

PowerShell


L'esempio seguente utilizza la query Patient?_tag=tag-system|tag2 per cercare le risorse Paziente con i valori system e code specificati.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_tag=tag-system|tag2" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient2",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Mountain View",
            "district": "KW",
            "line": [
              "1800 Amphibious Blvd"
            ],
            "period": {
              "start": "2000-01-01"
            },
            "text": "1800 Amphibious Blvd",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1989-03-11",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "FR",
                  "display": "jkl",
                  "system": "123"
                },
                {
                  "code": "french",
                  "display": "mno",
                  "system": "456"
                }
              ],
              "text": "pqr"
            }
          }
        ],
        "deceasedBoolean": false,
        "gender": "female",
        "id": "patient2",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "tag2",
              "display": "Tag Two",
              "system": "tag-system"
            },
            {
              "code": "tag|tag3",
              "display": "Tag Three",
              "system": "other"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "name": [
          {
            "family": "Lee",
            "given": [
              "Jane",
              "Evelyne"
            ],
            "use": "usual"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "0982344522"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "jane@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "relation": "search",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_tag=tag-system%7Ctag2"
    },
    {
      "relation": "first",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_tag=tag-system%7Ctag2"
    },
    {
      "relation": "self",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_tag=tag-system%7Ctag2"
    }
  ],
  "resourceType": "Bundle",
  "total": 1,
  "type": "searchset"
}

Ricerca di valori mancanti

Il modificatore di ricerca :missing può essere utilizzato su qualsiasi parametro di ricerca per trovare una corrispondenza in base alla presenza o all'assenza di valori nel campo specificato. Ad esempio, Patient?gender=unknown corrisponde a risorse che contengono esplicitamente il valore enum unknown per il genere; tuttavia, poiché questo campo non è obbligatorio, potrebbero esserci altre risorse che non vengono compilate nel campo. È possibile abbinare queste risorse tramite Patient?gender:missing=true. Al contrario, Patient?gender:missing=false corrisponde a qualsiasi risorsa che compila in modo esplicito questo campo.

Esempi di valori mancanti

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


Nel seguente esempio viene utilizzata la query gender:missing=false:

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?gender:missing=false"

PowerShell


Nel seguente esempio viene utilizzata la query gender:missing=false:

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?gender:missing=false" | Select-Object -Expand Content
In una risorsa Paziente con ID patient3 manca un valore gender:
{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/mydataset/fhirStores/FHIR_STORE_ID/fhir/Patient/patient3",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Lisbon",
            "district": "KW",
            "line": [
              "Avenida da Pastelaria, 1903"
            ],
            "period": {
              "start": "1980-01-01"
            },
            "text": "Avenida da Pastelaria, 1903",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1980-01-01",
        "deceasedBoolean": false,
        "id": "patient3",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "tag3",
              "display": "Tag $3",
              "system": "other|tag"
            },
            {
              "code": "code,4",
              "display": "Tag 4",
              "system": "system"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "name": [
          {
            "family": "Smith",
            "given": [
              "Mary"
            ],
            "text": "Smith, Mary",
            "use": "usual"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "1110891111"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "mary@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "relation": "search",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/mydataset/fhirStores/FHIR_STORE_ID/fhir/Patient/?gender%3Amissing=true"
    },
    {
      "relation": "first",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/mydataset/fhirStores/FHIR_STORE_ID/fhir/Patient/?gender%3Amissing=true"
    },
    {
      "relation": "self",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/mydataset/fhirStores/FHIR_STORE_ID/fhir/Patient/?gender%3Amissing=true"
    }
  ],
  "resourceType": "Bundle",
  "total": 1,
  "type": "searchset"
}

Il parametro di ricerca speciale _content esegue una corrispondenza di testo sui campi basati su stringhe (esclusi i campi di numero, data o enum) se il campo è la destinazione di qualsiasi parametro di ricerca nella risorsa. Per impostazione predefinita, _content corrisponde alle risorse che contengono tutte le parole nella query, con il supporto di operatori aggiuntivi:

  • | è l'operatore OR, ad esempio abc | def | ghi xyz corrisponderà a una risorsa che contiene xyz e uno o più abc def ghi.
  • - è l'operatore NOT, ad esempio abc -def corrisponderà a una risorsa che contiene abc ma non def.

La corrispondenza si basa su parole complete e non corrisponde a sottostringhe o caratteri non alfanumerici. L'ordine delle parole non ha importanza. Le parole corrispondenti possono essere distribuite in più campi nella risorsa.

Il parametro _text esegue lo stesso tipo di corrispondenza solo nel campo Narrativo, che deve contenere un riepilogo leggibile dei contenuti della risorsa. L'API Cloud Healthcare non genera automaticamente questo riepilogo, ma supporta il parametro di ricerca _text se questi dati sono stati compilati dal client durante la creazione o l'aggiornamento della risorsa.

Esempi di ricerche testuali

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


Nel seguente esempio viene utilizzata la query _content=Smith%20|%20Mountain%20View:

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_content=Smith%20|%20Mountain%20View"

PowerShell


Nel seguente esempio viene utilizzata la query _content=Smith%20|%20Mountain%20View:

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_content=Smith%20|%20Mountain%20View" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient1",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Mountain View",
            "district": "KW",
            "line": [
              "1800 Amphibious Blvd"
            ],
            "period": {
              "start": "1974-12-25"
            },
            "text": "1800 Amphibious Blvd",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1974-12-25",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "ENG",
                  "display": "def",
                  "system": "123"
                },
                {
                  "code": "english",
                  "display": "ghi",
                  "system": "456"
                }
              ],
              "text": "abc"
            }
          }
        ],
        "deceasedBoolean": false,
        "gender": "male",
        "id": "patient1",
        "meta": {
          "lastUpdated": "2021-10-21T16:41:47.211939+00:00",
          "tag": [
            {
              "code": "tag1",
              "display": "Tag One",
              "system": "tag-system"
            },
            {
              "code": "tag2",
              "display": "Tag Two",
              "system": "other-system"
            }
          ],
          "versionId": "MTYzNDgzNDUwNzIxMTkzOTAwMA"
        },
        "name": [
          {
            "family": "Lee",
            "given": [
              "Alex",
              "Cleve"
            ],
            "text": "Alex Lee",
            "use": "usual"
          },
          {
            "given": [
              "Joe"
            ],
            "use": "nickname"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "0982344522"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "alex@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient2",
      "resource": {
        "active": false,
        "address": [
          {
            "city": "Mountain View",
            "district": "KW",
            "line": [
              "1800 Amphibious Blvd"
            ],
            "period": {
              "start": "2000-01-01"
            },
            "text": "1800 Amphibious Blvd",
            "type": "both",
            "use": "home"
          }
        ],
        "birthDate": "1989-03-11",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "FR",
                  "display": "jkl",
                  "system": "123"
                },
                {
                  "code": "french",
                  "display": "mno",
                  "system": "456"
                }
              ],
              "text": "pqr"
            }
          }
        ],
        "deceasedBoolean": false,
        "gender": "female",
        "id": "patient2",
        "meta": {
          "lastUpdated": "2021-10-21T16:41:47.211939+00:00",
          "tag": [
            {
              "code": "tag2",
              "display": "Tag Two",
              "system": "tag-system"
            },
            {
              "code": "tag|tag3",
              "display": "Tag Three",
              "system": "other"
            }
          ],
          "versionId": "MTYzNDgzNDUwNzIxMTkzOTAwMA"
        },
        "name": [
          {
            "family": "Lee",
            "given": [
              "Jane",
              "Evelyne"
            ],
            "use": "usual"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "rank": 1,
            "system": "phone",
            "use": "home",
            "value": "0982344522"
          },
          {
            "rank": 2,
            "system": "email",
            "use": "home",
            "value": "jane@example.com"
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "relation": "search",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_content=Smith%7CMountain+View"
    },
    {
      "relation": "first",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_content=Smith%7CMountain+View"
    },
    {
      "relation": "self",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_content=Smith%7CMountain+View"
    }
  ],
  "resourceType": "Bundle",
  "total": 2,
  "type": "searchset"
}

Parametri di ricerca compositi

Quando esegui una ricerca utilizzando più parametri di query, ci sono casi in cui i singoli parametri di ricerca combinati con AND corrisponderanno a risultati indesiderati. I parametri di ricerca composti sono un tipo speciale di parametro di ricerca per risolvere questo problema.

Ad esempio, la risorsa Observation può contenere più valori nel campo component, ognuno dei quali contiene una coppia di code e value. Una ricerca di Observation?component-code=8867-4&component-value-quantity=lt50 corrisponderebbe a una risorsa con un componente contenente un valore di code pari a 8867-4 e un componente diverso contenente un valore value inferiore a 50. Questa ricerca non può essere utilizzata per limitare una corrispondenza di questi due valori all'interno dello stesso componente.

I parametri di ricerca compositi definiscono un nuovo parametro che combina altri due parametri di ricerca e definisce un livello di nidificazione entro il quale devono corrispondere entrambi. Nella query, i due valori sono uniti da $. Ad esempio, Observation ha un parametro composito component-code-value-quantity che può limitare l'esempio precedente a un singolo componente cercando Observation?component-code-value-quantity=8867-4$lt50. Questi parametri sono definiti dalla specifica FHIR e non esistono per tutte le combinazioni di parametri di ricerca.

I parametri di ricerca compositi non consentono i modificatori.

Come per tutti i parametri di ricerca, le informazioni su quali parametri composti sono supportati dall'API Cloud Healthcare sono disponibili nella dichiarazione delle funzionalità o nella Dichiarazione di conformità FHIR.

Esempi di ricerche composite

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


Nel seguente esempio viene utilizzata la query Observation?component-code-value-quantity=8480-6$lt150.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation?component-code-value-quantity=8480-6\$lt150"

PowerShell


Nel seguente esempio viene utilizzata la query Observation?component-code-value-quantity=8480-6$lt150.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation?component-code-value-quantity=8480-6\$lt150" | Select-Object -Expand Content
La risposta contiene l'osservazione con un component-code=8480-6 e un component-value-quantity di 133, che soddisfa i criteri per lt150.
{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/a35bf421-1f00-4897-a94d-4d47c3bb306b",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "55284-4",
              "display": "Blood Pressure",
              "system": "http://loinc.org"
            }
          ]
        },
        "component": [
          {
            "code": {
              "coding": [
                {
                  "code": "8480-6",
                  "display": "Systolic Blood Pressure",
                  "system": "http://loinc.org"
                }
              ],
              "text": "Systolic Blood Pressure"
            },
            "valueQuantity": {
              "code": "mmHg",
              "system": "http://unitsofmeasure.org",
              "unit": "mmHg",
              "value": 133
            }
          },
          {
            "code": {
              "coding": [
                {
                  "code": "8462-4",
                  "display": "Diastolic Blood Pressure",
                  "system": "http://loinc.org"
                }
              ],
              "text": "Diastolic Blood Pressure"
            },
            "valueQuantity": {
              "code": "mmHg",
              "system": "http://unitsofmeasure.org",
              "unit": "mmHg",
              "value": 84
            }
          }
        ],
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "a35bf421-1f00-4897-a94d-4d47c3bb306b",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-BloodPressure"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        }
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "relation": "search",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/?component-code-value-quantity=8480-6%24lt150"
    },
    {
      "relation": "first",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/?component-code-value-quantity=8480-6%24lt150"
    },
    {
      "relation": "self",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/?component-code-value-quantity=8480-6%24lt150"
    }
  ],
  "resourceType": "Bundle",
  "total": 1,
  "type": "searchset"
}

Una ricerca concatenata consente a una ricerca di attraversare i riferimenti nel contesto di una query. La sintassi di base per una ricerca concatenata è:

[reference parameter]:[resource type].[inner search parameter]=[inner value]

Se il parametro di riferimento fa riferimento a un solo tipo di risorsa, :[resource type] può essere omesso, ottenendo quanto segue:

[reference parameter].[inner search parameter]=[inner value]

Ad esempio, Observation ha un parametro di ricerca di riferimento subject che potrebbe indirizzare a Group, Device, Patient o Location. Per trovare Observations che hanno un subject che corrisponde a un Patient con un nome che inizia con "Joe", puoi cercare Observation?subject:Patient.name=Joe.

Se la query ha più parametri concatenati, ogni catena viene valutata separatamente. Ad esempio, Patient?general-practitioner.name=Joe&general-practitioner.address-country=Canada corrisponde a un Patient con due riferimenti general-practitioner, uno denominato "Joe" e l'altro con un indirizzo in Canada. Non esiste una sintassi per raggruppare queste clausole in modo che corrispondano solo a Joe del Canada.

Le ricerche concatenate possono essere ricorsive ad altre catene o a catene inverse, ad esempio Observation?subject:Patient.organization.name=Acme corrisponde a un Observation che fa riferimento a un subject che fa riferimento a un organization che ha un name di Acme.

Esempi di ricerche concatenate

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


L'esempio seguente utilizza la query Observation?subject:Patient.name=Christopher per restituire tutte le osservazioni che hanno un subject, che è un Patient il cui nome inizia con Christopher.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation?subject:Patient.name=Christopher"

PowerShell


L'esempio seguente utilizza la query Observation?subject:Patient.name=Christopher per restituire tutte le osservazioni che hanno un subject, che è un Patient il cui nome inizia con Christopher.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation?subject:Patient.name=Christopher" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/85652a63-09ba-4a5b-ac5b-b690c6972eb5",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "laboratory",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "2093-3",
              "display": "Total Cholesterol",
              "system": "http://loinc.org"
            }
          ],
          "text": "Total Cholesterol"
        },
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "85652a63-09ba-4a5b-ac5b-b690c6972eb5",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        },
        "valueQuantity": {
          "code": "mg/dL",
          "system": "http://unitsofmeasure.org",
          "unit": "mg/dL",
          "value": 191
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/e7aea507-61af-4290-9323-0b3daed0b7a9",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "laboratory",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "2571-8",
              "display": "Triglycerides",
              "system": "http://loinc.org"
            }
          ],
          "text": "Triglycerides"
        },
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "e7aea507-61af-4290-9323-0b3daed0b7a9",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        },
        "valueQuantity": {
          "code": "mg/dL",
          "system": "http://unitsofmeasure.org",
          "unit": "mg/dL",
          "value": 143
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/a35bf421-1f00-4897-a94d-4d47c3bb306b",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "55284-4",
              "display": "Blood Pressure",
              "system": "http://loinc.org"
            }
          ]
        },
        "component": [
          {
            "code": {
              "coding": [
                {
                  "code": "8480-6",
                  "display": "Systolic Blood Pressure",
                  "system": "http://loinc.org"
                }
              ],
              "text": "Systolic Blood Pressure"
            },
            "valueQuantity": {
              "code": "mmHg",
              "system": "http://unitsofmeasure.org",
              "unit": "mmHg",
              "value": 133
            }
          },
          {
            "code": {
              "coding": [
                {
                  "code": "8462-4",
                  "display": "Diastolic Blood Pressure",
                  "system": "http://loinc.org"
                }
              ],
              "text": "Diastolic Blood Pressure"
            },
            "valueQuantity": {
              "code": "mmHg",
              "system": "http://unitsofmeasure.org",
              "unit": "mmHg",
              "value": 84
            }
          }
        ],
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "a35bf421-1f00-4897-a94d-4d47c3bb306b",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-BloodPressure"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/14df9701-2dd4-4538-8fac-776c40dec22d",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "8302-2",
              "display": "Body Height",
              "system": "http://loinc.org"
            }
          ],
          "text": "Body Height"
        },
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "14df9701-2dd4-4538-8fac-776c40dec22d",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-VitalSign",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-BodyHeight"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        },
        "valueQuantity": {
          "code": "cm",
          "system": "http://unitsofmeasure.org",
          "unit": "centimeters",
          "value": 177.72961711703704
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/1e2fdce6-4c79-4ef8-a5a9-2326cddbc8b3",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "39156-5",
              "display": "Body Mass Index",
              "system": "http://loinc.org"
            }
          ],
          "text": "Body Mass Index"
        },
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "1e2fdce6-4c79-4ef8-a5a9-2326cddbc8b3",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-VitalSign",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-BodyMassIndex"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        },
        "valueQuantity": {
          "code": "kg/m2",
          "system": "http://unitsofmeasure.org",
          "unit": "kg/m2",
          "value": 38.34566163709526
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/58357362-6f18-438a-8479-3289ebab1617",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "laboratory",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "18262-6",
              "display": "Low Density Lipoprotein Cholesterol",
              "system": "http://loinc.org"
            }
          ],
          "text": "Low Density Lipoprotein Cholesterol"
        },
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "58357362-6f18-438a-8479-3289ebab1617",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        },
        "valueQuantity": {
          "code": "mg/dL",
          "system": "http://unitsofmeasure.org",
          "unit": "mg/dL",
          "value": 102
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/c6f1b042-a0fc-4bbc-9cd5-7a8a924c00e7",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "laboratory",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "2085-9",
              "display": "High Density Lipoprotein Cholesterol",
              "system": "http://loinc.org"
            }
          ],
          "text": "High Density Lipoprotein Cholesterol"
        },
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "c6f1b042-a0fc-4bbc-9cd5-7a8a924c00e7",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        },
        "valueQuantity": {
          "code": "mg/dL",
          "system": "http://unitsofmeasure.org",
          "unit": "mg/dL",
          "value": 60
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/ac57b908-2804-4d67-a7ad-1e4a4c3225a1",
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "29463-7",
              "display": "Body Weight",
              "system": "http://loinc.org"
            }
          ],
          "text": "Body Weight"
        },
        "effectiveDateTime": "2008-03-07T17:47:02-05:00",
        "encounter": {
          "reference": "Encounter/0e9d631c-4407-45e5-bfbe-689806caaf7b"
        },
        "id": "ac57b908-2804-4d67-a7ad-1e4a4c3225a1",
        "issued": "2008-03-07T17:47:02-05:00",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-observation-Observation",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-VitalSign",
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-vital-BodyWeight"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a"
        },
        "valueQuantity": {
          "code": "kg",
          "system": "http://unitsofmeasure.org",
          "unit": "kg",
          "value": 121.12557348891558
        }
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "relation": "search",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/?subject%3APatient.name=Christopher"
    },
    {
      "relation": "first",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/?subject%3APatient.name=Christopher"
    },
    {
      "relation": "self",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation/?subject%3APatient.name=Christopher"
    }
  ],
  "resourceType": "Bundle",
  "total": 8,
  "type": "searchset"
}

Una ricerca concatenata inversa trova le risorse in base a criteri di altre risorse che fanno riferimento a queste risorse. La sintassi per una ricerca concatenata inversa è:

_has:[resource type]:[reference parameter]:[search parameter]=[value]

Ad esempio, la risorsa Appointment ha un parametro di ricerca patient che fa riferimento a una risorsa Patient. Per trovare tutte le risorse Patient a cui fa riferimento una risorsa Appointment con data 2020-04-01, utilizza Patient?_has:Appointment:patient:date=eq2020-04-01.

Le catene inverse possono essere ricorsive ad altre catene o invertire catene, ad esempio Practitioner?_has:Encounter:practitioner:_has:Claim:encounter:created=eq2020-04-01 corrisponderebbe a una Practitioner P se esiste una Encounter E e una Claim C tale che C ha la data di creazione 2020-04-01, C fa riferimento a E tramite il suo riferimento encounter ed E a P tramite il suo riferimento practitioner.

Esempi di ricerca concatenata inversa

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


Nel seguente esempio viene utilizzata la query Patient?_has:Procedure:patient:date=eq2008-03-07.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_has:Procedure:patient:date=eq2008-03-07"

PowerShell


Nel seguente esempio viene utilizzata la query Patient?_has:Procedure:patient:date=eq2008-03-07.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_has:Procedure:patient:date=eq2008-03-07" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
      "resource": {
        "address": [
          {
            "country": "US",
            "line": [
              "907 Arlo Cliffs",
              "Suite 984"
            ],
            "postalCode": "XXXXX"
          }
        ],
        "birthDate": "1940-12-01",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "en-US",
                  "display": "English (United States)",
                  "system": "urn:ietf:bcp:47"
                }
              ]
            }
          }
        ],
        "deceasedDateTime": "2009-07-26T12:01:23-05:00",
        "extension": [
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "2106-3",
                  "display": "White",
                  "system": "http://hl7.org/fhir/v3/Race"
                }
              ],
              "text": "race"
            }
          },
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "2186-5",
                  "display": "Nonhispanic",
                  "system": "http://hl7.org/fhir/v3/Ethnicity"
                }
              ],
              "text": "ethnicity"
            }
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/birthPlace",
            "valueAddress": {
              "city": "Tama",
              "country": "US",
              "postalCode": "52339",
              "state": "Iowa"
            }
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
            "valueString": "Farrah Feeney"
          },
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
            "valueCode": "M"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired",
            "valueBoolean": false
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-actor-FictionalPerson-extension",
            "valueBoolean": true
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-FathersName-extension",
            "valueHumanName": {
              "text": "Christopher Diaz"
            }
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-SocialSecurityNumber-extension",
            "valueString": "999-16-9041"
          }
        ],
        "gender": "male",
        "generalPractitioner": [
          {
            "reference": "Organization/9fb51c89-1453-406c-8357-578311b43a91"
          }
        ],
        "id": "8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
        "identifier": [
          {
            "system": "https://github.com/synthetichealth/synthea",
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          },
          {
            "system": "http://hl7.org/fhir/sid/us-ssn",
            "type": {
              "coding": [
                {
                  "code": "SB",
                  "system": "http://hl7.org/fhir/identifier-type"
                }
              ]
            },
            "value": "999169041"
          },
          {
            "system": "urn:oid:2.16.840.1.113883.4.3.25",
            "type": {
              "coding": [
                {
                  "code": "DL",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "S99992205"
          },
          {
            "system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
            "type": {
              "coding": [
                {
                  "code": "PPN",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "X12551631X"
          },
          {
            "system": "http://hospital.smarthealthit.org",
            "type": {
              "coding": [
                {
                  "code": "MR",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          }
        ],
        "maritalStatus": {
          "coding": [
            {
              "code": "S",
              "system": "http://hl7.org/fhir/v3/MaritalStatus"
            }
          ],
          "text": "S"
        },
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-PersonOfRecord"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "multipleBirthBoolean": false,
        "name": [
          {
            "family": "Diaz",
            "given": [
              "Christopher"
            ],
            "prefix": [
              "Mr."
            ],
            "use": "official"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "system": "phone",
            "use": "home",
            "value": "434-100-2918 x800"
          }
        ],
        "text": {
          "div": "
Generated by Synthea. Version identifier: 2dd4c1c37e2743d14e5073c7b5e42899a3e51531
", "status": "generated" } }, "search": { "mode": "match" } } ], "link": [ { "relation": "search", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_has%3AProcedure%3Apatient%3Adate=eq2008-03-07" }, { "relation": "first", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_has%3AProcedure%3Apatient%3Adate=eq2008-03-07" }, { "relation": "self", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_has%3AProcedure%3Apatient%3Adate=eq2008-03-07" } ], "resourceType": "Bundle", "total": 1, "type": "searchset" }

Includere risorse aggiuntive nei risultati di ricerca

I parametri _include e _revinclude richiedono che i risultati di ricerca includano risorse aggiuntive ("risorse incluse") correlate alle risorse che corrispondono direttamente alla query ("risultati principali"). L'utilizzo di questi parametri è più efficiente rispetto a una serie di richieste per recuperare queste risorse aggiuntive separatamente. Nel bundle searchset restituito dalla ricerca, le risorse aggiunte da questi parametri saranno contrassegnate con entry.search.mode = include per distinguerle dai risultati principali, che avranno entry.search.mode = match.

L'inclusione in avanti con _include aggiunge risorse e versioni delle risorse a cui fanno riferimento i risultati principali, mentre l'inclusione inversa con _revinclude aggiunge risorse che fanno riferimento ai risultati principali. Il riferimento da seguire è specificato dal nome di un parametro di ricerca e in questo modo possono essere utilizzati solo i campi di riferimento disponibili come parametri di ricerca.

I formati dei parametri per _include e _revinclude sono gli stessi, inserendo due o tre valori delimitati da :. Il primo valore è il tipo di risorsa da cui proviene il riferimento, il secondo il nome del parametro di ricerca e il terzo valore facoltativo limita il tipo di risorsa a un singolo tipo nei casi in cui il riferimento può puntare a più di un tipo.

Ad esempio:

  • MedicationRequest?_include=MedicationRequest:subject cerca nelle risorse MedicationRequest e, per ogni risorsa restituita, restituisce anche il target del riferimento subject, che potrebbe essere Group o Patient come definito nella specifica FHIR.
  • MedicationRequest?_include=MedicationRequest:subject:Patient è simile, ma restituisce solo riferimenti subject a risorse Patient.
  • MedicationRequest?_revinclude=Provenance:target cerca in MedicationRequest risorse e, per ogni risorsa restituita, restituisce anche eventuali risorse Provenance in cui il riferimento target su Provenance fa riferimento alla risorsa corrispondente.

_include di esempi di ricerca

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


Nel seguente esempio viene utilizzata la query Observation?code=http://loinc.org|2571-8&_include=*.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation?code=http://loinc.org|2571-8&_include=*"

PowerShell


Nel seguente esempio viene utilizzata la query Observation?code=http://loinc.org|2571-8&_include=*.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Observation?code=http://loinc.org|2571-8&_include=*" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
      "resource": {
        "address": [
          {
            "country": "US",
            "line": [
              "907 Arlo Cliffs",
              "Suite 984"
            ],
            "postalCode": "XXXXX"
          }
        ],
        "birthDate": "1940-12-01",
        "communication": [
          {
            "language": {
              "coding": [
                {
                  "code": "en-US",
                  "display": "English (United States)",
                  "system": "urn:ietf:bcp:47"
                }
              ]
            }
          }
        ],
        "deceasedDateTime": "2009-07-26T12:01:23-05:00",
        "extension": [
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "2106-3",
                  "display": "White",
                  "system": "http://hl7.org/fhir/v3/Race"
                }
              ],
              "text": "race"
            }
          },
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "2186-5",
                  "display": "Nonhispanic",
                  "system": "http://hl7.org/fhir/v3/Ethnicity"
                }
              ],
              "text": "ethnicity"
            }
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/birthPlace",
            "valueAddress": {
              "city": "Tama",
              "country": "US",
              "postalCode": "52339",
              "state": "Iowa"
            }
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
            "valueString": "Farrah Feeney"
          },
          {
            "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
            "valueCode": "M"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired",
            "valueBoolean": false
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-actor-FictionalPerson-extension",
            "valueBoolean": true
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-FathersName-extension",
            "valueHumanName": {
              "text": "Christopher Diaz"
            }
          },
          {
            "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-SocialSecurityNumber-extension",
            "valueString": "999-16-9041"
          }
        ],
        "gender": "male",
        "generalPractitioner": [
          {
            "reference": "Organization/9fb51c89-1453-406c-8357-578311b43a91"
          }
        ],
        "id": "8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
        "identifier": [
          {
            "system": "https://github.com/synthetichealth/synthea",
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          },
          {
            "system": "http://hl7.org/fhir/sid/us-ssn",
            "type": {
              "coding": [
                {
                  "code": "SB",
                  "system": "http://hl7.org/fhir/identifier-type"
                }
              ]
            },
            "value": "999169041"
          },
          {
            "system": "urn:oid:2.16.840.1.113883.4.3.25",
            "type": {
              "coding": [
                {
                  "code": "DL",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "S99992205"
          },
          {
            "system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
            "type": {
              "coding": [
                {
                  "code": "PPN",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "X12551631X"
          },
          {
            "system": "http://hospital.smarthealthit.org",
            "type": {
              "coding": [
                {
                  "code": "MR",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          }
        ],
        "maritalStatus": {
          "coding": [
            {
              "code": "S",
              "system": "http://hl7.org/fhir/v3/MaritalStatus"
            }
          ],
          "text": "S"
        },
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "profile": [
            "http://standardhealthrecord.org/fhir/StructureDefinition/shr-demographics-PersonOfRecord"
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "multipleBirthBoolean": false,
        "name": [
          {
            "family": "Diaz",
            "given": [
              "Christopher"
            ],
            "prefix": [
              "Mr."
            ],
            "use": "official"
          }
        ],
        "resourceType": "Patient",
        "telecom": [
          {
            "system": "phone",
            "use": "home",
            "value": "434-100-2918 x800"
          }
        ],
        "text": {
          "div": "
Generated by Synthea. Version identifier: 2dd4c1c37e2743d14e5073c7b5e42899a3e51531
", "status": "generated" } }, "search": { "mode": "match" } } ], "link": [ { "relation": "search", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_has%3AProcedure%3Apatient%3Adate=eq2008-03-07" }, { "relation": "first", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_has%3AProcedure%3Apatient%3Adate=eq2008-03-07" }, { "relation": "self", "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_has%3AProcedure%3Apatient%3Adate=eq2008-03-07" } ], "resourceType": "Bundle", "total": 1, "type": "searchset" }

Il modificatore :iterate fa sì che un _include venga valutato in modo iterativo. Questo modificatore può seguire un ulteriore livello di riferimenti dai risultati inclusi o seguire strutture ricorsive come Observation:derived-from che fa riferimento a un altro Observation. La profondità della ricorsione è limitata.

Ad esempio:

  • Observation?_include:iterate=Observation:derived-from:Observation esegue ricerche su Observation risorse e segue in modo ricorsivo il riferimento derivato dalle risorse Observation corrispondenti, quindi dalle risorse incluse e così via.
  • MedicationRequest?_revinclude=Provenance:target&_include:iterate=Provenance:agent cercherà in MedicationRequest, includerà le risorse Provenance con un target presente in questo set di risultati, quindi includerà anche le risorse a cui viene fatto riferimento tramite il parametro agent di queste risorse Provenance.

Un carattere jolly, *, indica che devono essere inclusi tutti i riferimenti disponibili come parametri di ricerca. Puoi utilizzare il carattere jolly * come primo e unico argomento in _include o al posto del nome del parametro di ricerca dello standard _include, dove il terzo valore facoltativo limita il tipo di risorsa a un singolo tipo come nel comportamento originale.

Ad esempio:

  • Observation?_include=* cerca in Observation risorse e per ogni risorsa restituisce anche tutte le risorse di riferimento.
  • Observation?_include=Observation:* è equivalente al precedente.
  • MedicationRequest?_include=MedicationRequest:*:Patient restituisce tutti i riferimenti alle risorse Patient per ogni risorsa MedicationRequest.

Il server deduplica le risorse in modo che ogni pagina dei risultati includa solo una copia della risorsa, anche se la risorsa compare in più riferimenti. La stessa risorsa inclusa viene visualizzata in ogni pagina dei risultati se è correlata un risultato principale.

Tieni presente quanto segue in merito alle risorse aggiuntive incluse utilizzando i parametri _include e _revinclude:

  • Le risorse incluse non contano ai fini delle dimensioni della pagina. Non vengono conteggiate in Bundle.total e potrebbero causare un numero di risorse restituite maggiore di un parametro _count specificato.

  • Poiché le risorse incluse non vengono conteggiate ai fini delle dimensioni della pagina, presta attenzione ai parametri _include e _revinclude, che potrebbero generare molti risultati. Risultati di grandi dimensioni possono causare timeout o errori. Valuta la possibilità di utilizzare un valore _count inferiore per limitare il numero di risultati principali se prevedi molti risultati inclusi. Evita di seguire una relazione one-to-many in cui il lato multiplo della relazione non è limitato.

  • Un singolo parametro _revinclude aggiunge al massimo 100 risorse aggiuntive. Per i casi d'uso in cui potrebbero esserci più di 100 risorse che fanno riferimento ai risultati principali, usa una richiesta di query di ricerca separata usando i parametri di dimensione della pagina e di paginazione per recuperare più risultati.

Limitazione dei campi restituiti nei risultati di ricerca

Il parametro _elements consente al client di richiedere che venga restituito un solo sottoinsieme di campi per ogni risultato di ricerca al fine di ridurre le dimensioni della risposta omettendo dati non necessari. Il parametro accetta un elenco separato da virgole di nomi degli elementi base nella risorsa, ad esempio Patient?_elements=identifier,contact,link. Solo questi campi e i relativi campi secondari saranno inclusi nelle risorse restituite. Le risorse nella risposta modificate da questo parametro conterranno un valore meta.tag pari a SUBSETTED a indicare che sono incomplete.

_elements di esempi di ricerca

REST

Prima di utilizzare i dati della richiesta, effettua le seguenti sostituzioni:

  • PROJECT_ID: l'ID del tuo progetto Google Cloud
  • LOCATION: la posizione del set di dati padre
  • DATASET_ID: il set di dati padre del datastore FHIR
  • FHIR_STORE_ID: l'ID datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

arricciatura


Nel seguente esempio viene utilizzata la query Patient?_elements=identifier,contact,link.

Esegui questo comando:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_elements=identifier,contact,link"

PowerShell


Nel seguente esempio viene utilizzata la query Patient?_elements=identifier,contact,link.

Esegui questo comando:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?_elements=identifier,contact,link" | Select-Object -Expand Content

Dovresti ricevere una risposta JSON simile alla seguente:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient3",
      "resource": {
        "id": "patient3",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "SUBSETTED",
              "system": "http://hl7.org/fhir/v3/ObservationValue"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient2",
      "resource": {
        "id": "patient2",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "SUBSETTED",
              "system": "http://hl7.org/fhir/v3/ObservationValue"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
      "resource": {
        "id": "8ac08aa9-63d2-4e81-8647-3a138d7f9f5a",
        "identifier": [
          {
            "system": "https://github.com/synthetichealth/synthea",
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          },
          {
            "system": "http://hl7.org/fhir/sid/us-ssn",
            "type": {
              "coding": [
                {
                  "code": "SB",
                  "system": "http://hl7.org/fhir/identifier-type"
                }
              ]
            },
            "value": "999169041"
          },
          {
            "system": "urn:oid:2.16.840.1.113883.4.3.25",
            "type": {
              "coding": [
                {
                  "code": "DL",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "S99992205"
          },
          {
            "system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
            "type": {
              "coding": [
                {
                  "code": "PPN",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "X12551631X"
          },
          {
            "system": "http://hospital.smarthealthit.org",
            "type": {
              "coding": [
                {
                  "code": "MR",
                  "system": "http://hl7.org/fhir/v2/0203"
                }
              ]
            },
            "value": "c1ee4b49-3194-4b39-91ed-4d1393a780c6"
          }
        ],
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "SUBSETTED",
              "system": "http://hl7.org/fhir/v3/ObservationValue"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/patient1",
      "resource": {
        "id": "patient1",
        "meta": {
          "lastUpdated": "YYYY-MM-DDTHH:MM:SS+ZZ:ZZ",
          "tag": [
            {
              "code": "SUBSETTED",
              "system": "http://hl7.org/fhir/v3/ObservationValue"
            }
          ],
          "versionId": "MTYzMTgyMTExMDIyMDk5ODAwMA"
        },
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "relation": "search",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_elements=identifier%2Ccontact%2Clink"
    },
    {
      "relation": "first",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_elements=identifier%2Ccontact%2Clink"
    },
    {
      "relation": "self",
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?_elements=identifier%2Ccontact%2Clink"
    }
  ],
  "resourceType": "Bundle",
  "total": 4,
  "type": "searchset"
}

L'API Cloud Healthcare ha un supporto limitato per il parametro _summary, che fornisce sottoinsiemi predefiniti di campi di risorse simili a _elements:

  • _summary=text restituisce solo i campi di primo livello text, id e meta
  • _summary=data rimuove il campo text e restituisce tutti gli altri campi