KMPDU4 ;OAK/RAK - CM Tools Utilities ;2/17/04 09:54
;;3.0;KMPD;;Jan 22, 2009;Build 42
;
ASSCROU(KMPDRES,KMPDIEN,KMPDROU) ;-- add/remove Associate Routines to file 8972.1
;-----------------------------------------------------------------------
; KMPDIEN... Ien for file #8972.1 (CM CODE EVALUATOR).
; KMPDROU(). Array containing list of routines for this Ien.
;-----------------------------------------------------------------------
;
K KMPDRES
I '$G(KMPDIEN) S KMPDRES(0)="[IEN not defined]" Q
I '$D(^KMPD(8972.1,+KMPDIEN,0)) D Q
.S KMPDRES(0)="[IEN #"_KMPDIEN_" not defined for this file]"
;
N DA,DIK,FDA,I,MESSAGE,ZIEN
;
; delete all entries in ASSOCIATED ROUTINE multiple (#11)
S DA=0,DA(1)=+KMPDIEN,DIK="^KMPD(8972.1,"_+KMPDIEN_",11,"
F S DA=$O(^KMPD(8972.1,+KMPDIEN,11,DA)) Q:'DA D ^DIK
;
; add routines to list
S I=""
F S I=$O(KMPDROU(I)) Q:I="" I KMPDROU(I)]"" D
.K FDA
.S FDA($J,8972.111,"+2,"_KMPDIEN_",",.01)=KMPDROU(I)
.D UPDATE^DIE("","FDA($J)",.ZIEN,"MESSAGE")
;
S KMPDRES(0)="<Update Complete>"
;
Q
;
REPDEF(KMPDY,KMPDREP) ; - rpc - get report definition
;---------------------------------------------------------------------------
; KMPDREP - Report Name for file #8973.3 (CP REPORT)
; either field #.01 (NAME) or field #2.01 (DISPLAY NAME) can be
; used.
;
; KMPDY - return array containing free text report definition
;---------------------------------------------------------------------------
K KMPDY
I $G(KMPDREP)="" S KMPDY(0)="[Missing Report Name]" Q
;
N I,IEN,LN
S IEN=$O(^KMPD(8973.3,"B",KMPDREP,0))
S:'IEN IEN=$O(^KMPD(8973.3,"C",KMPDREP,0))
I 'IEN S KMPDY(0)="["_KMPDREP_" is not a valid report name]" Q
S I=0,LN=1
F S I=$O(^KMPD(8973.3,IEN,10,I)) Q:'I D
.S KMPDY(LN)=$G(^KMPD(8973.3,IEN,10,I,0))
.S LN=LN+1
;
I '$D(KMPDY) S KMPDY(0)="<No Definition for Report>"
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPDU4 1942 printed Nov 22, 2024@16:51:13 Page 2
KMPDU4 ;OAK/RAK - CM Tools Utilities ;2/17/04 09:54
+1 ;;3.0;KMPD;;Jan 22, 2009;Build 42
+2 ;
ASSCROU(KMPDRES,KMPDIEN,KMPDROU) ;-- add/remove Associate Routines to file 8972.1
+1 ;-----------------------------------------------------------------------
+2 ; KMPDIEN... Ien for file #8972.1 (CM CODE EVALUATOR).
+3 ; KMPDROU(). Array containing list of routines for this Ien.
+4 ;-----------------------------------------------------------------------
+5 ;
+6 KILL KMPDRES
+7 IF '$GET(KMPDIEN)
SET KMPDRES(0)="[IEN not defined]"
QUIT
+8 IF '$DATA(^KMPD(8972.1,+KMPDIEN,0))
Begin DoDot:1
+9 SET KMPDRES(0)="[IEN #"_KMPDIEN_" not defined for this file]"
End DoDot:1
QUIT
+10 ;
+11 NEW DA,DIK,FDA,I,MESSAGE,ZIEN
+12 ;
+13 ; delete all entries in ASSOCIATED ROUTINE multiple (#11)
+14 SET DA=0
SET DA(1)=+KMPDIEN
SET DIK="^KMPD(8972.1,"_+KMPDIEN_",11,"
+15 FOR
SET DA=$ORDER(^KMPD(8972.1,+KMPDIEN,11,DA))
if 'DA
QUIT
DO ^DIK
+16 ;
+17 ; add routines to list
+18 SET I=""
+19 FOR
SET I=$ORDER(KMPDROU(I))
if I=""
QUIT
IF KMPDROU(I)]""
Begin DoDot:1
+20 KILL FDA
+21 SET FDA($JOB,8972.111,"+2,"_KMPDIEN_",",.01)=KMPDROU(I)
+22 DO UPDATE^DIE("","FDA($J)",.ZIEN,"MESSAGE")
End DoDot:1
+23 ;
+24 SET KMPDRES(0)="<Update Complete>"
+25 ;
+26 QUIT
+27 ;
REPDEF(KMPDY,KMPDREP) ; - rpc - get report definition
+1 ;---------------------------------------------------------------------------
+2 ; KMPDREP - Report Name for file #8973.3 (CP REPORT)
+3 ; either field #.01 (NAME) or field #2.01 (DISPLAY NAME) can be
+4 ; used.
+5 ;
+6 ; KMPDY - return array containing free text report definition
+7 ;---------------------------------------------------------------------------
+8 KILL KMPDY
+9 IF $GET(KMPDREP)=""
SET KMPDY(0)="[Missing Report Name]"
QUIT
+10 ;
+11 NEW I,IEN,LN
+12 SET IEN=$ORDER(^KMPD(8973.3,"B",KMPDREP,0))
+13 if 'IEN
SET IEN=$ORDER(^KMPD(8973.3,"C",KMPDREP,0))
+14 IF 'IEN
SET KMPDY(0)="["_KMPDREP_" is not a valid report name]"
QUIT
+15 SET I=0
SET LN=1
+16 FOR
SET I=$ORDER(^KMPD(8973.3,IEN,10,I))
if 'I
QUIT
Begin DoDot:1
+17 SET KMPDY(LN)=$GET(^KMPD(8973.3,IEN,10,I,0))
+18 SET LN=LN+1
End DoDot:1
+19 ;
+20 IF '$DATA(KMPDY)
SET KMPDY(0)="<No Definition for Report>"
+21 ;
+22 QUIT