source: WorldVistAEHR/trunk/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMAHO1.m@ 1154

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

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1QAMAHO1 ;HISC/GJC-REPORTS FOR FALLOUT FILE ;11/15/94 13:47
2 ;;1.0;Clinical Monitoring System;**3**;09/13/1993
3 ;
4 D KILL,HOME^%ZIS S (CNT,CNTR,QAMEXIT)=0
5 F QAM0=0:0 D ASKSRT Q:QAMOUT
6 I QAMEXIT D KILL Q
7 K CHOICE F QAM0=0:0 D ASKPRT Q:QAMOUT
8 I $D(PARRY),$D(SARRY) D ^QAMAHO3
9KILL F QA="DATE","DLMNT","ELEMENT","IEN","MON","PAT","SUB","TEMP" K ^UTILITY($J,"QAM "_QA)
10 K %,%DT,CD,CNT,CNTR,DATA1,DATA2,DIR,DIRUT,DIW,DIWF,DIWI,DIWL,DIWR,DIWT,DIWTC,DIWX,DN,DTOUT,DUP,DUOUT,EF,ELEM,FIELD,GC,IEN,JD,LABEL1,LABEL2,LIMIT,LOOP,LP,LP0,LP1,MN,MN1
11 K MON,MON1,MON2,MONI,NAME1,NAME2,PAGE,PARRY,PCPY,PNT,POP,PRNT,PTNT,QA,QAM0,QAM1,QAM2,QAMD0,QAMDATA,QAMDIEN,QAMDT,QAMEXIT,QAMFIN,QAML,QAMLP,QAMOUT,QAMPT,QAMQUIT,QAQQUIT,QAMTYPE
12 K QAM1HED,QAM2HED,QAMENGD,QAQNBEG,QAQNEND,QAMRANG,QAMTART,QAMX,SARRY,SCPY,SORT,SUB,SUB1,SUB2,TODAY,YZ,ZTSAVE,Z,ZZZ,ELEMENT,QAMCD,SARRAY,QAQQUIT,QAMELEM,CHOICE,PARRAY,QA,X1,X2,C,QADIRPNT
13 D K^QAQDATE S:$D(ZTQUEUED) ZTREQ="@"
14 Q
15ASKSRT ;
16 S QAMOUT=0,LIMIT=4
17 W:CNTR'=2 @IOF W:CNTR=0 !!?15,"Enter the fields you wish to sort on. "
18 I CNTR=2 W !!?15,"Maximum of two sort fields reached!!",*7 R ZZZ:3 S QAMOUT=1 Q
19 I CNTR>0 W !?15,"Select next field to sort on. "
20 W !?15,"Maximum two sort fields allowed." W:CNTR>0 !?15,"* indicates already selected." D DISP W !!?15,"Sort selection #",CNTR+1_": "
21 R SORT:DTIME
22 I 'CNTR,(SORT="") D VOID G ASKSRT:%=2 W:QAMOUT !!?15,*7,"Exiting without a report." Q:QAMOUT
23 S:SORT="" QAMOUT=1 S:SORT["^" (QAMEXIT,QAMOUT)=1 Q:QAMOUT!(QAMEXIT)
24 I SORT'?1N.N!(SORT<1)!(SORT>4) D MSSG G ASKSRT
25 S CNTR=CNTR+1,FIELD=$P($T(ZFLDS+SORT),U,2) D CHSRT G:SCPY ASKSRT S SARRY(CNTR)=+FIELD
26 D PAT^QAMAHO2:SORT=1,MON^QAMAHO2:SORT=2,EVENT^QAMAHO5:SORT=3,DLMNT^QAMAHO2:SORT=4
27 I QAMOUT K SARRY(CNTR),SARRAY(CNTR),CHOICE(+FIELD) S CNTR=CNTR-$S(CNTR:1,1:0) G ASKSRT
28 S SARRAY(CNTR)=$P(FIELD," ",2,99),CHOICE(+FIELD)=CNTR S:SORT=4 SARRAY(CNTR)=QAMDATA
29 Q
30ASKPRT ;
31 S QAMOUT=0,LIMIT=4
32 W:CNT'=4 @IOF W:CNT=0 !!?15,"Enter the fields you wish to print."
33 I CNT=4 W !!?15,"Maximum of four print fields reached!!",*7 R ZZZ:3 S QAMOUT=1 Q
34 I CNT>0 W !?15,"Select next field to print on. "
35 W !?15,"Maximum four print fields allowed. " W:CNT>0 !?15,"* indicates already selected." D DISP W !!?15,"Print selection # ",CNT+1_": "
36 R PRNT:DTIME
37 I 'CNT,(PRNT="") D VOID G ASKPRT:%=2 W:QAMOUT !!?15,*7,"Exiting without a report." Q:QAMOUT
38 S:PRNT="" QAMOUT=1 S:PRNT["^" (QAMEXIT,QAMOUT)=1 Q:QAMOUT!(QAMEXIT)
39 I PRNT'?1N.N!(PRNT<1)!(PRNT>4) D MSSG G ASKPRT
40 S CNT=CNT+1,FIELD=$P($T(ZFLDS+PRNT),U,2) D CHPRT G:PCPY ASKPRT S PARRY(CNT)=+FIELD,(PARRAY(+FIELD),CHOICE(+FIELD))=CNT
41 I PRNT=4 S QAQDIC="^QA(743.4,",QAQDIC(0)="AEMNQZ",QAQDIC("A")="Select DATA ELEMENT: ",QAQUTIL="QAM ELEMENT" D EN1^QAQSELCT I QAQQUIT K PARRY(CNT),CHOICE(+FIELD) S CNT=CNT-$S(CNT:1,1:0),(QAMQUIT,QAQQUIT)=0
42 Q
43CHPRT ;
44 S PCPY=0 F LP=1:1:CNT I $D(PARRY(LP)),(PARRY(LP)=+FIELD) S PCPY=1,CNT=CNT-$S(CNT:1,1:0) Q
45 W:PCPY !!?5,*7,"You have previously chosen `",$P(FIELD," ",2,99),"' to print. " R:PCPY ZZZ:3
46 Q
47CHSRT ;
48 S SCPY=0 F LP=1:1:CNTR I $D(SARRY(LP)),(SARRY(LP)=+FIELD) S SCPY=1,CNTR=CNTR-$S(CNTR:1,1:0) Q
49 W:SCPY !!?5,*7,"You have previously chosen `",$P(FIELD," ",2,99),"' to sort on. " R:SCPY ZZZ:3
50 Q
51DISP ;
52 W ! F QAML=1:1:2 S X=$P($T(ZFLDS+QAML),U,2) W !,+X,$S($D(CHOICE(+X))#2:" * ",1:" "),$P(X," ",2) S X=$P($T(ZFLDS+QAML+2),U,2) W ?40,+X,$S($D(CHOICE(+X))#2:" * ",1:" "),$P(X," ",2)
53 Q
54MSSG ;
55 W *7," ??",!!?15,"Enter a number between 1 - "_LIMIT_". " R ZZZ:3
56 Q
57VOID ;
58 W !!?15,*7,"You have not selected any sort or print data.",!?15,"Do you wish to exit the program" K DTOUT S %=1 D YN^DICN I (%=1)!(%=-1) S (QAMEXIT,QAMOUT)=1
59 I %=0 W !,*7,?15,"""Y"" for Yes, ""N"" for No " G VOID
60 Q
61ZFLDS ;;
62 ;;^1 Patient Name
63 ;;^2 Monitor
64 ;;^3 Event Date
65 ;;^4 Data Element
Note: See TracBrowser for help on using the repository browser.