Generate StudyInstanceUID

  • Hi,
    Maybe this subject is off-topic. So I apologize in advance.


    To fill a worklist table, I need generate StudyInstanceUID and AccessionNumber.
    I am working with delphi.


    Please, does someone has some delphi(pascal) code to generate StudyInstanceUID and AccessionNumber.


    Regards,
    Luiz

  • Hi,


    this is kind of what dgate does (in c):


    BOOL
    GenUID(char *oString)
    {
    MyGetPrivateProfileString(szRootSC, "UIDPrefix", "1.2.3.4.5.6.7.8.9", UIDPrefix, 64, ConfigFile))
    sprintf(oString, "%s.%u.%d.%u", UIDPrefix, (unsigned int)time(NULL), GetTickCount()%1000, (UIDPostfix++)%100);
    }


    where 1.2.3.4.5.6.7.8.9 should be your organizations UID root.


    Hope this helps!


    Marcel

  • Hi,


    Each UID starts with a base string that is organisation dependent - such that UIDs are globaly unique. In conquest I generate this when you install conquest based on our organizations UID followed by a constant string and a random string. This is stored in the configuration file. How you generate your base string is really up to you!


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!