RAXREF ;HISC/DAD-EXECUTE SET AND KILL XREF'S ;8/22/96 15:02
;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
; REQUIRED VARIABLES
; RADICT = DATA DICTIONARY NUMBER
; RAFLD = FIELD NUMBER IN THE ABOVE DD
; RAX = FIELD VALUE TO BE CROSS REFERENCED
; DA = DA or DA array
ENKILL(RADICT,RAFLD,RAX,DA) ;
; *** Execute a field's cross reference kill logic
D CHECK I RAEXIT D EXIT Q
S RAXSAV=RAX
F RAXREF=0:0 S RAXREF=$O(^DD(RADICT,RAFLD,1,RAXREF)) Q:RAXREF'>0 S X=RAXSAV X:$D(^DD(RADICT,RAFLD,1,RAXREF,2))#2 ^(2)
D EXIT
Q
ENSET(RADICT,RAFLD,RAX,DA) ;
; *** Execute a field's cross reference set logic
D CHECK I RAEXIT D EXIT Q
S RAXSAV=RAX
F RAXREF=0:0 S RAXREF=$O(^DD(RADICT,RAFLD,1,RAXREF)) Q:RAXREF'>0 S X=RAXSAV X:$D(^DD(RADICT,RAFLD,1,RAXREF,1))#2 ^(1)
D EXIT
Q
EXIT ; Kill and quit
K RAEXIT,RAXREF,RAXSAV
Q
CHECK ; Check if parameters are valid
S RAEXIT=$S($D(DA)[0:1,$D(RAX)[0:1,$D(RADICT)[0:1,$D(RAFLD)[0:1,RAX="":1,RADICT'>0:1,RAFLD'>0:1,1:0)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRAXREF 1009 printed Oct 16, 2024@18:41:25 Page 2
RAXREF ;HISC/DAD-EXECUTE SET AND KILL XREF'S ;8/22/96 15:02
+1 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
+2 ; REQUIRED VARIABLES
+3 ; RADICT = DATA DICTIONARY NUMBER
+4 ; RAFLD = FIELD NUMBER IN THE ABOVE DD
+5 ; RAX = FIELD VALUE TO BE CROSS REFERENCED
+6 ; DA = DA or DA array
ENKILL(RADICT,RAFLD,RAX,DA) ;
+1 ; *** Execute a field's cross reference kill logic
+2 DO CHECK
IF RAEXIT
DO EXIT
QUIT
+3 SET RAXSAV=RAX
+4 FOR RAXREF=0:0
SET RAXREF=$ORDER(^DD(RADICT,RAFLD,1,RAXREF))
if RAXREF'>0
QUIT
SET X=RAXSAV
if $DATA(^DD(RADICT,RAFLD,1,RAXREF,2))#2
XECUTE ^(2)
+5 DO EXIT
+6 QUIT
ENSET(RADICT,RAFLD,RAX,DA) ;
+1 ; *** Execute a field's cross reference set logic
+2 DO CHECK
IF RAEXIT
DO EXIT
QUIT
+3 SET RAXSAV=RAX
+4 FOR RAXREF=0:0
SET RAXREF=$ORDER(^DD(RADICT,RAFLD,1,RAXREF))
if RAXREF'>0
QUIT
SET X=RAXSAV
if $DATA(^DD(RADICT,RAFLD,1,RAXREF,1))#2
XECUTE ^(1)
+5 DO EXIT
+6 QUIT
EXIT ; Kill and quit
+1 KILL RAEXIT,RAXREF,RAXSAV
+2 QUIT
CHECK ; Check if parameters are valid
+1 SET RAEXIT=$SELECT($DATA(DA)[0:1,$DATA(RAX)[0:1,$DATA(RADICT)[0:1,$DATA(RAFLD)[0:1,RAX="":1,RADICT'>0:1,RAFLD'>0:1,1:0)
+2 QUIT