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

ASURQ25P.m

Go to the documentation of this file.
ASURQ25P ; IHS/ITSC/LMH -RPT 25 R & N ITEMS ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine formats and prints report 25, List R & N Items
 ;from sorted extracts.
EN ;EP;PRIMARY ENTRY POINT FOR REPORT 25
 I '$D(IO) D HOME^%ZIS
 I '$D(DUZ(2)) W !,"Report must be run from Kernel option" Q
 I '$D(ASUL(1,"AR","AP")) D SETAREA^ASULARST
 S ASUK("PTRSEL")=$G(ASUK("PTRSEL")) I ASUK("PTRSEL")]"" G PSER
 S ZTRTN="PSER^ASUD25P",ZTDESC="SAMS RPT 25" D O^ASUUZIS
 I POP S IOP=$I D ^%ZIS Q
 I ASUK(ASUK("PTR"),"Q") Q
PSER ;EP;FOR TASKMAN QUEUE OF PRINT
 D:'$D(^XTMP("ASUR","R25")) SORT
 D U^ASUUZIS
 S (ASUC("PG"),ASUMS("E#","STA"))=0,ASUF("BK")=0
 S ASUV("E#","STA")=$O(^XTMP("ASUR","R25",0)) D:$G(ASUV("E#","STA"))]"" ARE^ASULARST($E(ASUV("E#","STA"),1,2)),STA^ASULARST(ASUV("E#","STA"))
 S ASUV("RPT")="R25",ASUQ("HDR")="HEADER^ASURQ25P"
 D ^ASUUDATA I ASUX("NDTA") G K
 S (ASUC("PG"),ASUMS("E#","STA"))=0,ASUF("BK")=""
 F  S ASUMS("E#","STA")=$O(^XTMP("ASUR","R25",ASUMS("E#","STA"))) Q:ASUMS("E#","STA")']""  D  Q:$D(DTOUT)  Q:$D(DUOUT)
 .D ARE^ASULARST($E(ASUMS("E#","STA"),1,2)),STA^ASULARST(ASUMS("E#","STA"))
 .I ASUV("E#","STA")'=ASUMS("E#","STA") D HEADER S ASUV("E#","STA")=ASUMS("E#","STA")
 .S ASUMS("E#","IDX")=0,ASUMS("E#","ARE")=$E(ASUMS("E#","STA"),1,2)
 .F  S ASUMS("E#","IDX")=$O(^XTMP("ASUR","R25",ASUMS("E#","STA"),ASUMS("E#","IDX"))) Q:ASUMS("E#","IDX")']""  D  Q:$D(DUOUT)  Q:$D(DTOUT)
 ..S ASUMX("E#","IDX")=ASUMS("E#","IDX")
 ..D READ^ASUMXDIO,^ASUMSTRD D:ASUF("BK") HEADER Q:$D(DUOUT)  Q:$D(DTOUT)
 ..W !,ASUMX("CAT"),?5,$E(ASUMX("IDX"),1,5),".",$E(ASUMX("IDX"),6),?12,?15,ASUMX("DESC",1),?48,ASUMX("AR U/I"),?52,$J($FN(ASUMS("QTY","O/H"),","),8),?60,$J($FN(ASUMS("CST/U"),",",2),8)
 ..W !?15,ASUMX("DESC",2),! S ASUC("LINE")=$G(ASUC("LINE"))+3 D:ASUC("LINE")>IOSL HEADER
 ..S ASUC("LI")=$G(ASUC("LI"))+1
 .W !!?10,"STATION LINE ITEMS: ",ASUC("LI") S ASUC("TOTLI")=$G(ASUC("TOTLI"))+ASUC("LI") S ASUC("LI")=0
 .I $E(ASUMS("E#","STA"),1,2)'=ASUMS("E#","ARE") W !!,"AREA LINE ITEMS: ",ASUC("TOTLI") S ASUC("TOTLI")=0
 W !!,"AREA LINE ITEMS: ",ASUC("TOTLI") S ASUC("TOTLI")=0
K ;
 K ASUMX,ASUMS,ASURX,ASUX,ASUC,ASUF("BK")
 Q
 S ASUC("PG")=$G(ASUC("PG"))+1,ASUC("LINE")=5
 I ASUC("PG")>1 D PAZ^ASUURHDR Q:$D(DUOUT)  Q:$D(DTOUT)
 W @(IOF),"REPORT #25 PHARMACY QUARTERLY LIST OF R AND N ITEMS",?90,ASUK("DT"),?110,"PAGE",?115,$J($FN(ASUC("PG"),","),7)
 W !,"AREA",?6,ASUL(1,"AR","AP"),?9,ASUL(1,"AR","NM")
 W !,"STAT",?6,ASUL(2,"STA","CD"),?9,ASUL(2,"STA","NM")
 W !,"P   INDEX",?54,"RECORD   UNIT    WHSE    REC/    ADJ   OVERAGES      SHORTAGES"
 W !,"C  NUMBER",?15,"DESCRIPTION",?47,"U/I",?53,"QUANTITY  COST  COUNT   ISSUE   QTY   QTY   VALUE   QTY   VALUE",!
 Q
SORT ;
 K ^XTMP("ASUR","R25")
 S ^XTMP("ASUR","R25",0)=ASUK("DT","FM")+10000_U_ASUK("DT","FM")
 S ASUMS("E#","STA")=0,^XTMP("ASUR","R25",0)=ASUK("DT","FM")
 F  S ASUMS("E#","STA")=$O(^ASUMS(ASUMS("E#","STA"))) Q:ASUMS("E#","STA")'?1N.N  D
 .F ASUMS("E#","IDX")=0:0 S ASUMS("E#","IDX")=$O(^ASUMS(ASUMS("E#","STA"),1,ASUMS("E#","IDX"))) Q:ASUMS("E#","IDX")'?1N.N  D
 ..D ^ASUMSTRD
 ..S ASUMX("E#","IDX")=ASUMS("E#","IDX") D READ^ASUMXDIO
 ..Q:ASUMX("ACC")'=1  Q:$G(ASUMX("DLIDX"))=1
 ..I (ASUMX("CAT")'="N")&(ASUMX("CAT")'="R") Q
 ..S ^XTMP("ASUR","R25",ASUMS("E#","STA"),ASUMS("E#","IDX"))=""
 Q