Skip to main content

HS.IHE.XDSb.Util

abstract class HS.IHE.XDSb.Util

IHE Utility Functions

Method Inventory

Methods

classmethod AttachDocuments(pInline=0, pSource As HS.Message.IHE.XDSb.Metadata, pTarget As HS.Message.XMLMessage) as %Status
Move inline documents to attachments (pInline=0), calculate size and hash
classmethod ContentIDToXOP(pClientId As %String) as %String
classmethod DeleteAttachments(ByRef pMessage As HS.Message.XMLMessage) as %Status
classmethod ErrorResponse(pSC As %Status, pResponseName As %String, Output pResponse As HS.Message.XMLMessage, pTransformer As HS.Util.XSLTTransformer = "") as %Status
Create an error response for various XDSb transactions pSC = the error pResponseName = the response name (ie. XDSb_RegistryResponse) pResponse = the resulting XMLMessage pTransformer = if the caller is a transformer, can send this to avoid reloading the XSLT used by this function
classmethod GetClassCodeFromDocument(pCDAStream As %Stream.Object, Output pClassCode As HS.IHE.XDSb.Types.CodedValue = "") as %Status
For a CDA document, get the IHE Class Code (FHIR Category) from the input XML stream. When not null, the pClassCode output object will have populated Code, Scheme, and Description properties.
classmethod GetFormatCodeFromDocument(pCDAStream As %Stream.Object, Output pFormatCode As HS.IHE.XDSb.Types.CodedValue = "") as %Status

Determine from the input XML file (which we have good reason to believe is some version of CDA) what its CDA Format and Version are. The output pFormatCode is based on the HS_IHE.CodedEntry table, whose entries tell us the correct XSL data transformation to use for this XML file

When not null, the pFormatCode output object will have populated Code, Scheme, and Description properties.

CDA Formats and Versions known to this method:
CCD
CCDA 2.1 Structured
CCDA 1.1 Structured
CCDA 2.1 Unstructured
CCDA 1.1 Unstructured

If the output pFormatCode is an empty string ("") this means a format code could not be identified from the data in the XML document. There are a few possible reasons:
(a) There was no suitable <templateId> found in the document;
(b) there was one, but it did not match a format known to this method; or
(c) there was one, and this method recognized it, but there was no entry configured in the HS_IHE.CodedEntry table for that format, so no result could be returned.

Reason (c) can be addressed by configuring the HS_IHE.CodedEntry table.

classmethod ProcessMetadata(pMetadata As HS.IHE.XDSb.Types.Metadata, Output pConsented As %Boolean = 0) as %Status
Process a XDSb metadata container, returning an error if response is a failure This is an optimization to ProcessResponse when the caller needs the metadata and to log errors/warnings by skipping the XPath evaluation
classmethod ProcessResponse(pResponse As HS.Message.XMLMessage) as %Status
Process a registry response, throwing an error if response is a failure
classmethod StreamHash(tStream As %Stream.GlobalBinary) as %String
Calculate the hash value for a document
classmethod XOPToContentID(pXOP As %String) as %String
FeedbackOpens in a new tab