Modifying a Context Group Example for C++ 6.0 and later
void ModifyContextGroup(ILEADDicomDSPtr& spDicomDS)
{
spDicomDS->ResetContextGroup ();
spDicomDS->LoadContextGroup ("");
// Look for a Context Group
if (!spDicomDS->FindContextGroup ("CID 6019"))
{
return;
}
// Look for a Coded Concept in the current Context Group
if (!spDicomDS->FindCodedConcept ("SRT", "F-01781"))
{
return;
}
// Set the Code Meaning of the current Coded Concept (French translation)
spDicomDS->SetCodedConceptCodeMeaning("Situé à 1 heure");
// Refer to Enumerating the Coded Concepts of a Context Group Example
// for C++ 6.0 and later for the function DisplayCodedConcept
DisplayCodedConcept(spDicomDS, FALSE);
// Delete the current Coded Concept
spDicomDS->DeleteCodedConcept ();
// Add a (testing) Coded Concept to the current Context Group
spDicomDS->InsertCodedConcept ("CSD", "", "CV", "CM", VARIANT_FALSE, "", 0);
DisplayCodedConcept(spDicomDS, FALSE);
// Restore the current Context Group (discard all the changes
// made to the Group)
spDicomDS->DefaultContextGroup (VARIANT_FALSE);
// Refer to Enumerating the Coded Concepts of a Context Group Example
// for C++ 6.0 and later for the function EnumCodedConcepts
EnumCodedConcepts(spDicomDS);
// Delete the current Context Group
spDicomDS->DeleteContextGroup ();
}