Funzioni di ricerca FHIR avanzate

Questa pagina spiega come cercare risorse FHIR utilizzando funzionalità di query più avanzate disponibili 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à di ricerca FHIR avanzata. Salva il file r4_bundle.json nella 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 restituisce una corrispondenza del prefisso, senza distinzione tra maiuscole e minuscole, attraverso il piegamento al modulo NFC standard Unicode. La punteggiatura e gli spazi vuoti aggiuntivi vengono ignorati.

Sono disponibili i seguenti modificatori:

  • :contains associa le 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 sezione seguente per vedere un esempio di utilizzo dei modificatori delle stringhe di ricerca:

Esempi di modificatori di ricerca delle 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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza 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


Il seguente esempio utilizza 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 parametro. Ad esempio, il numero 7.00 ha un intervallo implicito compreso tra 6.995 e 7.005 esclusi. La data 2015-08-12 ha un intervallo compreso tra 2015-08-12T00:00:00 (incluso) ed esclusivo (2015-08-13T00:00:00).

La precisione influisce sui risultati restituiti per i confronti di uguaglianze. Ad esempio, un valore 7.03 in una risorsa potrebbe corrispondere alla ricerca di value=7.0, ma non a una 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 con un valore singleton. Se non vengono specificati prefissi, il valore predefinito è eq.

  • eq: equivale a specificare, l'esatto valore memorizzato è compreso nell'intervallo definito dalla precisione del valore del parametro
  • ne: non uguale, il contrario di eq
  • gt: il valore esatto memorizzato è maggiore del valore esatto del parametro
  • lt: il valore esatto memorizzato è inferiore al valore esatto del parametro
  • ge: il valore esatto memorizzato è maggiore o uguale al valore esatto del parametro
  • le: il valore esatto memorizzato è 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 superiore e inferiore espliciti. I seguenti prefissi si applicano ai confronti degli intervalli. Se non vengono specificati prefissi, il valore predefinito è eq.

  • eq: è uguale, l'intervallo del valore parametro contiene completamente l'intervallo del target
  • ne: non uguale, il contrario di eq
  • gt: maggiore di, l'intervallo sopra il valore parametro si sovrappone all'intervallo del target
  • lt: minore di, l'intervallo al di sotto del 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 numeri, date e quantità di campioni

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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


L'esempio seguente utilizza la query _lastUpdated=gt2018-01-01 per cercare le 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 le 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 per i 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 la data su 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 token è esatta.

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

  • [parameter]=[code] corrisponde al valore code a prescindere da system
  • [parameter]=[system]|[code] deve corrispondere a quanto specificato per system e code
  • [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 alternativa:

  • :not annulla 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 accetta un parametro solo nel formato [system]|[code] e corrisponde alle risorse in cui il codice nella risorsa assume il parametro di query. Per utilizzare questo modificatore, il valore system specificato deve esistere nel datastore FHIR come risorsa CodeSystem.
  • :below è simile a :above, ma corrisponde se il codice nella risorsa viene incorporato dal parametro di query.
  • :in richiede un singolo parametro utilizzando la sintassi dei parametri 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 presente nel ValueSet di riferimento.
  • :not-in annulla le condizioni di :in

Le ricerche con token si applicano anche ai campi booleani e URI e ad alcuni campi di stringhe in cui è consentita solo la corrispondenza esatta. In questi casi, l'unico formato del 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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza la query Patient?_tag=tag-system|tag2 per cercare le risorse Pazienti con 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


Il seguente esempio utilizza la query Patient?_tag=tag-system|tag2 per cercare le risorse Pazienti con 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 in corso...

Il modificatore di ricerca :missing può essere utilizzato con qualsiasi parametro di ricerca per trovare una corrispondenza in base alla presenza o all'assenza di qualsiasi valore nel campo specificato. Ad esempio, Patient?gender=unknown corrisponde alle risorse che contengono esplicitamente il valore enum unknown per il genere, ma poiché questo campo non è obbligatorio, potrebbero esserci altre risorse che non compilano affatto il campo. Queste risorse possono essere abbinate da Patient?gender:missing=true. Al contrario, Patient?gender:missing=false corrisponde a qualsiasi risorsa che compila esplicitamente 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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza 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


Il seguente esempio utilizza 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 nei campi basati su stringhe (esclusi i campi di numero, data o enumerazione) se il campo è la destinazione di qualsiasi parametro di ricerca nella risorsa. Per impostazione predefinita, _content corrisponde alle risorse che contengono tutte le parole della query, con il supporto di operatori aggiuntivi:

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

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

Il parametro _text esegue lo stesso tipo di corrispondenza solo per il campo Narrativa, 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 ricerca testuale

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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza 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


Il seguente esempio utilizza 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 composita

Quando si esegue una ricerca utilizzando più parametri di query, in alcuni casi i singoli parametri di ricerca combinati con AND corrisponderebbero a risultati indesiderati. I parametri di ricerca composita sono un tipo speciale di parametro di ricerca che consente di 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. La ricerca di Observation?component-code=8867-4&component-value-quantity=lt50 corrisponde a una risorsa con un componente contenente code di 8867-4 e un componente diverso con value inferiore a 50. Questa ricerca non può essere utilizzata per limitare una corrispondenza a questi due valori all'interno dello stesso componente.

I parametri di ricerca composita 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 composita non consentono l'utilizzo di modificatori.

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

Esempi di ricerca composita

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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza 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


Il seguente esempio utilizza 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 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 di 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, generando:

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

Ad esempio, Observation ha un parametro di ricerca di riferimento subject che può rimandare a Group, Device, Patient o Location. Per trovare Observations con subject, ovvero Patient il cui nome 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 corrisponderebbe a un Patient con due riferimenti general-practitioner, uno denominato "Mario" e l'altro con un indirizzo in Canada. Non esiste una sintassi per raggruppare queste clausole in modo che abbiano una corrispondenza solo con Joe dal Canada.

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

Esempi di ricerca concatenata

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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


L'esempio seguente utilizza la query Observation?subject:Patient.name=Christopher per restituire tutte le osservazioni il cui subject è 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 il cui subject è 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 associa le risorse in base a criteri su altre risorse che le fanno riferimento. La sintassi per una ricerca concatenata inversa è la seguente:

_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 con altre catene o catene inverse. Ad esempio, Practitioner?_has:Encounter:practitioner:_has:Claim:encounter:created=eq2020-04-01 corrisponde a una P di Practitioner se esiste una Encounter E e una Claim C in modo che C abbia la data di creazione 2020-04-01, C si riferisce a E tramite il suo riferimento encounter ed E si riferisce 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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza 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


Il seguente esempio utilizza 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 all'effettuazione di una serie di richieste per recuperare queste risorse aggiuntive separatamente. Nel bundle searchset restituito dalla ricerca, le risorse aggiunte da questi parametri verranno 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 le risorse che fanno riferimento ai risultati primari. Il riferimento da seguire viene specificato dal nome di un parametro di ricerca e solo i campi di riferimento disponibili come parametri di ricerca possono essere utilizzati in questo modo.

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

Ad esempio:

  • MedicationRequest?_include=MedicationRequest:subject cerca su MedicationRequest risorse e per ogni risorsa restituita restituisce anche la destinazione 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 Patient risorse.
  • MedicationRequest?_revinclude=Provenance:target cerca su MedicationRequest risorse e, per ogni risorsa restituita, restituisce anche qualsiasi risorsa Provenance in cui il riferimento target su Provenance si riferisce alla risorsa corrispondente.

_include 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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza 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


Il seguente esempio utilizza 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 fanno riferimento a un altro Observation. La profondità della ricorsione è limitata.

Ad esempio:

  • Observation?_include:iterate=Observation:derived-from:Observation cerca su Observation risorse e segue in modo ricorsivo il riferimento derivato dalle risorse Observation corrispondenti, poi dalle risorse incluse e così via.
  • MedicationRequest?_revinclude=Provenance:target&_include:iterate=Provenance:agent eseguirà la ricerca su MedicationRequest, includerà Provenance risorse con un target presente in questo set di risultati e 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 oppure al posto del nome del parametro di ricerca dallo standard _include, dove il terzo valore facoltativo limita il tipo di risorsa a un solo tipo come nel comportamento originale.

Ad esempio:

  • Observation?_include=* cerca su 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 quest'ultima compare in più riferimenti. La stessa risorsa inclusa viene visualizzata in ogni pagina dei risultati se un risultato principale è correlato.

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

  • Le risorse incluse non vengono conteggiate 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 produrre molti risultati. I risultati di grandi dimensioni possono causare timeout o errori. Potresti utilizzare un valore _count più basso per limitare il numero di risultati principali se prevedi molti risultati inclusi. Evita di seguire una relazione one-to-many in cui i lati multipli non sono limitati.

  • 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 primari, utilizza una richiesta di query di ricerca separata utilizzando le dimensioni della pagina e i parametri di paginazione per recuperare più risultati.

Limitare i campi restituiti nei risultati di ricerca

Il parametro _elements consente al client di richiedere che venga restituito solo un 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 di elementi di 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 che sono state alterate da questo parametro conterranno un valore meta.tag SUBSETTED per indicare che sono incomplete.

_elements 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 del datastore FHIR

Per inviare la richiesta, scegli una delle seguenti opzioni:

curl


Il seguente esempio utilizza 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


Il seguente esempio utilizza 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 supporta limitato il parametro _summary, che fornisce sottoinsiemi predefiniti di campi delle 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