Inserting a Context Group Example for C++ 6.0 and later
void InsertContextGroup(ILEADDicomDSPtr& spDicomDS)
{
// Context Group Version
spDicomDS->DateTimeValueCount = 1;
spDicomDS->DateTimeValues[0]->Year = 2005;
spDicomDS->DateTimeValues[0]->Month = 3;
spDicomDS->DateTimeValues[0]->Day = 22;
spDicomDS->DateTimeValues[0]->Hours = 0;
spDicomDS->DateTimeValues[0]->Minutes = 0;
spDicomDS->DateTimeValues[0]->Seconds = 0;
spDicomDS->DateTimeValues[0]->Fractions = 0;
spDicomDS->DateTimeValues[0]->Offset = 0;
// Insert a (testing) Context Group
spDicomDS->InsertContextGroup ("CID XXXX", "New Context Group", VARIANT_TRUE, 0);
spDicomDS->DateTimeValueCount = 0;
// Fill the Context Group with some (testing) Coded Concepts
spDicomDS->InsertCodedConcept ("CSD1", "", "CV1", "CM1", VARIANT_FALSE, "", 0);
spDicomDS->InsertCodedConcept ("CSD2", "", "CV2", "CM2", VARIANT_FALSE, "", 0);
spDicomDS->InsertCodedConcept ("CSD3", "", "CV3", "CM3", VARIANT_FALSE, "", 0);
// 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 Context Group
spDicomDS->DeleteContextGroup ();
}