LAFF: 'Code Black' Captures the Chaos of the Emergency Room (Exclusive Video)

Ryan McGarry's gritty documentary -- shot over the course of four years at the Los Angeles County Hospital -- makes its world premiere at the Los Angeles Film Festival on June 18.

When Ryan McGarry began his residency at Los Angeles County Hospital in 2008, he also decided to become a first-time filmmaker and chronicle life inside the emergency room.

The result is Code Black, which makes its world premiere in competition at the Los Angeles Film Festival on June 18.

Code Black, produced by Linda Goldstein Knowlton (Somewhere Between, Whale Rider), reveals the triumphs and difficulties McGarry and fellow residents face on a daily basis. As they are forced to confront the unexpected realities of life and death in a hospital, as well as a health-care system on the brink of overload, many residents question their identities as doctors and what it means to practice medicine within a bureaucracy.

STORY: 'The Way, Way Back,' Starring Steve Carell, to Close Los Angeles Film Festival

McGarry wrote the documentary with Joshua Altman. Executive producers are Mark Jonathan Harris, Marti Noxon, Edward Newton, M.D., William "Billy" Mallon, M.D., Jan Shoenberger, M.D., Matt Damron and Diku Mandavia, M.D. Andrew C. Richey and Thomas G. Miller co-produced.

LAFF gets underway Thursday night with the world premiere of Sony Pictures Classics I'm So Excited, from filmmaker Pedro Almodovar. The fest runs through June 23.

Watch an exclusive clip from Code Black above.