HBHXMNT2 ; VAMC(IRMS)/MJT-HBHC maintenance routine, locates & prints report of records in ^HBHC(631, ^HBHC(632 files with pseudo SSNs, includes: patient name & SSN for pseudo SSN records, calls ^HBHXMNT3 ;9403
;;1.0;HOSPITAL BASED HOME CARE;**2**;NOV 01, 1993
S %ZIS="Q",HBHCCC=0 K IOP,ZTIO,ZTSAVE D ^%ZIS G:POP EXIT
I $D(IO("Q")) S ZTRTN="DQ^HBHXMNT2",ZTSAVE("HBHC*")="",ZTDESC="HBHC Pseudo SSN Report" D ^%ZTLOAD G EXIT
DQ ; De-queue
U IO
L +^HBHC(634.5,0):0 I '$T W *7,!!,"Another user has the pseudo SSN file locked.",!! H 3 G EXIT
K ^HBHC(634.5) S ^HBHC(634.5,0)="HBHC PSEUDO SSN ERROR(S)^634.5P^"
; Max length for HBHCHEAD = 50
S $P(HBHCY,"-",81)="",HBHCPAGE=0,HBHCHEAD="Pseudo SSN",HBHCHDR="W ""Patient Name"",?40,""SSN""",HBHCCOLM=(80-(30+$L(HBHCHEAD))\2) S:HBHCCOLM'>0 HBHCCOLM=1 D TODAY^HBHCUTL
D:IO'=IO(0)!($D(IO("S"))) HDRPAGE^HBHCUTL
I '$D(IO("S")),(IO=IO(0)) S HBHCCC=HBHCCC+1 W @IOF D HDRPAGE^HBHCUTL
F HBHCFILE=631,632 S HBHCDFN=0 F S HBHCDFN=$O(^HBHC(HBHCFILE,HBHCDFN)) Q:HBHCDFN'>0 S HBHCDPT=$P(^HBHC(HBHCFILE,HBHCDFN,0),U) I $P(^DPT(HBHCDPT,0),U,9)'?9N K DD,DO S DIC="^HBHC(634.5,",DIC(0)="MN",(X,DINUM)=HBHCDPT D FILE^DICN
I '$D(^HBHC(634.5,"B")) W *7,!!,"No patients found with pseudo SSNs. No resolution required!!" L -^HBHC(634.5,0) D ENDRPT^HBHCUTL1,^%ZISC G EXIT
D PRINT,ENDRPT^HBHCUTL1
K DD,DIC,DINUM,DO,HBHCCC,HBHCCOLM,HBHCDFN,HBHCDPT,HBHCDPT0,HBHCFILE,HBHCHDR,HBHCHEAD,HBHCPAGE,HBHCTDY,HBHCY,HBHCZ,X
D ^HBHXMNT3
EXIT ; Exit module
L -^HBHC(634.5,0)
K DD,DIC,DINUM,DO,HBHCCC,HBHCCOLM,HBHCDFN,HBHCDPT,HBHCDPT0,HBHCFILE,HBHCHDR,HBHCHEAD,HBHCPAGE,HBHCTDY,HBHCY,HBHCZ,X
Q
PRINT ; Print report
I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRPAGE^HBHCUTL
I (IOSL-$Y)<5 W @IOF D HDRPAGE^HBHCUTL
S HBHCDFN=0 F S HBHCDFN=$O(^HBHC(634.5,HBHCDFN)) Q:HBHCDFN'>0 S HBHCDPT0=^DPT(HBHCDFN,0) W !,$P(HBHCDPT0,U),?40,$E($P(HBHCDPT0,U,9),1,3)_"-"_$E($P(HBHCDPT0,U,9),4,5)_"-"_$E($P(HBHCDPT0,U,9),6,10)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHBHXMNT2 1970 printed Nov 22, 2024@17:09:13 Page 2
HBHXMNT2 ; VAMC(IRMS)/MJT-HBHC maintenance routine, locates & prints report of records in ^HBHC(631, ^HBHC(632 files with pseudo SSNs, includes: patient name & SSN for pseudo SSN records, calls ^HBHXMNT3 ;9403
+1 ;;1.0;HOSPITAL BASED HOME CARE;**2**;NOV 01, 1993
+2 SET %ZIS="Q"
SET HBHCCC=0
KILL IOP,ZTIO,ZTSAVE
DO ^%ZIS
if POP
GOTO EXIT
+3 IF $DATA(IO("Q"))
SET ZTRTN="DQ^HBHXMNT2"
SET ZTSAVE("HBHC*")=""
SET ZTDESC="HBHC Pseudo SSN Report"
DO ^%ZTLOAD
GOTO EXIT
DQ ; De-queue
+1 USE IO
+2 LOCK +^HBHC(634.5,0):0
IF '$TEST
WRITE *7,!!,"Another user has the pseudo SSN file locked.",!!
HANG 3
GOTO EXIT
+3 KILL ^HBHC(634.5)
SET ^HBHC(634.5,0)="HBHC PSEUDO SSN ERROR(S)^634.5P^"
+4 ; Max length for HBHCHEAD = 50
+5 SET $PIECE(HBHCY,"-",81)=""
SET HBHCPAGE=0
SET HBHCHEAD="Pseudo SSN"
SET HBHCHDR="W ""Patient Name"",?40,""SSN"""
SET HBHCCOLM=(80-(30+$LENGTH(HBHCHEAD))\2)
if HBHCCOLM'>0
SET HBHCCOLM=1
DO TODAY^HBHCUTL
+6 if IO'=IO(0)!($DATA(IO("S")))
DO HDRPAGE^HBHCUTL
+7 IF '$DATA(IO("S"))
IF (IO=IO(0))
SET HBHCCC=HBHCCC+1
WRITE @IOF
DO HDRPAGE^HBHCUTL
+8 FOR HBHCFILE=631,632
SET HBHCDFN=0
FOR
SET HBHCDFN=$ORDER(^HBHC(HBHCFILE,HBHCDFN))
if HBHCDFN'>0
QUIT
SET HBHCDPT=$PIECE(^HBHC(HBHCFILE,HBHCDFN,0),U)
IF $PIECE(^DPT(HBHCDPT,0),U,9)'?9N
KILL DD,DO
SET DIC="^HBHC(634.5,"
SET DIC(0)="MN"
SET (X,DINUM)=HBHCDPT
DO FILE^DICN
+9 IF '$DATA(^HBHC(634.5,"B"))
WRITE *7,!!,"No patients found with pseudo SSNs. No resolution required!!"
LOCK -^HBHC(634.5,0)
DO ENDRPT^HBHCUTL1
DO ^%ZISC
GOTO EXIT
+10 DO PRINT
DO ENDRPT^HBHCUTL1
+11 KILL DD,DIC,DINUM,DO,HBHCCC,HBHCCOLM,HBHCDFN,HBHCDPT,HBHCDPT0,HBHCFILE,HBHCHDR,HBHCHEAD,HBHCPAGE,HBHCTDY,HBHCY,HBHCZ,X
+12 DO ^HBHXMNT3
EXIT ; Exit module
+1 LOCK -^HBHC(634.5,0)
+2 KILL DD,DIC,DINUM,DO,HBHCCC,HBHCCOLM,HBHCDFN,HBHCDPT,HBHCDPT0,HBHCFILE,HBHCHDR,HBHCHEAD,HBHCPAGE,HBHCTDY,HBHCY,HBHCZ,X
+3 QUIT
PRINT ; Print report
+1 IF ($DATA(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5)
WRITE @IOF
DO HDRPAGE^HBHCUTL
+2 IF (IOSL-$Y)<5
WRITE @IOF
DO HDRPAGE^HBHCUTL
+3 SET HBHCDFN=0
FOR
SET HBHCDFN=$ORDER(^HBHC(634.5,HBHCDFN))
if HBHCDFN'>0
QUIT
SET HBHCDPT0=^DPT(HBHCDFN,0)
WRITE !,$PIECE(HBHCDPT0,U),?40,$EXTRACT($PIECE(HBHCDPT0,U,9),1,3)_"-"_$EXTRACT($PIECE(HBHCDPT0,U,9),4,5)_"-"_$EXTRACT($PIECE(HBHCDPT0,U,9),6,10)
+4 QUIT