HS.FHIRServer.Storage.Json.Tools.FixReference
class HS.FHIRServer.Storage.Json.Tools.FixReference extends %SYS.Task.Definition
This utility class parses all non-Deleted resources in the active FHIRServer repos in the current namespace. It tries to fix malformed FHIR Reference objects that it finds. A malformed Reference object is one whose "reference" property is populated but is not a relative or absolute reference URL (aka, "literal reference").Method Inventory
Parameters
parameter ProgressGlobal = ^HS.FHIRServer.Fix;
Methods
method OnTask() as %Status
Inherited description: This method is responsible for executing the task.
At the scheduled time, the Task Manager creates an instance of this object, sets any property values using the stored "Settings" for the task, and then invokes this method to execute the task.
In order to execute a real task, override this method in a subclass.
At the scheduled time, the Task Manager creates an instance of this object, sets any property values using the stored "Settings" for the task, and then invokes this method to execute the task.
In order to execute a real task, override this method in a subclass.
classmethod RepairOneResource(pResourceObj As %DynamicObject, ByRef pContext)
Parse and repair one resource.
@argument pResourceObj %DynamicObject representation of a FHIR resource.
@argument pContext Array that holds various values to control processing,
held in an array to avoid a proliferation of input parameters.
Required context inputs:
context("fhirService") = FHIR Service instance for the current repo, to use for Search and Update.
context("schema") = FHIR schema (aka metadata API) to use for getting FHIR property information.
context("csp_url") = FHIR server URL, used for info logging purposes.
context("use_update_in_place") = useUpdateInPlace
Context maintained across many calls of this method:
context("propInfo") = In-memory buffer of property type information, to aid the speed of
this utility and reduce the number of global refs.
Required context inputs:
Context maintained across many calls of this method:
classmethod RepairReferencesFromObject(pObj As %DynamicObject, pFHIRType As %String, ByRef pContext)
This method assumes that the FHIR resource is valid per the specified
FHIR schema, except for the possible malformed reference objects.
@argument pObj %DynamicObject representation of a FHIR resource or property object.
@argument pFHIRType The FHIR data type (e.g., resource type name, complex type name, etc.) of pObj.
@argument pContext Array of values to control processing, hold state and return statuses.
Required context inputs:
context("fhirService") = FHIR Service instance for the current repo, to use for Search and Update.
context("schema") = FHIR schema (aka metadata API) to use for getting FHIR property information.
context("resource_key") = FHIR resource type and resource id to use in log messages.
Optional context inputs:
context("top_level") = Boolean indicating whether pObj is the top-level of the FHIR resource.
Returned context values:
context("needs_repair") = Boolean indicating whether the current FHIR resource was modified and
needs to be updated in the repo.
context("repair_log") = %DynamicArray of content changes and/or repair fails, to be applied to
persistent logging after a resource has been completely evaluated.
Context maintained across many calls of this method:
context("propInfo") = In-memory buffer of property type information, to aid the speed of
this utility and reduce the number of global refs.
@argument pObj %DynamicObject representation of a FHIR resource or property object.
@argument pFHIRType The FHIR data type (e.g., resource type name, complex type name, etc.) of pObj.
@argument pContext Array of values to control processing, hold state and return statuses.
Required context inputs:
Optional context inputs:
Returned context values:
Context maintained across many calls of this method:
classmethod Run() as %Status
This method parses all non-Deleted resources in the active FHIRServer
repos in the current namespace. It tries to fix malformed FHIR
Reference objects that it finds. A malformed Reference object is one
whose "reference" property is populated but is not a relative or
absolute reference URL (a "literal reference").
Details:
- This utility can repair a Reference only upon these conditions:
- - The Reference.identifier property is populated.
AND
- - Either: a) The target resource type for the reference property is a single resource type, OR b) the Reference.type property is populated with one of the Reference target resource types.
AND
- - A search on the repo using the criteria from Reference.identifier finds one and only one resource.
- If all conditions are met, then the resource type and resource id from the found resource are used to repair the Reference.reference value.
- Attempts to repair are logged to the Interoperability Event Log in the local namespace.
Details:
- This utility can repair a Reference only upon these conditions:
- - The Reference.identifier property is populated.
AND
- - Either: a) The target resource type for the reference property is a single resource type, OR b) the Reference.type property is populated with one of the Reference target resource types.
AND
- - A search on the repo using the criteria from Reference.identifier finds one and only one resource.
- If all conditions are met, then the resource type and resource id from the found resource are used to repair the Reference.reference value.
- Attempts to repair are logged to the Interoperability Event Log in the local namespace.
Inherited Members
Inherited Properties
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()
- CheckPermission()
- GetCollectionType()
- GetPropertyName()
- GetSettings()
- GetTaskName()
- OnSubmit()
- SetSettings()