L_DicomFindContextGroup

#include "ltdic.h"

L_LTDIC_API pDICOMCONTEXTGROUP L_DicomFindContextGroup(pszContextID)

L_TCHAR * pszContextID;

/* Context ID */

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

Parameter

Description

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

!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

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_DicomLoadContextGroup, L_DicomInsertContextGroup, L_DicomGetFirstContextGroup, L_DicomGetFirstCodedConcept, L_DicomFindCodedConcept

Topics:

Working with Context Groups

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;
}