Skip to main content

HS.FHIRServer.Storage.JsonAdvSQL.ConvertJson

abstract class HS.FHIRServer.Storage.JsonAdvSQL.ConvertJson extends HS.FHIRServer.Storage.Json.Interactions

Use the methods in this class to convert a 'Json' strategy based FHIR Repo to one based on a 'JsonAdvSQL' strategy. There are three steps involved. e.g.: 1. Set status = ##class(HS.FHIRServer.Storage.JsonAdvSQL.ConvertJson).Start("/csp/healthshare/mynamespace/fhir/r4", "MyStrategyKey") 2. Set status = ##class(HS.FHIRServer.Storage.JsonAdvSQL.ConvertJson).Cutover("/csp/healthshare/mynamespace/fhir/r4",2) 3. Set status = ##class(HS.FHIRServer.Storage.JsonAdvSQL.ConvertJson).Cleanup(1) See Start() for info on parameters etc. Start will output to terminal the correct arguments for the next method to run: Cutover(). Likewise after Cutover() is done it will output the correct argument to provide to Cleanup().

Property Inventory

Method Inventory

Parameters

parameter JsonAdvSQLInstanceId;

Properties

property InteractionsAdvSQL as HS.FHIRServer.Storage.JsonAdvSQL.Interactions;
Property methods: InteractionsAdvSQLGet(), InteractionsAdvSQLGetSwizzled(), InteractionsAdvSQLIsValid(), InteractionsAdvSQLNewObject(), InteractionsAdvSQLSet()

Methods

Will be copied over to the generated Interactions class used to link the old 'Json' repo to the new 'JsonAdvSQL' repo.
method Add(pResourceObj As %DynamicObject, pResourceIdToAssign As %String = "", pHttpMethod="POST") as %String
Will be copied over to the generated Interactions class used to link the old 'Json' repo to the new 'JsonAdvSQL' repo.
classmethod Cleanup(pOldServiceId As %String) as %Status
@APIMethod Optional method to run once Cutover() is complete and the new repo is validated to be working correctly. This will remove the old 'Json' based repo and any data no longer needed by the new 'JsonAdvSQL' based repo. Cleans up old search tables, search column metadata, CapabilityStatement, R.Rsrc compartment info and the repo/repoInstance rows. Parameters: -pOldServiceId - The 'serviceId' property of the HS.FHIRServer.RepoInstance that has been converted from Json to JsonAdvSQL. It will no longer have an associated cspUrl and will also be flagged isEnabled = 0.
classmethod Cutover(pOldAppKey As %String, pNewServiceId As %String) as %Status
@APIMethod Performs the cutover from the Old 'Json' based repo to the new 'JsonAdvSQL' repo once all setup/conversion from Start() is complete. Once this is run all incoming requests to the FHIR endpoint will now be handled by the new repo using the 'JsonAdvSQL' based strategy/search tables etc. The exact arguments needed are provided in terminal output from the previously Start() method. Parameters: -pOldAppKey - The csp url / application key for the old 'Json' based repo. e.g. "/csp/healthshare/hsfhir/r4". -pNewServiceId - The service id for the new 'JsonAdvSQL' based repo created by Start().
method Delete(pResourceType As %String, pResourceId As %String) as %String
Will be copied over to the generated Interactions class used to link the old 'Json' repo to the new 'JsonAdvSQL' repo.
method HardDelete(pResourceType As %String, pResourceId As %String, pVersions As %String)
Will be copied over to the generated Interactions class used to link the old 'Json' repo to the new 'JsonAdvSQL' repo.
classmethod Start(pAppKey As %String, pStrategyKey As %String, pNumWorkers As %Integer = $SYSTEM.WorkMgr.DefaultNumWorkers(), pWait As %Integer = 600) as %Status
@API.Method Use this method to kick off a conversion from a 'Json' based repo to a new 'JsonAdvSQL' repo. This will copy over most settings from the old repo, use the existing resource/version tables from the old repo but build new JsonAdvSQL search tables. Once conversion is complete a cut-over method will need to be run to finalize the process. *Note* During this process long running transactions/jobs should be avoided. E.g.: dataloader, huge data backloads. Anything where a FHIR Server Instance could be used without calling EnsureInstance() for several minutes. If you are certain most interactions with the FHIR Server occur via the REST Handler and are complete in a relatively short time, consider lowering the pWait time from the default value of 10 minutes. However there is no harm in waiting longer than necessary. @Input pAppkey AppKey / csp URL for the service we are converting. @Input pStrategyKey Strategykey for the new 'JsonAdvSQL' based implementation classes. @Input pNumWorkers Number of child jobs to run for Index() to build the new search tables. @Input pWait Number of seconds to wait after invalidating all instances before starting up the Index() background job.
method Update(pResourceObj As %DynamicObject) as %String
Will be copied over to the generated Interactions class used to link the old 'Json' repo to the new 'JsonAdvSQL' repo.
method UpdateInPlace(pResourceObj As %DynamicObject, pMethod As %String) as %String
Will be copied over to the generated Interactions class used to link the old 'Json' repo to the new 'JsonAdvSQL' repo.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab