Health in the Juvenile Justice Systemsocioeducativo.bsb.br, home page

In development · proposal

Two systems to know who arrives, what they need, and whether care continued.

Alongside the open content of this site, two systems are being developed for those who care for the health of adolescents in the juvenile justice system (in Brazil, the socio-educational system): one for statistical monitoring, with anonymized data, and one for continuity of care between the juvenile justice system and the health network. This page describes the proposal. Neither system runs on this site, and neither handles any adolescent data here. Real-world use depends on institutional authorization and on the data protection assessments required by law.

version 0.2 · October 2026 · CC BY 4.0

The problem

Care crosses many systems. Information does not.

An adolescent goes through many doors in a short time: apprehension, initial intake, pre-adjudication detention, a court-ordered socio-educational measure, release. At each step, health staff identify needs and refer the adolescent to the network — primary care units (UBS), community mental health centers (CAPS), shelters, the Guardianship Council (the local child protection body). The record of this path, however, is scattered across several health, justice and administrative systems (e-SUS APS, TrakCare, Jornada, SISREG, SEI) and spreadsheets that do not talk to each other.

Half of all entries at initial intake are adolescents who have been there before (Federal District Juvenile Justice Statistical Yearbook, 2022/2023). And the receiving network is overloaded: in August 2026, the Federal District Public Prosecutor’s Office reported more than 11,000 people waiting for a general psychiatry appointment.

  • Free-text records and manual spreadsheets. There is no reliable way to say how many arrive with mental distress, use substances or have overdue vaccinations.
  • Referrals with no status tracking. With no traceable deadline or owner, nobody knows whether the adolescent reached the CAPS or ran out of medication.
  • Counting visits, not people. Those who come back are counted again; readmission and continuity cannot be measured.

System 1 · Statistical monitoring

Answers who arrives and what they need, from the records that already exist, without exposing anyone.

System 2 · Continuity of care

Answers whether the care that started has continued, following each referral until the network reports back.

System 1 · Statistical monitoring

Indicators from existing records — anonymized before anything is read.

Health visits in the juvenile justice system are recorded in text documents. The system turns these documents into aggregate indicators — health profile, substance use, mental health, vaccination, referrals — to plan services and evaluate what works. It runs in five steps, always in this order:

  1. 1
    Local anonymization, first of all. A program runs on the service’s own computer, offline, and removes names, ID numbers, addresses, medical record numbers and staff names. Files are given codes. The key linking codes to documents stays outside the processing, held only by the person responsible.
  2. 2
    Standardized fields. The same fields are extracted from every visit, using a closed vocabulary (for example: substance use, vaccination status, referral). When extraction is assisted by a language model, the model only ever receives text that has already been anonymized.
  3. 3
    Rules that check meaning. “Denies use”, a fact about someone else (“the mother uses”) or an ambiguous answer becomes a pending item, never a finding. Phrases that come pre-filled in the document template are counted separately.
  4. 4
    Blinded validation. A sample is checked by two reviewers who do not see the extractor’s output; agreement is measured and disagreements are adjudicated. Only then does a number become an indicator.
  5. 5
    Aggregate numbers only. Counts and proportions by period. No individual result leaves the processing, and very small counts are not published.

What it delivers

  • Health profile by period, with source and date
  • Indicators for planning and monitoring
  • A measure of how often each item is actually recorded
  • Documented, reproducible methods and rules

Stated limitations

  • It measures what was recorded: no record does not mean no problem
  • It counts visits, not people, until System 2’s identifier exists
  • No figure is published before validation and institutional acknowledgment
  • It does not diagnose or make treatment decisions

System 2 · Continuity of care

No health referral gets lost between the juvenile justice system and the network.

A local registry, controlled by the health team, that follows the flow of care: what was requested, where to, by when, who is responsible and what happened. Clinical content stays where it has always been — in the official systems, behind their own authentication. The system keeps only the minimum the team itself enters, the status, and a pointer (case number, facility, date).

Requests

Nothing without an owner and a deadline

Every referral, test or action becomes an item with a destination, priority, owner and due date. If it is late, an alert is raised.

Continuity

Medication and therapy without gaps

Prescription validity (including controlled drugs under Brazilian regulation SVS/MS 344/1998), expected end of medication supply and psychotherapy schedule, tracked ahead of time.

Surveillance

Fast response to severe cases

Explicit severity criteria at entry and exit; a risk signal triggers case discussion and active outreach with primary care.

Counter-referral

Closing the loop with the network

The receiving service reports back (a counter-referral) in three fields: attended or not, a short note, and where the official record is. The full content stays in the source system.

Statistics

Indicators without manual spreadsheets

Monitoring indicators come straight from the structured registry, with no double entry — and feed the statistical system.

Identifier

Measuring people, not visits

A stable pseudonym, with identity kept separately. Without it, readmission and continuity cannot be measured per adolescent.

For partner services: thirty seconds.

No new system to learn and no password to remember. The professional at the CAPS, primary care unit or shelter receives a secure link, opens one screen and answers three fields:

  1. 1
    Attended? A missed appointment alerts the referring team.
  2. 2
    Short note. One or two sentences about what was done.
  3. 3
    Where is the official record? The full content stays in the source medical record.

What it is

  • A working tool for the health team
  • Requests, deadlines and owners tracked
  • Alerts for medication, therapy and attendance
  • Data model aligned with the national standard (FHIR R4)

What it is not

  • Not an electronic health record
  • Does not store other agencies’ clinical content
  • Does not replace the official systems (e-SUS APS, TrakCare, SEI, SISREG)
  • Not a commercial product

How they fit together

One looks back; the other looks ahead.

Statistical monitoring works with what has already been recorded and shows where the gaps are. Continuity of care starts recording, in structured form, what today sits in free text — and, with a per-person pseudonym, makes it possible to measure readmission and continuity per adolescent, not just per visit. Over time, the second system reduces the work of the first.

Data protection

Designed from Brazil’s data protection law (LGPD), not retrofitted to it.

The data subjects are adolescents in vulnerable situations. That is why both systems start from data minimization: keep the minimum, point to the rest, audit everything.

Impact assessment before real data

Health data about adolescents is high-risk processing: no use of real data before a Data Protection Impact Assessment (LGPD, art. 38) with the Data Protection Officer, and before institutional authorization.

Anonymize and pseudonymize

Statistics only read anonymized text. Continuity of care works with pseudonyms; identity is stored separately, encrypted, and re-identification is restricted and always logged.

Pointers, not copies

Clinical content from other services is not copied: it stays in the source system, behind its own authentication.

Audit trail

A record of who accessed what and when (LGPD, art. 37). Improper access becomes visible.

Controlled hosting

Identifiable data does not go to a public cloud: encrypted infrastructure controlled by the service.

Explicit legal basis

Health protection by health professionals (LGPD, art. 11, II, “f”), execution of public policy (art. 23) and the best interests of the adolescent (art. 14). Anything adolescents may use follows the Digital ECA, Brazil’s Digital Statute of Children and Adolescents (Law 15.211/2025): privacy by default, no profiling.

About this site: the pages are static and collect no personal data — no cookies, no trackers. Forms generate the PDF in your own browser; nothing is sent.

Implementation

In stages, each useful on its own. Nothing moves forward without the matching authorization.

Implementation stages: what each delivers, what it depends on and who authorizes it
StageWhat it deliversDepends onWho authorizes
0 · No personal data
under way
This site, the guides and the forms that generate PDFs in the browser; development and testing of both systems.Nothing external.No authorization needed: personal initiative, public content only.
1 · Use by the health teamStatistical monitoring of visits and a local registry of the flow of care (requests, deadlines, prescription and medication alerts), with a per-person pseudonym.Data Protection Impact Assessment; controlled hosting; access policy.The institutions responsible for the service and the Data Protection Officer, on formal record.
2 · Partner servicesThree-field counter-referral via secure link; confirmation by shelters that the adolescent is in their care.Stage 1; each service joining, one at a time.Each CAPS, primary care unit or shelter, by formal agreement.
3 · IntegrationsCase processing in SEI, structured health data in juvenile justice systems, submission to and queries from Brazil’s National Health Data Network (RNDS) using FHIR.Stages 1 and 2; credentials.The Federal District Health and Justice departments, by joint act or agreement.
4 · Other populationsReuse of the core for people experiencing homelessness, institutional care, people released from prison and migrants.Evaluation of stage 2; cross-service governance.Institutional decision by the departments involved.

The juvenile justice system is the starting point because it concentrates a great deal of vulnerability in a short time — and it is where loss of continuity costs most. The same core serves people on the street, in institutional care, leaving prison or arriving from another country. The choice is one of method, not of scope.

Commitments

A proposal to the institutions

A personal initiative of a public servant, offered for evaluation and possible adoption by the responsible institutions. If adopted, the systems move under their governance and infrastructure.

No cost and no commercial ties

They are not products for sale, have no sponsorship and require no procurement. Free software: text under CC BY 4.0; code, when published, under the MIT license.

Acknowledged risks

Overload of a small team (goals sized accordingly); change of administration; regulatory change (periodic review); data leaks (minimization, pseudonymization, no public cloud, impact assessment).

Legal and policy framework (Brazil)

Statute of Children and Adolescents (ECA), art. 88, VSINASE — Law 12.594/2012PNAISARI (national adolescent health policy in juvenile justice)Federal District Operational Plan (POD/DF), 3rd ed. 2023–2026Law 15.413/2026 — ECA art. 11-ANational Socio-Educational Plan 2026–2036Digital ECA (Digital Statute of Children and Adolescents) — Law 15.211/2025LGPD — Law 13.709/2018

Want to follow or contribute? Professionals in juvenile justice and health can write to contato@socioeducativo.bsb.br. Please do not send any adolescent data.