LDicomContextGroup::Find

#include "ltdic.h"

static pDICOMCONTEXTGROUP LDicomContextGroup::Find(pszContextID)

L_CHAR * pszContextID;

/* Context ID */

Returns a pointer to the Context Group in the Context Group Table that has the specified Context Identifier (CID).

Parameter

Description

pszContextID

Character string that contains a Context Identifier (CID). For a list of the Context Identifiers of the Context Groups maintained internally, refer to Context Identifier Values. The function Returns a pointer to the DICOMCONTEXTGROUP structure that specifies the Context Group in the Context Group Table for the specified Context ID.

Returns

!NULL

Pointer to a DICOMCONTEXTGROUP structure that specifies the Context Group in the Context Group Table for 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. To add Context Groups to the table, use the LDicomContextGroup::Load and LDicomContextGroup::Insert functions.

To search for a specific Coded Concept in a Context Group, use the LDicomContextGroup::FindCodedConcept 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:

LDicomContextGroup::Load, LDicomContextGroup::Insert, LDicomContextGroup::GetFirst, LDicomContextGroup::GetFirstCodedConcept, LDicomContextGroup::FindCodedConcept, Class Members

Topics:

Working with Context Groups

Example

L_VOID ModifyContextGroup()
{
   LDicomContextGroup::Reset ();
   LDicomContextGroup::Load ();

   pDICOMCONTEXTGROUP pGroup; 
   pDICOMCODEDCONCEPT pConcept; 

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

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

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

   // Delete the Coded Concept
   LDicomContextGroup::DeleteCodedConcept(pConcept); 

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

   // Restore the Context Group (discard all the changes made to the Group) 
   LDicomContextGroup::Default(pGroup); 
   // Refer to the example of LDicomContextGroup::GetFirstCodedConcept for
   // the function EnumCodedConcepts
   EnumCodedConcepts(pGroup); 

   // Delete the Context Group
   LDicomContextGroup::Delete(pGroup); 
}