{"v":"<h2 id=\"user-content-thinking-it-through-emergency-priority-list-by-area\" dir=\"auto\">Thinking it through: emergency priority list by area<\/h2>\n<p dir=\"auto\"><strong>Short version.<\/strong> We can ship a useful first version <strong>without a map<\/strong>, using VESTA fields we already load and the county we already hold. After that comes geocoding with the local Nominatim, plus a map you can select from by county, polygon or radius. Last, the answers collected on the V2 Emergency\/Disaster form take over from VESTA&#39;s coarser fields. The priority should be <strong>tiers with visible reasons, not a single score<\/strong>, and the rules belong to the customer.<\/p>\n<hr\/>\n<h3 id=\"user-content-1-what-vesta-already-gives-us\" dir=\"auto\">1. What VESTA already gives us<\/h3>\n<p dir=\"auto\">&#34;Bed-ridden&#34; is not a VESTA field. Several fields come close, and all of them already land in <code>hh_member_record.detail_enc<\/code> on the report path (Members export \/ Master List):<\/p>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>What it tells us<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>cliclass<\/code><\/td>\n<td>HHSC client classification (Class I = priority)<\/td>\n<td>The closest thing VESTA has to an emergency tier. Our glossary text for Class III\/IV (<code>code\/glossary.inc.php<\/code>) is a guess and should be checked with the customer before anything ranks on it.<\/td>\n<\/tr>\n<tr>\n<td><code>priority<\/code> (export) \/ <code>Priority<\/code> bool (API roster)<\/td>\n<td>Priority-client flag<\/td>\n<td>The API roster returns <code>Priority<\/code>, but it isn&#39;t in <code>VESTA_MEMBER_CONTRACT<\/code>. Adding it as a tolerated key costs one line.<\/td>\n<\/tr>\n<tr>\n<td>ADL flags + <code>freq_*<\/code>: <code>transfer<\/code>, <code>ambulation<\/code>, <code>walking<\/code>, <code>toileting<\/code>, <code>feeding_eating<\/code><\/td>\n<td>Mobility proxy: transfer + ambulation + toileting all assigned is roughly &#34;cannot leave without hands-on help&#34;<\/td>\n<td>These are <em>tasks on the plan<\/em>, not a mobility assessment. Label them &#34;needs help with transfer \/ walking&#34;, never &#34;bed-bound&#34;.<\/td>\n<\/tr>\n<tr>\n<td><code>dnr<\/code><\/td>\n<td>DNR on file<\/td>\n<td>Responders need to know it. It is not a priority input.<\/td>\n<\/tr>\n<tr>\n<td><code>able_to_respond<\/code><\/td>\n<td>Language, or &#34;Unable to Respond&#34;<\/td>\n<td>&#34;Unable to respond&#34; should raise priority: the client can&#39;t answer a welfare call.<\/td>\n<\/tr>\n<tr>\n<td><code>county<\/code> (Master List; MemberPlus for API)<\/td>\n<td>Area selection <strong>without geocoding<\/strong><\/td>\n<td>Already a plaintext column on <code>hh_member_record<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>diagnosis<\/code> (Master List, free text)<\/td>\n<td>Words like oxygen, dialysis, ventilator, insulin<\/td>\n<td>Free text. Use it only as a &#34;check this&#34; hint, never as a rank input.<\/td>\n<\/tr>\n<tr>\n<td><code>hh_auth<\/code> weekly hours \/ program<\/td>\n<td>Heavier care plans<\/td>\n<td>Secondary signal.<\/td>\n<\/tr>\n<tr>\n<td><code>hh_calendar<\/code> \/ <code>sp-schedule<\/code><\/td>\n<td>Who has a visit in the next 24\u201372 h, and which attendant<\/td>\n<td>Covers &#34;whose care is interrupted&#34; and &#34;which attendants to call&#34;.<\/td>\n<\/tr>\n<tr>\n<td>Emergency contact, phone, address<\/td>\n<td>The call list itself<\/td>\n<td>Already stored (encrypted).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p dir=\"auto\"><span class=\"emoji\" aria-label=\"warning\" data-alias=\"warning\">\u26a0\ufe0f<\/span> <strong>API cutover gap.<\/strong> The live API roster carries <strong>no<\/strong> <code>cliclass<\/code>, <code>DNR<\/code>, ADL pairs, <code>ABLE_TO_RESPOND<\/code> or <code>County<\/code> (VestaAPIPlan \u00a73.1). The Master List enrichment brings back the ADL flags and county. <code>cliclass<\/code> and <code>DNR<\/code> only come back through <strong>MemberPlus<\/strong>: one call per member, throttling not yet known (Q7\/Q8). If this feature leans on <code>cliclass<\/code>, an agency moving to the API loses it. We have to decide this <strong>before cutover<\/strong>, not after.<\/p>\n<p dir=\"auto\"><strong>First step: measure.<\/strong> How many open clients per agency actually have <code>cliclass<\/code>, <code>priority<\/code>, the ADL flags and <code>county<\/code> filled in? I tried to count this from the local DB, but that means decrypting <code>detail_enc<\/code>, and I didn&#39;t do it without your OK. The count should be a read-only script that prints aggregate numbers only, run where we&#39;re allowed to read PHI.<\/p>\n<h3 id=\"user-content-2-what-the-forms-add-v2-and-what-they-could-add\" dir=\"auto\">2. What the forms add (V2), and what they could add<\/h3>\n<p dir=\"auto\">The <strong>Emergency \/ Disaster Preparedness Plan<\/strong> (<code>emergency-disaster-form<\/code>) is the actual triage instrument. It already asks:<\/p>\n<ul dir=\"auto\">\n<li><code>disaster_class<\/code> I\u2013IV: the state&#39;s emergency scale. Class I is &#34;unable to withstand any interruption in power supply\u2026&#34;. The answer is shared with the CIS <code>classification<\/code> as <code>shared.client.emergency_class<\/code>, and the CIS version adds &#34;Bed confined \/ Ambulatory&#34;.<\/li>\n<li><code>special_needs<\/code> (yes\/no), <code>has_transportation<\/code> + <code>transportation_by_whom<\/code>, <code>evacuating_with_count<\/code>, <code>has_pet<\/code>.<\/li>\n<li><code>registered_211_stear<\/code> \/ <code>stear_status<\/code>.<\/li>\n<li>DME + DME phone, physician, pharmacy, emergency contact.<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>Possible additions.<\/strong> These would be interview questions, not new paper fields; they need a ruling under &#34;one meaning is one question&#34;:<\/p>\n<ul dir=\"auto\">\n<li>Power-dependent equipment: oxygen concentrator, ventilator, powered wheelchair or lift, hospital bed, home dialysis.<\/li>\n<li>Medication that needs refrigeration (insulin).<\/li>\n<li>Dialysis center and schedule (an outage interrupts <em>their<\/em> care, not just ours).<\/li>\n<li>Mobility, stated directly: bed-bound \/ wheelchair \/ walker \/ independent.<\/li>\n<li>Lives alone (nothing in VESTA says this; <code>evacuating_with_count<\/code> comes close).<\/li>\n<li>Hearing, vision or cognitive impairment that affects receiving a warning.<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>Freshness matters.<\/strong> A form answer is only as current as the last signed visit, which can be up to a year old. Every value on the emergency list should show &#34;as of {date}, from {VESTA | visit}&#34;.<\/p>\n<h3 id=\"user-content-3-the-priority-rule\" dir=\"auto\">3. The priority rule<\/h3>\n<ul dir=\"auto\">\n<li><strong>Tiers, each with reasons shown as chips:<\/strong> &#34;Class I (visit 3\/2026)&#34;, &#34;Oxygen&#34;, &#34;No transportation&#34;, &#34;Unable to respond&#34;, &#34;Visit due tomorrow&#34;. Staff need to <em>see why<\/em> someone is near the top. An opaque score invites distrust and quiet overrides.<\/li>\n<li><strong>Order of precedence:<\/strong> form <code>disaster_class<\/code> from a signed visit within 12 months \u2192 VESTA <code>cliclass<\/code> \/ <code>priority<\/code> \u2192 ADL proxy. Then modifiers inside a tier: power-dependent, no transportation, unable to respond, lives alone, care scheduled during the event window.<\/li>\n<li><strong>Code layout:<\/strong> a pure rule file (<code>code\/hh_emergency_rules.inc.php<\/code>) with a standalone test, plus a block per rule in a short customer-facing sheet, the same way FlagRules.md works. The customer writes the rule; we transcribe it.<\/li>\n<li><strong>Per-event overrides:<\/strong> a coordinator can pin a client up or down for one event without changing the rule.<\/li>\n<\/ul>\n<h3 id=\"user-content-4-geocoding-shared-with-routeplan-md-which-is-still-plan-only\" dir=\"auto\">4. Geocoding (shared with RoutePlan.md, which is still plan-only)<\/h3>\n<p dir=\"auto\">RoutePlan \u00a75\u2013\u00a77 already designs this, and the emergency list should be its first consumer:<\/p>\n<ul dir=\"auto\">\n<li><code>hh_geocode<\/code> exists and <strong>nothing writes it<\/strong>. Alter it <strong>before<\/strong> it holds anything: <code>lat_enc<\/code>\/<code>lng_enc<\/code> (a home coordinate is an address, so it&#39;s PHI), <code>geohash5<\/code> as a prefilter index (not de-identification), <code>precision<\/code> (rooftop \/ interpolated \/ centroid \/ none), <code>address_hash<\/code> so we only re-geocode when the address changes, and <code>source<\/code>.<\/li>\n<li><code>scripts\/geocode-members.php<\/code> against the local Nominatim (<code>NOM_HOST<\/code>\/<code>NOM_PORT<\/code>). Run it after <code>vesta-api-sync.php<\/code> and after the report-path load.<\/li>\n<li><strong>Expect a long tail in the Valley.<\/strong> Rural routes, colonias, PO boxes and &#34;FM 1234 &amp; \u2026&#34; addresses will fall back to a ZIP or city centroid. We need:\n<ul dir=\"auto\">\n<li>a coverage report per agency and branch (rooftop \/ centroid \/ failed), shown with the list so &#34;47 clients in this county could not be placed&#34; is visible;<\/li>\n<li><strong>manual pin correction<\/strong>: staff drag the pin, it saves as <code>source = &#39;manual&#39;<\/code>, and it stays until the address changes;<\/li>\n<li>centroid-only clients <strong>included in county selection<\/strong> (by VESTA county) but marked as approximate in radius and polygon selections.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Tiles:<\/strong> <code>MAP_TILE_URL<\/code> falls back to <code>tile.openstreetmap.org<\/code> when unset. For this page the fallback should fail closed (no map rather than a public tile server), so a misconfigured box never shows public servers which areas staff are looking at during an event. The reassessment planner&#39;s map is still switched off (&#34;tile server still building&#34;). Finishing that build is a prerequisite here, same as for routing.<\/li>\n<\/ul>\n<h3 id=\"user-content-5-choosing-the-area\" dir=\"auto\">5. Choosing the area<\/h3>\n<table>\n<thead>\n<tr>\n<th>Mode<\/th>\n<th>How<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>County<\/strong><\/td>\n<td>Works on day one from the VESTA <code>county<\/code> text, no coordinates needed. Once geocoded, a point-in-polygon county check that <strong>disagrees<\/strong> with VESTA&#39;s county is worth flagging as a data-quality item.<\/td>\n<\/tr>\n<tr>\n<td><strong>Radius<\/strong><\/td>\n<td>Click a point or search an address (local Nominatim), set the miles. Haversine on decrypted coordinates, prefiltered by geohash cells.<\/td>\n<\/tr>\n<tr>\n<td><strong>Polygon<\/strong><\/td>\n<td>Draw on the map (Leaflet + leaflet-geoman or Leaflet.draw, loaded from an allowed CDN at an exact version, or vendored like PDF.js). Point-in-polygon in pure PHP, tested.<\/td>\n<\/tr>\n<tr>\n<td><strong>ZIP \/ branch \/ HHSC region<\/strong><\/td>\n<td>Cheap filters. <code>DADS_Indv_Region<\/code> is on the API roster too.<\/td>\n<\/tr>\n<tr>\n<td><strong>Imported shape<\/strong> (later)<\/td>\n<td>GeoJSON\/KML upload from county emergency management, or <strong>NWS warning polygons<\/strong> from <code>api.weather.gov<\/code> (a fetch of public alerts that sends nothing of ours). For example: &#34;everyone inside tonight&#39;s flood warning, Class I first&#34;.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p dir=\"auto\">Boundaries: Census TIGER\/Line counties and ZCTAs (public domain), loaded once into a <code>geo_area<\/code> table. They aren&#39;t PHI.<\/p>\n<p dir=\"auto\"><strong>Scale.<\/strong> Coordinates are encrypted, so MariaDB spatial indexes can&#39;t help. That&#39;s fine: one agency&#39;s open clients number in the thousands, sodium decryption at that volume takes milliseconds, and a geohash\/bounding-box prefilter cuts it down further. Don&#39;t trade encryption for <code>ST_Contains<\/code>.<\/p>\n<h3 id=\"user-content-6-the-output\" dir=\"auto\">6. The output<\/h3>\n<ul dir=\"auto\">\n<li><strong>Ranked list + map<\/strong> colored by tier, filtered by the selected area and scoped by <code>hh_member_scope()<\/code> (administrators see everyone, field supervisors their caseload).<\/li>\n<li><strong>Call sheet export (PDF\/CSV):<\/strong> name, phone, emergency contact, address, tier + reasons, DME, assigned attendant + phone, next scheduled visit. <strong>Print before landfall<\/strong>, because power and internet may be gone when it&#39;s needed. Every export goes through the PHI audit.<\/li>\n<li><strong>Event tracking (phase 3):<\/strong> <code>emergency_event<\/code> (name, area shape, opened\/closed) + <code>emergency_event_client<\/code> (status: not reached \/ safe \/ needs help \/ evacuated \/ hospitalized, who called and when, note). Turns the list into a welfare-check board several staff can work at once. It also produces the after-action record surveyors ask for.<\/li>\n<li><strong>Attendants are affected too.<\/strong> <code>hh_attendant<\/code> has addresses. &#34;Which attendants live inside the shape&#34; tells the coordinator whose shifts will drop.<\/li>\n<li><strong>Permission:<\/strong> our own right, e.g. <code>client.emergency\/View<\/code> (+ <code>\/Manage<\/code> for events), classified in <code>code\/perms.inc.php<\/code> and seeded only when the screen checks it. Staff-only by name.<\/li>\n<\/ul>\n<h3 id=\"user-content-7-suggested-order\" dir=\"auto\">7. Suggested order<\/h3>\n<ol dir=\"auto\">\n<li><strong>Phase 0, decide and measure:<\/strong> fill rates of <code>cliclass<\/code> \/ <code>priority<\/code> \/ ADL \/ <code>county<\/code> per agency; customer confirms the tier rule and what Class I\u2013IV mean in their practice; decide <code>cliclass<\/code>\/<code>DNR<\/code> for API agencies (MemberPlus vs keeping the Members export); add <code>Priority<\/code> to the API roster mapping.<\/li>\n<li><strong>Phase 1, no map:<\/strong> priority list filtered by county \/ branch \/ ZIP, with reasons and an &#34;as of&#34; source, plus the printable call sheet. Delivers most of the value and needs no new infrastructure.<\/li>\n<li><strong>Phase 2, geo:<\/strong> finish the tile server; alter <code>hh_geocode<\/code> + <code>geocode-members.php<\/code> + coverage report + manual pin; map with radius and polygon selection; TIGER counties.<\/li>\n<li><strong>Phase 3, forms + events:<\/strong> form <code>disaster_class<\/code> and the special-needs answers override VESTA in the rule; the extra interview questions above (pending a decision); event tracking board; attendants-in-area.<\/li>\n<li><strong>Phase 4:<\/strong> NWS alert polygons; STEAR registration reconciliation (&#34;Class I and not registered with STEAR&#34; is an action item before hurricane season).<\/li>\n<\/ol>\n<h3 id=\"user-content-questions-for-the-customer\" dir=\"auto\">Questions for the customer<\/h3>\n<ol dir=\"auto\">\n<li>When an emergency happens today, what do they do? Is there a spreadsheet or a list we should match?<\/li>\n<li>Does <code>cliclass<\/code> in VESTA mean what we think it means, and is it kept current?<\/li>\n<li>Do they want the extra special-needs questions (power-dependent equipment, lives alone, \u2026) added to the visit, even though the paper form doesn&#39;t print them?<\/li>\n<li>Who works the list during an event: office staff only, or field supervisors for their own caseloads?<\/li>\n<li>Should attendants be on the same map (whose shifts will drop)?<\/li>\n<\/ol>\n"}