Files
ecw-charge-validation/tests/fixtures/hcfa_claim.html
T
ManikandanandClaude Opus 5.5 ba15a574ab Initial import: eCW Charge Validation bot and results Portal
Snapshot of the working project as of 2026-10-23 (local 2d4d4fc), one
commit with no earlier history: the tracked files were de-identified
first (synthetic claim ids and patient data only; see Context.md
section 7). Credentials, run logs, screenshots, claim reports and client
workbooks are gitignored and not included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:38:17 +05:30

500 lines
28 KiB
HTML

<!doctype html>
<!--
A cut-down of the professional/HCFA "Claim" screen eCW served on 2026-09-17
for claim 9103000 (Commercial payer — United Health Care).
Reproduced on purpose, rather than saved from the live page: the real form
is patient data and must never be committed. This screen is NOT the UB
Claim form (no #UBClaimBtn17, no #BillType) — is_ub_claim_form() must
return False against this fixture, the same as it does against the real
claim.
The real DOM has none of the UB form's ids at all — no #UBClaimDiv,
#BillType, #icdCodesTable, #UBClaimTbl3/4/10/17, uBClaimPOS*/uBClaimMod1*.
Every id here carries the per-open timestamp 8888888888888 instead
(deliberately different from ub_claim.html's 9999999999999, so a selector
that had one baked in fails against the other).
What matters most, reproduced faithfully from the real DOM:
* there is only ONE tab covering ICD and CPT/HCPCS together
("ICD & CPT") — no separate CPT/HCPCS tab exists to click at all
* the CPT rows still carry the stable `CPTROW_0`/`CPTROW_1` ids, same as
the UB form
* but the per-field ids are entirely different (`billingClaimIpt4ngR0`,
not `uBClaimPOS0`) and are positional/sequential — NOT safe to match
by prefix the way the UB form's are. `data-fieldname` is what is
actually stable here (`ClaimCPTPOS`, `ClaimCPTMOD1`, ... and, the one
exception, `claimCPTCode` lower-case for the code cell) — that is
the real live-verified attribute this fixture exists to test against.
* the whole form sits inside angular-ui-bootstrap's own modal window —
`class="modal fade ng-isolate-scope claimModalBackdrop in"`,
`window-class="claimModalBackdrop"`, no id — which closes on Escape
WITHOUT running closeClaimScreen() (verified live, claims 9109000 and
9119000, 2026-09-29). The UB form's wrapper is `ubClaimModalBackdrop`
instead and the Dental screen has none.
* the payer is in TWO tables, neither timestamped: `#billingClaimTbl5`
under "ICD & CPT" (just P + Name, and its Name cell carries an edit
input as well as the name), and `#billingClaimTbl8` under
"Insurances & Payment" — the same columns as the UB form's
#UBClaimTbl3, plus Ins Id. Subscriber values here are made up.
-->
<html>
<body>
<div class="modal fade ng-isolate-scope claimModalBackdrop in" role="dialog" tabindex="-1"
modal-window window-class="claimModalBackdrop" ng-click="close($event)"
style="display:block; z-index:1050">
<div class="modal-dialog ui-draggable"><div class="modal-content">
<div id="div_Billingclaim8888888888888">
<div class="modal fade bluetheme billing-width right-panel-mode in" id="claimModal8888888888888" style="display:block">
<div class="modal-dialog visible" style="width: 1286px;">
<div class="modal-content" id="claimModalContent8888888888888">
<div class="modal-header">
<h4 class="modal-title">Claim
<span class="ml5 fs11 patient-identifier-span">VALENZUELA, Fabiola &nbsp; Oct 19, 1984 (41 yo F) &nbsp; Acc No. 550201</span>
</h4>
</div>
<div class="modal-body">
<table class="table"><tbody><tr>
<td><label>Claim No</label></td>
<td><span ng-bind="ClaimData.InvId" title="9103000">9103000</span></td>
</tr></tbody></table>
<ul id="billingClaimUl1" class="nav">
<li class="active"><a class="cursor" data-toggle="tab" data-target="#icd8888888888888">ICD &amp; CPT</a></li>
<li><a class="cursor" data-toggle="tab" data-target="#inp8888888888888">Insurances &amp; Payment</a></li>
<li><a class="cursor" data-toggle="tab" data-target="#addinf8888888888888">Additional Information</a></li>
</ul>
<div class="tab-content claim-tab">
<div class="tab-pane active" id="icd8888888888888">
<h4>ICD Codes (2)</h4>
<table id="icdCodesTable8888888888888" class="table table-bordered blue-fade-table">
<thead><tr><th>#</th><th></th><th>Code</th><th>Name</th><th></th></tr></thead>
<tbody ng-model="ICDCodes">
<tr ng-repeat="icd in ICDCodes">
<td class="text-center">1</td>
<td class="text-center"><input type="checkbox"></td>
<td title="Z30.430"><input id="billingClaimIpt2ngR0" data-fieldname="ClaimICDCode" type="text" value="Z30.430"></td>
<td title="Encounter for insertion of intrauterine contraceptive device">Encounter for insertion of intrauterine contraceptive device</td>
<td class="text-center"><button></button></td>
</tr>
<tr ng-repeat="icd in ICDCodes">
<td class="text-center">2</td>
<td class="text-center"><input type="checkbox"></td>
<td title="Z13.31"><input id="billingClaimIpt2ngR1" data-fieldname="ClaimICDCode" type="text" value="Z13.31"></td>
<td title="Negative depression screening">Negative depression screening</td>
<td class="text-center"><button></button></td>
</tr>
<tr id="3">
<td class="text-center">*</td>
<td></td>
<td><input type="text" id="txtnewIcd8888888888888" ng-model="newICD"></td>
<td></td><td></td>
</tr>
</tbody>
</table>
<h4>Insurances</h4>
<table id="billingClaimTbl5" class="table table-bordered blue-fade-table nomargin">
<thead><tr><th></th><th>Name</th></tr></thead>
<tbody>
<tr ng-repeat="insurance in Insurances track by $index">
<td><span ng-bind="insurance.sequanceNo">P</span></td>
<!-- eCW's own tag typo, <sapn>, reproduced as served -->
<td title="United Health Care"><input type="text" value="" style="display:none"><sapn ng-bind="insurance.InsName">United Health Care</sapn></td>
</tr>
</tbody>
</table>
<h4 class="blue-header">CPT/HCPCS (3)</h4>
<button id="claimAddCPTBtn8888888888888" type="button" class="btn btn-lgrey btn-xs" ng-click="addProcedureCode('');">Add</button>
<div class="allbrd cptTbl" id="cptTable8888888888888">
<table class="table table-bordered blue-fade-table" id="claimCPTCodesTable8888888888888">
<thead><tr>
<th class="text-center">#</th><th>&nbsp;</th><th>Code</th><th>POS</th><th>TOS</th>
<th>SDOS</th><th>EDOS</th><th>M1</th><th>M2</th><th>M3</th><th>M4</th>
<th>ICD1</th><th>ICD2</th><th>ICD3</th><th>ICD4</th><th>Units</th>
<th>Billed Fee</th><th>Pro Id</th>
</tr></thead>
<tbody>
<tr ng-repeat="cpt in CPTCodes" id="CPTROW_0">
<td class="text-center">1</td>
<td><input type="checkbox" ng-click="updateBillToIns($index)" ng-checked="cpt.BillToIns=='1'" checked></td>
<td title="Office Visit, Est Pt., Level 3"><input id="claimCPTCode0" data-fieldname="claimCPTCode" type="text" value="99213" readonly></td>
<td><input id="billingClaimIpt4ngR0" data-fieldname="ClaimCPTPOS" type="text" value="11"></td>
<td><input id="billingClaimIpt5ngR0" data-fieldname="ClaimCPTTOS" type="text" value="1"></td>
<td><input id="billingClaimIpt6ngR0" data-fieldname="ClaimCPTSDOS" type="text" value="07/07/2026"></td>
<td><input id="billingClaimIpt7ngR0" data-fieldname="ClaimCPTEDOS" type="text" value="07/07/2026"></td>
<td><input id="billingClaimIpt8ngR0" data-fieldname="ClaimCPTMOD1" type="text" value=""></td>
<td><input id="billingClaimIpt9ngR0" data-fieldname="ClaimCPTMOD2" type="text" value=""></td>
<td><input id="billingClaimIpt10ngR0" data-fieldname="ClaimCPTMOD3" type="text" value=""></td>
<td><input id="billingClaimIpt11ngR0" data-fieldname="ClaimCPTMOD4" type="text" value=""></td>
<td><input id="billingClaimIpt12ngR0" data-fieldname="ClaimCPTICD1" type="text" value="1"></td>
<td><input id="billingClaimIpt13ngR0" data-fieldname="ClaimCPTICD2" type="text" value="2"></td>
<td><input id="billingClaimIpt14ngR0" data-fieldname="ClaimCPTICD3" type="text" value="3"></td>
<td><input id="billingClaimIpt15ngR0" data-fieldname="ClaimCPTICD4" type="text" value=""></td>
<td><input id="billingClaimIpt16ngR0" data-fieldname="ClaimCPTUnits" type="text" value="1"></td>
<td title="210.00"><input id="billingClaimIpt17ngR0" data-fieldname="ClaimCPTBilledFee" type="text" value="210.00"></td>
<td><input type="text" value="" readonly></td>
</tr>
<tr ng-repeat="cpt in CPTCodes" id="CPTROW_1">
<td class="text-center">2</td>
<td><input type="checkbox" ng-click="updateBillToIns($index)" ng-checked="cpt.BillToIns=='1'" checked></td>
<td title="MIRENA/LNG-RELEASING IUC SYS 52MG 5 YR DUR"><input id="claimCPTCode1" data-fieldname="claimCPTCode" type="text" value="J7298" readonly></td>
<td><input id="billingClaimIpt4ngR1" data-fieldname="ClaimCPTPOS" type="text" value="11"></td>
<td><input id="billingClaimIpt5ngR1" data-fieldname="ClaimCPTTOS" type="text" value="1"></td>
<td><input id="billingClaimIpt6ngR1" data-fieldname="ClaimCPTSDOS" type="text" value="07/07/2026"></td>
<td><input id="billingClaimIpt7ngR1" data-fieldname="ClaimCPTEDOS" type="text" value="07/07/2026"></td>
<td><input id="billingClaimIpt8ngR1" data-fieldname="ClaimCPTMOD1" type="text" value=""></td>
<td><input id="billingClaimIpt9ngR1" data-fieldname="ClaimCPTMOD2" type="text" value=""></td>
<td><input id="billingClaimIpt10ngR1" data-fieldname="ClaimCPTMOD3" type="text" value=""></td>
<td><input id="billingClaimIpt11ngR1" data-fieldname="ClaimCPTMOD4" type="text" value=""></td>
<td><input id="billingClaimIpt12ngR1" data-fieldname="ClaimCPTICD1" type="text" value="1"></td>
<td><input id="billingClaimIpt13ngR1" data-fieldname="ClaimCPTICD2" type="text" value=""></td>
<td><input id="billingClaimIpt14ngR1" data-fieldname="ClaimCPTICD3" type="text" value=""></td>
<td><input id="billingClaimIpt15ngR1" data-fieldname="ClaimCPTICD4" type="text" value=""></td>
<td><input id="billingClaimIpt16ngR1" data-fieldname="ClaimCPTUnits" type="text" value="1"></td>
<td title="1200.00"><input id="billingClaimIpt17ngR1" data-fieldname="ClaimCPTBilledFee" type="text" value="1200.00"></td>
<td><input type="text" value="" readonly></td>
</tr>
<tr ng-repeat="cpt in CPTCodes" id="CPTROW_2">
<td class="text-center">3</td>
<!-- Unchecked on purpose: the real bug report - G8510 had
been excluded from billing and needs re-including once
its ICD pointer is corrected. -->
<td><input type="checkbox" ng-click="updateBillToIns($index)" ng-checked="cpt.BillToIns=='1'"></td>
<td title="NEG SCR D PT NOT ELIG F/U/PLN DOC"><input id="claimCPTCode2" data-fieldname="claimCPTCode" type="text" value="G8510" readonly></td>
<td><input id="billingClaimIpt4ngR2" data-fieldname="ClaimCPTPOS" type="text" value="11"></td>
<td><input id="billingClaimIpt5ngR2" data-fieldname="ClaimCPTTOS" type="text" value="1"></td>
<td><input id="billingClaimIpt6ngR2" data-fieldname="ClaimCPTSDOS" type="text" value="07/07/2026"></td>
<td><input id="billingClaimIpt7ngR2" data-fieldname="ClaimCPTEDOS" type="text" value="07/07/2026"></td>
<td><input id="billingClaimIpt8ngR2" data-fieldname="ClaimCPTMOD1" type="text" value=""></td>
<td><input id="billingClaimIpt9ngR2" data-fieldname="ClaimCPTMOD2" type="text" value=""></td>
<td><input id="billingClaimIpt10ngR2" data-fieldname="ClaimCPTMOD3" type="text" value=""></td>
<td><input id="billingClaimIpt11ngR2" data-fieldname="ClaimCPTMOD4" type="text" value=""></td>
<!-- Wrong on purpose: points at ICD1 (Z30.430), not the
depression pointer (2) - this is the "target code
needs retagging" case set_cpt_pos_modifier's sibling
must fix. -->
<td><input id="billingClaimIpt12ngR2" data-fieldname="ClaimCPTICD1" type="text" value="1"></td>
<td><input id="billingClaimIpt13ngR2" data-fieldname="ClaimCPTICD2" type="text" value=""></td>
<td><input id="billingClaimIpt14ngR2" data-fieldname="ClaimCPTICD3" type="text" value=""></td>
<td><input id="billingClaimIpt15ngR2" data-fieldname="ClaimCPTICD4" type="text" value=""></td>
<td><input id="billingClaimIpt16ngR2" data-fieldname="ClaimCPTUnits" type="text" value="1"></td>
<td title="65.00"><input id="billingClaimIpt17ngR2" data-fieldname="ClaimCPTBilledFee" type="text" value="65.00"></td>
<td><input type="text" value="" readonly></td>
</tr>
<!-- the blank entry row eCW leaves at the bottom: no CPTROW_ id -->
<tr>
<td class="text-center">*</td>
<td class="text-center"><input type="checkbox" checked></td>
<td><input type="text" ng-model="newCPT"></td>
<td><input type="text"></td><td><input type="text"></td>
<td><input type="text"></td><td><input type="text"></td>
<td><input type="text"></td><td><input type="text"></td>
<td><input type="text"></td><td><input type="text"></td>
<td><input type="text"></td><td><input type="text"></td>
<td><input type="text"></td><td><input type="text"></td>
<td><input type="text"></td><td><input type="text"></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="inp8888888888888">
<h4>Insurances</h4>
<table id="billingClaimTbl8" class="table table-bordered blue-fade-table nomargin">
<thead><tr>
<th></th><th>Bill To</th><th>Ins Id</th><th>Name</th><th>State</th>
<th>Subscriber No</th><th>Rel</th><th>Insured</th><th>Group No</th>
</tr></thead>
<tbody>
<tr ng-repeat="insurance in Insurances track by $index">
<td><span ng-bind="insurance.sequanceNo">P</span></td>
<td><input type="checkbox" ng-model="insurance.PrimIns" checked></td>
<td><span ng-bind="insurance.InsId">1660</span></td>
<td><span ng-bind="insurance.InsName">United Health Care</span></td>
<td><span ng-bind="insurance.InsState">CO</span></td>
<td><span ng-bind="insurance.SubscriberNo">X00000000</span></td>
<td><span ng-bind="insurance.SubscriberRel">1</span></td>
<td><span ng-bind="insurance.SubscriberName">Doe, Alex</span></td>
<td><input type="text" value="" style="display:none"><span ng-bind="insurance.GroupNo"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div><!-- /modal-body -->
<!--
eCW's Fee Schedule / CPT picker (opened by the "Add" button above),
reproduced from the real DOM captured on a live "Claim" screen (claim
9109000). Unlike everything else on the claim screen, ITS OWN controls
carry stable ids with no per-open timestamp at all — this is a shared,
reusable component, not something scoped to one claim's open session.
-->
<div class="modal fade bluetheme" id="claimFeeScheduleModal" style="display:none">
<div class="modal-dialog"><div class="modal-content">
<div class="modal-header">
<button id="claimFeeScheduleBtn1" type="button" class="close">&times;</button>
<h4 class="modal-title">Fee Schedule</h4>
</div>
<div class="modal-body">
<table class="table table-bordered claimFSCPTTbl" id="example1">
<thead><tr><th>Id</th><th>CPT</th><th>Name</th><th>Fee</th></tr></thead>
<tbody id="claimFSCPTTblBody"></tbody>
</table>
</div>
<div class="modal-footer">
<input id="claimFeeScheduleIpt6" type="text" placeholder="Search CPT">
<button id="claimFeeScheduleBtn8" type="button">Cancel</button>
<button id="claimFeeSchOkBtn" type="button">OK</button>
</div>
</div></div>
</div>
<div class="grey-bg modal-footer">
<button id="claimProgressNoteBtn8888888888888" type="button" class="btn btn-lgrey btn-sm btn-xs pull-left"
ng-click="viewProgNote()">Prog. Notes</button>
<button id="billingClaimBtn36" type="button" class="btn btn-lgrey btn-sm btn-xs pull-right"
ng-click="closeClaimScreen()">Cancel</button>
<button id="claimScreenOkBtn8888888888888" type="button" class="btn btn-blue btn-sm btn-xs pull-right"
ng-click="currentButtonAction='';saveAllData()">OK</button>
</div>
</div></div></div>
</div></div></div></div><!-- /div_Billingclaim, modal-content, modal-dialog, uib window -->
<script>
// Cancel and OK both hide the same backdrop the real closeClaimScreen() /
// saveAllData() do — added so tests can prove the modal actually closes on
// both paths, exactly the same reasoning ub_claim.html's script block uses.
//
// Both take the whole uib window out of the DOM, as eCW does: after a
// real close, not one #billingClaimTbl8 was left in the document.
// `closeClaimScreenRan` is what lets a test tell a real Cancel apart from
// the form vanishing under an Escape.
window.closeClaimScreenRan = false;
function removeClaimWindow() {
var w = document.querySelector('.claimModalBackdrop');
if (w) w.remove();
}
document.getElementById('billingClaimBtn36').addEventListener('click', function () {
window.closeClaimScreenRan = true;
removeClaimWindow();
});
document.getElementById('claimScreenOkBtn8888888888888').addEventListener('click', function () {
removeClaimWindow();
});
// uib's modal stack dismisses its topmost window on Escape — for this
// form that means gone, closeClaimScreen() never run (verified live,
// claim 9109000). The Fee Schedule picker is on top while it is showing,
// so Escape goes to it instead.
document.addEventListener('keydown', function (e) {
if (e.key !== 'Escape') return;
var picker = document.getElementById('claimFeeScheduleModal');
if (picker && picker.style.display === 'block') return;
removeClaimWindow();
});
// The real DOM (claim 9103000) carries ng-blur="updateCPTMod(...)" on every
// M1 input, same as the UB form — reproduced as a data attribute so a test
// can prove set_cpt_pos_modifier() blurs the field on THIS screen too.
document.querySelectorAll('[data-fieldname="ClaimCPTMOD1"]').forEach(function (el) {
el.addEventListener('blur', function () { el.dataset.blurred = '1'; });
});
// The Fee Schedule picker: a small seed catalog, filtered by the search
// box the same "Starts With" way the real picker defaults to. This
// fakes eCW's own lookup/filter logic, not the fact that add_cpt_row()
// clicks Add, types a search, selects the one match, and clicks OK —
// that sequence is what the test proves, against real, stable ids.
var feeScheduleCatalog = [
{id: '509263', code: 'G2025', name: 'Telehealth originating site facility fee', fee: '25.00'},
{id: '488892', code: 'G2026', name: 'Unrelated decoy code', fee: '0.00'},
];
var feeScheduleSelectedCode = null;
function renderFeeScheduleResults(filterText) {
var tbody = document.getElementById('claimFSCPTTblBody');
tbody.innerHTML = '';
var q = (filterText || '').toUpperCase();
feeScheduleCatalog
.filter(function (row) { return row.code.toUpperCase().indexOf(q) === 0; })
.forEach(function (row) {
var tr = document.createElement('tr');
tr.innerHTML =
'<td>' + row.id + '</td>'
+ '<td><span>' + row.code + '</span></td>'
+ '<td>' + row.name + '</td>'
+ '<td>' + row.fee + '</td>';
tr.addEventListener('click', function () { feeScheduleSelectedCode = row.code; });
tbody.appendChild(tr);
});
}
document.getElementById('claimAddCPTBtn8888888888888').addEventListener('click', function () {
feeScheduleSelectedCode = null;
document.getElementById('claimFeeScheduleIpt6').value = '';
renderFeeScheduleResults('');
document.getElementById('claimFeeScheduleModal').style.display = 'block';
});
document.getElementById('claimFeeScheduleIpt6').addEventListener('input', function () {
renderFeeScheduleResults(this.value);
});
document.getElementById('claimFeeScheduleBtn8').addEventListener('click', function () {
document.getElementById('claimFeeScheduleModal').style.display = 'none';
});
document.getElementById('claimFeeSchOkBtn').addEventListener('click', function () {
document.getElementById('claimFeeScheduleModal').style.display = 'none';
if (!feeScheduleSelectedCode) return;
var tbody = document.querySelector('#claimCPTCodesTable8888888888888 tbody');
var addRowTr = tbody.querySelector('tr:last-child');
var n = document.querySelectorAll('#claimCPTCodesTable8888888888888 [id^="CPTROW_"]').length;
var newRow = document.createElement('tr');
newRow.id = 'CPTROW_' + n;
newRow.innerHTML =
'<td class="text-center">' + (n + 1) + '</td>'
+ '<td><input type="checkbox" ng-click="updateBillToIns(' + n + ')" checked></td>'
+ '<td><input data-fieldname="claimCPTCode" type="text" value="' + feeScheduleSelectedCode + '" readonly></td>'
+ '<td><input data-fieldname="ClaimCPTPOS" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTTOS" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTSDOS" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTEDOS" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTMOD1" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTMOD2" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTMOD3" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTMOD4" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTICD1" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTICD2" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTICD3" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTICD4" type="text" value=""></td>'
+ '<td><input data-fieldname="ClaimCPTUnits" type="text" value="1"></td>'
+ '<td><input data-fieldname="ClaimCPTBilledFee" type="text" value="25.00"></td>'
+ '<td><input type="text" value="" readonly></td>';
tbody.insertBefore(newRow, addRowTr);
newRow.querySelector('[data-fieldname="ClaimCPTMOD1"]')
.addEventListener('blur', function () { this.dataset.blurred = '1'; });
});
document.getElementById('claimProgressNoteBtn8888888888888').addEventListener('click', function () {
var m = document.createElement('div');
m.className = 'modal in';
m.id = 'progressNoteViewerDiv8888888888888';
m.style.display = 'block';
m.innerHTML =
'<div class="modal-dialog"><div class="modal-content">'
+ '<div class="modal-header"><h4 class="modal-title">Progress Note</h4></div>'
+ '<div class="modal-body">'
+ '<iframe id="progressNoteFrame" src="progress_note.html" '
+ 'style="width:900px;height:400px;border:0"></iframe>'
+ '</div>'
+ '<div class="modal-footer">'
+ '<button type="button" class="btn btn-blue btn-sm btn-xs pull-right" '
+ 'ng-click="closeProgressNoteViwer()">Close</button>'
+ '</div>'
+ '</div></div>';
document.body.appendChild(m);
m.querySelector('[ng-click="closeProgressNoteViwer()"]')
.addEventListener('click', function () { m.style.display = 'none'; });
});
</script>
<script>
// Angular's load, simulated (review item D7) — opt-in through the query
// string, so every test that loads this fixture plainly still sees a form
// that is already filled.
// ?load=delayed claim number and codes blank, filled 800 ms later
// ?load=never blank, and never filled (the timeout path)
// ?load=wrong filled 800 ms later with a DIFFERENT claim number
// ?load=noclaimno claim-number element removed; codes filled 800 ms later
// ?load=staggered claim number and row 1 at 800 ms, row 2 at 1100 ms,
// row 3 at 1400 ms — Angular filling one digest at a
// time, so the first non-zero count is not the last
// Plus, combinable with any ?load= mode:
// &stale=other a HIDDEN copy of an earlier claim's form (claim
// 5000002, one filled CPT row) sits in the DOM ahead of
// this one, and this form's claim number stays hidden
// until it is filled — eCW leaves closed forms behind
// &stale=same the same hidden leftover, but showing THIS claim's
// number, so only its filled row could fool a reader
// Codes are blanked as the .value PROPERTY only, which is where Angular
// keeps them: the value="" attribute still holds the template's code, so a
// reader that took the attribute would call the form loaded at once.
//
// And the Prog. Notes button's ng-disabled="!FormData.EnableProgressNote",
// which Angular flips only once the claim has loaded:
// ?pn=late disabled, enabled 1 s later
// ?pn=off disabled for good
(function () {
var m = /[?&]pn=(\w+)/.exec(location.search);
if (!m) return;
var b = document.querySelector('[ng-click="viewProgNote()"]');
b.disabled = true;
if (m[1] === 'late') setTimeout(function () { b.disabled = false; }, 1000);
})();
(function () {
var m = /[?&]load=(\w+)/.exec(location.search);
if (!m) return;
var mode = m[1];
var no = document.querySelector('[ng-bind="ClaimData.InvId"]');
var codes = Array.prototype.slice.call(
document.querySelectorAll('tr[id^="CPTROW_"] [data-fieldname="claimCPTCode"]'));
var want = codes.map(function (e) { return e.value; });
var claimNo = no ? no.textContent : '';
var s = /[?&]stale=(\w+)/.exec(location.search);
if (s) {
// Built before this form's values are blanked, and first in <body>.
var old = document.createElement('div');
old.className = 'modal fade ng-isolate-scope claimModalBackdrop';
old.style.display = 'none';
old.innerHTML =
'<span ng-bind="ClaimData.InvId">'
+ (s[1] === 'same' ? claimNo : '5000002') + '</span>'
+ '<table><tbody><tr id="CPTROW_0"><td>'
+ '<input data-fieldname="claimCPTCode" type="text" value="99999">'
+ '</td></tr></tbody></table>'
+ '<button type="button" ng-click="closeClaimScreen()">Cancel</button>';
document.body.insertBefore(old, document.body.firstChild);
if (no) no.style.display = 'none';
}
if (no) no.textContent = '';
if (mode === 'noclaimno' && no) { no.remove(); no = null; }
codes.forEach(function (e) { e.value = ''; });
if (mode === 'never') return;
if (mode === 'staggered') {
codes.forEach(function (e, i) {
setTimeout(function () {
if (i === 0 && no) { no.textContent = claimNo; no.style.display = ''; }
e.value = want[i];
}, 800 + 300 * i);
});
return;
}
setTimeout(function () {
if (no) {
no.textContent = (mode === 'wrong' ? '5000001' : claimNo);
no.style.display = '';
}
codes.forEach(function (e, i) { e.value = want[i]; });
}, 800);
})();
</script>
</body>
</html>