VistA-WorldVistAEHR/r/HOSPITAL_BASED_HOME_CARE-HBH/HBHXMNT2.m

27 lines
1.9 KiB
Mathematica
Raw Normal View History

2009-11-29 13:37:14 -05:00
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