With noteevents how can we match the icd9 code for a given clinical note from the diagnosis table. It seems that the subject_id, HADM_id are not unique.
You cannot link the ICD9 code to a specific note. ICD9 codes are linked to each hospital admission (HADM_ID), for which each person (SUBJECT_ID) will have one or more. Each hospital admission will likely have multiple notes, but these notes themselves are associated with a HADM_ID, and not directly to a diagnosis code. If you want specific diagnoses by day based on notes, you will have to mine the text directly.