source: WorldVistAEHR/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMPRUN0.m@ 1556

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1QAMPRUN0 ;HISC/DAD-AUTO ENROLL MONITOR RUN REPORT ;5/5/93 14:43
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3EN1 ; *** MENU ENTRY POINT
4 D ^QAQDATE G:QAQQUIT EXIT
5 K %ZIS,IOP S %ZIS="MQ" D ^%ZIS G:POP EXIT I $D(IO("Q")) K IO("Q") S ZTDESC="Auto enroll monitor run report",ZTRTN="ENTSK^QAMPRUN0",ZTSAVE("QAM*")="",ZTSAVE("QAQ*")="" D ^%ZTLOAD G EXIT
6ENTSK ;
7 K ^UTILITY($J,"QAMPRUN0") S X=QAQNBEG D H^%DTC S START=%H,X=QAQNEND D H^%DTC S END=%H
8 F QAMDATE=START:1:END S %H=QAMDATE D YMD^%DTC S QAMDT=X D SLOOP1
9 U IO S QAMQUIT=0,%DT="",X="T" D ^%DT X ^DD("DD") S TODAY=Y,PAGE=1 K UNDL S $P(UNDL,"-",80)="-"
10 D HEAD I '$D(^UTILITY($J,"QAMPRUN0")) W !!,"*** NO DATA FOUND FOR THIS REPORT ***" G EXIT
11 F QAMDT=0:0 S QAMDT=$O(^UTILITY($J,"QAMPRUN0",QAMDT)) Q:QAMDT'>0!QAMQUIT D PLOOP1
12EXIT ;
13 W ! D ^%ZISC
14 K %DT,%H,%ZIS,DIR,END,IOP,PAGE,POP,QA,QAM,QAMDATE,QAMDT,QAMMON,QAMQUIT,QAMS0,QAMS1,START,TODAY,UNDL,X,Y,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE D K^QAQDATE
15 S:$D(ZTQUEUED) ZTREQ="@"
16 Q
17SLOOP1 ;
18 S QAMS0=$O(^QA(743.6,"B",QAMDT,0)),Y=QAMDT X ^DD("DD")
19 S ^UTILITY($J,"QAMPRUN0",QAMDT)=$S(QAMS0'>0:Y_"^*** AUTO ENROLL DID NOT RUN FOR THIS DATE ***",1:Y_"^") Q:QAMS0'>0
20 F QAMS1=0:0 S QAMS1=$O(^QA(743.6,QAMS0,1,QAMS1)) Q:QAMS1'>0 D SLOOP2
21 Q
22SLOOP2 ;
23 S QA=^QA(743.6,QAMS0,1,QAMS1,0),QAM=$G(^QA(743,+QA,0)) Q:QAM=""
24 S Y=$P(QA,"^",2) X ^DD("DD") S ^UTILITY($J,"QAMPRUN0",QAMDT,$P(QAM,"^"))=$P(QAM,"^",2)_"^"_Y_"^"_$S($P(QAM,"^",4)'>0:" (m)",1:" (a)")
25 Q
26PLOOP1 ;
27 S QA=^UTILITY($J,"QAMPRUN0",QAMDT) W !!,$P(QA,"^"),?15,$P(QA,"^",2)
28 I $Y>(IOSL-6) D:$E(IOST)="C" PAUSE Q:QAMQUIT D HEAD
29 Q:$P(QA,"^",2)]""
30 S QAMMON="" F QAMMON(0)=0:1 S QAMMON=$O(^UTILITY($J,"QAMPRUN0",QAMDT,QAMMON)) Q:QAMMON=""!QAMQUIT D PLOOP2
31 W:QAMMON(0)'>0 !?2,"*** NO MONITORS RUN ***"
32 Q
33PLOOP2 ;
34 S QA=^UTILITY($J,"QAMPRUN0",QAMDT,QAMMON) W !?2,QAMMON,$P(QA,"^",3),?35,$P(QA,"^"),?68,$P(QA,"^",2) I $Y>(IOSL-6) D:$E(IOST)="C" PAUSE Q:QAMQUIT D HEAD
35 Q
36HEAD ;
37 W:(PAGE>1)!($E(IOST)="C") @IOF
38 W !!?24,"AUTO/MANUAL ENROLL MONITORS RUN",?68,TODAY,!?80-$L(QAQ2HED)/2,QAQ2HED,?68,"PAGE: ",PAGE S PAGE=PAGE+1
39 W !,"AUTO ENROLL RUN DATE",!?2,"MONITOR CODE (a/m=AUTO/MANUAL)",?35,"MONITOR TITLE",?68,"DATE RUN",!,UNDL
40 Q
41PAUSE ;
42 K DIR S DIR(0)="E" D ^DIR S QAMQUIT=$S(Y'>0:1,1:0)
43 Q
44EN2 ; *** AUTO ENROLL ENTRY POINT
45 D 2 S ZTIO=$P($G(^QA(740,1,"QAM")),"^",2) G:ZTIO="" 2 S Y=QAMTODAY X ^DD("DD") S QAQ2HED="FOR "_Y,ZTDESC="Auto enroll monitor run report",ZTRTN="ENTSK^QAMPRUN0",ZTDTH=$H
46 S (ZTSAVE("QAM*"),ZTSAVE("QAQ2HED"))="",(ZTSAVE("QAQNBEG"),ZTSAVE("QAQNEND"))=QAMTODAY D ^%ZTLOAD
472 K ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK
48 Q
Note: See TracBrowser for help on using the repository browser.