source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORCHANG3.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1ORCHANG3 ;SLC/MKB - Change view by event ; 08 May 2002 2:12 PM
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**141**;Dec 17, 1997
3 ;
4EVT ; -- Select new event
5 N X,Y,HDR,DOMAIN,DEFAULT,I,PROMPT,HELP,EVT
6 S HDR=$P($G(^TMP("OR",$J,ORTAB,0)),U,3),DEFAULT=""
7 D LIST^OREVNTX(.DOMAIN,+ORVP)
8 I $G(DOMAIN(0))<1 W !,"No events available for this patient.",! H 1 Q
9 F I=1:1:DOMAIN(0) S X=$P(DOMAIN(I),U,2)_" "_$$FMTE^XLFDT($P(DOMAIN(I),U,3),"2P"),DOMAIN("B",$$UP^XLFSTR(X))=I
10 S PROMPT="Select Patient Event: "
11 S HELP="Enter the event whose orders you wish to see listed here."
12 D EN Q:Y="^" S EVT=+$G(DOMAIN(Y))
13 S:EVT $P(HDR,";",3)="",$P(HDR,";",8)=EVT,DEFAULT=""
14 I EVT<1,'$P(HDR,";",3) S DEFAULT=1
15 S $P(^TMP("OR",$J,ORTAB,0),U,3,4)=HDR_U_DEFAULT
16 Q
17 ;
18EN ; -- Select new event via DOMAIN(), PROMPT, DEFAULT, HELP
19 N DONE S DONE=0,Y="" F D Q:DONE
20 . W !,PROMPT_$S($L(DEFAULT):DEFAULT_"//",1:"")
21 . R X:DTIME S:'$T X="^" I X["^" S Y="^",DONE=1 Q
22 . S:X="" X=DEFAULT I X="" S Y="^",DONE=1 Q
23 . I X="@" S Y="",DONE=1 Q
24 . I X["?" W !!,HELP D LIST Q
25 . D I 'Y W $C(7),!,HELP Q
26 . . N XP,XY,CNT,MATCH,DIR,I
27 . . S X=$$UP^XLFSTR(X),Y=+$G(DOMAIN("B",X)) Q:Y ; done
28 . . S CNT=0,XP=X F S XP=$O(DOMAIN("B",XP)) Q:XP="" Q:$E(XP,1,$L(X))'=X S CNT=CNT+1,XY=+DOMAIN("B",XP),MATCH(CNT)=XY_U_$P(DOMAIN(XY),U,2)
29 . . Q:'CNT
30 . . I CNT=1 S Y=+MATCH(1),XP=$P(MATCH(1),U,2) W $E(XP,$L(X)+1,$L(XP)) Q
31 . . S DIR(0)="NAO^1:"_CNT,DIR("A")="Select 1-"_CNT_": "
32 . . F I=1:1:CNT S DIR("A",I)=$J(I,3)_" "_$P(MATCH(I),U,2)
33 . . S DIR("?")="Select the desired value, by number"
34 . . I CNT>3 D FULL^VALM1 S VALMBCK="R" ;need to scroll
35 . . D ^DIR I $D(DIRUT) S Y="" Q
36 . . S Y=+MATCH(Y) W " "_$P(DOMAIN(Y),U,2)
37 . S DONE=1
38 Q
39 ;
40LIST ; -- List order events in DOMAIN
41 N I,Z,CNT,DONE D FULL^VALM1 S VALMBCK="R"
42 S CNT=0 W !,"Choose from:"
43 F I=1:1:DOMAIN(0) D Q:$G(DONE)
44 . S CNT=CNT+1 W ! I CNT>(IOSL-3) D Q:$G(DONE)
45 .. W ?3,"'^' TO STOP: " R Z:DTIME S:'$T!(Z["^") DONE=1 S CNT=1
46 . W $C(13)," "_$P(DOMAIN(I),U,2)_" "_$$FMTE^XLFDT($P(DOMAIN(I),U,3),"2P")
47 Q
Note: See TracBrowser for help on using the repository browser.