# Census every doctor and clinic in a city

You have access to a local/maps search tool and two French public
health-data lookups: a practitioner registry and a facility directory.
Run this for **[a specialty — e.g. "generalist doctors", "dentists" —
and a target city]**.

## 0. Set up (skip if you're already connected)

If you don't already have live tool access for this, connect it first
— this prompt is only as real as the tools behind it:

1. Get a Tulina account: book a demo at https://tulina.ai/book.
2. Add Tulina's MCP server to your assistant: https://mcp.tulina.ai/mcp
3. In Tulina, connect your own API keys for the tools this prompt uses
   — local/maps search, plus the two open-data health lookups (no key
   required for either).

Once connected, your assistant has real tool access and the rest of
this prompt runs as written.

## 1. Pin the specialty in both registries

A solo or group medical practice and a clinic or health center live in
two different repositories. Before running anything, resolve the
target specialty to:

- the practitioner registry's exact activity code (e.g. the code for
  generalist doctors, not a neighboring specialty), and
- the facility directory's matching category, for the larger
  structures that register there instead.

Getting either one wrong silently changes what step 4 and step 5 count
as exhaustive.

## 2. Collect every map listing

- Tile the target city into a grid of search anchors rather than
  running one query from the city center — a single anchored search
  caps out around twenty results and biases toward its own anchor
  point, undercounting silently with no error raised.
- Page every anchor to exhaustion, not just the first page.
- Record name, address, phone, and website for every hit in one
  running list.

## 3. Count each location once, by address and phone, not by name

Collapse the raw list on address and phone number. A single cabinet
very often lists multiple practitioners under one map pin — several
doctors sharing a secretariat, or an associate not yet reflected in
the listing — and deduping by name alone will double- or
triple-count that location.

## 4. List every registered practice

Query the national practitioner registry for every **active**
establishment under the resolved activity code, scoped to the same
city (by commune code, not city-name string-matching). This is the
regulatory record, not a search index — no bias toward an online
presence, and no result cap.

Note going in: a real share of individual-practitioner entries will
have their address suppressed in the public registry (opted out of
public diffusion) — those count toward the total but can't be
address-matched in step 6.

## 5. List every registered clinic

Query the national health-facility directory for every registered
clinic, health center, or larger structure in the same city. This is
a separate repository from individual practitioners — it catches
group facilities the practitioner registry structurally does not
cover, the same way step 4 catches solo practices the facility
directory does not.

## 6. Flag what the map missed

Match each addressable entry from both registries against the
deduped map list by address. Anything registered but never surfaced
by the census gets flagged as a gap — for manual verification, not
silently discarded. Some of these will be real (a practice with no
online booking or listing); some will be stale registrations for a
practice that has since closed. The flag is what makes that
distinction checkable instead of invisible.

## Output

Report: total distinct locations found by census, total active
entries across both registries (and how many practitioner addresses
were suppressed), how many registry entries matched a census hit, and
the final gap list with registered addresses for manual follow-up.
