HLDIE ;CIOFO-O/LJA - Direct 772 & 773 Sets ; 11/18/2003 11:17
;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13,1995
;
; Rules: if any of these rules is broken, FILE^DIE is called instead
;
; * Can't edit files other than 772,773
; * Don't pass IENS value with multiples IENs. You can only
; edit one IEN at a time!
; * Only flag "S" is honored. Flag "K" is ignored. Other
; flags result in FILE^DIE being called.
; * Can't edit ^HLMA(IEN,90) data.
; * Can't edit ^HLMA(IEN,91) data.
; * Can't edit ^HL(772,IEN,"IN") data (field #200, MESSAGE TEXT)
; * No checking of data performed! (Data format MUST be OK.)
; * No locking of records in files 772 or 773. (Locks on queues.)
;
FILE(FLAGS,ROOT,ERR,SUB,RTN) ; FILE^DIE functional equivalent...
; This call has similar parameters to FILE^DIE, but changes data
; using hard sets. The first two parameters of this API are the
; same as FILE^DIE. So, if any file other than 772 or 773 is being
; edited, this API just passes on the FLAGS,ROOT,ERR parameters to
; FILE^DIE and quits. If file 772 or 773 is being edited, the hard
; set code in HLDIE772 and HLDIE773 is called.
;
N DEBUG,FILE,HLEDITOR,LERR,IEN,X,XECMCODE
;
S DT=$$NOW^XLFDT\1
;
D BEGIN ; Debug call at beginning or process
;
; Check FILE, IEN, FIELDs passed, etc...
I '$$CHECKS D QUIT ;->
.
. S HLEDITOR="FILE^DIE"
.
. ; Call FILEMAN...
. D FILE^DIE($G(FLAGS),$G(ROOT),$G(ERR))
.
. ; Debug call made even with Fileman...
. D END
;
S HLEDITOR="FILE^HLDIE"
;
; If this point is reached, file 772 or 773 is being edited, data
; in ROOT() has been checked, and data is being hard set...
;
;
; Make sure ERR is defined...
I $G(ERR)']"" N HLERR S ERR="HLERR"
;
; All editing occurs in this call...
D EDITALL(.ROOT,FILE,IEN)
;
; Store debug data if XTMP debug string set...
D END
;
;check if ROOT needs to be retained
I FLAGS'["S" K @ROOT,FLAGS
;
Q
;
EDITALL(ROOT,FILE,IEN) ; Edit 772 or 773 by direct sets...
;
; FILE,IEN -- optional (parsed from ROOT())
;
N ERRNO,FIELD,GBL,NODE,ROUTINE,TAG,VALUE,XRF
;
S GBL=$$GBL(FILE,+IEN)
;
;check if .01="@" for deletion of record...
I $G(@ROOT@(FILE,IEN,.01))="@" D Q
.I FILE=773 D DEL773^HLUOPT3(+IEN) Q
.I FILE=772 D DEL772^HLUOPT3(+IEN)
;
; If no data in record passed in, log an error and quit...
I '$D(@GBL) D Q ; Remember. GBL contains IEN...
. S ERRNO=$$ERRNO(601,"The entry does not exist.",FILE,2)
. S @ERR@("DIERR",+ERRNO,"PARAM","IENS")=IEN_$S(IEN'[",":",",1:"")
;
;
; What routine holds the file-specific field/xref set code?
S ROUTINE=$S(FILE=772:"HLDIE772",FILE=773:"HLDIE773",1:"")
;
; Load NODEs...
D GETNODES(FILE,+IEN,.NODE)
;
; When a field is edited, the NODE(1) is changed
;
; Edit NODE(1), adding new values, and set XRF(XREF) nodes...
S FIELD=0
F S FIELD=$O(@ROOT@(FILE,IEN,FIELD)) Q:FIELD'>0 D
. ; VALUE = value passed in by process that is to be stored in file
. S VALUE=$G(@ROOT@(FILE,IEN,FIELD))
.
. ; If field should be deleted, VALUE will equal @...
. I VALUE="@" S VALUE=""
.
. ; Get and check tag...
. S TAG="F"_(FILE-770)_$TR(FIELD,".","")_U_ROUTINE
. S TAG(1)=$T(@TAG) I TAG(1)']"" D QUIT ;->
. . S ERRNO=$$ERRNO(501,"No set logic for file #"_FILE_"'s field# "_FIELD,FILE,3)
. . S @ERR@("DIERR",+ERRNO,"PARAM",1)=FIELD
. . S @ERR@("DIERR",+ERRNO,"PARAM","FIELD")=FIELD
.
. ; Call the subroutine below that is for the specific field...
. ; (No editing of xrefs or global data occurs in these calls.)
. D @("F"_(FILE-770)_$TR(FIELD,".","")_U_ROUTINE)
;
; If no data actually changed, quit...
QUIT:'$D(NODE("CHG")) ;->
;
; Store changes in the global now...
D STORE(FILE,IEN,.NODE)
;
; Set xrefs to correspond to the just-stored data...
S XRF=""
F S XRF=$O(XRF(XRF)) Q:XRF']"" D
. D @("XRF"_XRF_U_ROUTINE)
;
Q
;
GETNODES(FILE,IEN,NODE) ; Load pre-change data for each node in
; NODE(node,0), and load node to be changed in NODE(node,1).
; GBL -- req
F NODE=0,1,2,"P","S" D
. ; After setting, NODE(NODE,0) will equal each other.
. ; However, after each edited field is processed, the pieces of
. ; data in NODE(NODE,1) will be changed. The pre and post nodes
. ; then are of comparison value.
. S NODE(NODE,0)=$G(@GBL@(NODE)) ; Pre-change node
. S NODE(NODE,1)=NODE(NODE,0) ; Node that is changed
Q
;
STORE(FILE,IEN,NODE) ; Store changes in file...
N DATA,ND
;
; Loop thru change nodes, get changed data, and store it...
S ND=""
F S ND=$O(NODE("CHG",ND)) Q:ND']"" D
. S DATA=$G(NODE(ND,1))
. ; Even if no data no node, store it. (Will be removed by purge.)
. I FILE=772 S ^HL(772,+IEN,ND)=DATA
. I FILE=773 S ^HLMA(+IEN,ND)=DATA
;
QUIT
;
GBL(FILE,IEN) QUIT $S(FILE=772:"^HL(772,"_+IEN_")",1:"^HLMA("_+IEN_")")
;
CHKFLD(FILE,FIELD) ; Does passed-in field exist?
; Returns -- @ERR@(...) ->
;
; Quit if field exists...
QUIT:$D(^DD(+FILE,+FIELD)) 1 ;->
;
; Field doesn't exist. Log error...
S ERRNO=$$ERRNO(501,"File #"_FILE_" does not contain a field "_FIELD_".",FILE,3)
S @ERR@("DIERR",+ERRNO,"PARAM",1)=FIELD
S @ERR@("DIERR",+ERRNO,"PARAM","FIELD")=FIELD
;
Q ""
;
ERRNO(NUM,TXT,FILE,PNO) ; Return next ERROR number and create general data...
N NO
S NO=$G(@ERR@("DIERR"))+1,@ERR@("DIERR")=+NO_U_+NO
S @ERR@("DIERR",NO)=NUM
S @ERR@("DIERR",NO,"PARAM",0)=PNO
S @ERR@("DIERR",NO,"PARAM","FILE")=FILE
S @ERR@("DIERR",NO,"TEXT",1)=TXT
S @ERR@("DIERR","E",NUM,NO)=""
Q NO
;
GENLERR(ETXT) ; Store GENERAL (and fatal) error...
; ERR -- req
N NO
S NO=$G(@ERR@("DIERR"))+1,@ERR@("DIERR")=+NO_U_+NO
S @ERR@("DIERR",NO)=999_U_ETXT ; Made up error number
Q
;
CHECKS() ; Check ROOT() for file and validity of data...
; FLAGS, ROOT() -- req --> FILE,IEN
N I,OK,FIELD
;
;check the file & ien
S FILE=$O(@ROOT@(0))
I FILE'=772,FILE'=773 D QUIT "" ;->
. S IEN=$S(FILE:$O(@ROOT@(FILE,0)),1:0) ; Set for debugging
;
; ;shouldn't be more than 1 file!
QUIT:$O(@ROOT@(FILE)) "" ;->
;
;check the ien structure, and that only ien passed...
S IEN=$O(@ROOT@(FILE,0))
; Structure check...
QUIT:$P(IEN,",")'=+IEN_"," "" ;->
; Is it numeric?
QUIT:'(+IEN) "" ;->
; Has more than one IEN been passed?
QUIT:($O(@ROOT@(FILE,IEN))'="") "" ;->
;
;check the flags. Only K and S flags allowed...
I $L(FLAGS) D QUIT:'OK "" ;->
. S OK=1
. F I=0:1:$L(FLAGS) I $E(FLAGS,I)'="K",$E(FLAGS,I)'="S" S OK=0
;
; Check for existence of FIELD in FILE's DD & if an excluded field.
; (See rules for fields which cannot be updated by FILE^HLDIE.)
S FIELD=0,OK=1
F S FIELD=$O(@ROOT@(FILE,IEN,FIELD)) Q:FIELD="" D Q:'OK
. I '$$CHKFLD(FILE,FIELD) S OK=0 Q
. I FILE=773,FIELD\1=90 S OK=0 Q
. I FILE=773,FIELD\1=91 S OK=0 Q
. I FILE=772,FIELD=200 S OK=0 Q
;
; If not OK to use FILE^HLDIE, skip any further testing...
QUIT:'OK "" ;->
;
; *** WARNING ***
; The following check **MUST** be removed after FILE^HLDIE is working.
;
; Final check for whether FILE^HLDIE should be used...
I $G(^XTMP("HLDIE-DEBUG","CALL"))]"" QUIT "" ;->
; If this node exists and follows null, FILE^DIE will be used.
; Otherwise, execution defaults to using FILE^HLDIE.
;
Q OK
;
BEGIN ; Always call here before any ^HLDIE or ^DIE calls...
D DEBUG(1)
Q
;
END ; Always call here after all ^HLDIE or ^DIE actions...
D DEBUG(2)
Q
;
DEBUG(LOC) ; Debug presets and setup...
; Most variables created here should be left around. These variables
; are newed above.
N STORE
;
S RTN=$G(RTN),SUB=$G(SUB)
;
; First-time (beginning) call setups...
I LOC=1 D
. S RTN=$S(RTN]"":RTN,1:"HLDIE")_"~"_$S(RTN="HLDIE":"FILE",1:SUB)
. S DEBUG=$G(^XTMP("HLDIE-DEBUG","STATUS"))
. S XECMCODE=$P(DEBUG,U,3)
; DEBUG is always called at beginning (LOC=1) and end (LOC=2) or
; FILE^HLDIE. So, set up variables only once, at beginning...
;
; Setup that is individual to each (1 or 2) call...
S STORE=$P(DEBUG,U,LOC),STORE=$S(STORE=1:1,STORE=2:2,1:"")
; Some, All, or no data stored?
;
; If no STORE instructions, and no M code to specify STORE, quit...
QUIT:'STORE&($G(XECMCODE)'=1) ;->
;
; Call DEBUG to STORE data...
D DEBUG^HLDIEDBG(RTN,LOC,STORE,XECMCODE)
;
Q
;
EOR ;HLDIE - Direct 772 & 773 Sets ; 11/18/2003 11:17
HLDIE ;CIOFO-O/LJA - Direct 772 & 773 Sets ; 11/18/2003 11:17
+1 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13,1995
+2 ;
+3 ; Rules: if any of these rules is broken, FILE^DIE is called instead
+4 ;
+5 ; * Can't edit files other than 772,773
+6 ; * Don't pass IENS value with multiples IENs. You can only
+7 ; edit one IEN at a time!
+8 ; * Only flag "S" is honored. Flag "K" is ignored. Other
+9 ; flags result in FILE^DIE being called.
+10 ; * Can't edit ^HLMA(IEN,90) data.
+11 ; * Can't edit ^HLMA(IEN,91) data.
+12 ; * Can't edit ^HL(772,IEN,"IN") data (field #200, MESSAGE TEXT)
+13 ; * No checking of data performed! (Data format MUST be OK.)
+14 ; * No locking of records in files 772 or 773. (Locks on queues.)
+15 ;
FILE(FLAGS,ROOT,ERR,SUB,RTN) ; FILE^DIE functional equivalent...
+1 ; This call has similar parameters to FILE^DIE, but changes data
+2 ; using hard sets. The first two parameters of this API are the
+3 ; same as FILE^DIE. So, if any file other than 772 or 773 is being
+4 ; edited, this API just passes on the FLAGS,ROOT,ERR parameters to
+5 ; FILE^DIE and quits. If file 772 or 773 is being edited, the hard
+6 ; set code in HLDIE772 and HLDIE773 is called.
+7 ;
+8 NEW DEBUG,FILE,HLEDITOR,LERR,IEN,X,XECMCODE
+9 ;
+10 SET DT=$$NOW^XLFDT\1
+11 ;
+12 ; Debug call at beginning or process
DO BEGIN
+13 ;
+14 ; Check FILE, IEN, FIELDs passed, etc...
+15 ;->
IF '$$CHECKS
Begin DoDot:1
+16 +17 SET HLEDITOR="FILE^DIE"
+18 +19 ; Call FILEMAN...
+20 DO FILE^DIE($GET(FLAGS),$GET(ROOT),$GET(ERR))
+21 +22 ; Debug call made even with Fileman...
+23 DO END
End DoDot:1
QUIT
+24 ;
+25 SET HLEDITOR="FILE^HLDIE"
+26 ;
+27 ; If this point is reached, file 772 or 773 is being edited, data
+28 ; in ROOT() has been checked, and data is being hard set...
+29 ;
+30 ;
+31 ; Make sure ERR is defined...
+32 IF $GET(ERR)']""
NEW HLERR
SET ERR="HLERR"
+33 ;
+34 ; All editing occurs in this call...
+35 DO EDITALL(.ROOT,FILE,IEN)
+36 ;
+37 ; Store debug data if XTMP debug string set...
+38 DO END
+39 ;
+40 ;check if ROOT needs to be retained
+41 IF FLAGS'["S"
KILL @ROOT,FLAGS
+42 ;
+43 QUIT
+44 ;
EDITALL(ROOT,FILE,IEN) ; Edit 772 or 773 by direct sets...
+1 ;
+2 ; FILE,IEN -- optional (parsed from ROOT())
+3 ;
+4 NEW ERRNO,FIELD,GBL,NODE,ROUTINE,TAG,VALUE,XRF
+5 ;
+6 SET GBL=$$GBL(FILE,+IEN)
+7 ;
+8 ;check if .01="@" for deletion of record...
+9 IF $GET(@ROOT@(FILE,IEN,.01))="@"
Begin DoDot:1
+10 IF FILE=773
DO DEL773^HLUOPT3(+IEN)
QUIT
+11 IF FILE=772
DO DEL772^HLUOPT3(+IEN)
End DoDot:1
QUIT
+12 ;
+13 ; If no data in record passed in, log an error and quit...
+14 ; Remember. GBL contains IEN...
IF '$DATA(@GBL)
Begin DoDot:1
+15 SET ERRNO=$$ERRNO(601,"The entry does not exist.",FILE,2)
+16 SET @ERR@("DIERR",+ERRNO,"PARAM","IENS")=IEN_$SELECT(IEN'[",":",",1:"")
End DoDot:1
QUIT
+17 ;
+18 ;
+19 ; What routine holds the file-specific field/xref set code?
+20 SET ROUTINE=$SELECT(FILE=772:"HLDIE772",FILE=773:"HLDIE773",1:"")
+21 ;
+22 ; Load NODEs...
+23 DO GETNODES(FILE,+IEN,.NODE)
+24 ;
+25 ; When a field is edited, the NODE(1) is changed
+26 ;
+27 ; Edit NODE(1), adding new values, and set XRF(XREF) nodes...
+28 SET FIELD=0
+29 FOR
SET FIELD=$ORDER(@ROOT@(FILE,IEN,FIELD))
IF FIELD'>0
QUIT
Begin DoDot:1
+30 ; VALUE = value passed in by process that is to be stored in file
+31 SET VALUE=$GET(@ROOT@(FILE,IEN,FIELD))
+32 +33 ; If field should be deleted, VALUE will equal @...
+34 IF VALUE="@"
SET VALUE=""
+35 +36 ; Get and check tag...
+37 SET TAG="F"_(FILE-770)_$TRANSLATE(FIELD,".","")_U_ROUTINE
+38 ;->
SET TAG(1)=$TEXT(@TAG)
IF TAG(1)']""
Begin DoDot:2
+39 SET ERRNO=$$ERRNO(501,"No set logic for file #"_FILE_"'s field# "_FIELD,FILE,3)
+40 SET @ERR@("DIERR",+ERRNO,"PARAM",1)=FIELD
+41 SET @ERR@("DIERR",+ERRNO,"PARAM","FIELD")=FIELD
End DoDot:2
QUIT
+42 +43 ; Call the subroutine below that is for the specific field...
+44 ; (No editing of xrefs or global data occurs in these calls.)
+45 DO @("F"_(FILE-770)_$TRANSLATE(FIELD,".","")_U_ROUTINE)
End DoDot:1
+46 ;
+47 ; If no data actually changed, quit...
+48 ;->
IF '$DATA(NODE("CHG"))
QUIT
+49 ;
+50 ; Store changes in the global now...
+51 DO STORE(FILE,IEN,.NODE)
+52 ;
+53 ; Set xrefs to correspond to the just-stored data...
+54 SET XRF=""
+55 FOR
SET XRF=$ORDER(XRF(XRF))
IF XRF']""
QUIT
Begin DoDot:1
+56 DO @("XRF"_XRF_U_ROUTINE)
End DoDot:1
+57 ;
+58 QUIT
+59 ;
GETNODES(FILE,IEN,NODE) ; Load pre-change data for each node in
+1 ; NODE(node,0), and load node to be changed in NODE(node,1).
+2 ; GBL -- req
+3 FOR NODE=0,1,2,"P","S"
Begin DoDot:1
+4 ; After setting, NODE(NODE,0) will equal each other.
+5 ; However, after each edited field is processed, the pieces of
+6 ; data in NODE(NODE,1) will be changed. The pre and post nodes
+7 ; then are of comparison value.
+8 ; Pre-change node
SET NODE(NODE,0)=$GET(@GBL@(NODE))
+9 ; Node that is changed
SET NODE(NODE,1)=NODE(NODE,0)
End DoDot:1
+10 QUIT
+11 ;
STORE(FILE,IEN,NODE) ; Store changes in file...
+1 NEW DATA,ND
+2 ;
+3 ; Loop thru change nodes, get changed data, and store it...
+4 SET ND=""
+5 FOR
SET ND=$ORDER(NODE("CHG",ND))
IF ND']""
QUIT
Begin DoDot:1
+6 SET DATA=$GET(NODE(ND,1))
+7 ; Even if no data no node, store it. (Will be removed by purge.)
+8 IF FILE=772
SET ^HL(772,+IEN,ND)=DATA
+9 IF FILE=773
SET ^HLMA(+IEN,ND)=DATA
End DoDot:1
+10 ;
+11 QUIT
+12 ;
GBL(FILE,IEN) QUIT $SELECT(FILE=772:"^HL(772,"_+IEN_")",1:"^HLMA("_+IEN_")")
+1 ;
CHKFLD(FILE,FIELD) ; Does passed-in field exist?
+1 ; Returns -- @ERR@(...) ->
+2 ;
+3 ; Quit if field exists...
+4 ;->
IF $DATA(^DD(+FILE,+FIELD))
QUIT 1
+5 ;
+6 ; Field doesn't exist. Log error...
+7 SET ERRNO=$$ERRNO(501,"File #"_FILE_" does not contain a field "_FIELD_".",FILE,3)
+8 SET @ERR@("DIERR",+ERRNO,"PARAM",1)=FIELD
+9 SET @ERR@("DIERR",+ERRNO,"PARAM","FIELD")=FIELD
+10 ;
+11 QUIT ""
+12 ;
ERRNO(NUM,TXT,FILE,PNO) ; Return next ERROR number and create general data...
+1 NEW NO
+2 SET NO=$GET(@ERR@("DIERR"))+1
SET @ERR@("DIERR")=+NO_U_+NO
+3 SET @ERR@("DIERR",NO)=NUM
+4 SET @ERR@("DIERR",NO,"PARAM",0)=PNO
+5 SET @ERR@("DIERR",NO,"PARAM","FILE")=FILE
+6 SET @ERR@("DIERR",NO,"TEXT",1)=TXT
+7 SET @ERR@("DIERR","E",NUM,NO)=""
+8 QUIT NO
+9 ;
GENLERR(ETXT) ; Store GENERAL (and fatal) error...
+1 ; ERR -- req
+2 NEW NO
+3 SET NO=$GET(@ERR@("DIERR"))+1
SET @ERR@("DIERR")=+NO_U_+NO
+4 ; Made up error number
SET @ERR@("DIERR",NO)=999_U_ETXT
+5 QUIT
+6 ;
CHECKS() ; Check ROOT() for file and validity of data...
+1 ; FLAGS, ROOT() -- req --> FILE,IEN
+2 NEW I,OK,FIELD
+3 ;
+4 ;check the file & ien
+5 SET FILE=$ORDER(@ROOT@(0))
+6 ;->
IF FILE'=772
IF FILE'=773
Begin DoDot:1
+7 ; Set for debugging
SET IEN=$SELECT(FILE:$ORDER(@ROOT@(FILE,0)),1:0)
End DoDot:1
QUIT ""
+8 ;
+9 ; ;shouldn't be more than 1 file!
+10 ;->
IF $ORDER(@ROOT@(FILE))
QUIT ""
+11 ;
+12 ;check the ien structure, and that only ien passed...
+13 SET IEN=$ORDER(@ROOT@(FILE,0))
+14 ; Structure check...
+15 ;->
IF $PIECE(IEN,",")'=+IEN_","
QUIT ""
+16 ; Is it numeric?
+17 ;->
IF '(+IEN)
QUIT ""
+18 ; Has more than one IEN been passed?
+19 ;->
IF ($ORDER(@ROOT@(FILE,IEN))'="")
QUIT ""
+20 ;
+21 ;check the flags. Only K and S flags allowed...
+22 ;->
IF $LENGTH(FLAGS)
Begin DoDot:1
+23 SET OK=1
+24 FOR I=0:1:$LENGTH(FLAGS)
IF $EXTRACT(FLAGS,I)'="K"
IF $EXTRACT(FLAGS,I)'="S"
SET OK=0
End DoDot:1
IF 'OK
QUIT ""
+25 ;
+26 ; Check for existence of FIELD in FILE's DD & if an excluded field.
+27 ; (See rules for fields which cannot be updated by FILE^HLDIE.)
+28 SET FIELD=0
SET OK=1
+29 FOR
SET FIELD=$ORDER(@ROOT@(FILE,IEN,FIELD))
IF FIELD=""
QUIT
Begin DoDot:1
+30 IF '$$CHKFLD(FILE,FIELD)
SET OK=0
QUIT
+31 IF FILE=773
IF FIELD\1=90
SET OK=0
QUIT
+32 IF FILE=773
IF FIELD\1=91
SET OK=0
QUIT
+33 IF FILE=772
IF FIELD=200
SET OK=0
QUIT
End DoDot:1
IF 'OK
QUIT
+34 ;
+35 ; If not OK to use FILE^HLDIE, skip any further testing...
+36 ;->
IF 'OK
QUIT ""
+37 ;
+38 ; *** WARNING ***
+39 ; The following check **MUST** be removed after FILE^HLDIE is working.
+40 ;
+41 ; Final check for whether FILE^HLDIE should be used...
+42 ;->
IF $GET(^XTMP("HLDIE-DEBUG","CALL"))]""
QUIT ""
+43 ; If this node exists and follows null, FILE^DIE will be used.
+44 ; Otherwise, execution defaults to using FILE^HLDIE.
+45 ;
+46 QUIT OK
+47 ;
BEGIN ; Always call here before any ^HLDIE or ^DIE calls...
+1 DO DEBUG(1)
+2 QUIT
+3 ;
END ; Always call here after all ^HLDIE or ^DIE actions...
+1 DO DEBUG(2)
+2 QUIT
+3 ;
DEBUG(LOC) ; Debug presets and setup...
+1 ; Most variables created here should be left around. These variables
+2 ; are newed above.
+3 NEW STORE
+4 ;
+5 SET RTN=$GET(RTN)
SET SUB=$GET(SUB)
+6 ;
+7 ; First-time (beginning) call setups...
+8 IF LOC=1
Begin DoDot:1
+9 SET RTN=$SELECT(RTN]"":RTN,1:"HLDIE")_"~"_$SELECT(RTN="HLDIE":"FILE",1:SUB)
+10 SET DEBUG=$GET(^XTMP("HLDIE-DEBUG","STATUS"))
+11 SET XECMCODE=$PIECE(DEBUG,U,3)
End DoDot:1
+12 ; DEBUG is always called at beginning (LOC=1) and end (LOC=2) or
+13 ; FILE^HLDIE. So, set up variables only once, at beginning...
+14 ;
+15 ; Setup that is individual to each (1 or 2) call...
+16 SET STORE=$PIECE(DEBUG,U,LOC)
SET STORE=$SELECT(STORE=1:1,STORE=2:2,1:"")
+17 ; Some, All, or no data stored?
+18 ;
+19 ; If no STORE instructions, and no M code to specify STORE, quit...
+20 ;->
IF 'STORE&($GET(XECMCODE)'=1)
QUIT
+21 ;
+22 ; Call DEBUG to STORE data...
+23 DO DEBUG^HLDIEDBG(RTN,LOC,STORE,XECMCODE)
+24 ;
+25 QUIT
+26 ;
EOR ;HLDIE - Direct 772 & 773 Sets ; 11/18/2003 11:17