def unpack_uid(uid):
    """
    Convert packed PFile UID to standard DICOM UID.

    Parameters
    ----------
    uid : str
        packed PFile UID as a string
    Returns
    -------
    uid : str
        unpacked PFile UID as string

    """
    return ''.join([str(i-1) if i < 11 else '.' for pair in [(ord(c) >> 4, ord(c) & 15) for c in uid] for i in pair if i > 0])