InsertElement Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestInsertElement( )
   Dim nRet As Short

   LEADDICOM1.EnableMethodErrors = False
   'insert the new element
   LEADDICOM1.FindTag(LTDICLib.DicomDataSetTagConstants6.TAG_DISCHARGE_DATE)
   nRet = LEADDICOM1.InsertElement(False, LTDICLib.DicomDataSetTagConstants6.TAG_DISCHARGE_DATE, LEADDICOM1.CurrentTag.VR, False, LTDICLib.DicomMiscConstants.ELEMENT_INDEX_MAX)
   If (nRet <> 0) Then
      MessageBox.Show("Error Inserting Element")
   End If
   LEADDICOM1.EnableMethodErrors = True
End Sub