ECOBVSTS ;BP/CMF - Visits 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
ADD(RESULT,HANDLE,VALUE) ; add Visit object to list
N CREATE,LIST,CHILD,ITEM,SOURCE
D METHOD(.CREATE,HANDLE_".of.Get_namespace")
S CHILD=$$CREATE^ECOBVST(CREATE)
D METHOD(.LIST,HANDLE_".GetList")
D COLLECT^ECOBL(.ITEM,LIST,CHILD)
D METHOD^ECOBVST(.RESULT,CHILD_".SetVisitIEN."_VALUE)
S RESULT=CHILD
Q
;;
CLEAR(RESULT,HANDLE,VALUE) ;Clear list
N CHILD
D METHOD(.CHILD,HANDLE_".First")
F Q:CHILD="-1^End of list" D
.D DESTROY^ECOBVST(CHILD)
.D METHOD(.CHILD,HANDLE_".Next")
.Q
D CLEAR^ECOBUL(.RESULT,HANDLE,VALUE) ;parent method
Q
;;
EXECUTE(RESULT,HANDLE,VALUE) ; get Visits, add to list
; uses IA 1905
N DFN,SDT,EDT,NUM,VST,PARAMS,CHILD,STUB
S RESULT=0
D METHOD(.DFN,HANDLE_".GetPatientIEN")
D METHOD(.SDT,HANDLE_".GetFMStartDate")
D METHOD(.EDT,HANDLE_".GetFMEndDate")
D METHOD(.NUM,HANDLE_".GetNumberToReturn")
K ^TMP("VSIT",$J)
D SELECTED^VSIT(DFN,SDT,EDT,"","","","","",NUM)
S VST=9999999999
S RESULT(0)=0
F S VST=$O(^TMP("VSIT",$J,VST),-1) Q:VST="" D
.S NUM=$O(^TMP("VSIT",$J,VST,"")) Q:NUM=""
.S PARAMS=^TMP("VSIT",$J,VST,NUM)
.D METHOD(.CHILD,HANDLE_".Add."_VST)
.D METHOD^ECOBVST(.STUB,CHILD_".Load."_PARAMS)
.S RESULT(NUM)=STUB
.S RESULT(0)=NUM
S:RESULT(0)'=0 RESULT=1
Q
;;
;; public methods
CREATE(NAME) ;
; call parent first
N HANDLE,X,CHILD
S HANDLE=$$CREATE^ECOBUL(NAME)
D METHOD(.X,HANDLE_".of.Set_class.EC VISITS")
D METHOD(.X,HANDLE_".of.Set_name.Visits")
D METHOD(.X,HANDLE_".of.Set_routine.METHOD^ECOBVSTS(.RESULT,ARGUMENT)")
;;
D METHOD(.CHILD,HANDLE_".Properties.Add.PatientIEN")
D METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
D METHOD(.CHILD,HANDLE_".Properties.Add.FMStartDate")
D METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
D METHOD(.CHILD,HANDLE_".Properties.Add.FMEndDate")
D METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
D METHOD(.CHILD,HANDLE_".Properties.Add.NumberToReturn")
D METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
D METHOD(.X,CHILD_".pf.SetValue."_20)
D METHOD(.X,CHILD_".pf.SetDefaultValue."_20)
;;
D METHOD(.CHILD,HANDLE_".Methods.Override.Add")
D METHOD(.X,CHILD_".mf.AddedByClass.EC VISITS")
D METHOD(.X,CHILD_".mf.SetDescription.Add VISIT object to list.")
D METHOD(.X,CHILD_".mf.SetHandler.ADD^ECOBVSTS(.RESULT,HANDLE,PARAMS)")
D METHOD(.X,CHILD_".mf.SetParams.[VisitIEN]... to be added")
D METHOD(.X,CHILD_".mf.SetReturns.Handle to Visit object")
;;
D METHOD(.CHILD,HANDLE_".Methods.Override.Clear")
D METHOD(.X,CHILD_".mf.AddedByClass.EC VISITS")
D METHOD(.X,CHILD_".mf.SetDescription.Returns VISITS to default state.")
D METHOD(.X,CHILD_".mf.SetHandler.CLEAR^ECOBVSTS(.RESULT,HANDLE,PARAMS)")
D METHOD(.X,CHILD_".mf.SetParams.")
D METHOD(.X,CHILD_".mf.SetReturns.1")
;;
D METHOD(.CHILD,HANDLE_".Methods.Add.Execute")
D METHOD(.X,CHILD_".mf.AddedByClass.EC VISITS")
D METHOD(.X,CHILD_".mf.SetDescription.Get Visits, add to list and results.")
D METHOD(.X,CHILD_".mf.SetHandler.EXECUTE^ECOBVSTS(.RESULT,HANDLE,PARAMS)")
D METHOD(.X,CHILD_".mf.SetParams.")
D METHOD(.X,CHILD_".mf.SetReturns.result array of Visit stubs")
;;
D METHOD(.X,HANDLE_".Root.Add.EC VISITS")
;
Q HANDLE
;;
DESTROY(HANDLE) ;
; call parent last
N CHILD
D METHOD(.CHILD,HANDLE_".First")
F Q:CHILD="-1^End of list" D
.D DESTROY^ECOBVST(CHILD)
.D METHOD(.CHILD,HANDLE_".Next")
.Q
Q $$DESTROY^ECOBUL(HANDLE)
;;
METHOD(RESULT,ARGUMENT) ;
; call parent last
D METHOD^ECOBUL(.RESULT,ARGUMENT) ; parent method
Q
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECOBVSTS 3775 printed Dec 13, 2024@01:58:12 Page 2
ECOBVSTS ;BP/CMF - Visits 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 ;; protected methods
ADD(RESULT,HANDLE,VALUE) ; add Visit object to list
+1 NEW CREATE,LIST,CHILD,ITEM,SOURCE
+2 DO METHOD(.CREATE,HANDLE_".of.Get_namespace")
+3 SET CHILD=$$CREATE^ECOBVST(CREATE)
+4 DO METHOD(.LIST,HANDLE_".GetList")
+5 DO COLLECT^ECOBL(.ITEM,LIST,CHILD)
+6 DO METHOD^ECOBVST(.RESULT,CHILD_".SetVisitIEN."_VALUE)
+7 SET RESULT=CHILD
+8 QUIT
+9 ;;
CLEAR(RESULT,HANDLE,VALUE) ;Clear list
+1 NEW CHILD
+2 DO METHOD(.CHILD,HANDLE_".First")
+3 FOR
if CHILD="-1^End of list"
QUIT
Begin DoDot:1
+4 DO DESTROY^ECOBVST(CHILD)
+5 DO METHOD(.CHILD,HANDLE_".Next")
+6 QUIT
End DoDot:1
+7 ;parent method
DO CLEAR^ECOBUL(.RESULT,HANDLE,VALUE)
+8 QUIT
+9 ;;
EXECUTE(RESULT,HANDLE,VALUE) ; get Visits, add to list
+1 ; uses IA 1905
+2 NEW DFN,SDT,EDT,NUM,VST,PARAMS,CHILD,STUB
+3 SET RESULT=0
+4 DO METHOD(.DFN,HANDLE_".GetPatientIEN")
+5 DO METHOD(.SDT,HANDLE_".GetFMStartDate")
+6 DO METHOD(.EDT,HANDLE_".GetFMEndDate")
+7 DO METHOD(.NUM,HANDLE_".GetNumberToReturn")
+8 KILL ^TMP("VSIT",$JOB)
+9 DO SELECTED^VSIT(DFN,SDT,EDT,"","","","","",NUM)
+10 SET VST=9999999999
+11 SET RESULT(0)=0
+12 FOR
SET VST=$ORDER(^TMP("VSIT",$JOB,VST),-1)
if VST=""
QUIT
Begin DoDot:1
+13 SET NUM=$ORDER(^TMP("VSIT",$JOB,VST,""))
if NUM=""
QUIT
+14 SET PARAMS=^TMP("VSIT",$JOB,VST,NUM)
+15 DO METHOD(.CHILD,HANDLE_".Add."_VST)
+16 DO METHOD^ECOBVST(.STUB,CHILD_".Load."_PARAMS)
+17 SET RESULT(NUM)=STUB
+18 SET RESULT(0)=NUM
End DoDot:1
+19 if RESULT(0)'=0
SET RESULT=1
+20 QUIT
+21 ;;
+22 ;; public methods
CREATE(NAME) ;
+1 ; call parent first
+2 NEW HANDLE,X,CHILD
+3 SET HANDLE=$$CREATE^ECOBUL(NAME)
+4 DO METHOD(.X,HANDLE_".of.Set_class.EC VISITS")
+5 DO METHOD(.X,HANDLE_".of.Set_name.Visits")
+6 DO METHOD(.X,HANDLE_".of.Set_routine.METHOD^ECOBVSTS(.RESULT,ARGUMENT)")
+7 ;;
+8 DO METHOD(.CHILD,HANDLE_".Properties.Add.PatientIEN")
+9 DO METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
+10 DO METHOD(.CHILD,HANDLE_".Properties.Add.FMStartDate")
+11 DO METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
+12 DO METHOD(.CHILD,HANDLE_".Properties.Add.FMEndDate")
+13 DO METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
+14 DO METHOD(.CHILD,HANDLE_".Properties.Add.NumberToReturn")
+15 DO METHOD(.X,CHILD_".pf.AddedByClass.EC VISITS")
+16 DO METHOD(.X,CHILD_".pf.SetValue."_20)
+17 DO METHOD(.X,CHILD_".pf.SetDefaultValue."_20)
+18 ;;
+19 DO METHOD(.CHILD,HANDLE_".Methods.Override.Add")
+20 DO METHOD(.X,CHILD_".mf.AddedByClass.EC VISITS")
+21 DO METHOD(.X,CHILD_".mf.SetDescription.Add VISIT object to list.")
+22 DO METHOD(.X,CHILD_".mf.SetHandler.ADD^ECOBVSTS(.RESULT,HANDLE,PARAMS)")
+23 DO METHOD(.X,CHILD_".mf.SetParams.[VisitIEN]... to be added")
+24 DO METHOD(.X,CHILD_".mf.SetReturns.Handle to Visit object")
+25 ;;
+26 DO METHOD(.CHILD,HANDLE_".Methods.Override.Clear")
+27 DO METHOD(.X,CHILD_".mf.AddedByClass.EC VISITS")
+28 DO METHOD(.X,CHILD_".mf.SetDescription.Returns VISITS to default state.")
+29 DO METHOD(.X,CHILD_".mf.SetHandler.CLEAR^ECOBVSTS(.RESULT,HANDLE,PARAMS)")
+30 DO METHOD(.X,CHILD_".mf.SetParams.")
+31 DO METHOD(.X,CHILD_".mf.SetReturns.1")
+32 ;;
+33 DO METHOD(.CHILD,HANDLE_".Methods.Add.Execute")
+34 DO METHOD(.X,CHILD_".mf.AddedByClass.EC VISITS")
+35 DO METHOD(.X,CHILD_".mf.SetDescription.Get Visits, add to list and results.")
+36 DO METHOD(.X,CHILD_".mf.SetHandler.EXECUTE^ECOBVSTS(.RESULT,HANDLE,PARAMS)")
+37 DO METHOD(.X,CHILD_".mf.SetParams.")
+38 DO METHOD(.X,CHILD_".mf.SetReturns.result array of Visit stubs")
+39 ;;
+40 DO METHOD(.X,HANDLE_".Root.Add.EC VISITS")
+41 ;
+42 QUIT HANDLE
+43 ;;
DESTROY(HANDLE) ;
+1 ; call parent last
+2 NEW CHILD
+3 DO METHOD(.CHILD,HANDLE_".First")
+4 FOR
if CHILD="-1^End of list"
QUIT
Begin DoDot:1
+5 DO DESTROY^ECOBVST(CHILD)
+6 DO METHOD(.CHILD,HANDLE_".Next")
+7 QUIT
End DoDot:1
+8 QUIT $$DESTROY^ECOBUL(HANDLE)
+9 ;;
METHOD(RESULT,ARGUMENT) ;
+1 ; call parent last
+2 ; parent method
DO METHOD^ECOBUL(.RESULT,ARGUMENT)
+3 QUIT
+4 ;;