- A recent (<30 days before the prescription date) diagnosis of insomnia as determined by a set of selected International Classification of Disease (ICD) codes, to be used for medications that are not prescribed just for insomnia.