ECRUDSS ;ALB/DAN - DSS unit access by user report ;11/22/11 17:00
;;2.0;EVENT CAPTURE;**112**;8 May 96;Build 18
;
STRPT ;Main entry point for report
N IEN,CNT,UNIT
K ^TMP($J,"ECRUDSS") ;Temporary storage of information
U IO
S IEN=ECDUZ
S UNIT=0 F S UNIT=$O(^VA(200,IEN,"EC","B",UNIT)) Q:'+UNIT S ^TMP($J,"ECRUDSS",$$GET1^DIQ(724,UNIT,".01"))=""
I ECPTYP="E" D Q ;Put into parsable format
.S CNT=0,UNIT=""
.S CNT=CNT+1,^TMP($J,"ECRPT",CNT)="NAME^IEN^PERSON CLASS/CLASSIFICATION^DSS UNIT"
.F S UNIT=$O(^TMP($J,"ECRUDSS",UNIT)) Q:UNIT="" S CNT=CNT+1 S:CNT=2 ^TMP($J,"ECRPT",CNT)=$$GET1^DIQ(200,IEN,".01")_U_IEN_U_$P($$GET^XUA4A72(IEN,DT),U,3) S $P(^TMP($J,"ECRPT",CNT),U,4)=UNIT
.K ^TMP($J,"ECRUDSS")
;
D HDR
S UNIT=""
W $$GET1^DIQ(200,IEN,".01"),?32,IEN,?46,$E($P($$GET^XUA4A72(IEN,DT),U,3),1,52)
F S UNIT=$O(^TMP($J,"ECRUDSS",UNIT)) Q:UNIT="" D
.W ?100,UNIT,!
.I (IOSL-$Y)<5 W @IOF D HDR
K ^TMP($J,"ECRUDSS")
Q
;
HDR ;Print header for report
W !,"DSS Unit access by selected user",?$S($G(IOM):(IOM-18),1:62),$$FMTE^XLFDT($$NOW^XLFDT,"1M"),!!
W "USER NAME",?32,"IEN",?46,"PERSON CLASS/CLASSIFICATION",?100,"DSS UNIT",!,$$REPEAT^XLFSTR("-",$S($G(IOM):IOM,1:132)),!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECRUDSS 1226 printed Oct 16, 2024@17:59:30 Page 2
ECRUDSS ;ALB/DAN - DSS unit access by user report ;11/22/11 17:00
+1 ;;2.0;EVENT CAPTURE;**112**;8 May 96;Build 18
+2 ;
STRPT ;Main entry point for report
+1 NEW IEN,CNT,UNIT
+2 ;Temporary storage of information
KILL ^TMP($JOB,"ECRUDSS")
+3 USE IO
+4 SET IEN=ECDUZ
+5 SET UNIT=0
FOR
SET UNIT=$ORDER(^VA(200,IEN,"EC","B",UNIT))
if '+UNIT
QUIT
SET ^TMP($JOB,"ECRUDSS",$$GET1^DIQ(724,UNIT,".01"))=""
+6 ;Put into parsable format
IF ECPTYP="E"
Begin DoDot:1
+7 SET CNT=0
SET UNIT=""
+8 SET CNT=CNT+1
SET ^TMP($JOB,"ECRPT",CNT)="NAME^IEN^PERSON CLASS/CLASSIFICATION^DSS UNIT"
+9 FOR
SET UNIT=$ORDER(^TMP($JOB,"ECRUDSS",UNIT))
if UNIT=""
QUIT
SET CNT=CNT+1
if CNT=2
SET ^TMP($JOB,"ECRPT",CNT)=$$GET1^DIQ(200,IEN,".01")_U_IEN_U_$PIECE($$GET^XUA4A72(IEN,DT),U,3)
SET $PIECE(^TMP($JOB,"ECRPT",CNT),U,4)=UNIT
+10 KILL ^TMP($JOB,"ECRUDSS")
End DoDot:1
QUIT
+11 ;
+12 DO HDR
+13 SET UNIT=""
+14 WRITE $$GET1^DIQ(200,IEN,".01"),?32,IEN,?46,$EXTRACT($PIECE($$GET^XUA4A72(IEN,DT),U,3),1,52)
+15 FOR
SET UNIT=$ORDER(^TMP($JOB,"ECRUDSS",UNIT))
if UNIT=""
QUIT
Begin DoDot:1
+16 WRITE ?100,UNIT,!
+17 IF (IOSL-$Y)<5
WRITE @IOF
DO HDR
End DoDot:1
+18 KILL ^TMP($JOB,"ECRUDSS")
+19 QUIT
+20 ;
HDR ;Print header for report
+1 WRITE !,"DSS Unit access by selected user",?$SELECT($GET(IOM):(IOM-18),1:62),$$FMTE^XLFDT($$NOW^XLFDT,"1M"),!!
+2 WRITE "USER NAME",?32,"IEN",?46,"PERSON CLASS/CLASSIFICATION",?100,"DSS UNIT",!,$$REPEAT^XLFSTR("-",$SELECT($GET(IOM):IOM,1:132)),!
+3 QUIT