def METHOD_NAME(pid, record, result):
    """Preprocess related identifiers for record serialization.
    Resolves the passed pid to the proper `recid` in order to add related
    identifiers from PID relations.
    """
    recid_value = record.get('recid')
    if pid.pid_type == 'doi' and pid.pid_value == record.get('conceptdoi'):
        recid_value = record.get('conceptrecid')
        result['metadata']['doi'] = record.get('conceptdoi')
    recid = (pid if pid.pid_value == recid_value else
             PersistentIdentifier.get(pid_type='recid', pid_value=recid_value))
    if recid.pid_value == record.get('conceptrecid'):
        pv = PIDVersioning(parent=recid)
    else:
        pv = PIDVersioning(child=recid)
    # Serialize PID versioning as related identifiers
    if pv.exists:
        rels = serialize_related_identifiers(recid)
        if rels:
            result['metadata'].setdefault(
                'related_identifiers', []).extend(rels)
    return result