Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LRCAPR3A

LRCAPR3A.m

Go to the documentation of this file.
LRCAPR3A ;DALISC/PAC/FHS/JBM - WKLD REP GENERATOR-PRINT 2 ;10/16/92 16:49
 ;;5.2;LAB SERVICE;;Sep 27, 1994
COND ;
 D HDR1^LRCAPR4
 D LOC Q:LREND
 D LRMAC Q:LREND
 D:LRCTL CONTROL Q:LREND
 D WKLD Q:LREND
 D STAT
 Q
LOC ;
 Q:'$D(^TMP("LR",$J,"TST/LOC"))
 S LRSUBH1="TOTAL TESTS BY LOCATION: % of GRAND TOTAL"_" ( "_LRSUM_" )"
 W !!!?15,LRSUBH1,!?15,$E(LRDSH,1,$L(LRSUBH1)),!
 S LRLOC=""
 F I=0:1 S LRLOC=$O(^TMP("LR",$J,"TST/LOC",LRLOC)) Q:(LRLOC="")!(LREND)  D
 . S X=I#2 W:'X ! W ?X*40
 . W $E(LRLOC_"                    ",1,20),"="
 . W $J(^TMP("LR",$J,"TST/LOC",LRLOC),4),"  "
 . W $J($FN($S(LRSUM:^(LRLOC)/LRSUM,1:0)*100,"",2),5),"%"
 . I X,$Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 Q
LRMAC ;
 Q:'$D(^TMP("LR",$J,"TST/LRM"))
 S LRSUBH1="TOTAL TESTS by INSTRUMENTS: % of GRAND TOTAL"_" ( "_LRSUM_" )"
 I $Y+9>IOSL D PAUSE^LRCAPR4 Q:LREND  W @IOF D HDR1^LRCAPR4
 W !!!?15,LRSUBH1,!?15,$E(LRDSH,1,$L(LRSUBH1))
 S LRMAC=""
 F  S LRMAC=$O(^TMP("LR",$J,"TST/LRM",LRMAC)) Q:(LRMAC="")!(LREND)  S LRLMAC=^(LRMAC) D
 . I $Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 . W !!,LRMAC,"   =",$J(LRLMAC,5),"    "
 . W $J($FN($S(LRSUM:LRLMAC/LRSUM,1:0)*100,"",2),5),"%"
 . S LRTEST=""
 . F I=0:1 S LRTEST=$O(^TMP("LR",$J,"TST/LRM",LRMAC,LRTEST)) Q:(LRTEST="")!(LREND)  D
 . . S X=I#2 W:'X ! W ?X*40+1
 . . W LRTEST," = ",$J(^TMP("LR",$J,"TST/LRM",LRMAC,LRTEST),5)
 . . W "    ",$J($FN($S(LRLMAC:^(LRTEST)/LRLMAC,1:0)*100,"",2),5),"%"
 . . I X,$Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 Q
CONTROL ;
 Q:'$D(^TMP("LR",$J,"TST/CTL"))
 S LRSUBH1="Total CONTROL TESTS by INSTRUMENTS: % of GRAND TOTAL"_" ( "_LRSUM_" )"
 I $Y+9>IOSL D PAUSE^LRCAPR4 Q:LREND  W @IOF D HDR1^LRCAPR4
 W !!!?15,LRSUBH1,!?15,$E(LRDSH,1,$L(LRSUBH1))
 S LRMAC=""
 F  S LRMAC=$O(^TMP("LR",$J,"TST/CTL",LRMAC)) Q:(LRMAC="")!(LREND)  S LRLMAC=^(LRMAC) D
 . I $Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 . W !!,LRMAC,"   =",$J(LRLMAC,5),"    "
 . W $J($FN($S(LRSUM:LRLMAC/LRSUM,1:0)*100,"",2),5),"%"
 . S LRTEST=""
 . F I=0:1 S LRTEST=$O(^TMP("LR",$J,"TST/CTL",LRMAC,LRTEST)) Q:(LRTEST="")!(LREND)  D
 . . S X=I#2 W:'X ! W ?X*40+1
 . . W LRTEST," = ",$J(^TMP("LR",$J,"TST/CTL",LRMAC,LRTEST),5)
 . . W "    ",$J($FN($S(LRLMAC:^(LRTEST)/LRLMAC,1:0)*100,"",2),5),"%"
 . . I X,$Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 Q
WKLD ;
 Q:'$D(^TMP("LR",$J,"TST"))
 S LRSUBH1="TOTAL WKLD by TESTS: % of GRAND TOTAL"_" ( "_LRSUM_" )"
 I $Y+9>IOSL D PAUSE^LRCAPR4 Q:LREND  W @IOF D HDR1^LRCAPR4
 W !!!,?15,LRSUBH1,!?15,$E(LRDSH,1,$L(LRSUBH1)),!
 S LRTEST=""
 F I=0:1 S LRTEST=$O(^TMP("LR",$J,"TST",LRTEST)) Q:(LRTEST="")!(LREND)  D
 . I 'I#2,$Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 . S X=I#2 W:'X ! W ?X*40+1
 . W $E(LRTEST_"      ",1,8)," = ",$J(^TMP("LR",$J,"TST",LRTEST),5)
 . W " ",$J($FN($S(LRSUM:^(LRTEST)/LRSUM,1:0)*100,"",2),5),"%  "
 Q
STAT ;
 Q:'$D(^TMP("LR",$J,"TST/URG"))
 D:(LRIOPAT["A")!($L(LRIOPAT)>1) STAT1
 D:'LREND STAT2
 Q
STAT1 ; Combined patient type totals
 S LRPTYP="A"
 S LRSUBH1="TOTAL TESTS by 'STAT' URGENCY for  ALL PATIENTS: % of GRAND TOTAL"_" ( "_LRSUM_" )"
 I $Y+9>IOSL D PAUSE^LRCAPR4 Q:LREND  W @IOF D HDR1^LRCAPR4
 W !!!?((80-$L(LRSUBH1))/2),LRSUBH1
 W !?((80-$L(LRSUBH1))/2),$E(LRDSH,1,$L(LRSUBH1))
 I '$D(^TMP("LR",$J,"TST/URG",LRPTYP)) W !!,?30,"NONE FOUND" Q
 S LRURG=""
 F  S LRURG=$O(^TMP("LR",$J,"TST/URG",LRPTYP,LRURG)) Q:(LRURG="")!(LREND)  S LRURGCNT=^(LRURG) D
 . I $Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 . W !!,LRURG,"   =",$J(LRURGCNT,5),"    "
 . W $J($FN($S(LRSUM:LRURGCNT/LRSUM,1:0)*100,"",2),5)_"%"
 . S LRTEST=""
 . F I=0:1 S LRTEST=$O(^TMP("LR",$J,"TST/URG",LRPTYP,LRURG,LRTEST)) Q:(LRTEST="")!(LREND)  D
 . . S X=I#2 W:'X !
 . . W ?X*40+1,$E(LRTEST_"      ",1,8)," = "
 . . W $J(^TMP("LR",$J,"TST/URG",LRPTYP,LRURG,LRTEST),5),"    "
 . . W $J($FN($S(LRURGCNT:^(LRTEST)/LRURGCNT,1:0)*100,"",2),5)_"%"
 . . I X,$Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 Q
STAT2 ; Individual patient type totals
 F LRPTYP="I","O","R" Q:LREND  D
 . S LRSUBH1="TOTAL TESTS by 'STAT' URGENCY for "_$S(LRPTYP="I":"INPATIENTS",LRPTYP="O":"OUTPATIENTS",LRPTYP="R":"OTHER PATIENTS",1:"UNKNOWN PATIENTS")_": % of GRAND TOTAL"_" ( "_LRSUM_" )"
 . I $Y+9>IOSL D PAUSE^LRCAPR4 Q:LREND  W @IOF D HDR1^LRCAPR4
 . W !!!?((80-$L(LRSUBH1))/2),LRSUBH1
 . W !?((80-$L(LRSUBH1))/2),$E(LRDSH,1,$L(LRSUBH1))
 . I '$D(^TMP("LR",$J,"TST/URG",LRPTYP)) W !!,?30,"NONE FOUND" Q
 . S LRURG=""
 . F  S LRURG=$O(^TMP("LR",$J,"TST/URG",LRPTYP,LRURG)) Q:(LRURG="")!(LREND)  S LRURGCNT=^(LRURG) D
 . . I $Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 . . W !!,LRURG,"   =",$J(LRURGCNT,5),"    "
 . . W $J($FN($S(LRSUM:LRURGCNT/LRSUM,1:0)*100,"",2),5)_"%"
 . . S LRTEST=""
 . . F I=0:1 S LRTEST=$O(^TMP("LR",$J,"TST/URG",LRPTYP,LRURG,LRTEST)) Q:(LRTEST="")!(LREND)  D
 . . . S X=I#2 W:'X !
 . . . W ?X*40+1,$E(LRTEST_"      ",1,8)," = "
 . . . W $J(^TMP("LR",$J,"TST/URG",LRPTYP,LRURG,LRTEST),5),"    "
 . . . W $J($FN($S(LRURGCNT:^(LRTEST)/LRURGCNT,1:0)*100,"",2),5)_"%"
 . . . I X,$Y+6>IOSL D UP1^LRCAPR4 Q:LREND
 Q