ORWLRR ;SLC/STAFF- rpc routing for lab results ;10/20/98 14:08
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10**;Dec 17, 1997
;
; this routine simply routes CPRS rpc calls to the appropriate lab routine
;
ALLTESTS(ORY,FROM,DIR) ; from Remote Procedure file
D ALLTESTS^LR7OGO(.ORY,FROM,DIR)
Q
;
ATESTS(ORY,TEST) ; from Remote Procedure file
D ATESTS^LR7OGO(.ORY,TEST)
Q
;
ATG(ORY,TESTGP,USER) ; from Remote Procedure file
D ATG^LR7OGO(.ORY,TESTGP,USER)
Q
;
ATOMICS(ORY,FROM,DIR) ; from Remote Procedure file
D ATOMICS^LR7OGO(.ORY,FROM,DIR)
Q
;
CHART(ORY,DFN,DATE1,DATE2,SPEC,TEST) ; from Remote Procedure file
D CHART^LR7OGC(.ORY,DFN,DATE1,DATE2,SPEC,TEST)
Q
;
CHEMTEST(ORY,FROM,DIR) ; from Remote Procedure file
D CHEMTEST^LR7OGO(.ORY,FROM,DIR)
Q
;
GRID(ORY,DFN,DATE1,DATE2,SPEC,ORTESTS) ; from Remote Procedure file
D GRID^LR7OGG(.ORY,DFN,DATE1,DATE2,SPEC,.ORTESTS)
Q
;
INTERIM(ORY,DFN,DATE1,DATE2) ; Interim Report RPC (All Tests by Date)
N ROOT
S ROOT=$$SET()
I $$REMOTE(.DFN,.ROOT) D INTERIM^LR7OGM(.ORY,DFN,DATE1,DATE2)
D CLEAN(.ORY,.ROOT)
Q
;
INTERIMG(ORY,DFN,DATE1,DIR,FORMAT) ; from Remote Procedure file
D INTERIMG^LR7OGM(.ORY,DFN,DATE1,DIR,$G(FORMAT,1))
Q
;
INTERIMS(ORY,DFN,DATE1,DATE2,ORTESTS) ; from Remote Procedure file
D INTERIMS^LR7OGM(.ORY,DFN,DATE1,DATE2,.ORTESTS)
Q
;
MICRO(ORY,DFN,DATE1,DATE2) ; Micro Report RPC
N ROOT
S ROOT=$$SET()
I $$REMOTE(.DFN,.ROOT) D MICRO^LR7OGM(.ORY,DFN,DATE1,DATE2)
D CLEAN(.ORY,.ROOT)
Q
;
NEWOLD(ORY,DFN) ; from Remote Procedure file
D NEWOLD^LR7OGMU(.ORY,DFN)
Q
;
PARAM(ORY) ; from Remote Procedure file
D PARAM^LR7OGO(.ORY)
Q
;
SPEC(ORY,FROM,DIR) ; from Remote Procedure file
D SPEC^LR7OGO(.ORY,FROM,DIR)
Q
;
TG(ORY,USER) ; from Remote Procedure file
D TG^LR7OGO(.ORY,USER)
Q
;
USERS(ORY,FROM,DIR) ; from Remote Procedure file
D USERS^LR7OGO(.ORY,FROM,DIR)
Q
;
UTGA(ORY,ORTESTS) ; from Remote Procedure file
D UTGA^LR7OGO(.ORY,.ORTESTS)
Q
;
UTGD(ORY,TGRP) ; from Remote Procedure file
D UTGD^LR7OGO(.ORY,TGRP)
Q
;
UTGR(ORY,ORTESTS,TGRP) ; from Remote Procedure file
D UTGR^LR7OGO(.ORY,.ORTESTS,TGRP)
Q
;
INFO(ORY,ORTEST) ; Get Lab test description info
I '$L($T(ONE^LR7OR4)) S ORY(1)="Missing lab API (part of patch LR*5.2*256)" Q
D ONE^LR7OR4(.ORY,.ORTEST)
Q
REMOTE(DFN,ROOT) ;Setup for remote data
N REMOTE,ORGO
S REMOTE=+$P(DFN,";",2),ORGO=1
I 'REMOTE S DFN=+DFN Q ORGO ;DFN = DFN;ICN for remote calls
I REMOTE D
. I '$L($T(GETDFN^MPIF001)) D SETITEM^ORWRP(.ROOT,"MPI routines missing on remote system") S ORGO=0 Q
. S ICN=+$P(DFN,";",2),DFN=+$$GETDFN^MPIF001(ICN)
. I DFN<0 D SETITEM^ORWRP(.ROOT,"Patient not found on remote system") S ORGO=0 Q
. S:'$D(DUZ("AG")) DUZ("AG")="" ;Broker not currently setting agency for remote sites
Q ORGO
SET() ;Shared setup of ROOT node
K ^TMP("ORDATA",$J,"OUTPUT")
S ROOT=$NA(^TMP("ORDATA",$J,"OUTPUT"))
Q ROOT
CLEAN(ORY,ROOT) ;Shared Clean-up
I '$O(@ROOT@(0)) S @ROOT@(1)="",@ROOT@(2)="No Data Found"
I $S($D(ORY):$S('$O(@ORY@(0)):1,1:0),1:$O(@ROOT@(0))) M @ORY=@ROOT
K ^TMP("ORDATA",$J,"OUTPUT")
Q
ORWLRR ;SLC/STAFF- rpc routing for lab results ;10/20/98 14:08
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10**;Dec 17, 1997
+2 ;
+3 ; this routine simply routes CPRS rpc calls to the appropriate lab routine
+4 ;
ALLTESTS(ORY,FROM,DIR) ; from Remote Procedure file
+1 DO ALLTESTS^LR7OGO(.ORY,FROM,DIR)
+2 QUIT
+3 ;
ATESTS(ORY,TEST) ; from Remote Procedure file
+1 DO ATESTS^LR7OGO(.ORY,TEST)
+2 QUIT
+3 ;
ATG(ORY,TESTGP,USER) ; from Remote Procedure file
+1 DO ATG^LR7OGO(.ORY,TESTGP,USER)
+2 QUIT
+3 ;
ATOMICS(ORY,FROM,DIR) ; from Remote Procedure file
+1 DO ATOMICS^LR7OGO(.ORY,FROM,DIR)
+2 QUIT
+3 ;
CHART(ORY,DFN,DATE1,DATE2,SPEC,TEST) ; from Remote Procedure file
+1 DO CHART^LR7OGC(.ORY,DFN,DATE1,DATE2,SPEC,TEST)
+2 QUIT
+3 ;
CHEMTEST(ORY,FROM,DIR) ; from Remote Procedure file
+1 DO CHEMTEST^LR7OGO(.ORY,FROM,DIR)
+2 QUIT
+3 ;
GRID(ORY,DFN,DATE1,DATE2,SPEC,ORTESTS) ; from Remote Procedure file
+1 DO GRID^LR7OGG(.ORY,DFN,DATE1,DATE2,SPEC,.ORTESTS)
+2 QUIT
+3 ;
INTERIM(ORY,DFN,DATE1,DATE2) ; Interim Report RPC (All Tests by Date)
+1 NEW ROOT
+2 SET ROOT=$$SET()
+3 IF $$REMOTE(.DFN,.ROOT)
DO INTERIM^LR7OGM(.ORY,DFN,DATE1,DATE2)
+4 DO CLEAN(.ORY,.ROOT)
+5 QUIT
+6 ;
INTERIMG(ORY,DFN,DATE1,DIR,FORMAT) ; from Remote Procedure file
+1 DO INTERIMG^LR7OGM(.ORY,DFN,DATE1,DIR,$GET(FORMAT,1))
+2 QUIT
+3 ;
INTERIMS(ORY,DFN,DATE1,DATE2,ORTESTS) ; from Remote Procedure file
+1 DO INTERIMS^LR7OGM(.ORY,DFN,DATE1,DATE2,.ORTESTS)
+2 QUIT
+3 ;
MICRO(ORY,DFN,DATE1,DATE2) ; Micro Report RPC
+1 NEW ROOT
+2 SET ROOT=$$SET()
+3 IF $$REMOTE(.DFN,.ROOT)
DO MICRO^LR7OGM(.ORY,DFN,DATE1,DATE2)
+4 DO CLEAN(.ORY,.ROOT)
+5 QUIT
+6 ;
NEWOLD(ORY,DFN) ; from Remote Procedure file
+1 DO NEWOLD^LR7OGMU(.ORY,DFN)
+2 QUIT
+3 ;
PARAM(ORY) ; from Remote Procedure file
+1 DO PARAM^LR7OGO(.ORY)
+2 QUIT
+3 ;
SPEC(ORY,FROM,DIR) ; from Remote Procedure file
+1 DO SPEC^LR7OGO(.ORY,FROM,DIR)
+2 QUIT
+3 ;
TG(ORY,USER) ; from Remote Procedure file
+1 DO TG^LR7OGO(.ORY,USER)
+2 QUIT
+3 ;
USERS(ORY,FROM,DIR) ; from Remote Procedure file
+1 DO USERS^LR7OGO(.ORY,FROM,DIR)
+2 QUIT
+3 ;
UTGA(ORY,ORTESTS) ; from Remote Procedure file
+1 DO UTGA^LR7OGO(.ORY,.ORTESTS)
+2 QUIT
+3 ;
UTGD(ORY,TGRP) ; from Remote Procedure file
+1 DO UTGD^LR7OGO(.ORY,TGRP)
+2 QUIT
+3 ;
UTGR(ORY,ORTESTS,TGRP) ; from Remote Procedure file
+1 DO UTGR^LR7OGO(.ORY,.ORTESTS,TGRP)
+2 QUIT
+3 ;
INFO(ORY,ORTEST) ; Get Lab test description info
+1 IF '$LENGTH($TEXT(ONE^LR7OR4))
SET ORY(1)="Missing lab API (part of patch LR*5.2*256)"
QUIT
+2 DO ONE^LR7OR4(.ORY,.ORTEST)
+3 QUIT
REMOTE(DFN,ROOT) ;Setup for remote data
+1 NEW REMOTE,ORGO
+2 SET REMOTE=+$PIECE(DFN,";",2)
SET ORGO=1
+3 ;DFN = DFN;ICN for remote calls
IF 'REMOTE
SET DFN=+DFN
QUIT ORGO
+4 IF REMOTE
Begin DoDot:1
+5 IF '$LENGTH($TEXT(GETDFN^MPIF001))
DO SETITEM^ORWRP(.ROOT,"MPI routines missing on remote system")
SET ORGO=0
QUIT
+6 SET ICN=+$PIECE(DFN,";",2)
SET DFN=+$$GETDFN^MPIF001(ICN)
+7 IF DFN<0
DO SETITEM^ORWRP(.ROOT,"Patient not found on remote system")
SET ORGO=0
QUIT
+8 ;Broker not currently setting agency for remote sites
IF '$DATA(DUZ("AG"))
SET DUZ("AG")=""
End DoDot:1
+9 QUIT ORGO
SET() ;Shared setup of ROOT node
+1 KILL ^TMP("ORDATA",$JOB,"OUTPUT")
+2 SET ROOT=$NAME(^TMP("ORDATA",$JOB,"OUTPUT"))
+3 QUIT ROOT
CLEAN(ORY,ROOT) ;Shared Clean-up
+1 IF '$ORDER(@ROOT@(0))
SET @ROOT@(1)=""
SET @ROOT@(2)="No Data Found"
+2 IF $SELECT($DATA(ORY):$SELECT('$ORDER(@ORY@(0)):1,1:0),1:$ORDER(@ROOT@(0)))
MERGE @ORY=@ROOT
+3 KILL ^TMP("ORDATA",$JOB,"OUTPUT")
+4 QUIT