Medical Registration Verification
Feature Overview
When a doctor enters their primary registration number at sign-up, PPP performs a live regulator lookup — AHPRA for Australia, GMC for the UK — and surfaces a green tick when the person is genuinely confirmed on the public register or a red cross when the number cannot be confirmed. On a confirmed match the form auto-populates First name + Surname from the register, and (for GMC) derives Consultant vs Non-Consultant plus the registered specialty from the Specialist/GP registers. This is split out of Onboarding & Sign-up so the regulator-integration detail lives in one place.
Open Questions
| # | Question | Proposed answer / status | Ref |
|---|---|---|---|
| 1 | The richer detail-field markup (registration status / expiry / qualifications) was only validated against the one captured specialist page (MED0000958164). Is the assumed field-title text and section layout correct for a lapsed / suspended practitioner and for the Qualifications section on real pages? | Partially resolved (2026-06-03, #7679). A live UAT Job scrape of MED0000958164 cleared the F5 wall and returned full Specialist HTML, confirming the active path parses correctly (isSpecialist / specialty / specialtyFields / registrationStatus). The same run exposed two real-page parser bugs — registrationExpiryDate captured help-text and qualifications mixed in raw HTML + address fragments — now tracked in #8294. Still open: a real lapsed / suspended sample. Graceful defaults (unknown / null / []) mean a markup mismatch degrades safely; expiry/qualifications must not gate anything until #8294 lands. | #7438, #7679, #8294 |
| 2 | What raises the admin flag, and where does admin see it? On 2026-09-22 Matt approved a "secondary flag to our admin saying 'Hey, ask a few questions here. Explain more.'" whenever the background AHPRA full search finds something (registration.ahpra.background-findings-flag-admin). He did not say which register entries count (Conditions? Undertakings? Reprimands? Tribunal decisions? A lapsed or suspended status?), or how the flag reaches admin (an Admin Console queue, an email to PPP admin, or both). | Open — for Matt. Interim engineering default: Conditions + Undertakings only. Those are the two fields already surfaced (#11056 AC2). | transcript-2026-09-22, #12745 |
| 3 | Does the same admin flag apply to GMC (UK)? Matt's 2026-09-22 approval was about the AHPRA flow only. The GMC register also publishes conditions, undertakings and warnings, but PPP does not read them today. | Open — for Matt. No GMC equivalent is specified until he answers. | transcript-2026-09-22 |
Closed Questions (0) — click to expand
| # | Question | Resolution | Ref |
|---|
Acceptance Criteria
✅ Medical registration verification — live regulator lookup at sign-up:
- ✅ The Registration Number is the first field on the sign-up form (top-left), with the regulatory-body (AHPRA/GMC) selector immediately to its right on the same row, ahead of name and email — so the register lookup + autofill runs right at the start of sign-up. On narrow viewports the body selector stacks under the number field. †
- ✅ The primary registration field is labelled "Medical Registration Number" and carries
autocomplete="off"+inputmode="text"so password managers (Roboform/LastPass/1Password) do not mistake it for a vehicle registration and offer saved car-registration values (#7720). The live register-lookup behaviour above is unchanged. - ✅ A green tick appears on the field only when the person is genuinely confirmed on the public register; a well-formed-but-unconfirmed number shows a red cross, never a tick. (Applies to both AHPRA and GMC.) The lookup always ends in a tick, a cross or an error, in bounded time. It never sits with no feedback. The 2026-08-25 Task 6 walkthrough found a live AHPRA lookup hanging silently with no spinner, tick or cross. The cause was a Redis client with no timeouts; it was fixed by bounding them (#11797, fixed in #11842). ††
- ✅ Hovering the validation symbol reveals what the register returned (practitioner name, profession, status). (Applies to both AHPRA and GMC.) †
- ✅ On a confirmed register match the form auto-populates First name + Surname from the register, overwriting what was typed (best-effort split, user can still edit). Applies to both AHPRA and GMC — so GMC no longer warns on a name mismatch; it trusts the register and replaces the name. †
- ✅ Australia - AHPRA validation via the public AHPRA register (our own register-lookup client, not PCA). Confirms the registration exists + practitioner name + active status; the predictions endpoint exposes no specialty/consultant signal, so AHPRA registrants default to Non-Consultant. Graceful fallback when the register is unreachable (#5991, #6306)
- ✅ AHPRA verification wired to the same resolution layer (no-op until AHPRA returns speciality data) (#4613)
- ✅ Format is a client-side guide that gates the register call — the number must match the AHPRA format (3 letters + 10 digits) before any register lookup is sent, so invalid numbers never waste an AHPRA call. †
- ⏳ AHPRA Consultant detection — achievable via a lean
chrome-headless-shellscraper (separate component); proven locally returns the Specialist HTML. A pure HTTP fetch is impossible (the register search-results POST is F5/Shape-gated and returns a "request rejected" challenge shell even with a TSPD browser cookie). The workaround is a real (but lean) Chromium that executes the F5 challenge JS, gets the clearance cookie, and submits the register search to reach the detail page. This lives in a separate, isolated packageapi/ahpra-scraper/(ownpackage.json,playwright-core+chrome-headless-shell) so the main API stays Chromium-free; the backend wires to it behind an invoker interface (ahpraDetailScraperInvoker.ts) that runs inline locally and is swappable to a Container Apps Job in UAT. The HTML parser (parseAhpraDetail.ts) extracts the "Registration Type - Specialist" section (Specialty / Specialty Fields). Whole flow gated byAHPRA_DETAIL_SCRAPE_ENABLED(default OFF) + 24h Redis cache; graceful fallback (returns null / no-op so the existing flow is unaffected). Proven locally 2026-05-26: scraper returned{ isSpecialist: true, specialty: "Surgery", specialtyFields: "Orthopaedic surgery" }forMED0000958164(cleared the F5 wall on retry attempt 2). WhenisSpecialistis true thesuggestedUserTypebecomesconsultant. Deep retrieval, the UAT Job deploy, egress-IP validation, and the official AHPRA Practitioner Information Exchange evaluation are tracked in #7438. - ✅ Richer AHPRA detail fields (#7680, decomposed from #7438) —
parseAhpraDetailextracts, in addition to the Specialist section, the practitioner's registration status (active / lapsed / suspended), registration expiry date, and qualifications from the detail-page HTML. These flow through theAhpraValidationResultcontract (registrationStatus,registrationExpiryDate,qualifications) to the frontend without breaking existing consumers, so the consultant-status guard (#7643) can act on a lapsed/suspended registration. Unit-tested against the capturedMED0000958164fixture. - ✅ Deep AHPRA detail fields reach the registration UI (#7438) — the deep fields the backend returns (
registrationStatus,registrationExpiryDate,qualifications) are now surfaced through the frontend verification result onverifiedGmcData.ahpraDetail, where they were previously dropped at the API boundary. The pureextractAhpraDetailFieldsmapper applies the same safe defaults (unknown/null/[]) the backend uses, so a format-only fallback or a pre-deep-retrieval result yields a stable, non-partial shape. The real-page markup for status/expiry/qualifications is still representative pending UAT egress (Open Question 1). † - ✅ AHPRA scraper Job image + blob-result
jobinvoker (#7721, code-complete, deploy-gated; part of #7678) — the deploy-independent slice of the UAT Container Apps Job. ADockerfile.jobbakeschrome-headless-shellinto a lean Node 22 scraper image (AHPRA_SCRAPER_CHROME_PATHset) and CD builds + pushes it to ACR as a second UAT-tagged image alongside the API image. The scraper CLI optionally writes its JSON result to a short-lived result blob when the blob-target env vars are set (keeping stdout behaviour otherwise). Thejobinvoker (AHPRA_DETAIL_SCRAPE_STRATEGY=job) starts a Container Apps Job execution withAHPRA_NUMBER+ a generated blob key, polls to completion, reads + deletes the result blob, and returns the parsedAhpraDetailParseResult(or null on timeout/failure) — unit-tested with the Azure SDK + blob client mocked (no live calls).AHPRA_DETAIL_SCRAPE_ENABLEDstays default OFF so this changes no runtime behaviour until the Job is deployed and the flag is flipped. The Pulumi Job resource, NAT/egress, and live UAT validation stay on #7678 (deploy tracker). - ✅ UAT egress validated against AHPRA's F5/Shape wall (#7679) — the deployed
ahpra-scraper-uatContainer Apps Job uses Azure's shared Consumption egress (no NAT gateway / static outbound IP). A live UAT execution against MED0000958164 cleared the F5/TSPD challenge and returned full Specialist HTML (isSpecialist: true, Surgery / Orthopaedic surgery) in ~70s — confirming the UAT egress IP is not flagged, so no managed-egress/proxy is required. F5/Shape blocking is dynamic, so this is validated-not-guaranteed; if it regresses, the escalation path is a VNet-integrated env + NAT gateway (a Consumption-only env can't attach one directly). The synchronous poll-to-completion latency (~70s–5min) is unsuitable for the sign-up request path — async dispatch-and-reconcile tracked in #8293. † - ✅ Sign-up never blocks on the AHPRA detail scrape — async dispatch-and-reconcile (#8293) — specialist detection is enrichment, not a sign-up gate, so the slow detail scrape is no longer awaited in the request path.
validateAhpraNumberreturns immediately with aspecialistDetectionStatusofresolved(24h cache hit),pending(cache miss — the scrape is dispatched in the background), ordisabled(flag off). On apendingresult the scrape runs detached (dispatchSpecialistDetection) and, when it confirms a specialist, reconcilesuserType -> consultant(+ resolvedspecialityId) onto the user profile (reconcileSpecialistStatusToProfile) and warms the 24h Redis cache so a later poll returnsresolved. The sign-up UI shows a non-blocking "Confirming specialist status…" affordance and lightly polls until it resolves. Whole path stays gated byAHPRA_DETAIL_SCRAPE_ENABLED(default OFF). Job self-writeback (Option B — the Job upserts the profile itself) is a deferred follow-up; this slice needs no infra/Job-image change. † - ✅ AHPRA registration Conditions / Undertakings parsed from the detail page (#11056 AC2) —
parseAhpraDetailnow also extracts the "Registration details" section's Conditions and Undertakings rows intoAhpraDetailParseResult.conditions/.undertakings(string[],[]when the row reads "None" — never['None']), flowing throughAhpraValidationResult.conditions/.undertakingswith the same[]safe-default convention asqualifications. This closes the CPD Home Program Policy §2 promise that AHPRA register cross-checks include "Any conditions or restrictions on registration," which the code previously had no field to carry. Verified against a real captured "Registration details" section (Dr Craig McCombe, MED0001399353 — a public-register practitioner with a documented 2020 QCAT reprimand) showing the "None"/"None" case, plus a constructed-analog populated-Conditions fixture built from the real Reprimands row's<ul><li>list shape (the only populated row in the real sample). That same real markup exposed a pre-existing title-matching bug:extractFieldEntry's title regex required the field-title div's content to be exactly the label immediately followed by</div>, but AHPRA's real markup for Conditions/Undertakings (and Reprimands/Tribunal decision/Date of first Registration) puts a<a data-toggle="popover">tooltip link inside the field-title div after the label — so the old regex could never match past it and silently returnednull/dropped a real value. Fixed generally by loosening the title-matching regex to tolerate trailing markup before the title div's close. Reprimands/Tribunal decision are documented (same list-or-"None" shape) but intentionally not surfaced — out of scope for AC2's "conditions or restrictions" wording. No UI surface wired yet —qualifications/registrationStatusalready reach the frontendAhpraValidationResult/AhpraDetailFieldstypes viauseGmcVerification.tsbut have no rendering consumer either, so extending that hook + finding/building a UI surface (e.g. an admin AHPRA verification screen) is a follow-up, not bundled into this data-shape change. † - ✅ Field-title label-boundary fix — a shorter field label can no longer match a longer sibling label (#12386, follow-up to #11056 AC2) — #11056 AC2's popover-tolerance fix loosened
extractFieldEntryHtml's title-matching regex toLABEL\s*[\s\S]*?</div>(to match past the popover<a>tag AHPRA nests in some field-title divs). That unrestricted trailing-markup tolerance had an unintended side effect: a shorter label could match a longer sibling label that starts with it — e.g.extractFieldEntry(sectionSlice, 'Specialty')could match aSpecialty Fieldstitle row instead of correctly finding nothing, silently mis-attributing that row's value (e.g.specialty: 'Orthopaedic surgery',isSpecialist: true) whenever the plainSpecialtyrow was absent, reordered afterSpecialty Fields, or failed to match for any other reason. All previously-known real fixtures happened to listSpecialtybeforeSpecialty Fields, so the existing suite didn't catch it. Fixed by requiring only whitespace between the label and the next<(the popover tag or</div>) via a(?=<)lookahead, in place of the unrestricted[\s\S]*?— this still tolerates the popover markup while rejecting any non-whitespace continuation of the label. Found via/sge:pr-reviewrun on the already-merged #12370. - ✅ NAS-hosted
nas-httpinvoker strategy replaces the Azure Container Apps Job (#11839, split from #11819; ADR-0006) — thejobstrategy above targeted a scale-to-zero Container Apps Job, which went dormant when the Container Apps environment was scaled tominReplicas=0on 2026-08-09 as part of the NAS migration. A third invoker strategy,nas-http(AHPRA_DETAIL_SCRAPE_STRATEGY=nas-http), calls a resident sidecar container (ahpra-scraperservice,deploy/nas/docker-compose.nas.yml, built from a newapi/ahpra-scraper/Dockerfile.nas) over the NAS compose stack's internalppp-netbridge network via a small HTTP contract (POST /scrape { ahpraNumber } -> { result }). Unlike the other 12 jobs migrated by #11819 (plain node-cron ticks folded straight into the always-onbackendcontainer), this one keeps its Chromium-bearing runtime in a separate sidecar container rather than bundling it intobackend— adocker run-per-request design was rejected because the NAS compose stack has no Docker-socket mount anywhere, and adding one purely to avoid one resident Node process would be a materially bigger new privilege surface. The sidecar itself never keeps a browser resident:scrapeAhpraDetail()launches and closes its own Chromium instance per call, so idle cost between requests is a small Node HTTP server, appropriate for a genuinely on-demand/low-frequency workload (annual registration rechecks + occasional sign-up detection, not a tight loop). Thejobstrategy is kept, not deleted, per ADR-0006's own precedent of removing a superseded mechanism only once its replacement is verified working. Code-complete; NAS-side manual setup (settingAHPRA_SCRAPER_IMAGEin.env.nas.uatand flippingAHPRA_DETAIL_SCRAPE_STRATEGY=nas-httpto actually enable it) is outstanding — see the PR description for exact steps.
- ✅ UK - GMC validation: live GMC registrant lookup; derives Consultant vs Non-Consultant from the Specialist/GP registers and returns the specialist register entries. The name is taken from the register (no name-match required). A Consultant suggestion requires the register page to confirm Specialist Register membership; scraped list entries alone never promote, and an unknown flag leaves the suggestion indeterminate (#12765).
- ✅ GMC verification response includes the resolved
specialityIdalongsidespecialistRegisterEntries(#4613)
- ✅ GMC verification response includes the resolved
- ✅
registration.consultant-status.source-of-truth(#7643) — consultant/specialist status is derived from the registration-body (AHPRA/GMC) lookup result, never from a user-uploaded certificate or self-selection. A certificate scan (medical degree / indemnity) may be stored as evidence but never changes the role. † - ✅
registration.consultant-status.no-self-claim(#7643) — a user cannot set or elevate their own account to consultant. The consultant role is granted only when registration-body verification returns specialist/consultant status; if it does not confirm, the account stays non-consultant and cannot sign off other users' work. Enforced server-side at sign-up (GMC + AHPRA) and on profile update, so the role cannot be set via a direct API call. †- ⏳ A GMC doctor on the GP Register counts as a Consultant/specialist — same as the Specialist Register, including UK GMC GPs (decision: Rob, 2026-05-26; honours #7387's AC "a GP counts as a consultant/specialist for our purposes").
deriveGmcSpecialistStatusmust acceptisOnGpRegisterand returnisSpecialist: truefor GPs, and the specialist/HLSR requirements fire for them. (Tracked in #7436; lands on PR #7433's branch.) Partly built (2026-10-04): sign-up classification (classifyGmcUserType), the radio pre-set and the server consultant gate now treat the GP Register as specialist; thederiveGmcSpecialistStatus/HLSR consumer wiring remains ⏳. - ✅ GMC graduate year auto-populate — on a confirmed GMC match, the
registeredQualificationfield (e.g. "MB ChB 2003 University of Sheffield") is parsed byparseGmcGraduateYearand the 4-digit year is populated into the Graduate Year field (pgy) at sign-up. Guard: only populates when the field is blank, preserving any user-entered value. - ✅ GMC degree + university capture at sign-up —
registeredQualificationalso contains the degree (e.g. "MB ChB") and awarding institution (e.g. "University of Sheffield"). The sign-up form now has optional Medical Degree + Awarding University free-text fields; on a confirmed GMC matchparseGmcDegree/parseGmcUniversityslice them out ofregisteredQualificationand pre-populate both (blank-guard, exactly like the graduate-year populate). Stored onusers.medical_degree/users.awarding_university(migration0118). (Implemented in #7441.) - ⏳ GMC degree pre-seed → PPP Passport (follow-up) — the canonical long-term home for degree history is the PPP Passport Medical Degree domain (
ppp_passport_medical_degree, #5611), which supports multiple degrees (the sign-up fields capture one). Per Rob (2026-05-26): the richer flow is to OCR-extract institution/qualification/year from the uploaded degree certificate (reuse GeminianalyzeImage/ocrHospitalMatch) rather than only the sign-up free-text. The sign-up capture above is the lightweight first cut; migrating/pre-seeding it into the Passport domain remains open. (Tracked under #5611.) Open question for Matt: Rob's 2026-05-26 note said degree should live in the Passport (OCR) "not a sign-up field", whereas #7441 asked for sign-up fields — these now coexist (sign-up captures one entry, Passport is the canonical multi-entry store). Confirm this is the intended split.
- ⏳ A GMC doctor on the GP Register counts as a Consultant/specialist — same as the Specialist Register, including UK GMC GPs (decision: Rob, 2026-05-26; honours #7387's AC "a GP counts as a consultant/specialist for our purposes").
✅
registration.reg-number-first-field— the registration number is the first field on the sign-up form (top-left), with the AHPRA/GMC regulatory-body selector to its right, and it is autofocused — so the register lookup + autofill runs immediately as the very first action. † (#7640)✅
registration.live-lookup-on-entry-not-stored-load— the live register lookup fires when the number is entered or edited, never to re-verify an unchanged stored number on load. † ‡✅
registration.ahpra.background-findings-flag-admin— built (#12745), interim default for Q2. A doctor's AHPRA number is checked on the registration screen and sign-up continues. An asynchronous full search of the register then runs in the background. When it finds something on the doctor's registration, PPP admin gets a secondary flag to "ask a few questions here, explain more". The flag never blocks or delays sign-up. Which findings count, and where admin sees the flag, are Open Question Q2. GMC is Q3. Shipped: sign-up is not blocked, and the background detail scrape reads Conditions and Undertakings (#8293, #11056 AC2). A non-empty Conditions or Undertakings list is now stored inahpra_background_findings(one row per distinct finding set, keyed by AHPRA number because the scrape runs before the user exists), every active super admin gets a mandatoryahpra_background_findingnotification, and Admin → AHPRA Findings (/admin/ahpra-findings) names the doctor and the entries and lets an admin mark each resolved with a note. Reprimands and Tribunal decisions do not trigger it. Q2 (which findings count, where admin sees them) is still Matt's to answer. The background scrape is still gated byAHPRA_DETAIL_SCRAPE_ENABLED, which defaults tofalseon the NAS stack, so it may not run on UAT or prod until that flag is checked. †‡⏳
registration.ahpra.public-register-now-formal-api-later— AHPRA verification stays on the public AHPRA register (our own lookup client and detail scraper). PPP does not chase PCA. Matt wants the formal AHPRA API (the Practitioner Information Exchange) as the long-term route, but that decision is parked until January 2027. Matt also flagged its per-user cost (about $1 per user per year, roughly $8,000+ a year for the Q Health cohort alone). He expects the registration-status check to run only once a year, which is the annual re-check (#8327) behindregistration.live-lookup-on-entry-not-stored-load. Re-raise the formal-API decision with Matt in January 2027. ††
What each register provides — and what we use
Legend: ✅ used · ➖ retrievable but only displayed / informational · ⏳ retrievable in the raw data but not yet wired up · ❌ not retrievable / not present.
GMC (UK) — publicGmcRegistrant fields
| Field | Retrievable? | Do we use it? | How |
|---|---|---|---|
name | ✅ | ✅ | Populate First name / Surname; drives the case-insensitive verified match |
isConsultant | ✅ | ✅ | Sets Consultant userType + isSpecialist |
specialistRegisterEntries (e.g. ["Trauma and orthopaedic surgery"]) | ✅ | ✅ | Resolves the doctor's specialty |
suggestedUserType | ✅ | ✅ | Seeds the Consultant / Non-Consultant default |
resolvedSpecialityId / resolvedSpecialityCanonicalName | ✅ | ✅ | Auto-selects the PPP canonical speciality (#4613) |
licenceStatus | ✅ | ✅ | Drives the "verified" tooltip / licence-status enforcement |
profession | ✅ | ➖ | Shown in the hover tooltip only |
registeredQualification (e.g. "MB ChB 2003 University of Sheffield") | ✅ | ✅ | Graduate year parsed by parseGmcGraduateYear → pgy; degree parsed by parseGmcDegree → Medical Degree field; university parsed by parseGmcUniversity → Awarding University field. All three pre-populated (blank-guard) at sign-up (#7441). |
fullRegistrationDate | ✅ | ➖ | Not used |
gender | ✅ | ❌ | Not used |
isOnGpRegister | ✅ | ➖ | Informs the consultant-derivation logic |
url / gmcReferenceNumber / identifier | ✅ | ➖ | Reference / link only |
| Date of Birth | ❌ | ❌ | Not provided by GMC |
AHPRA (Australia) — publicAhpraRegistrant fields
| Field | Retrievable? | Do we use it? | How |
|---|---|---|---|
practitionerName | ✅ | ✅ | Populate First name / Surname |
source (ahpra-scrape | ahpra-format) | ✅ | ✅ | Verified register match vs format-only → green tick vs red cross |
isValid | ✅ | ✅ | Format validity gate |
professionLabel / professionPrefix | ✅ | ➖ | Display only |
registerUrl | ✅ | ➖ | Link out to the register entry |
suggestedUserType (always nonConsultant) | ✅ | ➖ | No real consultant signal on this endpoint — AHPRA registrants default Non-Consultant |
identifier | ✅ | ➖ | Reference |
hpii | ➖ (usually null) | ❌ | Not used |
qualifications | ❌ (empty on this endpoint) | ❌ | Not used |
| Specialty / Consultant status | 🔄 detail page (scraper) | 🔄 building | Being built — #7438: not in the predictions API; retrieved from the F5/Shape-gated detail page via the lean chrome-headless-shell scraper (separate api/ahpra-scraper component → UAT Container Apps Job), then derives Consultant. Proven to return the Specialist HTML; UAT egress validation + official AHPRA Practitioner Information Exchange evaluation tracked in #7438. |
| Date of Birth & graduate year | ❌ | ❌ | Not provided by AHPRA |
Takeaway: GMC gives us Consultant status, specialty and (derivable) graduate year. The AHPRA predictions endpoint gives us name and active status only. Specialist status, Conditions and Undertakings come from the detail-page scraper. That scraper runs in the background without blocking sign-up (#8293), but only where AHPRA_DETAIL_SCRAPE_ENABLED is on. The formal Practitioner Information Exchange decision is parked until January 2027 (registration.ahpra.public-register-now-formal-api-later). (Refreshed 2026-10-03, Task 6. The table row above marked "🔄 building" was written before #8293 and #11056 AC2 shipped.)
Change Log
| Date | Change | PR/Issue | Reason |
|---|---|---|---|
| 2026-10-04 | The background AHPRA search now persists Conditions and Undertakings to ahpra_background_findings, notifies every active super admin (ahpra_background_finding, mandatory, senderless), and lists them on Admin → AHPRA Findings (/admin/ahpra-findings) where an admin can mark each resolved with a note. Sign-up is unchanged and never blocked. | #12745 | Matt 2026-09-22 approved a secondary flag to PPP admin when the background search finds something. Which findings trigger it and where admin sees it stay Open Question Q2; the interim default is Conditions and Undertakings with an Admin Console list plus a notification. Still gated by AHPRA_DETAIL_SCRAPE_ENABLED. |
| 2026-10-04 | A GMC doctor is suggested "Consultant" only when the register page itself confirms Specialist Register membership. Scraped list entries no longer promote to consultant on their own, the entry list is only read when membership is confirmed, and an unknown flag leaves the suggestion indeterminate (the doctor chooses). Regression scenario added for a non-specialist whose page carries an unrelated list. | #12765 | UAT run-through (Rob, 2026-10-03) showed "we've suggested: Consultant" for a doctor not on the Specialist Register. The entry parser read the next list anywhere on the page, and the classifier treated any entry as specialist registration. Consistent with #7643 (consultant status comes only from the registration body). |
| 2026-10-04 | A GMC doctor on the GP Register is now classified Consultant at sign-up (suggestion banner, "registered specialist" radio, and the server-side consultant gate in validateConsultantStatus), the same as the Specialist Register. Sign-up seed job titles now match the ten defaults in jobTitles.ts instead of the old four generic titles. | #7436, #11187 | Rob 26 May 2026 on #7436 ("a GMC doctor on the GP Register counts as a Consultant/specialist … No jurisdiction carve-out") and Matt's 17 Apr brief ("GPs = Consultants"); classifyGmcUserType ignored isOnGpRegister, so GP-Register doctors were suggested Non-Consultant. Task 6 (#11187) video checklist T6-34 and T6-17. |
| 2026-10-03 | Task 6 (Sign up and Registration) spec refresh. Added registration.ahpra.background-findings-flag-admin to match Matt's 2026-09-22 statement. Sign-up is never blocked, and when the background AHPRA full search finds something, PPP admin gets a secondary flag. The AC is marked drift (#12745) because nothing raises that flag, and the background scrape defaults to OFF on NAS. Added registration.ahpra.public-register-now-formal-api-later (Matt 2026-05-05 / 05-27 / 06-24 / 06-29), which keeps the public-register approach, makes the formal AHPRA API the long-term route, and parks that decision until January 2027. The tick/cross AC now says the lookup must always resolve, citing the #11797 silent-hang bug fixed in #11842. Corrected the stale AHPRA "Takeaway" note. Added Open Questions Q2 (what triggers the admin flag and where admin sees it) and Q3 (should GMC flag too?). Status set to partial-drift. Notion "Sign up - doctor" page linked and synced (last edited 2026-05-26; it contains nothing newer). | #11187, #12745, #11797, #4630, #7681, #11056, #8293 | Async Task spec refresh, where the newest dated Matt statement wins. Matt's newest statement on registration verification is the 2026-09-22 Weekly Tech transcript (~01:11–01:12), and the spec had no AC for it. The read-only code check found the admin flag is not built. The AHPRA silent hang from the #11187 walkthrough was already fixed (#11842), so it adds no new drift. |
| 2026-09-21 | Fixed a field-title label-boundary regression introduced by #12370 (#11056 AC2): extractFieldEntryHtml's title-matching regex could match a shorter label (e.g. "Specialty") against a longer sibling label that starts with it (e.g. "Specialty Fields"), silently mis-attributing that row's value. Fixed by requiring only whitespace between the label and the next < via a (?=<) lookahead, in place of the unrestricted [\s\S]*? #12370 introduced. | #12386, #11056 | /sge:pr-review run on already-merged PR #12370 (per Rob's standing instruction to review every PR and fix findings, even though PR review isn't a merge gate in this repo) found that #12370's popover-tolerance fix to the field-title regex had an unintended side effect: a shorter field label could match a longer sibling label starting with it, because the loosened regex swallowed non-whitespace text between the label and the title div's close. All currently-known real fixtures list "Specialty" before "Specialty Fields", so the existing suite didn't catch it — it only surfaces if AHPRA ever reorders those rows, drops the plain "Specialty" row, or a markup glitch breaks the exact-title match while a label-prefixed sibling still matches. Filed as #12386. |
| 2026-09-21 | Extended AhpraDetailParseResult/AhpraValidationResult with conditions/undertakings (string[], [] for "None"), and fixed a title-matching bug in parseAhpraDetail.ts that silently dropped any field whose title div carries a trailing popover tooltip <a> tag. | #12370, #11056 | #11056 AC2 — the CPD Home Program Policy §2 promises AHPRA register cross-checks include "Any conditions or restrictions on registration," but the parse result had no such field and a prior investigation pass could not confirm the live register even exposes one. Real captured "Registration details" HTML (Dr Craig McCombe, MED0001399353, 2026-09-21) confirmed the Conditions/Undertakings rows exist and use a "<ul><li> list, or <strong>None </strong>" shape, and separately exposed extractFieldEntry's title-matching regex breaking on the popover <a> tag AHPRA's real markup nests inside the field-title div for several rows. Fixed generally rather than special-cased to the two new fields. |
| 2026-07-12 | Repointed the spec's front-matter code-paths and every inline src: citation from pre-reorg paths to their current identity-and-profile/ bounded-context locations (ahpraRegistrantService, gmcRegistrantService, authService, userProfileService, and the gmc/ahpra router dirs), plus the GeneralForm.tsx → GeneralForm/ barrel split (auto-populate logic now in utils/practitionerName.ts + hooks/useGmcAutoPopulate.ts). Citation-only; no acceptance criteria changed. | #~, #10486 | SGD drift check C13 (content-drift, spec vs shipped code) flagged all backend citations as stale after the ADR-0003 bounded-context reorg relocated the implementation under identity-and-profile/. Functional behaviour matches the ACs exactly — this is path-citation drift only, no behavioural divergence. |
| 2026-06-09 | Enabled the AHPRA detail scrape in UAT (AHPRA_DETAIL_SCRAPE_ENABLED=true on the backend Container App, in lockstep with the already-deployed scraper Job) so specialist/consultant determination actually evaluates instead of no-opping. | #~, #8330, #7679 | The scrape was deliberately held off until the UAT egress IP was proven against AHPRA's F5/Shape bot wall; that validation completed in #7679 (a live UAT Job cleared the challenge and returned Specialist HTML). With the gate still off, every determination silently fell through to the non-consultant default (#8330). The flag is scoped to UAT via the ahpraScraperImageTag gate (unset in prod), so prod continues to fall back to the inline strategy with the scrape off. |
| 2026-06-03 | Async dispatch-and-reconcile for the AHPRA detail scrape — sign-up no longer blocks on the slow (~70s–5min) Container Apps Job. validateAhpraNumber returns immediately with a specialistDetectionStatus (resolved / pending / disabled); a pending result dispatches the scrape in the background and reconciles userType -> consultant onto the profile + 24h Redis cache when it confirms a specialist. | #8303, #8293 | Follow-on from #7679. The detail-scrape Job is proven in UAT but the synchronous job invoker polls to completion (~70s–5min) — a doctor cannot wait that long on the sign-up screen. Specialist detection is enrichment, not a sign-up gate, so the slow scrape is now fire-and-forget: the request returns straight away, the scrape runs detached (dispatchSpecialistDetection), and on a confirmed specialist it reconciles the profile (reconcileSpecialistStatusToProfile) and warms the 24h cache so a later light poll resolves it. The sign-up UI shows a non-blocking "Confirming specialist status…" affordance. Whole path stays gated by AHPRA_DETAIL_SCRAPE_ENABLED (default OFF); no infra/Job-image change. Job self-writeback (Option B) is a deferred follow-up. |
| 2026-06-03 | Recorded the live UAT egress validation against AHPRA's F5/Shape wall — the deployed ahpra-scraper-uat Container Apps Job, on Azure's shared Consumption egress, cleared the bot-wall and returned full Specialist HTML for MED0000958164, so no managed egress/proxy is required. | #8295, #7679 | #7679 (part of the #7438 deep-retrieval epic) asked whether the UAT Container Apps Job egress IP is flagged by AHPRA's F5/Shape (TSPD) wall the way a pure HTTP fetch is. A live UAT Job execution against MED0000958164 succeeded in ~70s with full Specialist HTML (isSpecialist: true, Surgery / Orthopaedic surgery), confirming the shared Consumption egress is not blocked — AC1 met, AC2 (clean egress/proxy) N/A. The run also partially resolved Open Question 1 (active path confirmed) and surfaced two follow-ups: #8294 (real-page parser noise in expiry/qualifications) and #8293 (async dispatch-and-reconcile so sign-up doesn't block on the ~70s-5min Job). F5/Shape blocking is dynamic, so the result is validated-not-guaranteed; escalation on regression is a VNet-integrated env + NAT gateway. |
| 2026-06-01 | Surfaced the deep AHPRA detail fields (registration status / expiry / qualifications) through the frontend verification result on verifiedGmcData.ahpraDetail, where they were previously dropped at the API boundary. | #7866, #7438 | #7438 deep AHPRA retrieval — the backend parse/fetch/cache/Job pipeline was already complete (#7680, #7721) and returned the richer fields on AhpraValidationResult, but the frontend useGmcVerification hook never carried them, so the registration UI could not display the practitioner's live registration status. A pure extractAhpraDetailFields mapper applies the same safe defaults (unknown / null / []) the backend uses. Detail scrape stays gated behind AHPRA_DETAIL_SCRAPE_ENABLED (default OFF); richer-field markup is representative pending real lapsed/suspended page validation (Open Question 1, #7679). |
| 2026-05-27 | AHPRA detail scraper Job image + blob-result job invoker landed (code-complete, deploy-gated). A Dockerfile bakes chrome-headless-shell into a lean Node 22 scraper Job image; CD builds + pushes it to ACR as a second UAT-tagged image; the scraper CLI optionally writes its JSON result to a result blob; and the job invoker starts a Container Apps Job, polls it, reads + deletes the result blob and returns the parsed result. | #7724, #7721, #7438 | Lets the (Chromium-bearing) AHPRA detail scrape run out-of-process from a fixed egress IP without bloating the main API image. Everything verifiable without a live Azure deploy ships now; AHPRA_DETAIL_SCRAPE_ENABLED stays default OFF so runtime behaviour is unchanged until the Job is deployed and the flag flipped post-demo (Pulumi Job + NAT egress + live validation stay on #7678). |
| 2026-05-27 | Gated consultant/specialist status on registration-body verification so it can never be self-claimed. The consultant role is now granted only when the AHPRA/GMC lookup confirms specialist/consultant status. Added a server-side AHPRA consultant gate at sign-up (mirroring the existing GMC gate) that downgrades an unconfirmed consultant claim to non-consultant, and a guard in updateUserProfile that rejects elevating a non-consultant to consultant via a direct profile-update API call. The sign-up "Consultant Verification Required" warning now also covers AHPRA. | #7711, #7643 | A certificate (medical degree / indemnity) does not prove consultant status — that comes from the registration body. Previously only the GMC sign-up path enforced this; AU (AHPRA) sign-ups and any direct updateUserProfile call could set userType=consultant without verification, which also grants the ability to sign off other users' work. The guard is enforced server-side so it holds even against a direct API call (not UI-only). Indeterminate verification fails safe to non-consultant. |
| 2026-05-27 | Reordered the medical-professional sign-up form so the Registration Number is the first field (top-left), with the AHPRA/GMC regulatory-body selector immediately to its right on the same row, ahead of name and email. | #7707, #7640 | Surfaces the register lookup + autofill right at the start of sign-up (demo, 28 May). Field order/placement only — the verification adornment, validation, tab order, mobile stacking, and the useGmcVerification lookup trigger are all unchanged. |
| 2026-05-27 | Extended the pure parseAhpraDetail HTML parser to pull richer fields from the AHPRA practitioner detail page in addition to the Specialist section: registration status (active / lapsed / suspended / cancelled / unknown), registration expiry date (raw text), and qualifications. These now flow through the AhpraValidationResult contract (registrationStatus, registrationExpiryDate, qualifications) to the frontend. | #7703, #7680, #7438 | Decomposed from #7438. The detail page already exposes the practitioner's registration status, expiry, and qualifications alongside the specialist data, so the consultant-status guard (#7643) and the sign-up flow can act on a lapsed/suspended registration. Additive contract fields with safe defaults (unknown / null / []) so existing consumers are unaffected, and the parser reads them independently of the Specialist section so a lapsed non-specialist still surfaces status and expiry. |
| 2026-05-27 | Make the registration number the first field on the sign-up form (top-left, autofocused) with the AHPRA/GMC regulatory-body selector to its right. | #7640 | Matt/Rob (27 May) — "move the registration number to be the first field … a neat thing to show right at the start; the fast lookup + autofill then runs immediately." Reordered GeneralForm so the register lookup is the first action. |
| 2026-05-26 | Captured the GMC medical degree and awarding university at sign-up. Added optional Medical Degree + Awarding University free-text fields to the registration form, two new parsers (parseGmcDegree, parseGmcUniversity) that slice the degree and institution out of the GMC registeredQualification string, and a blank-guarded auto-populate effect that fills both on a confirmed GMC match (mirroring the existing graduate-year populate). New nullable columns users.medical_degree / users.awarding_university (migration 0116). Flipped the "GMC degree + university capture" AC to ✅. | #7535, #7441 | Issue #7441 split this out of the Medical Registration Verification spec as a tracked gap: the GMC registeredQualification field already returns the degree and awarding university alongside the graduate year, but only the year was parsed and the rest discarded because there were no form fields. Matt's onboarding brief lists Medical Degree as a sign-up field. The fields are kept optional and free-text (consistent with the register-derived, non-controlled nature of the qualification string); the richer multi-degree PPP Passport (#5611, OCR) flow remains the canonical long-term home and is noted as an open question for Matt. |
| 2026-05-26 | AHPRA Consultant detection moved from "blocked" to achievable via a lean chrome-headless-shell scraper in a separate isolated package (api/ahpra-scraper/); proven locally to return the Specialist HTML for MED0000958164 (Surgery / Orthopaedic surgery). | #7443, #7387 | Pure HTTP fetch is impossible (the register results POST is F5/Shape-gated and returns a challenge shell even with a TSPD cookie). A real but lean Chromium clears the wall; isolating it keeps the main API Chromium-free and lets the UAT egress IP be fixed independently via a scale-to-zero Container Apps Job (infra follow-up). |
| 2026-05-26 | Split "Medical Registration Verification" into its own feature spec (AHPRA + GMC live regulator lookup); added a collapsed field-by-field table of what each register provides vs what PPP uses. | The regulator-integration detail (green tick / red cross, name auto-populate, consultant + specialty derivation) had grown large enough inside onboarding.md to warrant its own spec; onboarding now links out to it. The new register-fields table documents the gap between retrievable and consumed fields (GMC consultant/specialty/graduate-year-derivable; AHPRA name + active status only). |