I have panel data, an example is shown below. How do I create a visit number by id (statenumber)?

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input long statenumber str59 srvshortname int srvdate str57 serviceprovider
999777 "FB Food Voucher"                      21188 "HELP"              
999777 "FB Food Voucher"                      21245 "HELP"              
999777 "NMCM Screening"                       21265 "HELP"              
999777 "NMCM Referral"                        21265 "HELP"              
999777 "NMCM Insurance Enrollment Assistance" 21265 "HELP"              
999777 "NMCM Referral"                        21270 "HELP"              
999777 "Medical Return Complex"               21283 "WSU - Adult Clinic"
999777 "HERR"                                 21283 "WSU - Adult Clinic"
999777 "Medical Treatment Adherence"          21283 "WSU - Adult Clinic"
999777 "NMCM Referral"                        21284 "HELP"              
999777 "NMCM Referral"                        21286 "HELP"              
999777 "NMCM Referral"                        21292 "HELP"              
999777 "NMCM Insurance Enrollment Assistance" 21300 "HELP"              
999777 "NMCM Referral"                        21300 "HELP"              
999777 "NMCM Referral"                        21313 "HELP"              
999777 "NMCM Referral"                        21314 "HELP"              
999777 "NMCM Referral"                        21318 "HELP"              
999777 "NMCM Referral"                        21335 "HELP"              
999777 "NMCM Referral"                        21343 "HELP"              
999777 "NMCM Referral"                        21347 "HELP"              
end
format %tdnn/dd/CCYY srvdate
Thank you for helping!