===========================================================
 INSTALL THE MEDILABEL CONNECTOR  (one time, ~1 minute)
 This is the reliable capture method - works on any computer,
 no settings to change, nothing leaves the PC.
===========================================================

WHAT IT IS
----------
A tiny browser extension that sends the text of the page you are
looking at to the MediLabel app on THIS computer (and nowhere
else - it talks only to 127.0.0.1, which is the computer itself).

The extension does no thinking. All the intelligence - finding
the patient, refusing to use the prescriber's name, checking the
date of birth - stays in the MediLabel app where it is covered
by automated tests.

Why this replaces the old method: screen-reading needed Chrome's
accessibility system switched on per machine, which is not
practical across many computers. The extension runs inside the
page itself, so it works everywhere immediately.


INSTALL - CHROME (also works the same in Edge)
----------------------------------------------
1. Open Chrome.

2. Type into the address bar and press Enter:

        chrome://extensions

   (In Edge:  edge://extensions )

3. Turn ON "Developer mode" - the toggle is in the top right
   corner. (In Edge it is on the left side.)

4. Click the "Load unpacked" button that appears.

5. In the folder picker, select the folder called

        extension

   inside your MediLabel Cloud folder (the same folder that has
   Run_Cloud.bat in it), and click "Select Folder".

6. You will see "MediLabel Connector" appear in the list.
   That is it. Done.


CHECK IT IS WORKING
-------------------
1. Start MediLabel Cloud (Run_Cloud.bat).
2. Open a patient in your clinical software.
3. Press Ctrl+F12 (or the app's "Test capture" button).

In Test capture you should see:

    EXTENSION (primary source - works on any computer)
    ------------------------------------------------------
    Receiver     : listening on 127.0.0.1:8471
    Snapshot     : FRESH (2s old)

You can also click the MediLabel Connector icon in the browser
toolbar: a green "OK" badge means it can reach the app; a red
"OFF" badge means the app is not running.


FOR CLINIC-WIDE ROLLOUT (many computers)
----------------------------------------
"Load unpacked" is fine for testing but must be repeated per
machine by hand. For a clinic, the practical options are:

  a. Publish the extension to the Chrome Web Store (can be
     "unlisted", so only people with the link can install it).
     Installation then becomes one click per computer, and
     updates are automatic. Cost: one-off USD $5 developer fee.

  b. If the clinic uses managed Windows/Google accounts, IT can
     push the extension to every machine automatically via
     policy (ExtensionInstallForcelist).

Both remove ALL per-user setup. (a) is recommended and is the
natural next step once you are happy with field testing.


PRIVACY / SECURITY NOTES
------------------------
- The extension sends page text ONLY to 127.0.0.1 (this PC).
  It cannot send anything to the internet: its permissions in
  manifest.json allow only http://127.0.0.1:8471.
- The app keeps the last snapshot in memory for 30 seconds and
  never writes it to disk.
- The extension is read-only. It cannot type, click, or change
  anything in your clinical software.
- Page addresses are stripped of query strings before sending.
- You can read every line of what it does: content.js is ~100
  lines with comments.


IF THE HOTKEY STILL FINDS NOTHING
---------------------------------
- Is MediLabel Cloud actually running? Click the extension icon:
  red "OFF" badge = app not running.
- Is the patient page the tab you are LOOKING at? Snapshots come
  from visible tabs.
- Press "Test capture" -> "Save to Desktop" and send the file to
  Vahid. It shows exactly what was and was not received.
