LDicomContextGroup::Insert

#include "ltdic.h"

static pDICOMCONTEXTGROUP LDicomContextGroup::Insert(pszContextIdentifier, pszName, bExtensible, pContextGroupVersion, uFlags = 0)

Adds a new Context Group to the Context Group Table.

Parameters

L_TCHAR * pszContextIdentifier

Character string that contains the Context Identifier (0008,010F) of the new Context Group. For a list of values, refer to Context Identifier Values.

L_TCHAR * pszName

Character string that contains the name of the new Context Group.

L_BOOL bExtensible

Value that specifies whether the new Context Group is Extensible. Possible values are:

Value Meaning
TRUE The new Context Group is Extensible.
FALSE The new Context Group is Non-extensible.

pVALUEDATETIME pContextGroupVersion

Pointer to a VALUEDATETIME structure that specifies the Context Group Version (0008,0106) of the new Context Group.

L_UINT16 uFlags

Flags that control the behavior of this function. This can be set to 0 or one of the following values:

Value Meaning
DICOM_CONTEXTGROUP_DISALLOW_DUPLICATES [0x01] The function should fail if a Context Group with the same specified Context Identifier already exists in the Context Group Table.

Returns

Value Meaning
!NULL Pointer to a DICOMCONTEXTGROUP structure that specifies the newly inserted Context Group.
NULL The function failed to allocate memory.

Comments

NOTE: If the Context Identifier, Name, and Context Group Version of the new Context Group are not specified, the function fails and Returns NULL.

A Context Group can be added to the Context Group Table either by loading it from the internal table maintained by LEADTOOLS or by inserting it into the Context Group Table directly. Use the Insert function to insert a new Context Group to the Context Group Table. To load Context Groups from the internal table, call the LDicomContextGroup::Load function.

Use the function LDicomContextGroup::InsertCodedConcept to add Coded Concepts to a Context Group in the Context Group Table.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

L_INT LDicomContextGroup_InsertExample() 
{ 
   pDICOMCONTEXTGROUP pGroup; 
 
   VALUEDATETIME Version = { 2004, 3, 22, 0, 0, 0, 0, 0 }; 
 
   // Insert a (testing) Context Group 
   pGroup = LDicomContextGroup::Insert(TEXT("CID XXXX"), 
                                       TEXT("New Context Group"), 
                                       TRUE, 
                                       &Version); 
 
   if (!pGroup) 
   { 
      return DICOM_ERROR_MEMORY; 
   } 
 
   // Fill the Context Group with some (testing) Coded Concepts 
   if(LDicomContextGroup::InsertCodedConcept(pGroup, TEXT("CSD1"), NULL, TEXT("CV1"), TEXT("CM1")) == NULL) 
      return DICOM_ERROR_MEMORY; 
   if(LDicomContextGroup::InsertCodedConcept(pGroup, TEXT("CSD2"), NULL, TEXT("CV2"), TEXT("CM2"))== NULL) 
      return DICOM_ERROR_MEMORY; 
   if(LDicomContextGroup::InsertCodedConcept(pGroup, TEXT("CSD3"), NULL, TEXT("CV3"), TEXT("CM3"))== NULL) 
      return DICOM_ERROR_MEMORY; 
 
   // Refer to the example of LDicomContextGroup::GetFirstCodedConcept for 
   // the function EnumCodedConcepts 
   EnumCodedConcepts(pGroup);  
 
   // Delete the Context Group 
   LDicomContextGroup::Delete(pGroup);  
 
   return DICOM_SUCCESS; 
} 
Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C++ Class Library Help