HS.FHIRServer.API.Interactions
abstract class HS.FHIRServer.API.Interactions extends %Library.RegisteredObject
Property Inventory
Method Inventory
- Add()
- Batch()
- Delete()
- FindResourceMeta()
- GetPatientStatus()
- GetResourceMeta()
- GetVersionList()
- HardDelete()
- History()
- JSONPatch()
- LoadMetadata()
- OnAfterRequest()
- OnBeforeRequest()
- Operation()
- PostProcessRead()
- PostProcessSearch()
- Read()
- Search()
- SetMetadata()
- Update()
Parameters
parameter BatchHandlerClass = HS.FHIRServer.DefaultBundleProcessor;
@API
Declares the name of the class that will be invoked to handle a FHIR batch or transaction request.
parameter OAuth2TokenHandlerClass = HS.FHIRServer.API.OAuth2Token;
@API
Declares the name of the class that will handle validation of FHIR interactions against OAuth 2.0 tokens.
parameter OperationHandlerClass = HS.FHIRServer.API.OperationHandler;
@API
Declares the name of the class that will be invoked to handle a FHIR Operation request.
parameter ResourceValidatorClass = HS.FHIRServer.Util.ResourceValidator;
@API
Declares the name of the class that will be used to validate FHIR resources.
Properties
property oauth2TokenHandler as HS.FHIRServer.API.OAuth2Token [ Calculated ];
@API An object to support OAuth authorization.
NOTE: The Implementor of the Interactions subclass must provide a "oauth2TokenHandlerGet" method to provide the handler object
Methods
abstract method Add(pResourceObj As %DynamicObject, pResourceIdToAssign As %String = "", pHttpMethod="POST") as %String
@API
This method will add a resource to the collection managed by this service, returning the ID value of the
newly added resource.
@Input pResourceObj A A %DynamicObject representing the resource to be added. If the resource has an ID value, it will
be ignored.
@Input pResourceIdToAssign If "", then an ID will be assigned to the new resource. If present,
the specified ID must be assigned to the new resource. If the requested id cannot be assigned, an appropriate
error is thrown.
@Input pHttpMethod The Http method that is resulting in this Add request. (POST for a Create or
PUT for Conditional Create)
@Return The ID of the newly added resource
@Throws The implementation must report errors via $$$ThrowStatus.
method Batch(pService As HS.FHIRServer.API.Service, pRequest As HS.FHIRServer.API.Data.Request, pResponse As HS.FHIRServer.API.Data.Response)
@API
This method will mark a resource as deleted, returning the Version Id of the
deleted resource.
@Input pResourceType The 'resourceType' of the resource to be deleted.
@Input pResourceId The ID of the resource to be deleted.
@Return The version ID of the deleted resource
@Throws The implementation must report errors via $$$ThrowStatus.
abstract method FindResourceMeta(pResourceType As %String, pResourceId As %String, pVersionId As %String = "") as %List
@API Returns a %List of metadata about a specified resource or "" if none.
@Input pResourceType The requested ResourceType (required)
@Input pResourceId The requested 'id' property (required)
@Input pVersionId The requested 'meta.versionId' property (optional). If missing or "", it is
a request for the "current" version (the return will provide the actual version number).
@Return A %List of 6 properties of the resource, or "" if the resource is not found. The form of the list is:
$ListBuild(rsrcKey, versionId, isDeleted, isCurrentVersion, lastUpdated, verb, mpiid)
where:
rsrcKey: The unique identifier of the current version in the form /
versionId: The version number of the found resource
isDeleted: A %Boolean indicating whether this version of the resource is deleted.
isCurrentVersion: A %Boolean indicating whether this is the current version of the resource
lastModified: The value of the 'meta.lastUpdated' property of the resource
verb: The HTTP Verb used to create or update this resource (PUT, POST, or PATCH)
@API
Returns the current patient status (e.g. it may return a status meaning that this patient is in the middle of being updated and that the result of searching may be incomplete) .
The inputs to this method:
@Input pPatientId - A patient id
@Return A status
@Throws The implementation must report errors via $$$ThrowStatus.
@Input pPatientId - A patient id
@Return A status
@Throws The implementation must report errors via $$$ThrowStatus.
final method GetResourceMeta(pResourceType As %String, pResourceId As %String, pVersionId As %String = "") as %List
@API Returns a %List of metadata about a specified resource or Throws "not found" if none
@Input pResourceType The requested ResourceType (required)
@Input pResourceId The requested 'id' property (required)
@Input pResourceType The requested 'meta.versionId' property (optional). If missing or "", it is
a request for the "current" version (the return will provide the actual version number).
@Return A %List of 6 properties of the resource, or "" if the resource is not found. The form of the list is:
$ListBuild(rsrcKey, versionId, isDeleted, isCurrentVersion, lastUpdated, verb, mpiid)
where:
rsrcKey: The unique identifier of the current version in the form /
versionId: The version number of the found resource
isDeleted: A %Boolean indicating whether this version of the resource is deleted.
isCurrentVersion: A %Boolean indicating whether this is the current version of the resource
lastModified: The value of the 'meta.lastUpdated' property of the resource
@Throws $$$HSFHIRErrResourceNotFound if current version is not found, or
$$$HSFHIRErrResourceVersionNotFound if the requested version is specified and not found
abstract method GetVersionList(pResourceType As %String, pResourceId As %String, Output pCurrentVersionId) as %List
@API Returns a %List of version Id's for the specified resource Id.
@Input pResourceType The requested ResourceType (required)
@Input pResourceId The requested 'id' property (required)
@Output pCurrentVersionId The resource version id of the current version, or "" if the current version has been HardDelete'd
@Return A %List of version Id's stored for the specified resource type and id. (including the current version). May be an empty list.
abstract method HardDelete(pResourceType As %String, pResourceId As %String, pVersions As %String = "*")
@API
This method will remove the resource and all versions from the database
@Input pResourceType The 'resourceType' of the resource to be deleted.
@Input pResourceId The ID of the resource to be deleted.
@Input pVersions (Optional) Specification of which versions to delete as follows:
"" - The current version only
"*" - All Versions (default)
$LB(vid, ...) - A list of version Id's to delete @Throws The implementation must report errors via $$$ThrowStatus.
"" - The current version only
"*" - All Versions (default)
$LB(vid, ...) - A list of version Id's to delete @Throws The implementation must report errors via $$$ThrowStatus.
abstract method History(pResourceType As %String, pResourceId As %String, pSince As %String, pAt As %String) as HS.FHIRServer.Util.SearchResult
@API
This method returns the version history of a specified resource
@Input pResourceType The 'resourceType' of the resource to be described
@Input pResourceId The ID of the resource to be described
@Input pSince The instant value provided in the _since search parameter. Only versions created after this instant
will be included
@Input pAt The the date-time value of the _at search parameter. Only include resource versions that were current at some point
during the time period specified in the date-time value
@Return A HS.FHIRServer.Util.SearchResult object containing one row for each version sorted with the latest
version first.
@Throws The implementation must report errors via $$$ThrowStatus.
abstract method JSONPatch(pPatchOperations As %DynamicArray, pResourceObj As %DynamicObject) as %Boolean
@API
This method will apply the specified JSON Patch operations to the specified resource object.
It does NOT apply the updated FHIR content to the repo.
@Input pPatchOperations %DynamicArray of JSON Patch operations.
@Input pResourceObj %DynamicObject representation of the resource to be patched.
@Return Boolean value indicating whether the resource object content was updated by the patch.
@Throws The implementation must report errors via $$$ThrowStatus.
@Input pPatchOperations %DynamicArray of JSON Patch operations.
@Input pResourceObj %DynamicObject representation of the resource to be patched.
@Return Boolean value indicating whether the resource object content was updated by the patch.
@Throws The implementation must report errors via $$$ThrowStatus.
abstract method LoadMetadata() as %DynamicObject
@API Gets the active CapabilityStatement for the service.
@Return A %DynamicObject Json representation of a CapabilityStatement that the service
is supporting.
method OnAfterRequest(pFHIRService As HS.FHIRServer.API.Service, pFHIRRequest As HS.FHIRServer.API.Data.Request, pFHIRResponse As HS.FHIRServer.API.Data.Response)
@API Notification that a request in about to be dispatched. The Interactions object
may use this to manage any session information or other bookkeeping. By default, no processing
is performed.
@Input pFHIRService The instance of HS.FHIRServer.Service that invoked this method
@Input pFHIRRequest The request about to be processed
@Input pFHIRResponse The response about to be returned
method OnBeforeRequest(pFHIRService As HS.FHIRServer.API.Service, pFHIRRequest As HS.FHIRServer.API.Data.Request, pTimeout As %Integer)
@API Notification that a request in about to be dispatched. The Interactions object
may use this to manage any session information or other bookkeeping. By default, no processing
is performed.
@Input pFHIRService The instance of HS.FHIRServer.Service that invoked this method
@Input pFHIRRequest The request about to be processed
@Input pTimeout The maximum number of sessions between requests that session data remains valid
method Operation(pService As HS.FHIRServer.API.Service, pRequest As HS.FHIRServer.API.Data.Request, pResponse As HS.FHIRServer.API.Data.Response)
method PostProcessRead(pResourceObject As %DynamicObject) as %Boolean
@API
A method to evaluate the result of a potentially successful read to determine if the read is allowed based
on consent or other custom processing rules.
The inputs to this method:
@Input pResourceObject - A %DynamicObject representing the requested resource
@Return A boolean value; True if the resource should be returned, false if not. If false is returned, the service will reply with a 404 Not Found.
@Throws The implementation must report errors via $$$ThrowStatus.
@Input pResourceObject - A %DynamicObject representing the requested resource
@Return A boolean value; True if the resource should be returned, false if not. If false is returned, the service will reply with a 404 Not Found.
@Throws The implementation must report errors via $$$ThrowStatus.
method PostProcessSearch(pResultSet As HS.FHIRServer.Util.SearchResult, pResourceType As %String)
@API
A method to evalate the result of a potentially successful search to filter the set of results to be returned
based on consent or other custom processing rules. The results are provided in a HS.Util.TransientTable subclass
(HS.FHIRServer.Util.SearchResult). This method may enumerate each result row and upon analysis set the 'Deleted'
column of the row to 1 if the row should be filtered out from the result set. Available columns in the pResultSet
are:
- - Key : A unique key for the resource
- - Deleted : Initialized as blank for all rows. Provides a means to mark rows for exclusion from the returned Bundle of resources. The search and $everything logic subsequent to the return from PostProcessSearch will ignore result set rows that have the Deleted column set to 1.
- - ResourceType : Resource type.
- - ResourceId : Resource id.
- - Mode : "match" means the resource matched by the search criteria. "include" means the resource is present only because a "match" resource has a reference to it.
Inputs:
@Input pResultSet - An OREF to the search results contained in a HS.Util.TransientTable subclass (HS.FHIRServer.Util.SearchResult).
pResourceType The type of resource enumerated by pResultSet. If the result set contains mixed types, then pResource will be empty (""). @Throws The implementation must report errors via $$$ThrowStatus.
- - Key : A unique key for the resource
- - Deleted : Initialized as blank for all rows. Provides a means to mark rows for exclusion from the returned Bundle of resources. The search and $everything logic subsequent to the return from PostProcessSearch will ignore result set rows that have the Deleted column set to 1.
- - ResourceType : Resource type.
- - ResourceId : Resource id.
- - Mode : "match" means the resource matched by the search criteria. "include" means the resource is present only because a "match" resource has a reference to it.
Inputs:
@Input pResultSet - An OREF to the search results contained in a HS.Util.TransientTable subclass (HS.FHIRServer.Util.SearchResult).
pResourceType The type of resource enumerated by pResultSet. If the result set contains mixed types, then pResource will be empty (""). @Throws The implementation must report errors via $$$ThrowStatus.
abstract method Read(pResourceType As %String, pResourceId As %String, pVersionId As %String = "") as %DynamicObject
@API Returns the %DynamicObject representing the requested resource.
@Input pResourceType The requested ResourceType (required)
@Input pResourceId The requested 'id' property (required)
@Input pVersionId The requested resource version (optional). If missing, this is
a request for the "current" version
@Return A %List of 6 properties of the resource, or "" if the resource is not found. The form of the list is:
$ListBuild(rsrcKey, versionId, isDeleted, isCurrentVersion, lastUpdated, verb)
where:
rsrcKey: The unique identifier of the current version in the form /
versionId: The version number of the found resource
isDeleted: A %Boolean indicating whether this version of the resource is deleted.
isCurrentVersion: A %Boolean indicating whether this is the current version of the resource
lastModified: The value of the 'meta.lastUpdated' property of the resource
@Throws The implementation must report errors via $$$ThrowStatus. Common exceptions are
$$$HSFHIRErrResourceNotFound and $$$HSFHIRErrResourceVersionNotFound.
abstract method Search(pResourceType As %String, pCompartmentType As %String, pCompartmentId As %String, pParameters As HS.FHIRServer.API.Data.QueryParameters, ByRef pSortKeys)
@API
This method performs the requested search for resources and returns a HS.FHIRServer.Util.SearchResult
with the selected resource information. If the query specifies _include or _revinclude parameters, then
resources of type other than 'pResourceType' will be part of the result set. Included resources will
be denoted in the result set 'Mode' column with the value 'include'
@Input pResourceType The 'resourceType' of the resource to be searched
@Input pCompartmentType If not "", indicates a compartment search of the specified Compartment Type and Id
@Input pCompartmentId The ID of the resource comartment being searched
@Input pParameters A HS.FHIRServer.API.Data.QueryParameters describing the query parameters specified for the search
@Input pSortKeys (ByRef) A multi-dimensional structure describing any sorting to be performed on the result set. The
structure of pSortKeys is an array of sort keys indexed 1-n:
pSortKeys(n) = 1 for ascending, 0 for descending
pSortKeys(n, "SearchParam") = An HS.FHIRServer.SearchParam object whose value is used to sort.
@Return A HS.FHIRServer.Util.SearchResult object containing one row for each selected resource.
@Throws The implementation must report errors via $$$ThrowStatus.
abstract method SetMetadata(metadata As %DynamicObject)
@API Sets the active CapabilityStatement to be used by the service. This is typically
called by an installer when the service is being configured or updated.
@Input metadata A Json representation of a CapabilityStatement resource that will be
returned on a GET request to "/metadata"
abstract method Update(pResourceObj As %DynamicObject) as %String
@API
This method will take the provided resource as an update to an existing resource.
@Input pResourceObj A %DynamicObject representing the resource to be deleted.
@Return The ID of the updated resource
@Throws The implementation must report errors via $$$ThrowStatus.
Inherited Members
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()