Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird das Konzept der referenziellen Integrität in Bezug auf Ressourcen in einem FHIR-Speicher in der Cloud Healthcare API erläutert.
Der FHIR-Speicher erzwingt referenzielle Integrität bei Verweisen auf andere Ressourcen im selben Speicher:
Beim Erstellen, Aktualisieren oder Patchen einer Ressource schlägt der Vorgang fehl, wenn der resultierende Inhalt der Ressource einen Verweis auf eine nicht vorhandene Ressource oder Ressourcenversion enthält.
Beim Löschen einer Ressource schlägt der Vorgang fehl, wenn andere Ressourcen im Speicher auf diese Ressource verweisen.
Die referenzielle Integrität kann durch Festlegen der Option disableReferentialIntegrity zum Zeitpunkt der Speichererstellung deaktiviert werden.
Ausschluss und Einschränkungen
Die FHIR-Spezifikation lässt verschiedene Arten von Referenzen zu, von denen einige nicht von der referenziellen Integrität abgedeckt werden:
Eine externe Referenz, die durch eine URL angegeben wird, die nicht mit der Basis-URL des FHIR-Speichers übereinstimmt.
Eine logische Referenz, die durch eine Geschäfts-ID angegeben wird.
Eine Referenz, die nur eine für Menschen lesbare Zeichenfolge enthält.
Verweise in FHIR-Erweiterungen unterliegen nur der referenziellen Integrität, wenn complexDataTypeReferenceParsing auf ENABLED gesetzt ist. Dies ist der Standardwert für neue FHIR-Speicher.
Bestimmte API-Methoden können unter bestimmten Bedingungen dazu führen, dass die referenzielle Integrität verletzt wird:
Mit FHIR können Verweise mithilfe des Formulars [resource type]/[resource ID]/_history/[version ID] auf eine bestimmte Verlaufsversion einer Ressource verweisen. Die Referenzintegrität wird beim Erstellen oder Aktualisieren auf diese Referenzen angewendet. Wenn Sie jedoch die Methode Resource-purge verwenden, um historische Versionen einer Ressource zu entfernen, werden eingehende Referenzen nicht überprüft.
Die FHIR-Methode import erzwingt keine referenzielle Integrität. Die Methode kann entweder verwendet werden, wenn keine referenzielle Integrität erforderlich ist oder wenn die Eingabe bekanntermaßen die referenzielle Integrität erfüllt. Im letzteren Fall erreichen die Referenzen im FHIR-Speicher nach dem erfolgreichen Import jeder Ressource Eventual Consistency.
Die Methode deidentify kann möglicherweise einen FHIR-Speicher in einem Status erstellen, der während des Vorgangs vorübergehend oder dauerhaft nicht erfüllt wird, wenn ein bestimmter Teil der Ressourcen mithilfe von Filtern ausgewählt wird.
Ein Zustand, in dem die Integrität erzwungen wird, aber durch einen der vorherigen Fälle verletzt wurde, führt dazu, dass Ressourcenaktualisierungen für eine Ressource abgelehnt werden, die eine ungültige Referenz enthält, es sei denn, das Update korrigiert oder entfernt alle ungültigen Referenzen. Ein solcher Status kann auch zu Problemen für Anwendungen führen, die den Speicher verwenden und Integrität voraussetzen.
Enthaltene Ressourcen
Die FHIR-Spezifikation enthält eine Einschränkung, dass auf jede enthaltene Ressource von irgendwo innerhalb ihrer enthaltenen Ressource verwiesen werden muss (einschließlich Verweise von anderen enthaltenen Ressourcen) und jeder Verweis auf eine enthaltene Ressource gültig sein muss. Diese Einschränkung wird unabhängig von der referenziellen Integrität erzwungen und kann nicht deaktiviert werden, da sie in den FHIRPath-Invarianten für jede einzelne Ressource definiert ist.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-18 (UTC)."],[[["\u003cp\u003eThis page outlines how the Cloud Healthcare API's FHIR store enforces referential integrity on references to other resources within the same store, causing operations to fail if references are invalid or if referenced resources are deleted.\u003c/p\u003e\n"],["\u003cp\u003eReferential integrity can be disabled during FHIR store creation using the \u003ccode\u003edisableReferentialIntegrity\u003c/code\u003e option.\u003c/p\u003e\n"],["\u003cp\u003eCertain types of references, such as external URLs, logical identifiers, or simple display strings, are excluded from referential integrity checks, and references within FHIR extensions are only checked if \u003ccode\u003ecomplexDataTypeReferenceParsing\u003c/code\u003e is enabled.\u003c/p\u003e\n"],["\u003cp\u003eSpecific API methods like \u003ccode\u003eResource-purge\u003c/code\u003e, \u003ccode\u003eimport\u003c/code\u003e, and \u003ccode\u003edeidentify\u003c/code\u003e can bypass referential integrity checks, potentially leading to a state where integrity is violated.\u003c/p\u003e\n"],["\u003cp\u003eThe FHIR specification's constraint on contained resources, which requires them to be referenced within their containing resource and every reference to them to be valid, is enforced independently and cannot be disabled.\u003c/p\u003e\n"]]],[],null,["# FHIR referential integrity\n\nThis page explains the concept of referential integrity as it relates to\nresources within a FHIR store in the Cloud Healthcare API.\n\nThe FHIR store enforces referential integrity on references to other resources\nwithin the same store:\n\n- When creating, updating, or patching a resource, the operation will fail if the resulting content of the resource contains a reference to a resource or resource version that does not exist.\n- When deleting a resource, the operation will fail if there are other resources in the store that reference that resource.\n\nReferential integrity can be disabled by setting the\n[`disableReferentialIntegrity`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores#FhirStore.FIELDS.disable_referential_integrity) option at the time of store creation.\n\nExclusions and limitations\n--------------------------\n\nThe FHIR specification allows various forms of\n[references](http://hl7.org/fhir/references.html), some of which are not\ncovered by referential integrity:\n\n- An external reference specified by a URL that does not match the base URL of the FHIR store.\n- A logical reference specified by a business identifier.\n- A reference containing only a human-readable display string.\n- References inside FHIR [extensions](http://hl7.org/fhir/extensibility.html) are only subject to referential integrity if [`complexDataTypeReferenceParsing`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores#ComplexDataTypeReferenceParsing) is set to `ENABLED`. This is the default value for new FHIR stores.\n\nCertain API methods can cause referential integrity to be violated under some conditions:\n\n- FHIR allows references to point to a specific history version of a resource using the form `[resource type]/[resource ID]/_history/[version ID]`. Referential integrity is applied to these references when created or updated, but when using the [`Resource-purge`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores.fhir/Resource-purge) method to remove historical versions of a resource, incoming references are **not** checked.\n- The FHIR [`import`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores/import) method does not enforce referential integrity. The method may be used either in cases where referential integrity is not required, or where the input is known to satisfy referential integrity. In the latter case, the references inside the FHIR store will reach eventual consistency after every resource is successfully imported.\n- The [`deidentify`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores/deidentify) method can potentially create a FHIR store in a state that does not satisfy referential integrity temporarily during the operation, or permanently if filters are used to select a subset of resources.\n\nA state where integrity is being enforced but has been violated by one of the previous cases will\ncause resource updates to be rejected on a resource that contains an invalid reference, unless the\nupdate fixes or removes all invalid references. Such a state might also create difficulties for\napplications using the store that assume integrity.\n\nContained resources\n-------------------\n\nThe FHIR specification contains a constraint that every\n[contained resource](http://hl7.org/fhir/references.html#contained) must be\nreferenced from somewhere within its containing resource (including references from other\ncontained resources), and every reference to a contained resource must be valid. This constraint\nis enforced separately from referential integrity and cannot be disabled as it is defined in the\nFHIRPath invariants on each individual resource."]]