I agree with Twizzle. If this is outpatient coding please see Section IV. J. of ICD10 CM Coding Guidelines
"Code all documented conditions that coexist at the time of the encounter/visit, and require or affect patient care treatment or management. Do not code conditions that were previously treated and no longer exist. However, history codes (categories Z80 - Z87) may be used as secondary codes if the historical condition or family history has an impact on current care or influences treatment"
One needs to determine if the pt is still on medication to treat or suppress the urgency in that case I would code an actual dx something along the lines of R39.15, otherwise if the condition has passed and the condition of urgency is some how pertinent to the complaint for that encounter, say they are being treated now at this encounter for a UTI (very broad example) warranting the Z code I would use a hx code. If neither of these scenarios are happening, the pt is not on meds to actively suppress the urgency and the hx of urgency is not impacting the care or treatment then I would not capture the hx code or the R code.
diagnosis codes, diagnosis coding