source: FOIAVistA/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMPFAL0.m@ 1288

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1QAMPFAL0 ;HISC/DAD-PATIENTS WITH MULTIPLE FALL OUTS REPORT ;7/2/92 08:13
2 ;;1.0;Clinical Monitoring System;;09/13/1993
3 K ^UTILITY($J,"QAMPFAL"),^UTILITY($J,"QAM MONITOR")
4 S QAQDIC="^QA(743,",QAQDIC(0)="AEMNQZ",QAQDIC("A")="Select MONITOR: ",QAQUTIL="QAM MONITOR" D EN1^QAQSELCT G:QAQQUIT EXIT
5 K DIR,DIRUT S DIR(0)="NO^1:99:0",DIR("A")="Minimum number of fall outs per patient",DIR("?",1)="Enter the minimum number of fall outs a patient must have",DIR("?")="in order to appear on this report."
6 W ! D ^DIR G:$D(DIRUT) EXIT S QAMINFAL=Y D ^QAQDATE G:QAQQUIT EXIT
7 K %ZIS,IOP S %ZIS="MQ" D ^%ZIS G:POP EXIT
8 I $D(IO("Q")) K IO("Q") S ZTRTN="ENTSK^QAMPFAL0",(ZTSAVE("QAM*"),ZTSAVE("QAQ*"),ZTSAVE("^UTILITY($J,"))="",ZTDESC="Patients with multiple fall outs report" D ^%ZTLOAD G EXIT
9ENTSK ;
10 S QAMONTXT="" F QAMONTXT(0)=0:0 S QAMONTXT=$O(^UTILITY($J,"QAM MONITOR",QAMONTXT)) Q:QAMONTXT="" F QAMONIEN=0:0 S QAMONIEN=$O(^UTILITY($J,"QAM MONITOR",QAMONTXT,QAMONIEN)) Q:QAMONIEN'>0 D LOOP1
11 D ^QAMPFAL1
12EXIT ;
13 W ! D ^%ZISC
14 K %ZIS,DFN,DIR,DIRUT,FALLDATE,MONITOR,PAGE,POP,QAM,QAMCOUNT,QAMD0,QAMDFN,QAMDT,QAMINFAL,QAMNAME,QAMONIEN,QAMONTXT,QAMQUIT,QAMSSN,TODAY,UNDL,VA,X,Y,ZTRTN,ZTSAVE,QAQQUIT,VAERR,^UTILITY($J,"QAMPFAL"),^UTILITY($J,"QAM MONITOR")
15 D K^QAQDATE S:$D(ZTQUEUED) ZTREQ="@"
16 Q
17LOOP1 ;
18 F QAMDT=(QAQNBEG-.0000001):0 S QAMDT=$O(^QA(743.1,"AA",QAMONIEN,QAMDT)) Q:(QAMDT'>0)!(QAMDT>(QAQNEND+.9999999)) F QAMDFN=0:0 S QAMDFN=$O(^QA(743.1,"AA",QAMONIEN,QAMDT,QAMDFN)) Q:QAMDFN'>0 D LOOP2
19 Q
20LOOP2 ;
21 S QAM=$S($D(^DPT(QAMDFN,0))#2:^(0),1:"") Q:QAM="" S QAMNAME=$P(QAM,"^"),QAMCOUNT=0 Q:$D(^UTILITY($J,"QAMPFAL",QAMNAME))
22 S DFN=QAMDFN D PID^VADPT6 S QAMSSN=VA("PID")
23 S ^UTILITY($J,"QAMPFAL",QAMNAME)=QAMSSN
24 F QAMD0=0:0 S QAMD0=$O(^QA(743.1,"B",QAMDFN,QAMD0)) Q:QAMD0'>0 D LOOP3
25 K:QAMCOUNT<QAMINFAL ^UTILITY($J,"QAMPFAL",QAMNAME)
26 Q
27LOOP3 ;
28 S QAM=$S($D(^QA(743.1,QAMD0,0))#2:^(0),1:""),MONITOR=$P(QAM,"^",2),FALLDATE=$P(QAM,"^",3) Q:(MONITOR'>0)!(FALLDATE<QAQNBEG)!(FALLDATE>(QAQNEND+.9999999))
29 S ^UTILITY($J,"QAMPFAL",QAMNAME,FALLDATE,MONITOR,QAMD0)="",QAMCOUNT=QAMCOUNT+1
30 Q
Note: See TracBrowser for help on using the repository browser.