Funzioni di ricerca FHIR avanzate

Questa pagina spiega come cercare risorse FHIR utilizzando query più avanzate di funzionalità disponibili tramite projects.locations.datasets.fhirStores.fhir.search . Questa guida presuppone che tu abbia già familiarità con i contenuti di Ricerca di risorse FHIR.

Bundle FHIR di esempio

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

esegui il bundle FHIR di esempio

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

Modificatori di ricerca delle stringhe

Una ricerca per stringa utilizza per impostazione predefinita una corrispondenza del prefisso, senza distinzione tra maiuscole e minuscole fino al formato Unicode NFC standard. Punteggiatura ed extra lo spazio vuoto viene ignorato.

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 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 parametro valore. Ad esempio, il numero 7.00 ha un intervallo implicito di 6.995 (inclusi) in esclusiva per 7.005. La data 2015-08-12 ha un intervallo di Da 2015-08-12T00:00:00 (incluso) a 2015-08-13T00:00:00 (esclusivamente).

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

Tutti i valori in virgola mobile clinicamente significativi in FHIR sono rappresentati da come Decimal e Quantità che registrano la precisione del valore memorizzato. A titolo di eccezione, ci sono alcune che utilizzano numeri interi semplici, ad esempio per rappresentare una posizione in in 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, il valore esatto memorizzato è compreso nell'intervallo definito dal precisione del valore 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 valore parametro
  • le: il valore esatto memorizzato è inferiore o uguale al parametro esatto valore

I valori delle date hanno un intervallo implicito basato sul livello di specificità dei (un anno, un mese, un giorno). Altri tipi di dati, ad esempio Intervallo e Ciclo contengono limiti superiore e inferiore espliciti. I seguenti prefissi si applicano all'intervallo e i confronti. Se non vengono specificati prefissi, il valore predefinito è eq.

  • eq: è uguale a, l'intervallo del valore parametro contiene completamente l'intervallo di il target
  • ne: non uguale, il contrario di eq
  • gt: maggiore di, l'intervallo sopra il valore parametro si sovrappone al 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 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


Il seguente esempio utilizza l'elemento _lastUpdated=gt2018-01-01 query per cercare le risorse Pazienti 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


Il seguente esempio utilizza l'elemento _lastUpdated=gt2018-01-01 query per cercare le risorse Pazienti 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 giorno 01-01-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 a l'ultimo aggiornamento delle 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. Corrispondenza delle stringhe in base a un parametro token sia esatta.

La maggior parte delle ricerche di token si applica a tipi di dati complessi contenenti un valore system che è un URI che indica il sistema di denominazione da cui proviene il valore di code. Questi le 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) in text o display associato al codice, anziché il valore del codice stesso
  • :above accetta un parametro solo nel formato [system]|[code] e corrisponde in cui il codice della risorsa assume il parametro di query. Per utilizzare questo modificatore, il valore system specificato, deve esistere nel datastore FHIR come CodeSystem risorsa.
  • :below è simile a :above, ma corrisponde se il codice nella risorsa viene riassunto dal parametro di query.
  • :in richiede un singolo parametro utilizzando la sintassi dei parametri di riferimento, per esempio code:in=ValueSet/1234. Il riferimento deve fare riferimento a un ValueSet risorsa all'interno dello stesso datastore FHIR. Il modificatore corrisponde a qualsiasi codice presente il ValueSet di riferimento.
  • :not-in annulla le condizioni di :in

Le ricerche di token si applicano anche ai campi booleani e URI e a determinate stringhe e campi in cui è consentita solo la corrispondenza esatta. In questi casi, l'unico 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 l'elemento 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 l'elemento 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. Per esempio, Patient?gender=unknown corrisponde alle risorse che contengono esplicitamente unknown valore enum per il genere, ma poiché questo campo non è obbligatorio, potrebbero esserci ad altre risorse che non compilano il campo. Queste risorse possono essere corrisponde a Patient?gender:missing=true. Il 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 testuale su stringhe campi (esclusi i campi di numero, data o enum) se il campo è il target di a qualsiasi parametro di ricerca sulla 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 def.

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

Il parametro _text esegue lo stesso tipo di corrispondenza solo nel campo Narrativa , che deve contenere un riepilogo leggibile della risorsa contenuti. L'API Cloud Healthcare non genera automaticamente riepilogo, ma supporta il parametro di ricerca _text se questi dati sono stati compilati da il client quando crei o aggiorni la 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 ricerca, in alcuni casi singoli i parametri di ricerca combinati con AND corrisponderebbero a risultati indesiderati. Composito i parametri di ricerca sono un tipo speciale di parametro di ricerca che consente di problema.

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

I parametri di ricerca composita definiscono un nuovo parametro che combina altri due parametri di ricerca e definisce un livello di nidificazione entro il quale devono essere corrispondono. Nella query, i due valori sono uniti da $. Ad esempio: Observation ha un parametro composito component-code-value-quantity che può limita 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 compositi vengono supportate dall'API Cloud Healthcare è disponibile nella dichiarazione di capacità o la 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 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ò puntano a Group, Device, Patient o Location. Per trovare Observations che hanno un subject, ovvero Patient il cui nome inizia con "Joe", puoi cercare Observation?subject:Patient.name=Joe.

Se la query ha più parametri concatenati, viene valutata ogni catena separatamente. Ad esempio, Patient?general-practitioner.name=Joe&general-practitioner.address-country=Canada corrisponderebbe a un Patient con due Riferimenti general-practitioner, uno con nome "Joe" e l'altra di avere in Canada. Non esiste una sintassi per raggruppare queste clausole in modo che corrispondano solo Joe dal Canada.

Le ricerche concatenate possono essere ricorsive con altre catene o catene inverse, ad esempio Observation?subject:Patient.organization.name=Acme corrisponde a un Observation che fa riferimento a subject che fa riferimento a organization che ha un valore 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


Il seguente esempio utilizza la query Observation?subject:Patient.name=Christopher per restituire tutte le osservazioni con subject, ovvero Patient ha un nome che 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


Il seguente esempio utilizza la query Observation?subject:Patient.name=Christopher per restituire tutte le osservazioni con subject, ovvero Patient ha un nome che 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 vi 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 riferimento a una risorsa Patient. Per trovare tutte le Patient risorse che sono 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 un Practitioner P se esistono Encounter E e Claim C come che C ha data di creazione 2020-04-01, C si riferisce a E tramite 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 includere risorse aggiuntive ("risorse incluse") relative alle risorse che corrispondono direttamente alla query ("risultati principali"). L'uso di questi parametri richiede efficiente rispetto all'invio di una serie di richieste per recuperare risorse separatamente. Nel bundle searchset restituito dalla ricerca, le risorse aggiunte da questi parametri saranno contrassegnate entry.search.mode = include per distinguerli dai risultati primari che avrà entry.search.mode = match.

Inoltra l'inclusione con _include aggiunge risorse e versioni delle risorse a cui si fa riferimento nei risultati principali e l'inclusione inversa con _revinclude aggiunge che fanno riferimento ai risultati primari. Il riferimento da seguire è specificato dal nome di un parametro di ricerca e solo i campi di riferimento che disponibili come parametri di ricerca.

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

Ad esempio:

  • MedicationRequest?_include=MedicationRequest:subject ricerche su MedicationRequest risorse e, per ogni risorsa restituita, restituisce anche target del riferimento subject, che potrebbe essere Group o Patient definito nella specifica FHIR.
  • MedicationRequest?_include=MedicationRequest:subject:Patient è simile ma restituisce solo i riferimenti subject alle risorse Patient.
  • MedicationRequest?_revinclude=Provenance:target ricerche su MedicationRequest risorse e, per ogni risorsa restituita, restituisce anche Risorse Provenance in cui il riferimento target su Provenance si riferisce a la 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 l'elemento Observation?code=http://loinc.org|2571-8&_include=* query.

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 l'elemento Observation?code=http://loinc.org|2571-8&_include=* query.

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 a un altro Observation. La profondità della ricorsione è limitata.

Ad esempio:

  • Observation?_include:iterate=Observation:derived-from:Observation di ricerche su Observation risorse e segue in modo ricorsivo il riferimento derivato da Observation risorse corrispondenti e poi da risorse incluse. attiva.
  • 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 include anche le risorse a cui viene fatto riferimento tramite il parametro agent delle Provenance risorse.

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

Ad esempio:

  • Observation?_include=* cerca in Observation risorse e per ogni e la risorsa restituisce tutte le risorse di riferimento.
  • Observation?_include=Observation:* è equivalente al precedente.
  • MedicationRequest?_include=MedicationRequest:*:Patient restituisce tutti riferimenti a Patient risorse 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 conteggiati in Bundle.total e potrebbero causare il numero in modo che siano maggiori di un parametro _count specificato.

  • Poiché le risorse incluse non vengono conteggiate ai fini delle dimensioni della pagina, fai attenzione Parametri _include e _revinclude che potrebbero produrre molti risultati. Grande le dimensioni dei risultati possono causare timeout o errori. Potresti usare un _count più piccolo per limitare il numero di risultati primari se prevedi molti risultati inclusi. Evita di seguire una relazione one-to-many in cui le parti in molti della relazione non sono limitati.

  • Un singolo parametro _revinclude ne aggiunge al massimo 100 Google Cloud. Per i casi d'uso in cui potrebbero essere presenti più di 100 risorse che fanno riferimento ai risultati principali, utilizza una richiesta di query di ricerca separata in base alle dimensioni pagina e parametri di impaginazione per recuperare più risultati.

Limitare i campi restituiti nei risultati di ricerca

Il parametro _elements consente al client di richiedere che solo un sottoinsieme di vengono restituiti per ogni risultato di ricerca al fine di ridurre le dimensioni della risposta del omettere dati non necessari. Il parametro accetta un elenco di valori di base separati da virgole nomi di elementi nella risorsa, ad esempio Patient?_elements=identifier,contact,link. Solo questi campi e i relativi saranno inclusi nelle risorse restituite. Risorse nella risposta che sono state alterate da questo parametro conterranno il valore meta.tag di SUBSETTED per indicare che sono incompleti.

_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 l'elemento Patient?_elements=identifier,contact,link query.

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 l'elemento Patient?_elements=identifier,contact,link query.

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