Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORCONSLT

ORCONSLT.m

Go to the documentation of this file.
  1. ORCONSLT ;SLC/MKB-Consult actions ;6/7/01 07:28
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**4,26,48,68,100**;Dec 17, 1997
  1. ; External References
  1. ; DBIA 2424 Call to APIs COMMENT, DC, EDTSUB, PS, and RC in
  1. ; routine GMRCA1
  1. ; DBIA 2425 Call to CPRS^GMRCACTM
  1. ; DBIA 2395 Call to FR^GMRCAFRD
  1. ; DBIA 2901 Call to SF^GMRCASF
  1. ; DBIA 3120 Call to DIS^GMRCDIS
  1. ; DBIA 2427 Call to APIs ADDEND and ENTER in routine GMRCTIU
  1. ; DBIA 10140 Call to EN^XQORM
  1. EN ; -- main entry point
  1. N ORCMENU,XQORM,Y,ORFLG S VALMBCK=""
  1. S ORNMBR=$P(XQORNOD(0),"=",2) D SELECT^ORCHART(ORNMBR)
  1. S ORCMENU=$S($$SERVMENU:"SERVICE",1:"USER")
  1. S XQORM=+$O(^ORD(101,"B","ORC CONSULT "_ORCMENU_" MENU",0))_";ORD(101,"
  1. S XQORM(0)="1AD"_$S(ORCMENU="USER":"",1:"\"),XQORM("A")="Select action: ",XQORM("M")=+$P($G(^ORD(101,+XQORM,4)),U,2)
  1. W ! D EN^XQORM G:Y'>0 ENQ
  1. X:$D(^ORD(101,+$P(Y(1),U,2),20)) ^(20)
  1. ENQ D DESELECT^ORCHART(ORNMBR):'$G(OREBUILD)
  1. Q
  1. ;
  1. EN1(ORACT) ; -- Action ORACT on consults
  1. N ORLK,ORI,NMBR,ORQUIT,ORIDX,ID,GMRCACT,X
  1. S VALMBCK="" Q:'$L($G(ORACT))
  1. I '$G(ORNMBR) S ORNMBR=$$ORDERS^ORCHART("") Q:'ORNMBR N ORCMENU,ORFLG S ORCMENU=$S($$SERVMENU:"SERVICE",1:"USER")
  1. D FREEZE^ORCMENU S VALMBCK="R"
  1. 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)
  1. . S ID=$P(ORIDX,U),X=$P(ORIDX,U,4) Q:'ID D SUBHDR^ORCACT(X)
  1. . I (ORACT="CMMT")!(ORACT="PRNT")!(ORACT="EDITRES")!($G(ORFLG(ID))>1) D @ORACT Q
  1. . W !,"Insufficient privilege for this service!" H 2
  1. I $G(OREBUILD) D TAB^ORCHART(ORTAB,1) S $P(^TMP("OR",$J,"ORDERS",0),U)=""
  1. Q
  1. ;
  1. EDITRES ;Edit/Resubmit consult
  1. D EDTSUB^GMRCA1(+ID) S OREBUILD=1
  1. Q
  1. REC ; -- Receive consult
  1. D RC^GMRCA1(+ID) S OREBUILD=1
  1. Q
  1. ;
  1. SCHED ; -- Schedule consult
  1. D RC^GMRCA1(+ID,1) S OREBUILD=1
  1. Q
  1. ;
  1. RR ; -- Reroute consult
  1. D FR^GMRCAFRD(+ID) S OREBUILD=1
  1. Q
  1. ;
  1. CMMT ; -- Add comment to consult order
  1. D COMMENT^GMRCA1(+ID)
  1. Q
  1. ;
  1. COMP ; -- Complete consult
  1. ;S GMRCACT="COMPLETE" D DC^GMRCA1(+ID)
  1. D ENTER^GMRCTIU(+ID) S OREBUILD=1
  1. Q
  1. ;
  1. REMRSLT ; -- Remove Medicine Results
  1. I '$L($T(DIS^GMRCDIS)) W !!,"This action is not available yet." H 2 Q
  1. D DIS^GMRCDIS(+ID) S OREBUILD=1
  1. Q
  1. ;
  1. DC ; -- Discontinue consult
  1. S GMRCACT="DISCONTINUE" D DC^GMRCA1(+ID,6) S OREBUILD=1
  1. Q
  1. ;
  1. DENY ; -- Deny consult request
  1. S GMRCACT="DENY" D DC^GMRCA1(+ID,19) S OREBUILD=1
  1. Q
  1. ;
  1. FWD ; -- Forward consult request to other services
  1. ;D RR^GMRCAFWD(+ID) S OREBUILD=1
  1. W !!,"No longer available." H 1
  1. Q
  1. ;
  1. PRNT ; -- Print consult form
  1. D PS^GMRCA1(+ID)
  1. Q
  1. ;
  1. SIGF ; -- Significant Findings
  1. I '$L($T(SF^GMRCASF)) W !!,"This action is not available yet." H 2 Q
  1. D SF^GMRCASF(+ID) S OREBUILD=1
  1. Q
  1. ;
  1. ADDEND ; -- Make an addendum to the consult result
  1. D ADDEND^GMRCTIU(+ID) S OREBUILD=1
  1. Q
  1. ;
  1. SERVMENU() ; -- Returns 1 or 0, if user is allowed service menu
  1. N NMBR,I,X,Y S X="",Y=0
  1. I '$L($T(CPRS^GMRCACTM)) G SMQ
  1. 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)
  1. G:'$L(X) SMQ D CPRS^GMRCACTM(X) ; builds ORFLG(GMRCIEN)=<menu>
  1. S I=0 F S I=$O(ORFLG(I)) Q:I'>0 I ORFLG(I)>1 S Y=1 Q
  1. SMQ Q Y