source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXLOG.m@ 1476

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

initial load of WorldVistAEHR

File size: 4.5 KB
Line 
1ECXLOG ;ALB/GTS - Extract Log Report for DSS ; 11/2/06 8:38am
2 ;;3.0;DSS EXTRACTS;**84,95,92**;Dec 22, 1997;Build 30
3 ;
4EN ;entry point from option
5 ;Initialize variables
6 N DIR,ECSD1,ECED,X,Y
7 ;Prompt for start date
8 S DIR(0)="D^::EX"
9 S DIR("A")="Enter Report Start Date"
10 D ^DIR
11 I $D(DIRUT) Q
12 S ECSD1=Y
13 ;Prompt for end date
14 K DIR,X,Y
15 S DIR(0)="D^"_ECSD1_":"_DT_":EX"
16 S DIR("A")="Enter Report Ending Date"
17 D ^DIR
18 I $D(DIRUT) Q
19 S ECED=Y
20 ;Queue Report
21 W !!,"** REPORT REQUIRES 132 COLUMNS TO PRINT CORRECTLY **",!!
22 N ZTDESC,ZTIO,ZTSAVE,I
23 S ZTIO=""
24 S ZTDESC="DSS EXTRACT LOG STATISTICS"
25 F I="ECSD1","ECED","ECXNUM","ECXPKG","ECXSET","ECXTXDT","ECXPURGE","ECXTRACT","ECXMONTH","ECXUCONF" D
26 .S ZTSAVE(I)=""
27 D EN^XUTMDEVQ("EN1^ECXLOG",ZTDESC,.ZTSAVE)
28 Q
29 ;
30EN1 ;Tasked entry point
31 ;Input : ECSD1 - FM format report start date
32 ; ECED - FM format report end date
33 ;
34 ;Output : None
35 ;
36 ;Declare variables
37 N LN,PAGENUM,STOP,ECXCT,ECXDACT,ECXNUM,ECXPKG,ECXSET,ECXCOUNT,ECXTXDT
38 N ECXPURGE,ECXTRACT,ECXUMSG,ECXUSER,ECXMONTH,MSGNUM,COUNT,DIC,ECX0,X
39 N ECX1,ECXED1,QFLG
40 S ECXED1=ECED+.9999,ECXCT=ECSD1-.0001,(QFLG,PAGENUM,STOP)=0
41 D HEADER I STOP D EXIT Q
42 D GETDATA
43 I $O(^TMP("ECXDSS",$J,""))="" D Q
44 .W !
45 .W !,"***********************************************"
46 .W !,"* NOTHING TO REPORT FOR SELECTED TIME FRAME *"
47 .W !,"***********************************************"
48 .D WAIT
49 D DETAIL I STOP D EXIT Q
50 K ^TMP("ECXDSS",$J)
51 Q
52 ;
53GETDATA ;Get data
54 F S ECXCT=$O(^ECX(727,"AE",ECXCT)) Q:(ECXCT>ECXED1)!('ECXCT)!(QFLG=1) D
55 .S ECXDACT=0
56 .F S ECXDACT=$O(^ECX(727,"AE",ECXCT,ECXDACT)) Q:('ECXDACT)!(QFLG=1) D
57 ..;Get data nodes
58 ..S ECX0=$G(^ECX(727,ECXDACT,0)),ECX1=$G(^(1))
59 ..Q:ECX0=""
60 ..S ECXNUM=$P(ECX0,U,1),ECXPKG=$E($P(ECX0,U,3),1,13),ECXSET=$E($P(ECX0,U,4),2,7)_"-"_$E($P(ECX0,U,5),2,7),ECXCOUNT=$P(ECX0,U,6),ECXTXDT=$G(^ECX(727,ECXDACT,"TR")),ECXPURGE=$G(^ECX(727,ECXDACT,"PURG")),ECXTRACT=$P(ECX0,U,2),ECXUSER=$P(ECX0,U,7)
61 ..S ECXMONTH=$P($$FMTE^XLFDT($P(ECX0,U,4),"D")," ",1)_" "_$P($$FMTE^XLFDT($P(ECX0,U,4),"D")," ",3)
62 ..;Resolve external values for ECXUSER
63 ..K DIC S DIC="^VA(200,",DIC(0)="NZ",X=ECXUSER D ^DIC
64 ..S ECXUSER=$P($G(Y(0)),U,1)
65 ..;Count number of UNCONF messages in Message number multiple
66 ..S (MSGNUM,COUNT)=0 F S MSGNUM=$O(^ECX(727,ECXDACT,1,MSGNUM)) Q:MSGNUM'>0 D
67 ...S COUNT=COUNT+1
68 ..S ECXUMSG=$G(COUNT)
69 ..;Save for later
70 ..S ^TMP("ECXDSS",$J,ECXPKG,ECXNUM)=ECXNUM_U_ECXPKG_U_ECXSET_U_ECXCOUNT_U_ECXTXDT_U_ECXPURGE_U_ECXTRACT_U_ECXMONTH_U_ECXUMSG_U_ECXUSER
71 ..Q
72 .Q
73 Q
74 ;
75HEADER ;print header
76 S PAGENUM=$G(PAGENUM)+1
77 S $P(LN,"-",132)=""
78 W @IOF
79 W !,?1,"DSS EXTRACT LOG STATISTICS",?120,"Page: ",PAGENUM
80 W !!,?1,"EXTRACT NUMBER",?20,"VISTA PACKAGE",?39,"DATA SET DATES",?59,"RECORD COUNT",?75,"DATE TRANSMITTED",?98,"DATE PURGED"
81 W !,?3,"DATE EXTRACTED",?25,"DATA MONTH",?40,"MSG UNCONF"
82 W ?60,"REQUESTOR"
83 W !?1,LN
84 Q
85 ;
86DETAIL ;Print detailed line
87 ;Input : ^TMP("ECXDSS",$J) full global reference
88 ; ECXNUM - Extract Number
89 ; ECXPKG - VistA Package
90 ; ECXDATA - Data Set
91 ; ECXCOUNT - Record Count
92 ; ECXTXDT - Transmission Date
93 ; ECXPURGE - Extract Purge Date
94 ; ECXTRACT - Extract Date
95 ; ECXMONTH - Data Month and Year
96 ; ECXUCONF - Unconfirmed Messages
97 ; ECXUSER - Requestor
98 ;Output : None
99 ;
100 N NODE,PACKAGE,NUMBER
101 S PACKAGE="" F S PACKAGE=$O(^TMP("ECXDSS",$J,PACKAGE)) Q:PACKAGE=""!(STOP) D Q:STOP
102 .S NUMBER=0 F S NUMBER=$O(^TMP("ECXDSS",$J,PACKAGE,NUMBER)) Q:'NUMBER!(STOP) D Q:STOP
103 ..S NODE=^TMP("ECXDSS",$J,PACKAGE,NUMBER)
104 ..W !!,?1,$P(NODE,U,1),?20,$P(NODE,U,2),?39,$P(NODE,U,3),?59,$P(NODE,U,4),?75,$$FMTE^XLFDT($P(NODE,U,5),"D"),?98,$$FMTE^XLFDT($P(NODE,U,6),"D")
105 ..W !,?3,$$FMTE^XLFDT($P(NODE,U,7),"D"),?25,$P(NODE,U,8),?40,$P(NODE,U,9),?60,$P(NODE,U,10)
106 ..I $Y>(IOSL-5) D WAIT Q:STOP D HEADER
107 ..Q
108 Q
109 ;
110WAIT ;End of page logic
111 ;Input ; None
112 ;Output ; STOP - Flag indicating if printing should continue
113 ; 1 = Stop 0 = Continue
114 ;
115 S STOP=0
116 ;CRT - Prompt for continue
117 I $E(IOST,1,2)="C-"&(IOSL'>24) D Q
118 .F Q:$Y>(IOSL-3) W !
119 .N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
120 .S DIR(0)="E"
121 .D ^DIR
122 .S STOP=$S(Y'=1:1,1:0)
123 ;Background task - check taskman
124 S STOP=$$S^%ZTLOAD()
125 I STOP D
126 .W !,"*********************************************"
127 .W !,"* PRINTING OF REPORT STOPPED AS REQUESTED *"
128 .W !,"*********************************************"
129 Q
130EXIT ;Kill temp global
131 K ^TMP("ECXDSS",$J)
132 Q
Note: See TracBrowser for help on using the repository browser.