source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XQORD.m@ 1608

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1XQORD ; SLC/KCM - Dialog Utility ;11/19/92 08:27 [ 05/08/95 4:16 PM ]
2 ;;8.0;KERNEL;;Jul 10, 1995
3EN D NUL^XQOR2 N DLG,ITM,X,XQORDX ;Process individual prompt
4 S DLG=+^TMP("XQORS",$J,XQORS-1,"VPT"),ITM=+^TMP("XQORS",$J,XQORS-1,"ITM",^TMP("XQORS",$J,XQORS-1,"ITM"),"IEN")
5 S X=$G(^ORD(101,DLG,10,ITM,1)),XQORDX("PRMT")=$P(X,"^",1),XQORDX("DFLT")=$P(X,"^",2),XQORDX("HELP")=$P(X,"^",3),XQORDX("MODE")=$P(X,"^",4)
6 S X=$G(^ORD(101,+XQORNOD,101.04)),XQORDX("DOM")=$P(X,"^",1),XQORDX("PARM")=$P(X,"^",5)
7 S:'$L(XQORDX("PRMT")) XQORDX("PRMT")=$P(X,"^",2) S:'$L(XQORDX("DFLT")) XQORDX("DFLT")=$P(X,"^",3) S:'$L(XQORDX("HELP")) XQORDX("HELP")=$P(X,"^",4)
8 S XQORDLG(ITM,"PRMT")=XQORDX("PRMT")_"^"_XQORDX("MODE"),XQORDLG("SEQ",+^TMP("XQORS",$J,XQORS-1,"ITM"))=ITM
9 I XQORDX("MODE")["E",$D(XQORMSG),XQORMSG="NEW" D G XEN
10 . I '$D(XQORDLG(ITM,1)),$L(XQORDX("DFLT")) S XQORDLG(ITM,1,"I")="",XQORDLG(ITM,1,"E")=XQORDX("DFLT")
11 ;
12 ; -- case prompt type (XQORDX("DOM"))
13 I "DFLNPSY"[XQORDX("DOM") D RDR^XQORD1 G C1
14 I XQORDX("DOM")="W" D WP^XQORD1 G C1
15 I XQORDX("DOM")="M" D MENU^XQORD1 G C1
16C1 ; -- end case prompt type
17 ;
18 ; -- case up-arrow status (X)
19 I $E(X)'="^" D SETANS G C2 ;valid entry
20 S X=$P(X,"^",2) I '$L(X) S XQORPOP=1,XQORDLG=-1 G C2 ;up arrow out
21 I $D(^TMP("XQORS",$J,XQORS-1,"PMT",$$UP(X))) S ^TMP("XQORS",$J,XQORS-1,"ITM")=$O(^($$UP(X),0))-1 G C2 ;full name jump
22 S Y=$O(^TMP("XQORS",$J,XQORS-1,"PMT",$$UP(X))) ;partial name jump
23 I $E(Y,1,$L(X))=$$UP(X) S ^TMP("XQORS",$J,XQORS-1,"ITM")=$O(^TMP("XQORS",$J,XQORS-1,"PMT",Y,0))-1 G C2
24 W " ??" S ^TMP("XQORS",$J,XQORS-1,"ITM")=^TMP("XQORS",$J,XQORS-1,"ITM")-1 ;otherwise...
25C2 ; -- end case up-arrow status
26 ;
27XEN Q ;Exit: XQORDLG(n)=external value of response
28 ;
29SETANS ;Setup answers in array according to type, calling info in X,Y
30 ;Entry: .X is external value, .Y is internal value, XQORDX("DOM") is prompt type
31 S XQORDLG(ITM)=""
32 I $L(Y) DO
33 . ; -- case prompt type (XQORDX("DOM"))
34 . I XQORDX("DOM")="D" D DD^%DT S XQORDLG(ITM)=Y G C3 ;date/Time
35 . I XQORDX("DOM")="F" S XQORDLG(ITM)=Y G C3 ;free Text
36 . I XQORDX("DOM")="L" S XQORDLG(ITM)=X G C3 ;list/Range
37 . I XQORDX("DOM")="N" S XQORDLG(ITM)=Y G C3 ;numeric
38 . I XQORDX("DOM")="P" S XQORDLG(ITM)=$P(Y,"^",2) G C3 ;pointer
39 . I XQORDX("DOM")="S" S XQORDLG(ITM)=Y(0) G C3 ;set
40 . I XQORDX("DOM")="Y" S XQORDLG(ITM)=$S(Y=0:"NO",Y=1:"YES",1:"") G C3 ;yes/no
41 . I XQORDX("DOM")="W" S XQORDLG(ITM)=Y G C3 ;word processing
42 . I XQORDX("DOM")="M" DO G C3 ;menu
43 . . N I S I=0 F S I=$O(Y(I)) Q:I<1 DO
44 . . . S XQORDLG(ITM)=$P(Y(I),"^",3)_","
45 . . S XQORDLG(ITM)=$E(XQORDLG(ITM),1,$L(XQORDLG(ITM))-1)
46C3 . ; -- end case prompt type
47 . ;
48 Q
49UP(X) Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
Note: See TracBrowser for help on using the repository browser.