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