There are several rules to be followed when making UIDs, and this page is a useful summary
General DICOM Rules
- Total length must be <= 64 characters, including the stops
- Must contain only digits 0-9 and full stops
- Each numeric "component" (between stops) must be a valid and unambiguous integer number, and so must not have a leading zero (unless the whole component is zero)
Must be guaranteed to be unique - this means:
- It must be derived from a proper official root under your sole control. You can get your own root for free if you wish from the Free UID menu link above. This will be a sub-root of the Medical Connections UID Range
- It must not be created by appending digits (however special you consider the combination!) to someone else's UID.
- In particular, series UIDs for secondary capture images, KIN objects etc. must not be created as derivatives of the Study UID (unless you own that root!)
- Related to the above, there is no expectation or requirement that the Study UID, Series UID and Instance UID for images should be derived from the same root (though in practice, Series UID and Instance UID normally are, as both must be generated internally by the equipment which generates the images)
Date and Time are useful for generating UIDs, but only if:
- Each machine has a unique root (normally your company UID root + a machine specific suffix such as a serial number
- If it is possible for UIDs to be generated at > 1 per second, then a sequential counter should also be used
- if on a multi-threaded machine, then the thread ID or a properly interlocked counter are needed to prevent 2 applications or 2 threads in the same application from generating identical UIDs simultaneously.
- Do not use time on its own - it is too easy to end up with a leading zero 0 - e.g. 20060724.093017 use instead 20060724093017
If you are using DicomObjects, then much of the above is taken care of for you, simply by using the DicomGlobal.NewUID method, but you are still responsible for setting a machine specific UID root into the UIDRoot registry_value (a string of course).
Medical Connections UID Range
For those interested in the details, UIDs allocated for free by Medical Connections have the following derivation.
- ISO root (2 = ITU)
- branch of ISO root allocated to member countries
- branch allocated to the British Standards Institute (BSI)
- branch allocated by BSI to UK companies
- branch allocated to companies in England & Wales (2 = Scotland and 3 = N. Ireland)
- branch allocated to UK company number 3680043 (Medical Connections Ltd)
- branch allocated by Medical Connections to free roots (old roots)
- branch allocated to a particular user. However the XXXX portion was getting too long! So we have also started issuing root on a new branch
- branch allocated to a particular user (new roots)
Note that UIDs
- Are valid anywhere in the world (irrespective of the country root from which they derive)
- Are not "registered" anywhere, and do not have to be (in fact there is no such system)
- Do not have to be in any way "special" for use with DICOM
- Are identical in construction, uniqueness and roots to the OIDs used in networking and security, so a root for one of these may be equally well used.