Skip to main content


persistent class EnsLib.DICOM.Util.AssociationContext extends %Library.Persistent, %XML.Adaptor

SQL Table Name: EnsLib_DICOM_Util.AssociationContext

This class represents a DICOM Association Context. It manages data which defines various parameters which are exchanged with the DICOM peer during the connection negotiation process. Items include the names of the calling and called Application Entity Titles (AETs), the maximum physical size of TCP data packets along with a list of one or more presentation context objects which defines of which services are/should be available and their associated transfer syntaxes

Property Inventory

Method Inventory


property CalledAET as %String (MAXLEN = 16) [ Required ];
This holds the Application Entity Title of the called DICOM Peer. Together with the CallingAET, this property uniquely defines the object instance
Property methods: CalledAETDisplayToLogical(), CalledAETGet(), CalledAETGetStored(), CalledAETIsValid(), CalledAETLogicalToDisplay(), CalledAETLogicalToOdbc(), CalledAETNormalize(), CalledAETSet()
property CallingAET as %String (MAXLEN = 16) [ Required ];
This holds the Application Entity Title of the calling DICOM Peer. Together with the CalledAET, this property uniquely defines the object instance
Property methods: CallingAETDisplayToLogical(), CallingAETGet(), CallingAETGetStored(), CallingAETIsValid(), CallingAETLogicalToDisplay(), CallingAETLogicalToOdbc(), CallingAETNormalize(), CallingAETSet()
property Description as %String (MAXLEN = 256);
This holds the Description of the Association Context
Property methods: DescriptionDisplayToLogical(), DescriptionGet(), DescriptionGetStored(), DescriptionIsValid(), DescriptionLogicalToDisplay(), DescriptionLogicalToOdbc(), DescriptionNormalize(), DescriptionSet()
property Name as %String (MAXLEN = 64);
This holds the Name of the Association Context
Property methods: NameDisplayToLogical(), NameGet(), NameGetStored(), NameIsValid(), NameLogicalToDisplay(), NameLogicalToOdbc(), NameNormalize(), NameSet()
property PresentationContexts as list of EnsLib.DICOM.Util.PresentationContext;
This holds the list of presentation contexts
Property methods: PresentationContextsBuildValueArray(), PresentationContextsCollectionToDisplay(), PresentationContextsCollectionToOdbc(), PresentationContextsDisplayToCollection(), PresentationContextsGet(), PresentationContextsGetObject(), PresentationContextsGetObjectId(), PresentationContextsGetStored(), PresentationContextsGetSwizzled(), PresentationContextsIsValid(), PresentationContextsOdbcToCollection(), PresentationContextsSet(), PresentationContextsSetObject(), PresentationContextsSetObjectId()


classmethod ActiveClose(ByRef qHandle As %Binary) as %Status
classmethod ActiveDetailClose(ByRef qHandle As %Binary) as %Status
classmethod ActiveDetailExecute(ByRef qHandle As %Binary, pGUID As %String) as %Status
classmethod ActiveDetailFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod ActiveExecute(ByRef qHandle As %Binary) as %Status
classmethod ActiveFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status
classmethod CreateAssociation(pCallingAET As %String, pCalledAET As %String, pTransferSyntaxes As %List = $ListBuild($$$IMPLICITVRLETRANSFERSYNTAX)) as %Status
This method creates an AssociationContext instance for the specified calling and called AET for AbstractSyntaxes which supports ALL known SOPs. The TCP Adapter will use the definitions defined here to validate associations It should be noted that this association simply defines all SOP classes that are known in the data dictionary. There is a small performance penalty for this and it may be preferable to define just the SOP classes needed either with the UI tool found at EMP/Maintenance/DICOM SETTINGS or by using the ImportAssociation() method above. Note that the default transfer syntax here is the DICOM mandated IMPLICIT VR little endian syntax.
classmethod ExportXML(pFileName As %String, pCallingAET As %String, pCalledAET As %String) as %Status
This method exports an Association Context as XML into the specified file
classmethod ImportAssociation(pFileName As %String, pCallingAET As %String, pCalledAET As %String, pOverWriteExisting As %Boolean = 0)
This method is passed a filename containing a list of presentation contexts containing SOP/TransferSyntax pairs An Association will be created between the pair of AETs containing the information from the file
classmethod ImportXML(pFileName) as %Status
This method imports a file containing an AssociationContext
method OnAcceptPresentationContext(pAbstractSyntax As %String, ByRef pTransferSyntaxes, Output pSelectedTransferSyntax, Output pAbstractSupported As %Boolean) as %Boolean
This method is called by the TCP Adapter when the Association Request from the DICOM peer is decoded.
classmethod ShowActive() as %Status
Shows all the active associations by exercising the Active and ActiveDetail queries
classmethod TestEnumerate()
Provides a simple way to test the Enumerate Query


query Active()
Selects CallingAET As %String, CalledAET As %String, GUID As %String
Lists the active assocations. Returns the calling AET,called AET and its unique ID The tuple represents the composite primary key
query ActiveDetail(pGUID As %String)
Selects PC As %Integer, AS As %String, ASName As %String, Accepted As %Boolean, TS As %String, TSName As %String
List the details of an Active Association PC is the presentation context ID will range from 1 - n odd numbers only AS is the uid of the abstract syntax ASName is the name of the abstract syntax Accepted is a Boolean. If its set to 1 then the next two items will be non empty TS is the uid of the accepted transfer syntax TSName is the name of the accepted transfer syntax
query Enumerate()
SQL Query:
SELECT %Id, CallingAET,CalledAET, Name, Description FROM EnsLib_DICOM_Util.AssociationContext


index (AET on CallingAET,CalledAET) [IdKey, Type = key];
Index AET, use this for retrieving instance of the object from the database
Index methods: AETCheck(), AETDelete(), AETExists(), AETOpen(), AETSQLCheckUnique(), AETSQLExists(), AETSQLFindPKeyByConstraint(), AETSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods


Storage Model: CacheStorage (EnsLib.DICOM.Util.AssociationContext)

FeedbackOpens in a new tab