HBHCR19B ;LR VAMC(IRMS)/MJT - HBHC rpt, called by HBHCR19A, entry points: INITIAL, PRTLOOP, EXIT ;Aug 2000
;;1.0;HOSPITAL BASED HOME CARE;**8,14,22,25**;NOV 01, 1993;Build 45
;******************************************************************************
;******************************************************************************
; --- ROUTINE MODIFICATION LOG ---
;
;PKG/PATCH DATE DEVELOPER MODIFICATION
;----------- ---------- ----------- ----------------------------------------
;HBH*1.0*25 FEB 2012 K GUPTA Support for ICD-10 Coding System
;******************************************************************************
;******************************************************************************
;
INITIAL ; Initialize variables
K ^TMP("HBHC",$J)
S $P(HBHCSP2," ",3)="",(HBHCCNT,HBHCTOT)=0,$P(HBHCY,"-",81)="",HBHCHEAD="ICD Code/Diagnosis Text by Date Range"
S HBHCHDR="W !,""Patient Name"",?27,""Last Four"",?41,"""_$$ICDTEXT^HBHCUTL3(HBHCBEG1,HBHCEND1)_" Code/Diagnosis Text"""
S HBHCCOLM=(80-(20+$L(HBHCHEAD))\2) S:HBHCCOLM'>0 HBHCCOLM=1
Q
PRTLOOP ; Print loop
S HBHCCAT=""
F S HBHCCAT=$O(^TMP("HBHC",$J,HBHCCAT)) Q:HBHCCAT="" D SUBTOT S HBHCNAME="" F S HBHCNAME=$O(^TMP("HBHC",$J,HBHCCAT,HBHCNAME)) Q:HBHCNAME="" S HBHCLST4="" F S HBHCLST4=$O(^TMP("HBHC",$J,HBHCCAT,HBHCNAME,HBHCLST4)) Q:HBHCLST4="" D PRTLOOP2
D SUBTOT
Q
SUBTOT ; Print subtotal from previous category
I HBHCCNT>0 W !!,"Category: "_HBHC_" Count: ",HBHCCNT,!,HBHCY S HBHCTOT=HBHCTOT+HBHCCNT
S HBHC=HBHCCAT,HBHCCNT=0
Q
PRTLOOP2 ; Print loop 2, PRTLOOP continued
S HBHCDX="" F S HBHCDX=$O(^TMP("HBHC",$J,HBHCCAT,HBHCNAME,HBHCLST4,HBHCDX)) Q:HBHCDX="" D PRINT
Q
PRINT ; Print report
I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<8) W @IOF D HDRRANGE^HBHCUTL
S HBHCTMP=^TMP("HBHC",$J,HBHCCAT,HBHCNAME,HBHCLST4,HBHCDX)
W !,HBHCNAME,?27,$E(HBHCLST4,8,11),?41,HBHCDX
S HBHCCNT=HBHCCNT+1
Q
EXIT ; Exit module
D ^%ZISC
K HBHC,HBHCAPDT,HBHCBEG1,HBHCBEG2,HBHCCAT,HBHCCATB,HBHCCATE,HBHCCC,HBHCCNT,HBHCCOLM,HBHCDFN,HBHCDPT0,HBHCDX,HBHCEND1,HBHCEND2,HBHCFLAG,HBHCHDR,HBHCHEAD,HBHCI,HBHCICDP,HBHCLST4,HBHCNAME,HBHCNOD0,HBHCPAGE,HBHCSP2,HBHCTDY,HBHCTMP
K HBHCTOT,HBHCY,HBHCZ,X,X1,X2,Y,^TMP("HBHC",$J),^TMP($J)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHBHCR19B 2313 printed Nov 22, 2024@17:08:23 Page 2
HBHCR19B ;LR VAMC(IRMS)/MJT - HBHC rpt, called by HBHCR19A, entry points: INITIAL, PRTLOOP, EXIT ;Aug 2000
+1 ;;1.0;HOSPITAL BASED HOME CARE;**8,14,22,25**;NOV 01, 1993;Build 45
+2 ;******************************************************************************
+3 ;******************************************************************************
+4 ; --- ROUTINE MODIFICATION LOG ---
+5 ;
+6 ;PKG/PATCH DATE DEVELOPER MODIFICATION
+7 ;----------- ---------- ----------- ----------------------------------------
+8 ;HBH*1.0*25 FEB 2012 K GUPTA Support for ICD-10 Coding System
+9 ;******************************************************************************
+10 ;******************************************************************************
+11 ;
INITIAL ; Initialize variables
+1 KILL ^TMP("HBHC",$JOB)
+2 SET $PIECE(HBHCSP2," ",3)=""
SET (HBHCCNT,HBHCTOT)=0
SET $PIECE(HBHCY,"-",81)=""
SET HBHCHEAD="ICD Code/Diagnosis Text by Date Range"
+3 SET HBHCHDR="W !,""Patient Name"",?27,""Last Four"",?41,"""_$$ICDTEXT^HBHCUTL3(HBHCBEG1,HBHCEND1)_" Code/Diagnosis Text"""
+4 SET HBHCCOLM=(80-(20+$LENGTH(HBHCHEAD))\2)
if HBHCCOLM'>0
SET HBHCCOLM=1
+5 QUIT
PRTLOOP ; Print loop
+1 SET HBHCCAT=""
+2 FOR
SET HBHCCAT=$ORDER(^TMP("HBHC",$JOB,HBHCCAT))
if HBHCCAT=""
QUIT
DO SUBTOT
SET HBHCNAME=""
FOR
SET HBHCNAME=$ORDER(^TMP("HBHC",$JOB,HBHCCAT,HBHCNAME))
if HBHCNAME=""
QUIT
SET HBHCLST4=""
FOR
SET HBHCLST4=$ORDER(^TMP("HBHC",$JOB,HBHCCAT,HBHCNAME,HBHCLST4))
if HBHCLST4=""
QUIT
DO PRTLOOP2
+3 DO SUBTOT
+4 QUIT
SUBTOT ; Print subtotal from previous category
+1 IF HBHCCNT>0
WRITE !!,"Category: "_HBHC_" Count: ",HBHCCNT,!,HBHCY
SET HBHCTOT=HBHCTOT+HBHCCNT
+2 SET HBHC=HBHCCAT
SET HBHCCNT=0
+3 QUIT
PRTLOOP2 ; Print loop 2, PRTLOOP continued
+1 SET HBHCDX=""
FOR
SET HBHCDX=$ORDER(^TMP("HBHC",$JOB,HBHCCAT,HBHCNAME,HBHCLST4,HBHCDX))
if HBHCDX=""
QUIT
DO PRINT
+2 QUIT
PRINT ; Print report
+1 IF ($DATA(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<8)
WRITE @IOF
DO HDRRANGE^HBHCUTL
+2 SET HBHCTMP=^TMP("HBHC",$JOB,HBHCCAT,HBHCNAME,HBHCLST4,HBHCDX)
+3 WRITE !,HBHCNAME,?27,$EXTRACT(HBHCLST4,8,11),?41,HBHCDX
+4 SET HBHCCNT=HBHCCNT+1
+5 QUIT
EXIT ; Exit module
+1 DO ^%ZISC
+2 KILL HBHC,HBHCAPDT,HBHCBEG1,HBHCBEG2,HBHCCAT,HBHCCATB,HBHCCATE,HBHCCC,HBHCCNT,HBHCCOLM,HBHCDFN,HBHCDPT0,HBHCDX,HBHCEND1,HBHCEND2,HBHCFLAG,HBHCHDR,HBHCHEAD,HBHCI,HBHCICDP,HBHCLST4,HBHCNAME,HBHCNOD0,HBHCPAGE,HBHCSP2,HBHCTDY,HBHCTMP
+3 KILL HBHCTOT,HBHCY,HBHCZ,X,X1,X2,Y,^TMP("HBHC",$JOB),^TMP($JOB)
+4 QUIT