source: FOIAVistA/trunk/r/HOSPITAL_BASED_HOME_CARE-HBH/HBHCR15B.m@ 812

Last change on this file since 812 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 5.0 KB
Line 
1HBHCR15B ;LR VAMC(IRMS)/MJT-HBHC rpt using file 634.6, called from HBHCR15A, entry points: PROMPT1 & END, & from HBHCXMT, entry point: PROMPT2 ;9804
2 ;;1.0;HOSPITAL BASED HOME CARE;**6,8,9,10,13,15**;NOV 01, 1993
3PROMPT1 ; Prompt user for which transmit date from last 12 batchs to include, default is Most Recent; uses transmit date cross-ref to obtain batch dates
4 S HBHCDATE="" F S HBHCDATE=$O(^HBHC(634.6,"C",HBHCDATE)) Q:HBHCDATE="" S HBHC(-HBHCDATE)=""
5 S HBHCDATE="" F HBHCI=1:1 S HBHCDATE=$O(HBHC(HBHCDATE)) Q:(HBHCDATE="")!(HBHCI>12) S Y=$E(HBHCDATE,2,9) D DD^%DT S TMP(HBHCI)=$E(HBHCDATE,2,9) W !,$J(HBHCI,2),".",?6,Y
6 W !
7 K DIR,DIRUT
8 S DIR(0)="N^",DIR("A")="Select Transmit Date",DIR("B")=1,DIR("?")="Select transmit date by number. Press return for 'Most Recent' transmit date"
9 D ^DIR Q:$D(DIRUT)
10 I '$D(TMP(Y)) W *7,!!,"Please select number from list.",! H 1 G PROMPT1
11 S HBHCXMDT=TMP(Y)
12PROMPT2 ; Prompt user for which forms to include, default is Summary
13 S HBHCCC=0
14 D TODAY^HBHCUTL
15 S:'$D(HBHCXMDT) HBHCXMDT=DT
16 S:$P(^HBHC(631.9,1,0),U,7)]"" HBHCIOP=$P(^%ZIS(1,$P(^HBHC(631.9,1,0),U,7),0),U)
17 K DIR,DIRUT
18 S DIR(0)="S^3:Admission;4:Visit;5:Discharge;6:Correction;A:All;S:Summary;",DIR("A")="Select Forms to Include",DIR("B")="Summary",DIR("?")="Select form type to be included in report. Press return for 'Summary'."
19 D ^DIR Q:$D(DIRUT)
20 S HBHCDIR=Y,HBHCY0=Y(0)
21 S Y=HBHCXMDT D DD^%DT S HBHCHEAD=$S(HBHCDIR="S":Y_" Transmit, "_HBHCY0,1:Y_" Transmit, "_HBHCY0_" Forms,")
22 Q
23END ; End of report processing
24 ; Count number of visits
25 S HBHCCNT=0,HBHCNAME="" F S HBHCNAME=$O(^TMP($J,HBHCNAME)) Q:HBHCNAME="" S HBHCLST4=0 F S HBHCLST4=$O(^TMP($J,HBHCNAME,HBHCLST4)) Q:HBHCLST4'>0 S HBHCDATE=0 F S HBHCDATE=$O(^TMP($J,HBHCNAME,HBHCLST4,HBHCDATE)) Q:HBHCDATE'>0 D CONT
26 D:IO'=IO(0)!($D(IO("S"))) HDRPAGE^HBHCUTL
27 I '$D(IO("S")),IO=IO(0) S HBHCCC=HBHCCC+1 W @IOF D HDRPAGE^HBHCUTL
28 D:HBHCDIR'="S" PRTLOOP
29 I HBHCDIR="A" S HBHCHDR="W ?36,""Summary""" W @IOF D HDRPAGE^HBHCUTL
30 W:(HBHCDIR'="A")&(HBHCDIR'="S") !
31 W:(HBHCDIR=3)!(HBHCDIR="A")!(HBHCDIR="S") !,"Admit Eval/Adm Form 3 Total:",?32,$J(HBHCCNTA,5),!,"Reject Eval/Adm Form 3 Total:",?32,$J(HBHCCNTR,5)
32 W:HBHCDIR=3 !?32,"-----",!,"All Eval/Adm Forms Total:",?31,$J(HBHCCNTA+HBHCCNTR,6),!
33 W:(HBHCDIR=4)!(HBHCDIR="A")!(HBHCDIR="S") !,"Visit Form 4 Total:",?32,$J(HBHCCNT4,5)
34 W:(HBHCDIR=5)!(HBHCDIR="A")!(HBHCDIR="S") !,"Discharge Form 5 Total:",?32,$J(HBHCCNT5,5)
35 W:(HBHCDIR=6)!(HBHCDIR="A")!(HBHCDIR="S") !,"Correction Form 6 Total:",?32,$J(HBHCCNT6,5)
36 W:(HBHCDIR="A")!(HBHCDIR="S") !?32,"-----",!,"All Forms Total:",?31,$J(HBHCCNTA+HBHCCNTR+HBHCCNT4+HBHCCNT5+HBHCCNT6,6)
37 W:(HBHCDIR=4)!(HBHCDIR="A")!(HBHCDIR="S") !!,"Number of Visits Total:",?32,$J(HBHCCNT,5)
38 D ENDRPT^HBHCUTL1
39 Q
40CONT ; Continue count of visits loop
41 S HBHCPRV="" F S HBHCPRV=$O(^TMP($J,HBHCNAME,HBHCLST4,HBHCDATE,HBHCPRV)) Q:HBHCPRV="" S HBHCCNT=HBHCCNT+1
42 Q
43PRTLOOP ; Print loop
44 S HBHCFORM="" F S HBHCFORM=$O(^TMP("HBHC",$J,HBHCFORM)) Q:HBHCFORM="" D HEADER,PRTLOOP2,SUB
45 Q
46PRTLOOP2 ; Print loop continued
47 S HBHCACTN="" F S HBHCACTN=$O(^TMP("HBHC",$J,HBHCFORM,HBHCACTN)) Q:HBHCACTN="" S HBHCNAME="" F S HBHCNAME=$O(^TMP("HBHC",$J,HBHCFORM,HBHCACTN,HBHCNAME)) Q:HBHCNAME="" D PRTLOOP3
48 Q
49PRTLOOP3 ; Print loop continued (again)
50 S HBHCLST4=0 F S HBHCLST4=$O(^TMP("HBHC",$J,HBHCFORM,HBHCACTN,HBHCNAME,HBHCLST4)) Q:HBHCLST4'>0 S HBHCDATE="" F S HBHCDATE=$O(^TMP("HBHC",$J,HBHCFORM,HBHCACTN,HBHCNAME,HBHCLST4,HBHCDATE)) Q:HBHCDATE="" D PRTLOOP4
51 Q
52PRTLOOP4 ; Print loop continued (again & again)
53 S HBHCPRV="" F S HBHCPRV=$O(^TMP("HBHC",$J,HBHCFORM,HBHCACTN,HBHCNAME,HBHCLST4,HBHCDATE,HBHCPRV)) Q:HBHCPRV="" S HBHCIEN="" F S HBHCIEN=$O(^TMP("HBHC",$J,HBHCFORM,HBHCACTN,HBHCNAME,HBHCLST4,HBHCDATE,HBHCPRV,HBHCIEN)) Q:HBHCIEN="" D PRINT
54 Q
55PRINT ; Print report
56 S HBHCINFO=^TMP("HBHC",$J,HBHCFORM,HBHCACTN,HBHCNAME,HBHCLST4,HBHCDATE,HBHCPRV,HBHCIEN)
57 I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<10) W:HBHCPAGE>0 @IOF D HDRPAGE^HBHCUTL,HEADER
58 W !?4,$S(HBHCFORM="A":3,HBHCFORM="V":4,HBHCFORM="D":5,1:6),?8,HBHCNAME,?31,HBHCLST4,?38,$E(HBHCDATE,1,2),"-",$E(HBHCDATE,3,4),"-",$E(HBHCDATE,7,8) W:$P(HBHCINFO,U,3)]"" ?46,"@"_$P(HBHCINFO,U,3)
59 W ?55,$S(HBHCFORM=6:$P(HBHCINFO,U,2),HBHCFORM="A":HBHCACTN,HBHCFORM="V":$P(HBHCINFO,U),1:"") W:HBHCFORM="V" ?60,HBHCPRV
60 Q
61HEADER ; Sub-header module
62 W !,$S(HBHCFORM=6:"Correction Form 6",HBHCFORM="A":"Evaluation/Admission Form 3",HBHCFORM="D":"Discharge Form 5",1:"Visit Form 4")_" Records",?55,$S(HBHCFORM=6:"Type",HBHCFORM="A":"Action",HBHCFORM="V":"Provider",1:""),!
63 Q
64SUB ; Sub-total module
65 W:(HBHCDIR="A")&(HBHCFORM=6) !!?4,"Correction Form 6 Total:",?37,$J(HBHCCNT6,5),!,HBHCY
66 W:(HBHCDIR="A")&(HBHCFORM="A") !!?4,"Admit Eval/Adm Form 3 Total:",?37,$J(HBHCCNTA,5),!?4,"Reject Eval/Adm Form 3 Total:",?37,$J(HBHCCNTR,5),!?37,"-----",!?4,"All Eval/Adm Forms Total:",?36,$J(HBHCCNTA+HBHCCNTR,6),!,HBHCY
67 W:(HBHCDIR="A")&(HBHCFORM="D") !!?4,"Discharge Form 5 Total:",?37,$J(HBHCCNT5,5),!,HBHCY
68 W:(HBHCDIR="A")&(HBHCFORM="V") !!?4,"Visit Form 4 Total:",?30,$J(HBHCCNT4,5)
69 W:(HBHCDIR="A")&(HBHCFORM="V") !!?4,"Number of Visits Total:",?30,$J(HBHCCNT,5),!,HBHCY
70 Q
Note: See TracBrowser for help on using the repository browser.