Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
09fd782
w/o prog
stephenwaite May 9, 2026
b159353
w/o prog
stephenwaite May 9, 2026
b9db864
debug
stephenwaite May 9, 2026
f38236b
payments are stored negative so add them
stephenwaite May 9, 2026
3117a44
add create a negative pd-amount
stephenwaite May 9, 2026
db38ec1
wo002 to adj to zero by dos range
stephenwaite May 10, 2026
9ee775e
wo001 changes for credit bals
stephenwaite May 10, 2026
6e91c1a
indent
stephenwaite May 10, 2026
e04afcb
use date of charge as payment date
stephenwaite May 10, 2026
6162727
wo004 walk charcur for garfile archive
stephenwaite May 10, 2026
d20a501
indent
stephenwaite May 10, 2026
8a06eb8
per charge filter for archival
stephenwaite May 10, 2026
9498495
write to hisfile
stephenwaite May 11, 2026
47a2609
use copybook
stephenwaite May 11, 2026
6a646c8
use copybook
stephenwaite May 11, 2026
e860c5e
missing pays
stephenwaite May 11, 2026
bf284af
truncate for icd9
stephenwaite May 11, 2026
7d39082
perform thru
stephenwaite May 11, 2026
0822064
2ndary 026
stephenwaite May 11, 2026
50d0c11
Adj nm1 size
stephenwaite May 11, 2026
63b666c
MC ins type
stephenwaite May 11, 2026
6e6b03c
MB for prim payer ins type
stephenwaite May 11, 2026
3a569c6
fix memory leak
stephenwaite May 12, 2026
acf7bb5
0M4
stephenwaite May 12, 2026
8546587
prior total for paid flag
stephenwaite May 13, 2026
78b49d0
capture auth
stephenwaite May 13, 2026
b7f1ef2
remove ambigous ref01
stephenwaite May 13, 2026
242bf35
hra and 02 fixes
stephenwaite May 13, 2026
11091df
bump to sonnet 4-6
stephenwaite May 15, 2026
448d5be
update sonnet 4-6
stephenwaite May 15, 2026
1a7039f
debug cache
stephenwaite May 15, 2026
164469c
remove debug
stephenwaite May 15, 2026
386502c
over paid out in ef-auth
stephenwaite May 16, 2026
0cd04be
fix logic g-delete
stephenwaite May 20, 2026
4bf2d32
fix no valid record position
stephenwaite May 20, 2026
6ee2308
GARFILE I-O
stephenwaite May 20, 2026
9aff35d
CHARCUR I-O
stephenwaite May 20, 2026
a4ac580
Fix gdelete logic
stephenwaite May 20, 2026
3a3ec12
debug
stephenwaite May 20, 2026
05833e7
remove debug
stephenwaite May 20, 2026
f63dfac
chcrr uppercase
stephenwaite May 21, 2026
ad9b0e0
unique isa gs for aggregated remits
stephenwaite May 29, 2026
4137698
fix mtime warning
stephenwaite May 29, 2026
f1c4058
fix mtime warning
stephenwaite May 29, 2026
6c8e581
debug
stephenwaite May 29, 2026
0b3fd67
claudes fix
stephenwaite May 29, 2026
a9cb9fb
python update
stephenwaite Jun 1, 2026
7fa5b5d
+x for python scripts
stephenwaite Jun 1, 2026
3c147c2
prompt for specificity
stephenwaite Jun 3, 2026
5e5bd6f
prompt for specificity
stephenwaite Jun 3, 2026
4584eb9
prompt meniscus tear table
stephenwaite Jun 3, 2026
59e0522
symptom codes
stephenwaite Jun 3, 2026
c948a4c
suppress read when ask claude
stephenwaite Jun 3, 2026
85157d3
prompt for specificity
stephenwaite Jun 3, 2026
9f56cfa
bump max_tokens
stephenwaite Jun 3, 2026
1973cf3
check it's a valid code
stephenwaite Jun 3, 2026
efd5ad3
debug valid icd10
stephenwaite Jun 3, 2026
1e947b6
only load icd10s for claude
stephenwaite Jun 3, 2026
4586e80
debug valid icd10
stephenwaite Jun 3, 2026
d26c7a7
debug valid icd10
stephenwaite Jun 3, 2026
ff29b29
move g1 auth capture to svc loop
stephenwaite Jun 5, 2026
7d574c7
REVERT move g1 auth capture to svc loop
stephenwaite Jun 5, 2026
833cf58
debug
stephenwaite Jun 5, 2026
4d39ed6
debug
stephenwaite Jun 5, 2026
3250e02
debug
stephenwaite Jun 5, 2026
c1f40e5
debug
stephenwaite Jun 5, 2026
03dde46
SAVE-AUTH
stephenwaite Jun 5, 2026
fa19826
remove accept omitted
stephenwaite Jun 5, 2026
bc8c020
debug
stephenwaite Jun 5, 2026
daf19e1
debug
stephenwaite Jun 5, 2026
5171b7c
use clp-1 for garno invalid read
stephenwaite Jun 6, 2026
ddcbf0d
nsa flag and co-131
stephenwaite Jun 6, 2026
edb7b84
medfile from csv
stephenwaite Jun 6, 2026
6943c24
197 report
stephenwaite Jun 6, 2026
0f54a21
separate col for adj and correct due col
stephenwaite Jun 6, 2026
67ff015
use cash paid instead of total pay for comparison with med allow
stephenwaite Jun 6, 2026
e8bc994
skip those with 03 payments
stephenwaite Jun 8, 2026
6b3991e
add dos to report
stephenwaite Jun 8, 2026
82fb275
hardcode 160 allen st
stephenwaite Jun 13, 2026
b21f893
hardcode 160 allen st
stephenwaite Jun 16, 2026
6680ddf
fix garout01 rec length
stephenwaite Jun 17, 2026
eb77691
remove accept omitted
stephenwaite Jun 17, 2026
aa5aa97
delete scripts
stephenwaite Jun 17, 2026
5058ee1
update names
stephenwaite Jun 17, 2026
5c02ffb
delgar
stephenwaite Jun 17, 2026
233d271
rri2d fix for cigna med adv and docr in ins pending
stephenwaite Jun 23, 2026
b2a0679
docr in ins pending to report prog
stephenwaite Jun 23, 2026
087cef6
debug g-delete
stephenwaite Jun 25, 2026
e351ee9
debug FG
stephenwaite Jun 25, 2026
aa42741
debug FG
stephenwaite Jun 25, 2026
638dee3
debug FG
stephenwaite Jun 25, 2026
a0bda93
debug FG
stephenwaite Jun 25, 2026
93cfcb9
find FG issues
stephenwaite Jun 25, 2026
186bc22
remove debug
stephenwaite Jun 25, 2026
023e9a8
write charnew after autocode 75571
stephenwaite Jun 26, 2026
30e7274
debug overpay garno
stephenwaite Jun 29, 2026
186d4f1
initialize err01
stephenwaite Jun 29, 2026
dfefb07
debug p1-lost-svc
stephenwaite Jun 29, 2026
c579e7a
debug p1-lost-svc
stephenwaite Jun 29, 2026
dcd6386
debug p1-lost-svc
stephenwaite Jun 29, 2026
3c417c2
fix else if statement
stephenwaite Jun 29, 2026
852d627
remove debug
stephenwaite Jun 29, 2026
622c3a8
delauth
stephenwaite Jun 29, 2026
2ed1e3a
delkin
stephenwaite Jun 29, 2026
d57c4aa
delmplr
stephenwaite Jun 29, 2026
de1cee3
co 193 for aetna denied claim
stephenwaite Jun 30, 2026
25b79ac
del posted charges
stephenwaite Jun 30, 2026
9c5528c
add cc pc
stephenwaite Jun 30, 2026
0d400a3
sonnet 5 and void 46 docp
stephenwaite Jul 1, 2026
3942ddb
add logic for clm-docp
stephenwaite Jul 1, 2026
8e4c31f
more logic for clm-docp
stephenwaite Jul 1, 2026
0933826
adjust 197 by charcur key
stephenwaite Jul 6, 2026
87bd4af
prefer non benign reads
stephenwaite Jul 6, 2026
28a03a0
adjust 197 by charcur key, add payfile
stephenwaite Jul 6, 2026
b00cc30
adjust 197 payfile isam
stephenwaite Jul 6, 2026
eb7ba3f
14 DENIAL
stephenwaite Jul 6, 2026
db1b604
humana custom handling
stephenwaite Jul 6, 2026
3898416
humana custom handling
stephenwaite Jul 6, 2026
4945422
doc-taxo and remove redundant facility
stephenwaite Jul 6, 2026
3a1b1d3
debug clm docp
stephenwaite Jul 6, 2026
0e0c4d9
remove debug clm docp and svc facility
stephenwaite Jul 6, 2026
ba9d3cd
wo per ins
stephenwaite Jul 7, 2026
d2fbac5
remove 197 check
stephenwaite Jul 7, 2026
ec889dc
dbg
stephenwaite Jul 8, 2026
cf7b8cc
dbg
stephenwaite Jul 8, 2026
987d976
dbg
stephenwaite Jul 8, 2026
d5d7c48
find cdm pairs
stephenwaite Jul 8, 2026
3beebc2
fix report
stephenwaite Jul 8, 2026
5a32664
fix cc-patid
stephenwaite Jul 8, 2026
5008baf
cc-visitno
stephenwaite Jul 8, 2026
b80dbe5
tsv
stephenwaite Jul 9, 2026
c1d217c
no cr bals with 197
stephenwaite Jul 10, 2026
0a79eed
process iedi reports
stephenwaite Jul 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 35 additions & 23 deletions bcbsvt/check_x12s.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
<?php

use phpseclib3\Net\SFTP;

require_once(dirname(__FILE__) . '/../vendor/autoload.php');


$cms_user = getenv('MOVEIT_USERNAME');
$cms_pass = getenv('MOVEIT_PASSWORD');

$sftp = new SFTP('moveit.bcbsvt.com');
$sftp->setTimeout(300); // 5 minutes instead of default
$sftp->setKeepAlive(30); // Send keep-alive every 30 seconds
$sftp->setTimeout(300); // 5 minutes instead of default
$sftp->setKeepAlive(30); // send keep-alive every 30 seconds

if (!$sftp->login($cms_user, $cms_pass)) {
echo "login failed" . "\n";
echo "login failed\n";
exit;
};
}

$path = '/Home/cms';

$files = $sftp->rawlist($path, true);
if (!is_array($files)) {
$raw = $sftp->rawlist($path);
if (!is_array($raw)) {
throw new RuntimeException("rawlist failed: " . $sftp->getLastError());
}
usort($files, fn($a, $b) => $a->mtime <=> $b->mtime);

if (!empty($files)) {
foreach ($files as $file) {
if (!empty($file)) {
$dt_utc = new DateTimeImmutable('@' . $file->mtime); // unix timestamp directly
$date = $dt_utc->setTimezone(new DateTimeZone('America/New_York'));
echo "file: " . $file->filename . " uploaded to 02 on " .
$date->format('Y-m-d h:i:s a') . "\n";
}
}
} else {
// there's a test directory

// read a field whether the entry is an object or an associative array
$prop = function ($entry, $key) {
if (is_object($entry)) return $entry->$key ?? null;
if (is_array($entry)) return $entry[$key] ?? null;
return null;
};

$files = [];
foreach ($raw as $name => $entry) {
if ($name === '.' || $name === '..') continue;
if ($prop($entry, 'type') === NET_SFTP_TYPE_DIRECTORY) continue; // 2
$mtime = $prop($entry, 'mtime');
if (!$mtime) continue;
$files[] = [
'filename' => $prop($entry, 'filename') ?? $name,
'mtime' => $mtime,
];
}

usort($files, fn($a, $b) => $a['mtime'] <=> $b['mtime']);

foreach ($files as $file) {
$dt_utc = new DateTimeImmutable('@' . $file['mtime']);
$date = $dt_utc->setTimezone(new DateTimeZone('America/New_York'));
echo "file: {$file['filename']} uploaded to 02 on "
. $date->format('Y-m-d h:i:s a') . "\n";
}
5 changes: 0 additions & 5 deletions copylib/charcur.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
02 CC-SERVICE PIC X.
02 CC-DIAG PIC X(7).
02 CC-PROC PIC X(7).
* 40
02 CC-MOD2 PIC XX.
02 CC-MOD3 PIC XX.
02 CC-MOD4 PIC XX.
02 CC-AMOUNT PIC S9(4)V99.
02 CC-DOCR PIC X(3).
02 CC-DOCP PIC X(2).
02 CC-PAYCODE PIC 999.
*60
02 CC-STUD PIC X.
02 CC-WORK PIC XX.
02 CC-DAT1 PIC X(8).
Expand All @@ -27,12 +25,10 @@
02 CC-PAPER PIC X.
02 CC-PLACE PIC X.
02 CC-EPSDT PIC X.
* 79
02 CC-DATE-T PIC X(8).
02 CC-DATE-A PIC X(8).
02 CC-DATE-P PIC X(8).
02 CC-REC-STAT PIC X.
* 104
02 CC-DX2 PIC X(7).
02 CC-DX3 PIC X(7).
02 CC-ACC-TYPE PIC X.
Expand All @@ -43,4 +39,3 @@
02 CC-DX5 PIC X(7).
02 CC-DX6 PIC X(7).
02 CC-FUTURE PIC X(6).
* 156
1 change: 0 additions & 1 deletion copylib/payfile.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
02 PD-DENIAL PIC XX.
02 PD-CLAIM PIC X(6).
02 PD-DATE-T PIC X(8).
* 61
02 PD-DATE-E PIC X(8).
02 PD-ORDER PIC X(6).
02 PD-BATCH PIC X(6).
8 changes: 0 additions & 8 deletions copylib/rri/charcur.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
03 CC-KEY3 PIC XXX.
02 CC-PATID PIC X(8).
02 CC-CLAIM PIC X(6).
* 25
02 CC-SERVICE PIC X.
02 CC-DIAG PIC X(7).
02 CC-PROC.
Expand All @@ -15,13 +14,11 @@
02 CC-MOD2 PIC XX.
02 CC-MOD3 PIC XX.
02 CC-MOD4 PIC XX.
* 50
02 CC-AMOUNT PIC S9(4)V99.
02 CC-DOCR PIC X(3).
02 CC-DOCP PIC X(2).
02 CC-PAYCODE PIC 999.
02 CC-STUD PIC X.
* 65
02 CC-WORK PIC XX.
02 CC-DAT1 PIC X(8).
02 CC-RESULT PIC X.
Expand All @@ -30,24 +27,19 @@
02 CC-COLLT PIC X.
02 CC-AUTH PIC X.
02 CC-PAPER PIC X.
* 81
02 CC-PLACE PIC X.
02 CC-EPSDT PIC X.
02 CC-DATE-T PIC X(8).
* claim age date
02 CC-DATE-A PIC X(8).
02 CC-DATE-P PIC X(8).
02 CC-REC-STAT PIC X.
* 108
02 CC-DX2 PIC X(7).
02 CC-DX3 PIC X(7).
* 122
02 CC-ACC-TYPE PIC X.
02 CC-DATE-M PIC X(8).
02 CC-ASSIGN PIC X.
02 CC-NEIC-ASSIGN PIC X.
02 CC-DX4 PIC X(7).
* 140
02 CC-QP1 PIC XX.
02 CC-QP2 PIC XX.
02 CC-VISITNO PIC X(7).
Expand Down
41 changes: 41 additions & 0 deletions copylib/rri/hisfile.cpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
01 HISFILE01.
02 HISFILE-KEY.
03 HS-KEY8 PIC X(8).
03 HS-CLAIM PIC X(6).
03 HS-REC-TYPE PIC X.
03 HS-KEY4 PIC XXXX.
02 HS-PATID.
03 HS-PATID7 PIC X(7).
03 HS-PATID1 PIC X.
02 HS-SERVICE PIC X.
02 HS-DIAG PIC X(5).
02 HS-PROC PIC X(11).
02 HS-MOD2 PIC XX.
02 HS-MOD3 PIC XX.
02 HS-MOD4 PIC XX.
02 HS-AMOUNT PIC X(6).
02 HS-DOCR PIC X(3).
02 HS-DOCP PIC X(2).
02 HS-PAYCODE PIC XXX.
02 HS-STUD PIC X.
02 HS-WORK PIC XX.
02 HS-DAT1 PIC X(8).
02 HS-RESULT PIC X.
02 HS-ACT PIC X.
02 HS-SORCREF PIC X.
02 HS-COLLT PIC X.
02 HS-AGE PIC X.
02 HS-PAPER PIC X.
02 HS-PLACE PIC X.
02 HS-EPSDT PIC X.
02 HS-DATE-T PIC X(8).
02 HS-DATE-A PIC X(8).
02 HS-DATE-E PIC X(8).
02 HS-REC-STAT PIC X.
02 HS-DX2 PIC X(5).
02 HS-DX3 PIC X(5).
02 HS-ACC-TYPE PIC X.
02 HS-DATE-M PIC X(8).
02 HS-ASSIGN PIC X.
02 HS-NEIC-ASSIGN PIC X.
02 HS-FUTURE PIC X(6).
33 changes: 12 additions & 21 deletions iedi/process_reports.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

$user = getenv('USER');
$batch_file = '/tmp/w22' . $user;
$remit_file = '/tmp/w33' . $user;
Expand Down Expand Up @@ -30,21 +29,12 @@
$za = new ZipArchive();
switch ($ext) {
case 'TXT':
print $fileName . "\n";
$flag = false;
foreach (file($fileName) as $line) {
if ((stripos($line, 'R') != false) || (stripos($line, 'E') != false)) {
$flag = true;
if ((stripos($line, 'SE') != false) || (stripos($line, 'GE') != false) || (stripos($line, 'IEA') != false)) {
$flag = false;
}
}
}
if (!empty($flag)) {
echo "uh oh, have to check out 999 error or reject $fileName\n";
}
readline('enter to continue');
break;
print $fileName . "\n";
if (preg_match('/(IK5|AK9)\*[RE]/', file_get_contents($fileName))) {
echo "uh oh, have to check out 999 error or reject $fileName\n";
}
readline('enter to continue');
break;
case 'txt':
print $fileName . "\n";
$contents = file_get_contents($fileName);
Expand All @@ -58,12 +48,13 @@
file_put_contents($remit_file, '/home/sidw/iedi/' . $fileName . "\n", FILE_APPEND);
break;
case 'zip':
$za->open($fileName);
if ($za->open($fileName) !== true) { echo "bad zip: $fileName\n"; break; }
for ($i = 0; $i < $za->numFiles; $i++) {
$stat = $za->statIndex($i);
$fileName277 = basename($stat['name']) . PHP_EOL;
$za->extractTo('/tmp');
file_put_contents($batch_file, '/tmp/' . $fileName277, FILE_APPEND);
$name = $za->statIndex($i)['name'];
if (pathinfo($name, PATHINFO_EXTENSION) !== '277') continue;
$dest = '/tmp/' . basename($name);
copy("zip://$fileName#$name", $dest);
file_put_contents($batch_file, $dest . "\n", FILE_APPEND);
}
$za->close();
break;
Expand Down
Loading