source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORCONSLT.m@ 1111

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

initial load of WorldVistAEHR

File size: 3.1 KB
RevLine 
[613]1ORCONSLT ;SLC/MKB-Consult actions ;6/7/01 07:28
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**4,26,48,68,100**;Dec 17, 1997
3 ; External References
4 ; DBIA 2424 Call to APIs COMMENT, DC, EDTSUB, PS, and RC in
5 ; routine GMRCA1
6 ; DBIA 2425 Call to CPRS^GMRCACTM
7 ; DBIA 2395 Call to FR^GMRCAFRD
8 ; DBIA 2901 Call to SF^GMRCASF
9 ; DBIA 3120 Call to DIS^GMRCDIS
10 ; DBIA 2427 Call to APIs ADDEND and ENTER in routine GMRCTIU
11 ; DBIA 10140 Call to EN^XQORM
12EN ; -- main entry point
13 N ORCMENU,XQORM,Y,ORFLG S VALMBCK=""
14 S ORNMBR=$P(XQORNOD(0),"=",2) D SELECT^ORCHART(ORNMBR)
15 S ORCMENU=$S($$SERVMENU:"SERVICE",1:"USER")
16 S XQORM=+$O(^ORD(101,"B","ORC CONSULT "_ORCMENU_" MENU",0))_";ORD(101,"
17 S XQORM(0)="1AD"_$S(ORCMENU="USER":"",1:"\"),XQORM("A")="Select action: ",XQORM("M")=+$P($G(^ORD(101,+XQORM,4)),U,2)
18 W ! D EN^XQORM G:Y'>0 ENQ
19 X:$D(^ORD(101,+$P(Y(1),U,2),20)) ^(20)
20ENQ D DESELECT^ORCHART(ORNMBR):'$G(OREBUILD)
21 Q
22 ;
23EN1(ORACT) ; -- Action ORACT on consults
24 N ORLK,ORI,NMBR,ORQUIT,ORIDX,ID,GMRCACT,X
25 S VALMBCK="" Q:'$L($G(ORACT))
26 I '$G(ORNMBR) S ORNMBR=$$ORDERS^ORCHART("") Q:'ORNMBR N ORCMENU,ORFLG S ORCMENU=$S($$SERVMENU:"SERVICE",1:"USER")
27 D FREEZE^ORCMENU S VALMBCK="R"
28 F ORI=1:1:$L(ORNMBR,",") S NMBR=$P(ORNMBR,",",ORI) I NMBR,$L($T(@ORACT)) S ORIDX=$G(^TMP("OR",$J,ORTAB,"IDX",NMBR)) D Q:$G(ORQUIT)
29 . S ID=$P(ORIDX,U),X=$P(ORIDX,U,4) Q:'ID D SUBHDR^ORCACT(X)
30 . I (ORACT="CMMT")!(ORACT="PRNT")!(ORACT="EDITRES")!($G(ORFLG(ID))>1) D @ORACT Q
31 . W !,"Insufficient privilege for this service!" H 2
32 I $G(OREBUILD) D TAB^ORCHART(ORTAB,1) S $P(^TMP("OR",$J,"ORDERS",0),U)=""
33 Q
34 ;
35EDITRES ;Edit/Resubmit consult
36 D EDTSUB^GMRCA1(+ID) S OREBUILD=1
37 Q
38REC ; -- Receive consult
39 D RC^GMRCA1(+ID) S OREBUILD=1
40 Q
41 ;
42SCHED ; -- Schedule consult
43 D RC^GMRCA1(+ID,1) S OREBUILD=1
44 Q
45 ;
46RR ; -- Reroute consult
47 D FR^GMRCAFRD(+ID) S OREBUILD=1
48 Q
49 ;
50CMMT ; -- Add comment to consult order
51 D COMMENT^GMRCA1(+ID)
52 Q
53 ;
54COMP ; -- Complete consult
55 ;S GMRCACT="COMPLETE" D DC^GMRCA1(+ID)
56 D ENTER^GMRCTIU(+ID) S OREBUILD=1
57 Q
58 ;
59REMRSLT ; -- Remove Medicine Results
60 I '$L($T(DIS^GMRCDIS)) W !!,"This action is not available yet." H 2 Q
61 D DIS^GMRCDIS(+ID) S OREBUILD=1
62 Q
63 ;
64DC ; -- Discontinue consult
65 S GMRCACT="DISCONTINUE" D DC^GMRCA1(+ID,6) S OREBUILD=1
66 Q
67 ;
68DENY ; -- Deny consult request
69 S GMRCACT="DENY" D DC^GMRCA1(+ID,19) S OREBUILD=1
70 Q
71 ;
72FWD ; -- Forward consult request to other services
73 ;D RR^GMRCAFWD(+ID) S OREBUILD=1
74 W !!,"No longer available." H 1
75 Q
76 ;
77PRNT ; -- Print consult form
78 D PS^GMRCA1(+ID)
79 Q
80 ;
81SIGF ; -- Significant Findings
82 I '$L($T(SF^GMRCASF)) W !!,"This action is not available yet." H 2 Q
83 D SF^GMRCASF(+ID) S OREBUILD=1
84 Q
85 ;
86ADDEND ; -- Make an addendum to the consult result
87 D ADDEND^GMRCTIU(+ID) S OREBUILD=1
88 Q
89 ;
90SERVMENU() ; -- Returns 1 or 0, if user is allowed service menu
91 N NMBR,I,X,Y S X="",Y=0
92 I '$L($T(CPRS^GMRCACTM)) G SMQ
93 F I=1:1:$L(ORNMBR,",") S NMBR=$P(ORNMBR,",",I) I NMBR S X=X_$S($L(X):";",1:"")_+$P($G(^TMP("OR",$J,ORTAB,"IDX",NMBR)),U)
94 G:'$L(X) SMQ D CPRS^GMRCACTM(X) ; builds ORFLG(GMRCIEN)=<menu>
95 S I=0 F S I=$O(ORFLG(I)) Q:I'>0 I ORFLG(I)>1 S Y=1 Q
96SMQ Q Y
Note: See TracBrowser for help on using the repository browser.