L_DicomFindContextGroup

#include "ltdic.h"

pDICOMCONTEXTGROUP EXT_FUNCTION L_DicomFindContextGroup(pszContextID)

L_CHAR * 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_VOID ModifyContextGroup()
{
   pDICOMCONTEXTGROUP pGroup; 
   pDICOMCODEDCONCEPT pConcept; 

   L_DicomResetContextGroup ();
   L_DicomLoadContextGroup (NULL); 

   // Look for a Context Group
   pGroup = L_DicomFindContextGroup(CID_6019); 
   if (!pGroup) 
   {
      return; 
   }

   // Look for a Coded Concept in the Context Group
   pConcept = L_DicomFindCodedConcept (pGroup, "SRT", "F-01781");
   if (!pConcept) 
   {
      return; 
   }

   // Set the Code Meaning of the Coded Concept (French translation) 
   if (!L_DicomSetCodedConceptCodeMeaning (pConcept, "Situé à 1 heure"))
   {
      return; 
   }
   // Refer to the example of L_DicomGetCodedConceptGroup for
   // the function DisplayCodedConcept
   DisplayCodedConcept(pConcept, FALSE); 

   // Delete the Coded Concept
   L_DicomDeleteCodedConcept (pConcept); 

   // Add a (testing) Coded Concept to the Context Group
   pConcept = L_DicomInsertCodedConcept (pGroup, "CSD", NULL, "CV", "CM",
                                        NULL, NULL, 0); 
   if (!pConcept) 
   {
      return; 
   }
   DisplayCodedConcept(pConcept, FALSE); 

   // Restore the Context Group (discard all the changes made to the Group) 
   L_DicomDefaultContextGroup (pGroup); 
   // Refer to the example of L_DicomGetFirstCodedConcept for
   // the function EnumCodedConcepts
   EnumCodedConcepts(pGroup); 

   // Delete the Context Group
   L_DicomDeleteContextGroup (pGroup); 
}