import hashlib


def make_orthanc_id(vals):
    """Return Orthanc ID of Patient, Study, or Series
    https://book.orthanc-server.com/faq/orthanc-ids.html#orthanc-ids
    Format: SHA-1 hash of (PatientID|StudyInstanceUID|SeriesInstanceUID)
    """
    str = '|'.join(vals)
    hh = hashlib.sha1(str.encode('utf-8')).hexdigest()
    sha1 = '-'.join([hh[n * 8:(n + 1) * 8] for n in range(0, 5)])
    return sha1