Every role the system recognises, and the exact path each one walks from first contact to a completed referral — screen by screen, endpoint by endpoint, with the email fired at each step and the point where the path currently breaks.
Roles are Django groups. There is no separate "specialist" role — direction is a property of the referral row, not of the person. Any verified practitioner can both send and receive.
| Role | How the system identifies them | Can do | Cannot do |
|---|---|---|---|
| Visitor unauthenticated |
No token in localStorage |
Landing and policy pages, request a demo, register, check email availability, list insurers, job roles and clinics, geocode a postcode | Everything else — every other view requires a verified practitioner or delegate |
| Practitioner Clinician group |
Clinician group and UserProfile.isVerified |
The whole product: search, refer, accept, reject, book, mark DNA, patients, analytics, practice management, delegates, settings | Admin endpoints |
| Delegate acting for a practitioner |
Delegate group plus a verified DelegateUserLink to exactly one practitioner |
Nearly everything the practitioner can, operating directly on their data — the backend substitutes the practitioner's profile for every query | Manage other delegates, edit or delete a referral, all admin routes |
| Patient | A Patient row created by a practitioner. No account, no login, no FK to a user. |
Receive transactional email only, and only if primaryEmail is set |
Log in. There is no patient portal and no patient-facing screen anywhere |
| MedR staff Staff group |
Staff group; created by a management command or the admin-user endpoint |
Five staff API endpoints, plus the full Django admin at /medr/ |
In practice, use the in-app Admin screen for anything real — it is not wired to the API |
| Operations | Operations group; authenticates by an X-Custom-Token header rather than Knox |
Nothing today | The permission class exists but is applied to no view. The machinery is built and unattached |
DelegateUserLink carries five permission booleans — view, create and manage referrals, manage insurance, manage practices. They are stored, surfaced in the API, and toggled by switches in the UI, but no view or service ever reads them. On creation the backend hard-codes three to true and ignores the other two, discarding whatever the form submitted. A delegate's real permissions are therefore whatever the endpoint-level permission classes allow, identically for every delegate.
set_verified_clinician() has exactly one caller — inside email verification — and zero test callers. It sets isVerified = True and moves the user into the Clinician group in one step. There is no review queue, no approval endpoint, no second actor. The registration number is captured as free text and never validated against any register.
The API nonetheless returns "Email successfully verified, please wait for the MedR team to review your account." The account is already live and fully privileged when that message is shown.
Because the only route to isVerified = True runs through the emailed link, and no email currently leaves the building, no new practitioner can onboard on a production-mode deployment until the email pipeline works. The same applies to password reset and to every delegate invitation. This is why the email work is not a notifications nicety — it gates registration.
The referral form renders a file input labelled "Upload PDF or Word document (Max 10MB)" and stores the file in component state. The create payload never includes it, the serializer has no file field, and there is no attachment model on Referral at all. The landing page advertises "Attach referral letter with one click." This is the largest single gap between what the product promises and what it does.
Note: a delegate can accept, reject, book and mark DNA on the practitioner's behalf — those four transitions inherit the default permission class. Only edit and delete of a referral are practitioner-only. Worth confirming that is the intended clinical governance model.
There is no patient account, no login, no portal and no patient-facing screen. A patient exists as a row created by a practitioner, carrying name, date of birth, sex, contact details, address, insurance policy or self-payer flag, and a consent checkbox with a timestamp.
Their entire experience of MedR is up to five emails over a referral's life — created, accepted, rejected, booked, did-not-attend — and only if primaryEmail was filled in. Those five templates are correctly addressed, but all five are placeholders, none carries a link back into the app, and all five arrive under the subject line "You have been referred by …" regardless of what actually happened.
The backend serves seven staff endpoints — list user profiles, list practitioner profiles, list and verify insurers, create an admin user, list patients, list referrals. The frontend Admin page calls none of them. It renders three hardcoded arrays and its add, edit and delete controls persist nothing. An administrator using that screen is looking at invented users, clinics and practices.
The routing decision reads the admin flag from a value captured before login wrote it, so the very first login sends an administrator to the dashboard instead of Find Clinician. It corrects itself on any refresh. Cosmetic, but it is the sort of thing that gets reported as "the admin login is broken".
Asked explicitly, so stated exactly. Navigation is a single React state value, not a URL — so "where you land" is decided entirely by one initialiser plus one switch statement.
| Entry point | First screen | What is on top of it |
|---|---|---|
| Fresh visit, no session | Landing page | No sidebar, no header chrome. Cookie consent banner. |
| Verification link from the sign-up email | Landing page | Verification modal, auto-runs, then offers "Continue to Login" |
| Delegate invitation link | Landing page | Complete-profile modal — confirm name, set password |
| Password reset link | Landing page | Forgot-password modal in set-new-password mode |
| Login — practitioner, profile complete | Dashboard | — |
| Login — practitioner, no clinic yet | Practice Management | Blocking modal plus an amber banner; every other nav item disabled |
| Login — delegate | Dashboard | Falls back to Practice Management only if the linked practitioner has no clinic |
| Login — MedR staff | Find Clinician | Intended; misroutes to Dashboard on the very first login |
| Refresh, anywhere, while signed in | Dashboard (or Find Clinician for staff) | Whatever screen you were on is lost, along with filters, tabs, drafts and open modals |
| Any 401 from the API | Landing page | Token dropped, hard redirect to / |
The app has no routing library. Navigation is one useState value switched over in a single component, and the address bar reads / on every screen. Nothing ever pushes a history entry, and a mount-time effect actively strips query parameters back out of the URL.
Consequences: the browser back button leaves the application entirely; a refresh returns you to the dashboard; nothing — no referral, no patient, no practitioner profile — can be bookmarked or shared.
The part that matters for delivery: the app recognises exactly four ?type= values — login, verify clinician email, verify delegate email, password reset. It does not recognise type=referral, which is precisely what the referral emails are built to send. So even once templates exist and sending is switched on, "view this referral" links will land the user on a bare dashboard. Deep-linking has to be built before referral emails are worth sending.
Signed in on demo.medr.co.uk and tested each behaviour directly. The URL stays / on every screen. Browser back leaves the application entirely to a blank page; forward returns but lands on the dashboard. Reload keeps the session but bounces to the dashboard rather than staying put. A hand-typed deep path keeps the path in the address bar and renders the dashboard anyway. So the ceiling for any emailed link is "the dashboard" — never the referral it is about.
Two corrections to the demo credentials in our brief, worth passing back to Anshul: the documented password is wrong, and one of the two documented logins does not authenticate at all. The login endpoint also takes the email in a field named username, not email. Specific credentials deliberately omitted from this hosted copy — they are in the local version.
Paths that look complete in the interface and do nothing. Separated from the items the client has already declared out of scope.
| Journey step | What happens | Impact |
|---|---|---|
| Clinical letter upload | File is selected and held in state; the create payload omits it. No attachment model exists. | critical advertised feature |
| Edit a referral | The screen relabels itself "Edit Referral" but submits to the create endpoint, producing a duplicate. The update endpoint has no caller in the frontend. | critical data integrity |
| Admin screen | Hardcoded sample rows; controls persist nothing. | critical |
| Register from a policy page | The success callback is empty, so a completed registration leaves the user on the page, not signed in and not redirected. | high |
| Successful referral denial | Shows a red error toast on the success path. | medium looks like a failure |
| Delegate opens Practice Management | The Staff & Delegates tab renders for them, then its data call returns 403. | medium |
| Delegate permission switches | Persist and show a success toast; nothing reads them. | medium false assurance |
| "Wait for the MedR team to review your account" | No review exists. The account is already live. | medium misleading |
| Analytics export | The endpoint returns an empty object. Mitigated — the button is commented out. | low |
| Request a demo | Fires a Slack message and persists nothing. A missed enquiry is unrecoverable. | medium commercial |
| Find peers in your own speciality | The speciality filter excludes every role the searcher already holds — a cardiologist cannot filter for cardiologists. | low confirm intent |
| Insurance toggle | Applies to every one of the practitioner's clinics at once; the read shows only the first. Per-clinic differences cannot be expressed. | low confirm intent |
Sends an email, records no invitation. Completing the flow belongs to a later build.
A deliberate placeholder behind a blur overlay. The backend returns fixed values; there is no subscription model.
Social login and magic links are explicitly excluded from the launch scope.