ECOB31 ;BP/CMF - User Last Used Parameters Object
;;2.0;EVENT CAPTURE;**100**;8 May 96;Build 21
;@author - Chris Flegel
;@date - 17 May 2009
;@version - 1.0
;;
Q
;; private methods
;;
;; protected methods
LOAD(RESULT,HANDLE,PARAMS) ;
N ECUSER,ECPARAM,X
D METHOD(.ECUSER,HANDLE_".GetIen")
;;
S ECPARAM=$$GET^XPAR("USR","EC LAST CLINIC",ECUSER,"E")
D METHOD(.X,HANDLE_".SetClinic."_ECPARAM)
;;
S ECPARAM=$$GET^XPAR("USR","EC LAST LOCATION",ECUSER,"E")
D METHOD(.X,HANDLE_".SetLocation."_ECPARAM)
;;
S ECPARAM=$$GET^XPAR("USR","EC LAST PRINTER",ECUSER,"E")
D METHOD(.X,HANDLE_".SetPrinter."_ECPARAM)
;;
S RESULT=1
Q
;;
SAVE(RESULT,HANDLE,PARAMS) ;
N ECUSER,ECPARAM,ECERR
D METHOD(.ECUSER,HANDLE_".GetIen")
;;
D METHOD(.ECPARAM,HANDLE_".GetClinic")
D EN^XPAR("USR","EC LAST CLINIC",ECUSER,ECPARAM,.ECERR)
;;
D METHOD(.ECPARAM,HANDLE_".GetLocation")
D EN^XPAR("USR","EC LAST LOCATION",ECUSER,ECPARAM,.ECERR)
;;
D METHOD(.ECPARAM,HANDLE_".GetPrinter")
D EN^XPAR("USR","EC LAST PRINTER",ECUSER,ECPARAM,.ECERR)
;;
S RESULT=$S($D(ECERR):0,1:1)
Q
;; public methods
CREATE(NAME) ;
; call parent first
N HANDLE,X,CHILD
S HANDLE=$$CREATE^ECOB3(NAME)
D METHOD(.X,HANDLE_".of.Set_class.EC OBU LAST USED")
D METHOD(.X,HANDLE_".of.Set_name.User Last Used")
D METHOD(.X,HANDLE_".of.Set_routine.METHOD^ECOB31(.RESULT,ARGUMENT)")
;;
D METHOD(.CHILD,HANDLE_".Methods.Add.Load")
D METHOD(.X,CHILD_".mf.SetAddedByClass.User Last Used")
D METHOD(.X,CHILD_".mf.SetDescription.Access Kernel Params of last used.")
D METHOD(.X,CHILD_".mf.SetHandler.LOAD^ECOB31(.RESULT,HANDLE,PARAMS)")
D METHOD(.X,CHILD_".mf.SetParams.")
D METHOD(.X,CHILD_".mf.SetReturns.1")
;;
D METHOD(.CHILD,HANDLE_".Methods.Add.Save")
D METHOD(.X,CHILD_".mf.SetAddedByClass.User Last Used")
D METHOD(.X,CHILD_".mf.SetDescription.Persist Kernel Params of last used.")
D METHOD(.X,CHILD_".mf.SetHandler.SAVE^ECOB31(.RESULT,HANDLE,PARAMS)")
D METHOD(.X,CHILD_".mf.SetParams.")
D METHOD(.X,CHILD_".mf.SetReturns.1")
;;
D METHOD(.CHILD,HANDLE_".Properties.Add.Location")
D METHOD(.X,CHILD_".pf.SetAddedByClass.EC OBU LAST USED")
D METHOD(.X,CHILD_".pf.SetValue.")
D METHOD(.X,CHILD_".pf.SetDefaultValue.")
;
D METHOD(.CHILD,HANDLE_".Properties.Add.Clinic")
D METHOD(.X,CHILD_".pf.SetAddedByClass.EC OBU LAST USED")
D METHOD(.X,CHILD_".pf.SetValue.")
D METHOD(.X,CHILD_".pf.SetDefaultValue.")
;
D METHOD(.CHILD,HANDLE_".Properties.Add.Printer")
D METHOD(.X,CHILD_".pf.SetAddedByClass.EC OBU LAST USED")
D METHOD(.X,CHILD_".pf.SetValue.")
D METHOD(.X,CHILD_".pf.SetDefaultValue.")
;
; complex properties last
D METHOD(.X,HANDLE_".Root.Add.EC OBU LAST USED")
;
I $G(DUZ)'="" D
.D METHOD(.X,HANDLE_".SetIen."_DUZ)
.D METHOD(.X,HANDLE_".Load")
.Q
I $G(XQUSER)'="" D METHOD(.X,HANDLE_".SetName."_XQUSER)
Q HANDLE
;;
DESTROY(HANDLE) ;
; call parent last
N X
D METHOD(.X,HANDLE_".Save")
Q $$DESTROY^ECOB3(HANDLE)
;;
METHOD(RESULT,ARGUMENT) ;
; call parent last
D METHOD^ECOBU(.RESULT,ARGUMENT) ;parent method
Q
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECOB31 3150 printed Dec 13, 2024@01:57:58 Page 2
ECOB31 ;BP/CMF - User Last Used Parameters Object
+1 ;;2.0;EVENT CAPTURE;**100**;8 May 96;Build 21
+2 ;@author - Chris Flegel
+3 ;@date - 17 May 2009
+4 ;@version - 1.0
+5 ;;
+6 QUIT
+7 ;; private methods
+8 ;;
+9 ;; protected methods
LOAD(RESULT,HANDLE,PARAMS) ;
+1 NEW ECUSER,ECPARAM,X
+2 DO METHOD(.ECUSER,HANDLE_".GetIen")
+3 ;;
+4 SET ECPARAM=$$GET^XPAR("USR","EC LAST CLINIC",ECUSER,"E")
+5 DO METHOD(.X,HANDLE_".SetClinic."_ECPARAM)
+6 ;;
+7 SET ECPARAM=$$GET^XPAR("USR","EC LAST LOCATION",ECUSER,"E")
+8 DO METHOD(.X,HANDLE_".SetLocation."_ECPARAM)
+9 ;;
+10 SET ECPARAM=$$GET^XPAR("USR","EC LAST PRINTER",ECUSER,"E")
+11 DO METHOD(.X,HANDLE_".SetPrinter."_ECPARAM)
+12 ;;
+13 SET RESULT=1
+14 QUIT
+15 ;;
SAVE(RESULT,HANDLE,PARAMS) ;
+1 NEW ECUSER,ECPARAM,ECERR
+2 DO METHOD(.ECUSER,HANDLE_".GetIen")
+3 ;;
+4 DO METHOD(.ECPARAM,HANDLE_".GetClinic")
+5 DO EN^XPAR("USR","EC LAST CLINIC",ECUSER,ECPARAM,.ECERR)
+6 ;;
+7 DO METHOD(.ECPARAM,HANDLE_".GetLocation")
+8 DO EN^XPAR("USR","EC LAST LOCATION",ECUSER,ECPARAM,.ECERR)
+9 ;;
+10 DO METHOD(.ECPARAM,HANDLE_".GetPrinter")
+11 DO EN^XPAR("USR","EC LAST PRINTER",ECUSER,ECPARAM,.ECERR)
+12 ;;
+13 SET RESULT=$SELECT($DATA(ECERR):0,1:1)
+14 QUIT
+15 ;; public methods
CREATE(NAME) ;
+1 ; call parent first
+2 NEW HANDLE,X,CHILD
+3 SET HANDLE=$$CREATE^ECOB3(NAME)
+4 DO METHOD(.X,HANDLE_".of.Set_class.EC OBU LAST USED")
+5 DO METHOD(.X,HANDLE_".of.Set_name.User Last Used")
+6 DO METHOD(.X,HANDLE_".of.Set_routine.METHOD^ECOB31(.RESULT,ARGUMENT)")
+7 ;;
+8 DO METHOD(.CHILD,HANDLE_".Methods.Add.Load")
+9 DO METHOD(.X,CHILD_".mf.SetAddedByClass.User Last Used")
+10 DO METHOD(.X,CHILD_".mf.SetDescription.Access Kernel Params of last used.")
+11 DO METHOD(.X,CHILD_".mf.SetHandler.LOAD^ECOB31(.RESULT,HANDLE,PARAMS)")
+12 DO METHOD(.X,CHILD_".mf.SetParams.")
+13 DO METHOD(.X,CHILD_".mf.SetReturns.1")
+14 ;;
+15 DO METHOD(.CHILD,HANDLE_".Methods.Add.Save")
+16 DO METHOD(.X,CHILD_".mf.SetAddedByClass.User Last Used")
+17 DO METHOD(.X,CHILD_".mf.SetDescription.Persist Kernel Params of last used.")
+18 DO METHOD(.X,CHILD_".mf.SetHandler.SAVE^ECOB31(.RESULT,HANDLE,PARAMS)")
+19 DO METHOD(.X,CHILD_".mf.SetParams.")
+20 DO METHOD(.X,CHILD_".mf.SetReturns.1")
+21 ;;
+22 DO METHOD(.CHILD,HANDLE_".Properties.Add.Location")
+23 DO METHOD(.X,CHILD_".pf.SetAddedByClass.EC OBU LAST USED")
+24 DO METHOD(.X,CHILD_".pf.SetValue.")
+25 DO METHOD(.X,CHILD_".pf.SetDefaultValue.")
+26 ;
+27 DO METHOD(.CHILD,HANDLE_".Properties.Add.Clinic")
+28 DO METHOD(.X,CHILD_".pf.SetAddedByClass.EC OBU LAST USED")
+29 DO METHOD(.X,CHILD_".pf.SetValue.")
+30 DO METHOD(.X,CHILD_".pf.SetDefaultValue.")
+31 ;
+32 DO METHOD(.CHILD,HANDLE_".Properties.Add.Printer")
+33 DO METHOD(.X,CHILD_".pf.SetAddedByClass.EC OBU LAST USED")
+34 DO METHOD(.X,CHILD_".pf.SetValue.")
+35 DO METHOD(.X,CHILD_".pf.SetDefaultValue.")
+36 ;
+37 ; complex properties last
+38 DO METHOD(.X,HANDLE_".Root.Add.EC OBU LAST USED")
+39 ;
+40 IF $GET(DUZ)'=""
Begin DoDot:1
+41 DO METHOD(.X,HANDLE_".SetIen."_DUZ)
+42 DO METHOD(.X,HANDLE_".Load")
+43 QUIT
End DoDot:1
+44 IF $GET(XQUSER)'=""
DO METHOD(.X,HANDLE_".SetName."_XQUSER)
+45 QUIT HANDLE
+46 ;;
DESTROY(HANDLE) ;
+1 ; call parent last
+2 NEW X
+3 DO METHOD(.X,HANDLE_".Save")
+4 QUIT $$DESTROY^ECOB3(HANDLE)
+5 ;;
METHOD(RESULT,ARGUMENT) ;
+1 ; call parent last
+2 ;parent method
DO METHOD^ECOBU(.RESULT,ARGUMENT)
+3 QUIT
+4 ;;