source: WorldVistAEHR/trunk/r/VISTALINK-XOBV/XOBVRM.m@ 1361

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1XOBVRM ;; mjk/alb - VistaLink Request Manager ; 07/27/2002 13:00
2 ;;1.5;VistALink;;Sep 09, 2005
3 ;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
4 ;
5 QUIT
6 ;
7 ; --------------------------------------------------------------------------------
8 ; Request Manager
9 ; --------------------------------------------------------------------------------
10 ;
11EN(XOBROOT,XOBDATA,XOBHDLR) ; -- main entry point for Request Manager
12 NEW XOBOK,XOBOPT
13 SET XOBOK=0
14 ;
15 ; -- if 'current' request handler is not defined then parse xml global buffer
16 ; Note: 'Current' request handler could be define already via proprietary format reader
17 IF $GET(XOBHDLR)="" SET XOBOPT="" DO EN^XOBVRMX(XOBROOT,.XOBOPT,.XOBDATA,.XOBHDLR)
18 ;
19 ; -- default single call processing if not specified by request handler
20 IF $GET(XOBDATA("MODE"),"single call")="single call" SET XOBSTOP=1
21 ;
22 ; -- check if request handler info was successfully initialized / if not, throw exception
23 SET XOBHDLR=+$GET(XOBHDLR)
24 IF '$GET(XOBHDLR(XOBHDLR)) DO GOTO ENQ
25 . DO RMERR(184001,$GET(XOBHDLR(XOBHDLR,"ERROR"),"Request Manager not defined"))
26 . SET XOBOK=0
27 ;
28 ; -- do authtentication check for message type?
29 IF $GET(XOBHDLR(XOBHDLR,"AUTHENTICATE")) DO
30 . SET XOBOK=$$LOGGEDON^XOBSCAV()
31 ELSE DO
32 . SET XOBOK=1
33 ;
34 ; -- call request handler
35 IF XOBOK XECUTE $GET(XOBHDLR(XOBHDLR,"REQHDLR"))
36 ;
37ENQ ;
38 QUIT XOBOK
39 ;
40 ; ----------------------------------------------------------------------------------
41 ; Request Manager Error Handler
42 ; ----------------------------------------------------------------------------------
43RMERR(XOBCODE,XOBMSG) ; -- send request error message
44 NEW XOBDAT
45 SET XOBDAT("MESSAGE TYPE")=3
46 SET XOBDAT("ERRORS",1,"FAULT STRING")="System Error"
47 SET XOBDAT("ERRORS",1,"FAULT ACTOR")="Request Manager"
48 SET XOBDAT("ERRORS",1,"CODE")=XOBCODE
49 SET XOBDAT("ERRORS",1,"ERROR TYPE")="Request Manager"
50 SET XOBDAT("ERRORS",1,"CDATA")=0
51 SET XOBDAT("ERRORS",1,"MESSAGE",1)=$$EZBLD^DIALOG(XOBCODE,XOBMSG)
52 DO ERROR^XOBVLIB(.XOBDAT)
53 DO ^%ZTER
54 QUIT
55 ;
Note: See TracBrowser for help on using the repository browser.