Use of DATASUS to evaluate psychiatric inpatient care patterns in Southern Brazil

OBJECTIVE: To describe the construction and testing of a routine to assess psychiatric hospitalizations in the Brazilian Health System based on its database (DATASUS), and to assess characteristics and trends of these hospitalizations. METHODS: Data were extracted from hospital admission authorizations in the state of Rio Grande do Sul, Southern Brazil, from 2000 to 2004. Data from 91,233 admissions were processed through a routine (syntaxes) using SPSS program and their reliability was tested. Hospitalization rates in general and psychiatric hospitals and main diagnoses were described, and trends were analyzed using polynomial regression models. RESULTS: Intra and inter-rater reliabilities were 100%. There was seen a trend of increasing hospitalization rates due to mood disorders and decreasing rates due to schizophrenia and organic disorders. Hospitalization rates due to substance use disorders remained stable. There was an increasing trend in the number of psychiatric hospitalizations in general hospitals with a 97.7% growth in the period studied. CONCLUSIONS: Routines proved to be reliable and feasible, suggesting the use of data from Hospital Information System database as a source of information for continuous evaluation of psychiatric hospitalizations in Brazilian Health System. Psychiatric hospitalization rates may have changed due to changes in the type of patients; diagnostic patterns, known as treatmentoriented diagnostic bias; and legislation.


INTRODUCTION
The Brazilian policy on mental health has undergone important changes since the country signed the Caracas Declaration, the main purpose of which was to direct mental health legislation towards the deinstitutionalization of psychiatric patients.One of the ways by which this goal can be achieved is establishing outpatient services aimed at replacing psychiatric inpatient care Centros de Atenção Psicossocial (CAPS -Centers for Psychosocial Care) and therapeutic residencies).Hospitalization would be considered as a last therapeutic resource, and would be preferentially provided at general hospitals. 8spite having been established in the state of Rio Grande do Sul (Southern Brazil) early in the last decade, with Statute 9,716, enacted on 7 August 1992, Federal regulation only occurred in 2001, with Statute 10,216 of 6 April 2001.*However, independent data on the effects of these changes on the characteristics of psychiatric hospital admissions by the Brazilian Health System (SUS -Sistema Único de Saúde) have remained scarce. 4,10e last decade has seen a major advancement in the accessibility of information through the Internet by means of the Sistema de Informação Hospitalar (SIH/SUS -Hospital Information System).This database, originally intended for administrative purposes, contains data on all hospitalizations paid for by SUS in Brazil.It can be consulted through the DATASUS website,** as part of the universal accessibility policy of the Brazilian public health care system, which has been extended to administrative data.The version available online is produced without the patient's personal identifi cation.It consists of fi les containing information that are originally part of the hospital admission authorization (AIH) form.Among other data, this fi le includes patient diagnosis, selected demographic information, place and date of admission, length of stay, and hospitalization costs.
Secondary data extracted from DATASUS have already been used in different studies. 3However, these data are separated according to specifi c time periods, and lack any guidance as to how to bring together different periods in order to study time trends.Moreover, tables do not allow data to be stratifi ed for the analysis of additional characteristics, such as, for instance, type of hospital (psychiatric or general) or age group.
Another major limitation in the analysis of these secondary data is the format in which hospital admission s longer than 30 days are recorded.This is especially true for psychiatric hospitalizations.Since AIHs are limited to at most 30 days, hospitalizations beyond this time limit generate additional AIH records for the same patient, compromising the study of cumulative data, such as length of hospital stay, and hospitalization costs of over 30 days, which frequently occur in psychiatry.
An alternative to using DATASUS information is a program for tabulation and simple statistical tests called TABWIN.This tool allows for the separation of hospitalization data into subgroups, and for comparing variables from different time periods and fi les.However this software is of very limited use for data transformation, and does not allow the grouping of several AIHs pertaining to a same hospital stay.Thus, the use of these resources to evaluate the characteristics of psychiatric hospitalizations is still limited, requiring major adaptations for use by researchers who are not part of the system administration.Most of the studies published to this date have relied on data extracted by health system managers.
The objective of the present study was to construct and validate a routine (syntax) capable of extracting data on SIH/SUS psychiatric hospitalizations.Additionally, we analyzed trends in occupation according to type of hospital (psychiatric and general) and diagnosis.

METHODS
First, SIH/SUS fi les from January 2000 to December 2004 were located on the DATASUS website.We studied the structures of fi les and identifi ed peculiarities, such as multiple AIHs for the same hospitalization, and variation in the names of several fi elds over the period.Variables of interest, such as place of treatment, age, place of origin, and sex were decoded.An algorithm was constructed based on the original fi les in order to extract and manipulate data for execution in the SPSS v13.0 statistical package, and a single fi le was constructed containing all relevant information for the entire historical period.All routines were tested in three ways: on the same computer at different times with the same judge; on different computers with the same judge at different times; and on different computers with different judges.Test-retest reliability and agreement between judges were tested using data from a randomly chosen year (2001).
Next, the frequencies of psychiatric hospitalizations in general hospitals and psychiatric hospitals were obtained, as well as the frequency of psychiatric diagnosis upon admission.The few diagnoses belonging to ICD-10 16 groups F4, F5, F6, F7, F8, and F9 were placed together.The other ICD-10 16 diagnostic groups (F0, F1, F2, and F3) were described individually.A historical series was then analyzed in order to identify trends in the proportion of hospitalizations in general hospitals and in the proportion of major diagnoses found.To analyze trends, we constructed polynomial regression models with estimates of linear, quadratic, and cubic models, with subsequent choice of the model best fi tted to the historical series.The temporal variable was centralized to avoid data colinearity.The models had X and Y values representing dependent (proportion of diagnoses or of type of hospital) and independent variables (month, in the case of centralization).The choice of model was based on an analysis of the dispersion diagram, residuals, and the determination coeffi cient (r 2 closest to 1).In similar cases, the model with the lowest degree was chosen.Months were used as a unit because few years were available for analysis.A trend was considered as signifi cant when p<0.05.SPSS v13 software was used for data analysis.
Figure 1 shows a fl owchart of processing and data analysis routines.
The project was approved by the Research Ethics Committee of the Hospital de Clínicas (Comissão de Ética em Pesquisa -Hospital de Clínicas de Porto Alegre, CEP-HCPA).The authors signed a data confi dentiality statement which was fi led at the CEP-HCPA.

RESULTS
In order to locate fi les, the access sequence to DA-TASUS was "arquivo" ("fi le"), "ms-bbs" (Ministry of Health Bulletin Board System), and "Rio Grande do Sul" (the state for which the search was conducted).Access to fi les requires prior registration at the Ministry of Health BBS, an electronic address where fi les can be stored.Files in the ".dbc" format (the type of compacted fi le used by DATASUS), containing all AIHs organized by month and state were located.Rio Grande do Sul state fi les are named "rdrsaamm.dbc,"where "rd" is the shortened version of the fi le (without patient names, personal tax identifi cation numbers (CPF), or other personal identifi ers), "rs" is the state, "aa" is the year, and "mm" the month.Sixty fi les were located and transferred, from rdrs0001.dbc(January, 2000) to rdrs0412.dbc(December, 2004).
Files in the ".dbc" format were decompressed using TABWIN to a ".dbf" fi le using the "arquivo" ("fi le"), "comprime/expande" ("compress/expand"), ".dbf" sequence.These fi les already contained all AIHs paid for by SUS in all specialties for each month.A syntax was then written in SPSS to extract fi elds of interest, drop unwanted fi elds, and unify the 60 monthly fi les into a single fi le containing all 128,780 psychiatric AIHs.
Because of the multiplicity of AIHs pertaining to a same hospitalization, it was necessary to group different AIHs into a single record.This required re-encoding certain fi elds from string to numerical format, adding certain fi elds (cumulative fi elds, e.g., length of hospitalization and costs), and, in some cases, maintaining the fi rst record (date of admission) or the last record (date of discharge).All the other data were left unchanged.After correction, the number of case records dropped to 91,233   (1990).This procedure detected no differences between the results of the different extractions.
Table 1 presents the absolute and relative frequencies of different major diagnosis groups in the studied hospitalizations.There were fewer hospitalizations for schizophrenia and psychosis, more hospitalizations related to mood disorders, and little variation in the frequency of hospitalizations due to disorders related to use of psychoactive substances.There was a decrease in the number of psychiatric admissions in psychiatric hospital, accompanied by a proportional increase in general hospital admissions.Polynomial regression analyses of time trends in major diagnosis and type of hospital by are presented in Table 3.There was a signifi cant linear trend towards an increase in the proportion of hospitalizations due to mood disorders, and towards a reduction in hospitalizations related to schizophrenia and other psychoses.The proportion of hospitalizations due to substance abuse remained stable.There was an increasing trend in the proportion of hospitalizations taken place in general hospitals.
Figure 2 shows dispersion graphs for the analysis of proportion of hospitalizations according to main psychiatric diagnoses and for the proportion of psychia-tric hospitalizations in general hospitals for the months studied.

DISCUSSION
The results obtained allow us to discuss three major points: the use of secondary data in psychiatry, the trend toward a growing proportion of psychiatric hospitalizations in general hospitals, and trends in the proportion of patients hospitalized due to each of the different major psychiatric diagnoses.
Despite its frequency in the international literature, 9,11,13,25 the use of administrative databases for psychiatric research appears only sporadically in the Brazilian literature. 12,* The use of this type of data in our settings is limited by doubts as to the reliability of diagnosis-related information.Recent studies have identifi ed a lack of standardization in the completion and encoding of diagnoses and type of payment in SIH/SUS as the main reasons behind the variability found in these data. 12,25other limitation we identifi ed was the presence of hospitalizations with a blank "secondary diagnosis" fi eld.According to clinical experience, the number of secondary diagnoses is usually large; the low number of secondary diagnoses found may thus result from administrative routines.The issuance of AIHs with the In spite of the limitations inherent to the nature of this information, the present study showed the feasibility of using DATASUS to generate a research database containing all variables of interest to the researcher, and containing individual records for each hospitalization.This model allowed for the analysis of various characteristics of interest, a feature not available through the DATASUS website.The entire data analysis can be done on the researcher's own computer, allowing for analyses with different degrees of complexity.To our knowledge, no other routines or specifi c algorithms are capable of extracting data and creating databases for evaluating all psychiatric hospital admissions in Brazilian states based on DATASUS information, without the need for interference by the system manager.
The only reference located was a technical note by Campos et al 7 (2001) describing a proposal for the integration of data based on CD-ROMs containing the entire monthly list of AIHs for all of Brazil, provided by the Ministry of Health, but taken from different fi les.Although this is a further source of data, this method does not fulfi ll the assumptions of universal accessibility of the present proposal through direct remote access to raw data with the option to select specifi c areas of interest.
The method described in the present paper proved to be a feasible alternative for the analysis of characteristics and trends in psychiatric hospitalizations, despite the already mentioned limitations and the need for advanced knowledge of information technology.The use of secondary data is inexpensive (only computer equipment is required), and its potential to provide relevant epidemiological information must be disseminated, especially in countries with a service structure such the one in Brazil.This allows for the analysis of data on the entire population covered by SUS.Additional studies must be conducted in order to add information on hospitalizations covered by other sources of payment (social security institutions, health insurance, and health cooperatives).
In Brazil, the proportion of psychiatric hospitalizations taking place in general hospitals is around 4%. 5 However, we found that this proportion was higher in the state of Rio Grande do Sul than the national average, which may be explained by the concentration of psychiatric units in general hospitals in Southeastern and Southern Brazil (43% and 32%, respectively). 5In addition, this higher proportion may also be due to the pioneering legislature in the State, which since 1991 had already approved specifi c legislation prohibiting the creation of new psychiatric beds in psychiatric hospital.*In Latin America, the proportion of psychiatric beds in general hospitals is higher in Colombia (48.8%),Venezuela (26.8%),Chile (13.8%), and Uruguay (11.2%), whereas proportions in Brazil (2.9%), Bolivia (2.6%), and Paraguay (2.2%) are similar. 10Outstanding among the advantages of using psychiatric units inside general hospitals are the effect of reducing the stigma of mental disorder, easier access, the assurance of greater transparency in psychiatric practice, greater care for physical health, and increased interchange with other medical specialties. 4mpared to developed countries, Rio Grande do Sul ranks between The Netherlands, 20 where 33% of the hospitalizations are in general hospitals and France, 18 the United States, 12 and Italy, 5 where these proportions are 70%, 73%, and 100% respectively.
The trend towards an increased rate of hospitalizations in general hospitals found in Rio Grande do Sul has also been observed in other countries in recent decades.
In Italy, hospitalization in psychiatric hospital was reduced to almost zero in 1999; 6 in the United States, there was a 35% increase in hospitalizations in general hospitals between 1988 and 1994; 13 whereas in Spain there was also a slight increase, from 67% to 70%, between 1991 and 1995. 24In Germany, even though the proportion has been stable at around 50%, about 20% of beds in psychiatric hospitals were closed from 1994 to 1998. 2 Canada showed a slight decreasing trend in the number of days of treatment in psychiatric hospitals, from 60.4% in 1985/86 to 57.2% in 1998/99. 21e proportion of psychiatric hospitalizations in general hospitals in Rio Grande do Sul is higher than those described for the rest of the country, 5 probably The declining trend in hospitalizations due to schizophrenia and other psychoses found in the present study has been described in several countries since the 1950's, 15 although in European countries such as Poland rates of hospitalization due to psychosis have remained stable in the last 25 years.19 The present study, however, is limited by our inability to separate prevalent and incident cases, which does not allow us to defi ne whether an individual entry in the database is related to a fi rst hospitalization or to re-hospitalization.Be that as it may, the downward trend can be explained by a reduction in the rates of re-hospitalization of patients with schizophrenia and other secondary psychoses, as well by improved organization of outpatient services and progressive increase in public funds for outpatient care.4 An example of this was the regulation, since 2002, of 38 CAPS in the state,* which "prioritize care to patients with severe and persistent mental disorders".Alternative explanations include delays in diagnosing schizophrenia, changes in diagnostic criteria in the classifi cation systems (including a "narrower diagnostic space"), the possibility of a real lower incidence of schizophrenia, 23 and changes in the health system with the closing down of psychiatric beds in psychiatric hospitals.15,23 Higher rates of hospitalizations due to mood disorders have also been observed in other countries, 9 contributing to the decreasing trend in schizophrenia admissions.22 There has been an increasing investment in higher-cost medications, 4 (clozapine and other atypical antipsychotic drugs) provided free of charge in Brazil, through the refractory schizophrenia protocol,* and there is now a greater availability of alternatives for the treatment of mood disorders, with dozens of antidepressants and novel mood stabilizers.These settings may progressively favor the increase in humor disorder diagnosis.However, the present study does not allow us to determine whether this phenomenon is regional or national in character, since data from other states are not available for comparison.In any case, due to the doubtful reliability diagnoses derived from secondary data, and to the lack of information regarding prevalent/incident case ratio, it is impossible to discuss aspects associated with trends towards changes in proportion of diagnoses.However, the evidence of change in the profi le of hospitalized psychiatric patients in the State can be asserted, and attention must be called to the need for new studies to accurately determine the reasons for such changes.
The information from the present study can be used by municipal managers to plan health and work-related initiatives, aiming to improve the services offered.The use of our syntax,** with minor modifi cations in the identifi cation of cities and hospitals, may allow managers from different cities or states to become acquainted with the distribution of diagnoses and of the factors that infl uence them, facilitating care quality evaluations.The analysis of hospitalizations and rehospitalizations for a given disorder is mentioned as a possible indicator of quality of outpatient care, 11 that is, success in maintaining the patients out of hospital and in the community.

Figure 1 .
Figure 1.Flowchart of processing routines and data analysis.

Table 1 .
Absolute and relative frequencies of major diagnoses (ICD10) in psychiatric hospitalizations through the Brazilian Health System.Rio Grande do Sul, Southern Brazil, 2000-2004.which include other specialties as well (general hospital) was created based on information contained in the fi le "chrsaamm.arj"(registry of Rio Grande do Sul hospitals by year and month).The reliability and reproducibility of extraction routines (70.8%), which we considered as the correct number of psychiatric hospitalizations paid for by SUS.
Total 19,185 100.0 17,648 100.0 18,077 100.0 17,559 100.0 18,268 100.0 90,737 100.0 * International Classifi cation of Diseases 10 th Revision hospital) or Figura 2. Dispersion graphs showing the proportion of hospitalizations for each of the major psychiatric diagnoses (A -E) and psychiatric hospitalizations taken place at general hospitals (F).Rio Grande do Sul, Southern Brazil, 2000-2004.

Table 2 .
Absolute and relative frequencies of hospitalizations according to type of hospital.Rio Grande do Sul, Southern Brazil 2000-2004.

Table 3 .
Polynomial regression analysis of time trends in major psychiatric diagnosis and proportion of hospitalizations in general hospitals.Rio Grande do Sul, Southern Brazil, 2000-2004.samenumberfora same hospitalization was limited to three until SAS Administrative Ruling nº 111* was issued, hindering the proper analysis of these data.An alternative for the correct aggregation of data from prior to 2001 was proposed by Portela et al17 (1997), who suggested an algorithm which used different database fi elds as an attempt to identify entries pertaining to a same hospitalization but carrying different AIH numbers.
8inistério da Saúde: Legislação em saúde mental 1990-2004, Secretaria-Executiva, Secretaria de Atenção à Saúde.-5.ed.ampl.-Brasília:2004.**Pepe,VLE.Internações e reinternações psiquiátricas no estado do Rio de Janeiro [tese de doutorado] São Paulo: Faculdade de Medicina da Universidade de São Paulo; 2002placing the state in a more advanced position in the current reconstruction of psychiatric care in Brazil.8Thetrend towards a growing proportion of psychiatric hospitalizations in general hospitals reached 97.7% in only 5 years.Factors contributing to the current scenario include changes in the legislation taken place in 2002*, with the regulation of extra-hospital services, the closing of a major psychiatric hospital in December of the same year, and the already mentioned concentration of psychiatric units in general hospitals in the South, in addition to other legislative changes occurred in the State prior to 2001.According to these trends, the number of hospitalizations in general hospitals should continue to rise, and further studies are needed to better evaluate the characteristics of this type of hospitalization.