source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXCPRO1.m@ 1200

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1ECXCPRO1 ;ALB/JAP - PRO Extract YTD Report (cont) ; 5/9/05 3:08pm
2 ;;3.0;DSS EXTRACTS;**21,84**;Dec 22, 1997
3 ;
4PRINT ;print report
5 N PG,LN,QFLG,NODE,DESC,AVE,JJ,SS,TOTAL,TOT,TQTY
6 U IO
7 S QFLG=0,$P(LN,"-",132)=""
8 S Y=ECXARRAY("START") D DD^%DT S ECXSTART=Y
9 S Y=$S(LASTDAY:LASTDAY,ECXARRAY("END")>DT:DT,1:ECXARRAY("END")) D DD^%DT S ECXEND=Y
10 D NOW^%DTC S Y=$E(%,1,12) D DD^%DT S ECXRUN=Y
11 ;if ecxall=0, then only one subdivision of multidivision facility
12 ;if ecxall=1, then either entire facility (i.e., non-divisional), or all subdivisions combined under primary station#
13 ;but it's possible that no extract data was found
14 S ECXSTAT="",ECXSTAT=$O(^TMP($J,"ECXP",ECXSTAT)) I ECXSTAT="" D Q
15 .I ECXALL=0 S ECXSTAT=$O(DIVISION(""))
16 .F ECXTYPE="N","X" D Q:QFLG
17 ..S PG=0 D HEADER
18 ..W !!,?36,"No extract data available."
19 ..I $E(IOST)="C" D Q:QFLG
20 ...S SS=22-$Y F JJ=1:1:SS W !
21 ...S DIR(0)="E" D ^DIR K DIR S:'Y QFLG=1
22 F ECXTYPE="N","X" D Q:QFLG
23 .S PG=0 D HEADER
24 .S ECXHCPC=""
25 .I '$D(^TMP($J,"ECXP",ECXSTAT,ECXTYPE)) D Q
26 ..W !!,?36,"No extract data available."
27 ..I $E(IOST)="C" D Q:QFLG
28 ...S SS=22-$Y F JJ=1:1:SS W !
29 ...S DIR(0)="E" D ^DIR K DIR S:'Y QFLG=1
30 .F S ECXHCPC=$O(^TMP($J,"ECXP",ECXSTAT,ECXTYPE,ECXHCPC)) Q:ECXHCPC="" D Q:QFLG
31 ..S DESC=$G(^TMP($J,"HCPCS",ECXHCPC)) S:DESC="" DESC="(Unknown)" S DESC=ECXHCPC_" "_DESC
32 ..S NODE=^TMP($J,"ECXP",ECXSTAT,ECXTYPE,ECXHCPC)
33 ..;node holds - com qty^com cost^va nonlab qty^va nonlab cost^lab qty^lab labor cost^lab matrl cost
34 ..F I=1:1:7 S X(I)=+$P(NODE,U,I)
35 ..S AVE("C")=0,AVE("V")=0,AVE("L")=0,AVE("ALL")=0,TOT("L")=0,TOTAL=0,TQTY=0
36 ..S:X(1)>0 AVE("C")=X(2)/X(1) S:X(3)>0 AVE("V")=X(4)/X(3) S TOT("L")=X(6)+X(7) S:X(5)>0 AVE("L")=TOT("L")/X(5)
37 ..S TQTY=X(1)+X(3)+X(5),TOTAL=X(2)+X(4)+TOT("L")
38 ..S:TQTY>0 AVE("ALL")=TOTAL/TQTY
39 ..D:($Y+3>IOSL) HEADER Q:QFLG
40 ..W !,DESC,?33,$J(X(1),8,0),?43,$J(X(2),8,0),?53,$J(AVE("C"),8,2),?63,$J(X(3),8,0),?73,$J(X(4),8,0),?83,$J(AVE("V"),8,2),?93,$J(X(5),8,0),?103,$J(TOT("L"),8,0),?113,$J(AVE("L"),8,2),?123,$J(AVE("ALL"),8,2)
41 .I 'QFLG,$E(IOST)="C" D
42 ..S SS=22-$Y F JJ=1:1:SS W !
43 ..S DIR(0)="E" D ^DIR K DIR S:'Y QFLG=1
44 W @IOF
45 Q
46 ;
47HEADER ;header & page control
48 I $E(IOST)="C" D
49 .S SS=22-$Y F JJ=1:1:SS W !
50 .I PG>0 S DIR(0)="E" D ^DIR K DIR S:'Y QFLG=1
51 Q:QFLG
52 W:$Y!($E(IOST)="C") @IOF S PG=PG+1
53 W "Prosthetics (PRO) Extract YTD HCPCS Report",?122,"Page "_PG
54 W !,"FY Date Range: "_ECXSTART_" to "_ECXEND
55 I ECXALL=0 W !,"Division: "_$P(DIVISION(ECXSTAT),U,3)_" ("_$P(DIVISION(ECXSTAT),U,2)_")"
56 I ECXALL=1 W !,"Facility: "_$P(ECXPRIME,U,3)_" ("_$P(ECXPRIME,U,2)_")"
57 W !,"Run Date/Time: "_ECXRUN
58 W:ECXTYPE="N" !!,"REPORT OF NEW PROSTHETICS ACTIVITIES (Initial, Replacement, or Spare)"
59 W:ECXTYPE="X" !!,"REPORT OF REPAIR PROSTHETICS ACTIVITIES"
60 W !,?36,"Qty.",?44,"Total $",?55,"Ave. $",?67,"Qty.",?74,"Total $",?85,"Ave. $",?97,"Qty.",?104,"Total $",?114,"Ave. $",?125,"Ave. $"
61 W !,"PSAS HCPCS",?35,"-Comm-",?44,"-Comm-",?55,"-Comm-",?67,"-VA-",?75,"-VA-",?85,"-VA-",?96,"-Lab-",?105,"-Lab-",?114,"-Lab-",?125,"-All-"
62 W !,LN,!
63 Q
Note: See TracBrowser for help on using the repository browser.