ECOBPC ;BP/CMF - Properties object
;;2.0;EVENT CAPTURE;**100**;8 May 96;Build 21
;@author - Chris Flegel
;@date - 17 May 2009
;@version - 1.0
;;
Q
;;private methods
ADD(RESULT,HANDLE,VALUE) ; add Property object to list
N NAME,CHILD,ITEM,PROP
D METHOD(.NAME,HANDLE_".Get_namespace")
S CHILD=$$CREATE^ECOBP(NAME)
D COLLECT^ECOBL(.ITEM,HANDLE,CHILD)
S PROP("Name")=$P(VALUE,".")
D METHOD^ECOBP(.RESULT,CHILD_".SetName."_PROP("Name"))
;D METHOD^ECOBP(.RESULT,CHILD_".SetName."_VALUE)
D METHOD(.X,HANDLE_".Criteria.Index."_ITEM)
;support for property types
S PROP("Type")=$P(VALUE,".",2)
D:PROP("Type")'=""
.S PROP("Build")=$$GET^XPAR("PKG","ECOB PROPERTY TYPE",PROP("Type"),"E")
.Q:PROP("Build")=""
.S PROP("Tag")=$P(PROP("Build"),".")
.S PROP("Routine")=$P(PROP("Build"),".",2)
.S PROP("Execute")=PROP("Tag")_U_PROP("Routine")
.Q:$T(@$P(PROP("Execute"),"("))=""
.Q:$P(PROP("Execute"),"(",2)'="HANDLE,CHILD)"
.D @PROP("Execute")
.Q
S RESULT=CHILD
Q
;;
INFO(RESULT,HANDLE,PARAMS) ; view property details
N PROPERTY,JUSTIFY,OFFSET
D PARSE("Offset",PARAMS)
D METHOD(.PROPERTY,HANDLE_".First")
F Q:PROPERTY="-1^End of list" D
.D METHOD^ECOBP(.RESULT,PROPERTY_".ShowName."_JUSTIFY)
.D METHOD^ECOBP(.RESULT,PROPERTY_".ShowValue."_OFFSET)
.D METHOD^ECOBP(.RESULT,PROPERTY_".ShowDefaultValue."_OFFSET)
.D METHOD(.PROPERTY,HANDLE_".Next")
.Q
Q
;;
PARSE(PARSE,VALUE) ;
D PARSE^ECOBL(PARSE,VALUE) ; parent method
Q
;;
PROPERTY(HANDLE,SCOPE,PROPERTY,VALUE) ; parent method
D PROPERTY^ECOBL(HANDLE,SCOPE,PROPERTY,VALUE)
Q
;;
;; public methods
CREATE(NAME) ;
; call parent first
N HANDLE,X
S HANDLE=$$CREATE^ECOBL(NAME)
;;
D SELF^ECOB(.X,HANDLE,"Properties","Properties","METHOD^ECOBMC(.RESULT,ARGUMENT)","ECOBL")
;;
D METHOD(.X,HANDLE_".Criteria.SetArgument.GetName")
D METHOD(.X,HANDLE_".Criteria.SetOnReturn.handle")
Q HANDLE
;;
DESTROY(HANDLE) ;
; call parent last
N CHILD
D METHOD(.CHILD,HANDLE_".First")
F Q:+CHILD=-1 D
.D DESTROY^ECOBP(CHILD)
.D METHOD(.CHILD,HANDLE_".Next")
.Q
Q $$DESTROY^ECOBL(HANDLE)
;;
METHOD(RESULT,ARGUMENT) ;
; argument= handle.method.(additional.params...)
N HANDLE,METHOD,PARAMS
D PARSE("Handle",ARGUMENT)
D PARSE("Method",ARGUMENT)
D PARSE("Params",ARGUMENT)
I METHOD="Add" D ADD(.RESULT,HANDLE,PARAMS) Q
I METHOD="Info" D INFO(.RESULT,HANDLE,PARAMS) Q
D METHOD^ECOBL(.RESULT,ARGUMENT)
Q
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECOBPC 2486 printed Dec 13, 2024@01:58:07 Page 2
ECOBPC ;BP/CMF - Properties 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
ADD(RESULT,HANDLE,VALUE) ; add Property object to list
+1 NEW NAME,CHILD,ITEM,PROP
+2 DO METHOD(.NAME,HANDLE_".Get_namespace")
+3 SET CHILD=$$CREATE^ECOBP(NAME)
+4 DO COLLECT^ECOBL(.ITEM,HANDLE,CHILD)
+5 SET PROP("Name")=$PIECE(VALUE,".")
+6 DO METHOD^ECOBP(.RESULT,CHILD_".SetName."_PROP("Name"))
+7 ;D METHOD^ECOBP(.RESULT,CHILD_".SetName."_VALUE)
+8 DO METHOD(.X,HANDLE_".Criteria.Index."_ITEM)
+9 ;support for property types
+10 SET PROP("Type")=$PIECE(VALUE,".",2)
+11 if PROP("Type")'=""
Begin DoDot:1
+12 SET PROP("Build")=$$GET^XPAR("PKG","ECOB PROPERTY TYPE",PROP("Type"),"E")
+13 if PROP("Build")=""
QUIT
+14 SET PROP("Tag")=$PIECE(PROP("Build"),".")
+15 SET PROP("Routine")=$PIECE(PROP("Build"),".",2)
+16 SET PROP("Execute")=PROP("Tag")_U_PROP("Routine")
+17 if $TEXT(@$PIECE(PROP("Execute"),"("))=""
QUIT
+18 if $PIECE(PROP("Execute"),"(",2)'="HANDLE,CHILD)"
QUIT
+19 DO @PROP("Execute")
+20 QUIT
End DoDot:1
+21 SET RESULT=CHILD
+22 QUIT
+23 ;;
INFO(RESULT,HANDLE,PARAMS) ; view property details
+1 NEW PROPERTY,JUSTIFY,OFFSET
+2 DO PARSE("Offset",PARAMS)
+3 DO METHOD(.PROPERTY,HANDLE_".First")
+4 FOR
if PROPERTY="-1^End of list"
QUIT
Begin DoDot:1
+5 DO METHOD^ECOBP(.RESULT,PROPERTY_".ShowName."_JUSTIFY)
+6 DO METHOD^ECOBP(.RESULT,PROPERTY_".ShowValue."_OFFSET)
+7 DO METHOD^ECOBP(.RESULT,PROPERTY_".ShowDefaultValue."_OFFSET)
+8 DO METHOD(.PROPERTY,HANDLE_".Next")
+9 QUIT
End DoDot:1
+10 QUIT
+11 ;;
PARSE(PARSE,VALUE) ;
+1 ; parent method
DO PARSE^ECOBL(PARSE,VALUE)
+2 QUIT
+3 ;;
PROPERTY(HANDLE,SCOPE,PROPERTY,VALUE) ; parent method
+1 DO PROPERTY^ECOBL(HANDLE,SCOPE,PROPERTY,VALUE)
+2 QUIT
+3 ;;
+4 ;; public methods
CREATE(NAME) ;
+1 ; call parent first
+2 NEW HANDLE,X
+3 SET HANDLE=$$CREATE^ECOBL(NAME)
+4 ;;
+5 DO SELF^ECOB(.X,HANDLE,"Properties","Properties","METHOD^ECOBMC(.RESULT,ARGUMENT)","ECOBL")
+6 ;;
+7 DO METHOD(.X,HANDLE_".Criteria.SetArgument.GetName")
+8 DO METHOD(.X,HANDLE_".Criteria.SetOnReturn.handle")
+9 QUIT HANDLE
+10 ;;
DESTROY(HANDLE) ;
+1 ; call parent last
+2 NEW CHILD
+3 DO METHOD(.CHILD,HANDLE_".First")
+4 FOR
if +CHILD=-1
QUIT
Begin DoDot:1
+5 DO DESTROY^ECOBP(CHILD)
+6 DO METHOD(.CHILD,HANDLE_".Next")
+7 QUIT
End DoDot:1
+8 QUIT $$DESTROY^ECOBL(HANDLE)
+9 ;;
METHOD(RESULT,ARGUMENT) ;
+1 ; argument= handle.method.(additional.params...)
+2 NEW HANDLE,METHOD,PARAMS
+3 DO PARSE("Handle",ARGUMENT)
+4 DO PARSE("Method",ARGUMENT)
+5 DO PARSE("Params",ARGUMENT)
+6 IF METHOD="Add"
DO ADD(.RESULT,HANDLE,PARAMS)
QUIT
+7 IF METHOD="Info"
DO INFO(.RESULT,HANDLE,PARAMS)
QUIT
+8 DO METHOD^ECOBL(.RESULT,ARGUMENT)
+9 QUIT
+10 ;;