VistA-FOIAVistA/r/HOSPITAL_BASED_HOME_CARE-HBH/HBHCRP14.m

30 lines
1.8 KiB
Mathematica
Raw Permalink Normal View History

HBHCRP14 ; VAMC(IRMS)/MJT-HBHC report locates records in ^HBHC(631, ^HBHC(632 files with pseudo SSNs, populates ^HBHC(634.5 (pseudo SSN error(s)) file, report includes: patient name & SSN for pseudo SSN records ;9403
;;1.0;HOSPITAL BASED HOME CARE;**2,5,6**;NOV 1, 1993
S %ZIS="Q",HBHCCC=0 K IOP,ZTIO,ZTSAVE D ^%ZIS G:POP EXIT
I $D(IO("Q")) S ZTRTN="DQ^HBHCRP14",ZTSAVE("HBHC*")="",ZTDESC="HBPC 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) D:$P(^DPT(HBHCDPT,0),U,9)'?9N FILE
D PRINT,ENDRPT^HBHCUTL1
EXIT ; Exit module
L -^HBHC(634.5,0)
D ^%ZISC
K DD,DIC,DINUM,DO,HBHCCC,HBHCCOLM,HBHCDFN,HBHCDPT,HBHCDPT0,HBHCFILE,HBHCHDR,HBHCHEAD,HBHCPAGE,HBHCTDY,HBHCY,HBHCZ,X
Q
FILE ; File entry
; Quit if cancelled appointment
Q:((HBHCFILE=632)&($P(^HBHC(HBHCFILE,HBHCDFN,0),U,7)]""))
K DD,DO S DIC="^HBHC(634.5,",DIC(0)="MN",(X,DINUM)=HBHCDPT D FILE^DICN
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