HS.FHIR.DTL.Util.HC.Transform
class HS.FHIR.DTL.Util.HC.Transform
Method Inventory
- BuildSkipList()
- IndexResource()
- LinkResources()
- PreProcess()
- ProcessBundle()
- ProcessEntry()
- ShouldSkip()
Methods
classmethod BuildSkipList(object As %RegisteredObject, path As %String, ByRef aux) as %Status
For every path in ^HS.XF.ReferenceField, which contains all paths from reference elements to
SDA3 objects, check to see if the current resource has a value in that location. If it does,
the referenced resource can be added to the skip list, since it will be transformed when
transforming the current resource, and we want to prevent duplicates from being created.
object - Object to be searched
path - Element path where a reference could be stored, eg. "Patient:managingOrganization" or "Encounter:participant[n].actor"
aux - The 'aux' parameter used in all DTLs that contains, among other things, the callback
object.
classmethod IndexResource(resource As HS.FHIR.DTL.vSTU3.Model.Base.Resource, index As %Integer, ByRef aux) as %Status
Store the resource and it's location in the bundle within the 'aux' parameter so that a lookup can be done
in O(1) time instead of O(n) time. This is crucial because every time a reference is encountered, the resource
that is being referenced will need to be fetched.
resource - the resource to be indexed
index - the index in the bundle entry list
aux - The 'aux' parameter used in all DTLs that contains, among other things, the callback
object.
classmethod LinkResources(ByRef resource As HS.FHIR.DTL.vSTU3.Model.Base.Resource, ByRef bundle As HS.FHIR.DTL.vSTU3.Model.Resource.Bundle, callbackObject As HS.FHIR.DTL.Util.API.HC.Callback.Abstract.SDA3ToSTU3) as %Status
Extract additional resources created when transforming between SDA3 and STU3 and
link them using references. These additional resources can be in any object within the
resource, stored in the newResource property, so each object will need to be inspected.
Once they are found, they will be assigned a resource id (if they aren't duplicatesand a reference will be created
to the first resource. Then the newly created resource will be added to the end of the Bundle.
resource - The current resource that's being searched
bundle - The bundle that will have newly created resources added to the end.
callbackObject - instance of the callback class that determines certain
behavior like how resource ids should be assigned.
classmethod PreProcess(bundle As HS.FHIR.DTL.vSTU3.Model.Resource.Bundle, Output aux) as %Status
Pre-process the bundle so the STU3 to SDA3 transform knows which resources to skip (to prevent duplicate
streamlets) and index the Bundle so it can be quickly searched to find referenced resources).
bundle - the Bundle to preprocess.
aux - The 'aux' parameter used in all DTLs that contains, among other things, the callback
object. Also will contain the skip list and the bundle index.
classmethod ProcessBundle(ByRef bundle As HS.FHIR.DTL.vSTU3.Model.Resource.Bundle, callbackObject As HS.FHIR.DTL.Util.API.HC.Callback.Abstract.SDA3ToSTU3) as %Status
Loop through every entry in a Bundle after it has been transformed from
SDA3 and ensure all references are added and that each resource is given
an id.
bundle - The bundle object to be processed
callbackObject - instance of the callback class that determines certain
behavior like how resource ids should be assigned.
classmethod ProcessEntry(ByRef resource As HS.FHIR.DTL.vSTU3.Model.Base.Resource, ByRef entry As HS.FHIR.DTL.vSTU3.Model.Element.Bundle.entry, callbackObject As HS.FHIR.DTL.Util.API.HC.Callback.Abstract.SDA3ToSTU3) as %Status
Ensure the resource has an id, and add the fullUrl value for the resource.
resource - The resource to be processed
entry - the Bundle entry containing the resource to be processed.
callbackObject - instance of the callback class that determines certain
behavior like how resource ids should be assigned.
classmethod ShouldSkip(ByRef resource As HS.FHIR.DTL.vSTU3.Model.Base.Resource, ByRef aux) as %Boolean
Determines whether or not a resource should be skipped when transforming a Bundle to a Container. Will
look in the skip list generated before beginning the transformation.
resource - Resource in question
aux - The 'aux' parameter used in all DTLs that contains, among other things, the callback
object. Also contains the skip list.