parse_id function

Parse a primary_id