The complex cognitive processes that underlie human performance in 'messy' contexts such as critical care medicine suggest a need for a cognitive model with broad scope to support the understanding of error in such domains. The objective of this research is to characterize the cognition that underlies patient care in the domain of emergency psychiatry in order to enhance the understanding of error in this context. The theoretical framework of distributed cognition has been used to study collaborative decision-making in a number of similarly complex environments such as airline cockpits and air traffic control towers. These environments share certain characteristics with the critical care domain: the work is collaborative in nature, it is supported by artifacts that can be studied directly, and the consequences of error are dire. However, the nature of the work in this domain and the artifacts used to support it are unique. The application of the theoretical constructs of distributed cognition to this context is necessary in order to characterize the collective thinking that underlies critical care. Our research uses a combination of ethnographic and interview data to derive a distributed cognitive model of the psychiatric emergency department (PED), a high volume clinical unit dealing exclusively with the acute phases of psychiatric crises. The dynamics of workflow within the department are complex: several types of clinician collaborate by forming temporary multidisciplinary teams that attach to and manage particular patients. The component members of these teams change over time. Using the theoretical framework of distributed cognition, we interpreted the collected data to derive a cognitive model of the distribution of work and information flow in the PED. This modeling process has revealed several latent flaws in the system related to the underlying distribution of cognition across teams, time, space and artifacts. The characterization of this distribution has enhanced our understanding of the cognitive dynamics underlying error in this environment, and will serve to guide future research on error management in the ED and inform the development of context-appropriate error-management systems.