When you’re in the middle of a medical emergency, you don’t want to have to add “figure out where the ER is” to your list of urgent tasks. To save you precious minutes, your iPhone can do that for you now, as Lifehacker alerts us.

Find Closest ER is a function created for Shortcuts, an app Apple introduced as part of iOS 12 that allows you to add customized tasks to your iPhone’s repertoire. In the event that you need to find an emergency room, you can open up the Find Closest ER shortcut and it will calculate your location and bring up a list of nearby hospitals. Choose one from the list, and the shortcut will ask if you’re walking, driving, taking public transit, or if you need an ambulance or an Uber. It will then either take you to Apple Maps, the Uber app, or it will call 911 so you can request an ambulance.

A list of hospitals generated by Find Closest ER
A list of New York City-area hospitals generated by Find Closest ER in Manhattan
Screenshot, Find Closest ER

The shortcut requires a bit of setup, so don’t wait until you’re in the throes of panic to open it up for the first time. You’ll need to enable location services and set your search radius. You may also need to download another shortcut to make it work, DeviceType2, which will allow the shortcut to tell whether you’re using an iPhone or an iPad.

Now, bear in mind that this isn’t a substitute for calling 911. This is for the “It's 1 a.m. and I think maybe I broke my arm when I fell off the couch reaching for that bowl of popcorn” level emergency, not the “I am going into anaphylactic shock” sort. (Not sure when you should call 911? Here’s a guide.) Nor, unfortunately, can this shortcut tell you whether or not the nearest ER is in your health insurance’s network. In a time when you may not be thinking clearly, though, having a step-by-step guide to get you to a doctor could be vital.

A message directing the user to Lenox Health Greenwich Village Emergency Department
Screenshot, Find Closest ER

Grab your phone and click this link to download Find Closest ER to your Shortcuts app. Once you add it to your Shortcuts, you can add it to your Home Screen in order to make it extra-accessible in a pinch. You can also program Siri to recognize it as a voice command so that you can use it hands-free.

[h/t Lifehacker]