source: FOIAVistA/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGMTHLP.m@ 1553

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1RGMTHLP ;BIR/CML-MPI/PD HL7 MESSAGE STATUS REPORT ;12/12/00
2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**21**;30 Apr 99
3 S QFLG=1
4CHK ;
5 I '$D(^XTMP("RGMT","HL")) D G QUIT
6 .W !!,$C(7),"The option ""Compile MPI/PD HL7 Data"" must have"
7 .W !,"run to completion before this report can be printed!"
8 I '$D(^XTMP("RGMT","HL","@@@@","STOPPED")) D G QUIT
9 .W !!,$C(7),"The option ""Compile MPI/PD HL7 Data"" is currently running."
10 .W !,"This report cannot be generated until the compile has run to completion."
11 .W !!,"Please try again later.",!
12 W @IOF
13 I $D(^XTMP("RGMT","HL","@@@@","RANGE")) D
14 .W !!,"Data has been compiled for ",^XTMP("RGMT","HL","@@@@","RANGE"),"."
15 .W !,"Use the ""Compile MPI/PD HL7 Data"" option if this range is not sufficient."
16 ;
17REP ;Ask for type of report
18 K DIR,DIRUT,DTOUT,DUOUT
19 W !!
20 S DIR(0)="SAM^D:Detailed;S:Summary;"
21 S DIR("A")="Select TYPE of Report - (D)etailed or (S)ummary: "
22 D ^DIR K DIR G:$D(DIRUT) QUIT
23 G:Y="D" ^RGMTHLPD
24 ;
25BEGIN ; Produce SUMMARY Report
26 W !!,"This option allows you to print information found during the ""Compile MPI/PD"
27 W !,"HL7 Data"" compilation. The report is sorted by RELATED EVENT PROTOCOL, date,"
28 W !,"transmission type, and status. The total number of messages for each date,"
29 W !,"transmission type, and status are displayed."
30 ;
31ASK1 ;Ask for Date Range
32 W !!,"Enter date range for data to be included in report."
33 K DIR,DIRUT,DTOUT,DUOUT
34 S DIR(0)="DAO^:DT:EPX",DIR("A")="Beginning Date for Report: "
35 D ^DIR K DIR G:$D(DIRUT) QUIT S RGBDT=Y
36 S DIR(0)="DAO^"_RGBDT_":DT:EPX"
37 S DIR("A")="Ending Date for Report: "
38 D ^DIR K DIR G:$D(DIRUT) QUIT S RGEDT=Y
39 ;
40DEV ;
41 W !!,"The right margin for this report is 80.",!!
42 S ZTSAVE("RGBDT")="",ZTSAVE("RGEDT")=""
43 D EN^XUTMDEVQ("START^RGMTHLP","MPI/PD - Print HL7 Message Status (SUMMARY)") I 'POP Q
44 W !,"NO DEVICE SELECTED OR REPORT PRINTED!!"
45 G QUIT
46 ;
47START ;Print report
48 S (PG,QFLG)=0,U="^",$P(LN,"-",81)="",SITE=$P($$SITE^VASITE(),U,2)
49 S PRGBDT=$$FMTE^XLFDT(RGBDT),PRGEDT=$$FMTE^XLFDT(RGEDT)
50 D NOW^%DTC S HDT=$$FMTE^XLFDT($E(%,1,12))
51 D HDR
52 S STOPDT=RGEDT_".9"
53 S REPNM="@@@@"
54 F S REPNM=$O(^XTMP("RGMT","HL",REPNM)) Q:REPNM="" Q:QFLG D
55 .D:$Y+3>IOSL HDR Q:QFLG
56 .W !!,REPNM,":" D
57 ..S RGDT=RGBDT-.1
58 ..F S RGDT=$O(^XTMP("RGMT","HL",REPNM,RGDT)) Q:'RGDT Q:RGDT>STOPDT Q:QFLG D
59 ...D:$Y+4>IOSL HDR Q:QFLG
60 ...W !!?4,$$FMTE^XLFDT(RGDT) D
61 ....S TYPE="",TYPECNT=0
62 ....F S TYPE=$O(^XTMP("RGMT","HL",REPNM,RGDT,TYPE)) Q:TYPE="" Q:QFLG D
63 .....S TYPECNT=TYPECNT+1
64 .....W:TYPE="O"&(TYPECNT>1) !
65 .....W ?25,$S(TYPE="O":"OUTGOING",1:"INCOMING") S TOTCNT=0 D
66 ......S STATCNT=0,STAT=""
67 ......F S STAT=$O(^XTMP("RGMT","HL",REPNM,RGDT,TYPE,STAT)) Q:STAT="" Q:QFLG D
68 .......W:STATCNT>0 !
69 .......S STATCNT=STATCNT+1
70 .......W ?41,STAT S CNT=0 D W ?69,$J(CNT,6) S TOTCNT=TOTCNT+CNT
71 ........S IEN=0
72 ........F S IEN=$O(^XTMP("RGMT","HL",REPNM,RGDT,TYPE,STAT,IEN)) Q:'IEN Q:QFLG S CNT=CNT+1
73 ......I STATCNT>1 W !?69,"-------",!?59,"TOTAL",?69,$J(TOTCNT,6),!
74 ;
75QUIT ;
76 I $E(IOST)="C"&('QFLG) S DIR(0)="E" D D ^DIR K DIR
77 .S SS=22-$Y F JJ=1:1:SS W !
78 K %,CNT,HDT,IEN,IEN0,JJ,LN,MSGID,PG,PRGBDT,PRGEDT,QFLG,REP,REPNM,RGBDT
79 K RGDT,RGEDT,SITE,SS,STAT,STATCNT,STATNM,STOPDT,TOTCNT,TYPE,TYPECNT,X,Y,ZTSK
80 W:$E(IOST)'="C" @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
81 Q
82 ;
83HDR ;HEADER
84 I $E(IOST)="C" S SS=22-$Y F JJ=1:1:SS W !
85 I $E(IOST)="C",PG>0 S DIR(0)="E" W ! D ^DIR K DIR I 'Y S QFLG=1 Q
86 S PG=PG+1 W:$Y!($E(IOST)="C") @IOF
87 W !,"MPI/PD HL7 MESSAGE STATUS REPORT - SUMMARY (",PRGBDT," to ",PRGEDT,")"
88 W ?72,"Page: ",PG,!,"Printed at ",SITE," on ",HDT
89 W !!,"RELATED EVENT PROTOCOL",!?23,"TRANSMISSION",!?4,"DATE",?27,"TYPE"
90 W ?41,"STATUS",?69,"TOTAL",!,LN
91 Q
Note: See TracBrowser for help on using the repository browser.