L_DicomFindContextGroup

Summary

Returns a pointer to the Context Group, in the Context Group Table, with the Context Identifier (CID) specified.

Syntax

#include "ltdic.h"

L_LTDIC_API pDICOMCONTEXTGROUP L_DicomFindContextGroup(pszContextID)

Parameters

L_TCHAR * pszContextID

Character string that contains a Context Identifier (CID). The function returns a pointer to the DICOMCONTEXTGROUP structure that specifies the Context Group in the Context Group Table which has this Context ID.

Returns

Value Meaning
!NULL Pointer to a DICOMCONTEXTGROUP structure that specifies the Context Group, in the Context Group Table, with the specified Context ID.
NULL None of the Context Groups in the Context Group Table has the specified Context ID.

Comments

A Context Group is identified by its Context Identifier (CID). For a list of the Context Identifiers of the Context Groups maintained internally, refer to Context Identifier Values.

Notice that only the Context Groups in the Context Group Table are searched by the function: use the L_DicomLoadContextGroup and L_DicomInsertContextGroup functions to add Context Groups to the Context Group Table.

To search for a specific Coded Concept in a Context Group, use the L_DicomFindCodedConcept function.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

L_INT DicomFindContextGroupExample(L_VOID) 
{ 
   pDICOMCONTEXTGROUP pGroup; 
   pDICOMCODEDCONCEPT pConcept; 
   L_UINT16 nRet; 
 
   L_DicomResetContextGroup(); 
   nRet = L_DicomLoadContextGroup(NULL); 
   if (nRet != DICOM_SUCCESS) 
      return nRet; 
 
   // Look for a Context Group 
   pGroup = L_DicomFindContextGroup(CID_6019); 
   if (!pGroup) 
      return DICOM_ERROR_NULL_PTR; 
 
   // Look for a Coded Concept in the Context Group 
   pConcept = L_DicomFindCodedConcept(pGroup, TEXT("SRT"), TEXT("F-01781")); 
   if (!pConcept) 
      return DICOM_ERROR_NULL_PTR; 
 
   // Set the Code Meaning of the Coded Concept (French translation)  
   if (!L_DicomSetCodedConceptCodeMeaning (pConcept, TEXT("Situé à 1 heure"))) 
      return FAILURE - 1; 
 
   // Refer to the example of L_DicomGetCodedConceptGroup for 
   // the function DicomGetCodedConceptGroupExample 
   nRet = (L_UINT16) DicomGetCodedConceptGroupExample(pConcept, FALSE); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   // Delete the Coded Concept 
   L_DicomDeleteCodedConcept (pConcept); 
 
   // Add a (testing) Coded Concept to the Context Group 
   pConcept = L_DicomInsertCodedConcept (pGroup, TEXT("CSD"), NULL, TEXT("CV"), TEXT("CM"),  
      NULL, NULL, 0); 
   if (!pConcept) 
      return DICOM_ERROR_NULL_PTR; 
 
   nRet = (L_UINT16) DicomGetCodedConceptGroupExample(pConcept, FALSE); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   // Restore the Context Group (discard all the changes made to the Group)  
   if (!L_DicomDefaultContextGroup (pGroup)) 
      return FAILURE - 1; 
 
   // Refer to the example of L_DicomGetFirstCodedConcept for 
   // the function DicomGetFirstCodedConceptExample 
   nRet = (L_UINT16) DicomGetFirstCodedConceptExample(pGroup); 
 
   // Delete the Context Group 
   L_DicomDeleteContextGroup (pGroup); 
 
   return nRet; 
} 
Help Version 23.0.2024.7.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.