The Danish public health insurance scheme is a residence-based system. If you are living in Denmark and are registered in the Danish Civil Registration System, you are entitled to all public healthcare benefits.
If you intend to stay for a period of more than 3 months you must apply for an EU residence document (6 month if you move to Denmark from a Nordic country, or if you are an EU or Swiss citizen looking for a job) and you must notify the Citizen Service centre in your municipality of your stay.