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

INHR.m

Go to the documentation of this file.
  1. INHR ;JSH; 22 Dec 93 16:42;Interface - Misc. Reports
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. STATUS ;Message Statistics by status
  1. N:'$D(ZTSK) %DT,INSD,INED,ZTSK
  1. D DATES Q:(INSD<0)!(INED<0)
  1. S ZTRTN="STATZTSK^INHR" D QUEUE Q:$D(ZTSK) D WAIT^DICD
  1. STATZTSK ;TaskMan entry point to print message stats by status
  1. N:'$D(ZTSK) INCNT,S,I,INHD,INI,DUOUT,PAGE
  1. S I=INSD-.0000001,TYPE="STATUS"
  1. F S I=$O(^INTHU("B",I)) Q:'I Q:I>INED S X=0 F S X=$O(^INTHU("B",I,X)) Q:'X S S=$P(^INTHU(X,0),U,3) S:S]"" INCNT(S)=$G(INCNT(S))+1
  1. S INHD(1)=" Status Count"
  1. W:'$D(ZTSK) @IOF D HEAD
  1. S C=$P(^DD(4001,.03,0),U,2)
  1. S INI="" F S INI=$O(INCNT(INI)) Q:INI="" S Y=INI D Y^DIQ W !?3,Y,?35,INCNT(INI)
  1. K:$D(ZTSK) ^%ZTSK(ZTSK)
  1. Q
  1. ;
  1. DEST ;Message statistics by destination
  1. N %DT,INSD,INED,ZTSK
  1. D DATES Q:(INSD<0)!(INED<0)
  1. S ZTRTN="DESTZTSK^INHR" D QUEUE Q:$D(ZTSK) D WAIT^DICD
  1. DESTZTSK ;TaskMan entry point to print message stats by destination
  1. N:'$D(ZTSK) INCNT,S,I,INHD,INI,DUOUT,PAGE
  1. S I=INSD-.0000001,TYPE="DESTINATION"
  1. F S I=$O(^INTHU("B",I)) Q:'I Q:I>INED S X=0 F S X=$O(^INTHU("B",I,X)) Q:'X S S=$P(^INTHU(X,0),U,2) S:S]"" INCNT(S)=$G(INCNT(S))+1
  1. S INHD(1)=" Destination Count"
  1. W:'$D(ZTSK) @IOF D HEAD
  1. S INI="" F S INI=$O(INCNT(INI)) Q:'INI D Q:$G(DUOUT)
  1. . I $Y+3>IOSL D HEAD Q:$G(DUOUT)
  1. . W !?3,$E($P($G(^INRHD(INI,0)),U),1,40),?48,INCNT(INI)
  1. K:$D(ZTSK) ^%ZTSK(ZTSK)
  1. Q
  1. ;
  1. DSTAT ;Message statistics by destination/status
  1. N:'$D(ZTSK) %DT,INSD,INED,ZTSK
  1. D DATES Q:(INSD<0)!(INED<0)
  1. S ZTRTN="DSZTSK^INHR" D QUEUE Q:$D(ZTSK) D WAIT^DICD
  1. DSZTSK ;TaskMan entry point to print message stats by destination/status
  1. N:'$D(ZTSK) INCNT,S1,S2,I,INHD,IND,INS,TOTAL,DEST,DUOUT,PAGE
  1. S I=INSD-.0000001,TYPE="DESTINATION/STATUS"
  1. F S I=$O(^INTHU("B",I)) Q:'I Q:I>INED S X=0 F S X=$O(^INTHU("B",I,X)) Q:'X S S=$P(^INTHU(X,0),U,2,3) S:S?1.N1"^"1.E INCNT(+S,$P(S,U,2))=$G(INCNT(+S,$P(S,U,2)))+1
  1. S INHD(1)=" Destination Status Count"
  1. W:'$D(ZTSK) @IOF D HEAD
  1. S IND="" F S IND=$O(INCNT(IND)) Q:'IND D Q:$G(DUOUT)
  1. . I $Y+3>IOSL D HEAD Q:$G(DUOUT)
  1. . S (D,TOTAL)=0,DEST=$E($P($G(^INRHD(IND,0)),U),1,30) W !?3,DEST
  1. . S INS="" F S INS=$O(INCNT(IND,INS)) Q:INS="" D Q:$G(DUOUT)
  1. .. I $Y+3>IOSL D HEAD Q:$G(DUOUT) W !?3,DEST S D=0
  1. .. S C=$P(^DD(4001,.03,0),U,2),Y=INS D Y^DIQ W:D ! W ?35,$E(Y,1,30),?71,INCNT(IND,INS) S TOTAL=TOTAL+INCNT(IND,INS),D=1
  1. . I $Y+4>IOSL D HEAD Q:$G(DUOUT) W !?3,DEST
  1. . W !?70,"-----",!?63,"Total:",?71,TOTAL
  1. K:$D(ZTSK) ^%ZTSK(ZTSK)
  1. Q
  1. ;
  1. N L,I,X,Y
  1. K DUOUT S PAGE=+$G(PAGE)
  1. I IO=IO(0),'$D(ZTSK),$E(IOST,1,2)="C-",PAGE W !,*7 R X:DTIME S:$E(X)=U DUOUT=1
  1. Q:$G(DUOUT)
  1. W:PAGE @IOF S PAGE=PAGE+1
  1. S L="Interface Message Statics by "_TYPE S Y=INSD D DD^%DT S INSD(1)=Y,Y=INED D DD^%DT S INED(1)=Y
  1. W !?(40-($L(L)\2)),L
  1. S L="Period: "_INSD(1)_" - "_INED(1) W !?(40-($L(L)\2)),L,?(IOM-10),"Page: ",PAGE
  1. I $D(INHD)>9 W ! F I=1:1 Q:'$D(INHD(I)) W !,INHD(I)
  1. W ! K Z S $P(Z,"-",IOM+1)="" W Z
  1. Q
  1. ;
  1. QUEUE ;Select device for output and queue if necessary
  1. K IOP D ^%ZIS Q:POP S IOP=ION_";"_IOST_";"_IOM_";"_IOSL
  1. Q:IO=IO(0)
  1. S ZTIO=IOP
  1. F I="INSD","INED" S ZTSAVE(I)=""
  1. D ^%ZTLOAD W !?5,"Request "_$S($D(ZTSK):"",1:"NOT ")_"QUEUED!" Q
  1. ;
  1. DATES ;Get start/end dates (with time)
  1. S %DT("A")="START of Period: ",%DT="ATE" D ^%DT S INSD=+Y I INSD<0 S INED=-1 Q
  1. S %DT("A")="END of Period: ",%DT="ATE",%DT("B")="NOW" D ^%DT S INED=+Y
  1. S:INED\1=INED INED=INED+.999999
  1. Q