--- name: tartu-document-register description: Search Tartu's public document register for legal acts, agendas, minutes, contracts, correspondence, orders, stenograms, and construction records. module: tartu.mjs execution: get --- # Tartu Document Register ## Access - Register chooser: `https://info.raad.tartu.ee/dhs.nsf/dokreg?readform` - Public HTML backed by Lotus Notes views; no login is required. - The old `webaktid.nsf` route redirects to the same document-register splash page and is not a separate source. ## Retrieve Fetch the chooser and select the view matching the record type. Direct view prefixes are: - `koik` - all records - `oigusaktid` - legal acts - `haldusaktid` - permits, precepts, and other decisions - `paevakorrad` - agendas - `protokollid` - minutes - `lepingud` - contracts - `skirjad` / `vkirjad` - incoming / outgoing correspondence - `kaskkirjad` - administrative orders - `Stenogrammid` - meeting transcripts - `epd` - construction-related documents Each search view starts with this query string: ```text ?SearchView&Count=100&Start=1&SearchOrder=4&SearchMax=1000 ``` **A plain GET with `&Query=` searches it** — no browser session, no form POST (verified 2026-08-01 across `koik`, `oigusaktid`, `lepingud`, `paevakorrad`, `skirjad`, `epd`, `Stenogrammid`): ```text https://info.raad.tartu.ee/dhs.nsf/oigusaktid?SearchView&Count=100&Start=1&SearchOrder=4&SearchMax=1000&Query=raieluba ``` `Query` is Domino full-text syntax: a bare word; several words, where a space is an implicit AND (`detailplaneering Annelinn` and `detailplaneering AND Annelinn` both return the same 2 documents); a `"quoted phrase"`; a trailing wildcard (`raie*` → 188). Estonian letters work percent-encoded. Page with `Start=101`, which the register's own pager links. Search results are newest first, return at most 1,000 matches, and show 100 rows per page. Result columns differ per view and must be read from the header row, not by position: `oigusaktid` is Väljaandja / Dokumendi liik / Kuupäev / Nr / Pealkiri, `lepingud` is Kuupäev / Number / Linna pool / Teine osapool / Lühikirjeldus, `paevakorrad` is Istungi kp / Pidaja / Koht, and `Stenogrammid` leaves its last column unlabelled. Row links are written as `http://` and must be requested as `https://`. ## Return - Preserve the document type, registry number, title/summary, issuer or correspondent, registration/adoption date, access status, detail URL, attached full-text links, search filters, and retrieval time. - Keep restricted records in the result only when their public metadata is relevant; do not claim access to restricted full text. ## Limits - Physical-person names in correspondence may be reduced to initials. - Search fields differ by document type, so choose the view before forming the query. - **A view fetched without `&Query=` answers HTTP 200 with its search form** — 15,518 bytes, no error, and no count line. That is a request that never searched, and reporting it as "Tartu holds nothing" is the wrong answer this source produces most easily. - The register caps a wide search: over the ceiling it writes `üle N dokumendi` instead of a number. Report that as *at least* N. ## Verify - Require HTTP 200 HTML whose title is `Dokumendiregister`. - Require chooser links for `oigusaktid`, `paevakorrad`, `protokollid`, and `lepingud`; the bare `dhs.nsf` splash page is not a successful data response. - **A search only ran if the response carries `Otsingutingimustele vastas dokumenti`** (or `1 dokument`, or `üle N dokumendi` when capped — note the genitive drops the *t*). `vastas 0 dokumenti, muutke otsingutingimusi` is a real, empty result. No such line at all means the search was never run. Known-good acceptance check, run against the live register by `scripts/check-sources.mjs` (issue #82): ```probe GET https://info.raad.tartu.ee/dhs.nsf/oigusaktid?SearchView&Count=100&Start=1&SearchOrder=4&SearchMax=1000&Query=raieluba expect /Otsingutingimustele vastas\s+(üle\s+)?\d+\s+dokumen[dt]/ expect /\/dhs\.nsf\/web\/viited\// # 129 documents on 2026-08-01, the first being "Ropka tn 2 ehitusloa andmine" # (Korraldus 116, 02.02.2021, TLVK2021020200116). The counter is the same view # with the Query dropped: HTTP 200, the search form, and no count line at all. counter GET https://info.raad.tartu.ee/dhs.nsf/oigusaktid?SearchView&Count=100&Start=1&SearchOrder=4&SearchMax=1000 ``` ## Module API tartuDocuments(query, {view, start, count}) -> {source, page, view, query, ran, totals, columns, rows, note} tartuDocument(refOrUrl) -> {source, page, ref, title, fields, files, note}