HS.JSON.AdaptorFHIR

abstract class HS.JSON.AdaptorFHIR

Adds specialized JSON capabilities to classes.

Method Inventory

Parameters

parameter JSONSHOWEMPTY = 0;
If true, emit JSON for empty (non-collection) properties.
parameter JSONTYPEFIELD = _class;
Name of field in emitted JSON that holds the type (classname) for objects.

Methods

method %CreateProxy(Output pObj As %ZEN.proxyObject) as %Status
Create a proxy object and copy this object's values into it. This is an alternate way to create JSON content.
JSONSHOWEMPTY is ignored.
method %FHIRObjectHasValue() as %Boolean
classmethod %FromFHIRJSON(pJSONStreamOrString, ByRef pHSFHIRObj As %RegisteredObject, pResourceSchemaRoot As %String, ByRef pJSONObject As %Library.DynamicObject) as %Status
This method instantiates an HS FHIR object from a FHIR JSON stream or string and returns it.

Inputs:
  • pJSONStreamOrString : (required if pJSONObject not passed in) A FHIR JSON stream object or string.
  • pResourceSchemaRoot : (required) Class package to use as the schema root for FHIR resources. Example is "HS.FHIR.vSTU3.Model.Resource".
  • pJSONObject : (required if pJSONStreamOrString not passed in) %DynamicObject representation of the FHIR JSON.

    Outputs:
  • pHSFHIRObj : The HS FHIR object constructed from the FHIR JSON. If an error is incurred during the construction of pHSFHIRObj, then pHSFHIRObj is returned as $$$NULLOREF.
  • pJSONObject : %DynamicObject representation of the JSON payload, created by this method if it was not passed in as input. If pJSONObject was not passed in as input, AND if an error is incurred during the construction of pHSFHIRObj, then pJSONObject is returned as $$$NULLOREF.
  • classmethod %GetJSONType() as %String
    Return the value to be used within the JSONTYPEFIELD.
    method %ToFHIRJSON(pLevel As %Integer = 0, pFormat As %String = "aelotw", pIsPrimitive As %Boolean = 0) as %Status
    Write out this object's current value as FHIR JSON content. pFormat is ignored; it is only there for compatability with the %ZEN.proxyObject %ToJSON method. pIsPrimitive indicates whether the parent class was a primitive or not (see method IsPrimitive).

    Subclasses

    Feedback