DGAINP3 ;ALB/RMO - Set-up Utility and Print Inpatient AMIS's 334-341 ; 27 DEC 89 1:37 pm
;;5.3;Registration;;Aug 13, 1993
;==============================================================
;Set-up Utility Global to print inpatient AMIS segments for
;a selected Month/Year.
;
;Input:
; DGMYR -(Optional) Month/Year being printed in internal date format
;==============================================================
EN ;Entry point for IMS and MAS Inpatient AMIS 334-341 Print
I '$D(DGMYR) S DIC("A")="Select AMIS 334-341 MONTH/YEAR: ",DIC="^DGAM(334,",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q:Y<0 S DGMYR=+Y
S DGPGM="START^DGAINP3",DGVAR="DGMYR" D ZIS^DGUTQ G Q:POP
;
START U IO K ^UTILITY($J,"DGAINP") F DGSEG=0:0 S DGSEG=$O(^DGAM(334,DGMYR,"SE",DGSEG)) Q:'DGSEG D DIV
D ^DGAINP4
;
Q K ^UTILITY($J,"DGAINP"),%,DGAM,DGAM0,DGDIV,DGEND,DGMYR,DGPGM,DGSEG,DGVAR,I,POP W ! D CLOSE^DGUTQ
Q
;
DIV ;Loop through AMIS Segments by Division to set the Utility Global
S DGEND=$S(DGSEG=334!(DGSEG=336):15,1:14)
F DGDIV=0:0 S DGDIV=$O(^DGAM(334,DGMYR,"SE",DGSEG,"D",DGDIV)) Q:'DGDIV I $D(^(DGDIV,0)) S DGAM0=^(0) D SET
Q
;
SET ;Set Utility Global by Month/Year, Segment and Division
S DGAM="" F I=1:1:DGEND S $P(DGAM,"^",I)=0
I DGSEG=334 F I=1:1:DGEND S $P(DGAM,"^",I)=$S(I=12:+$P(DGAM0,"^",24),I=13:+$P(DGAM0,"^",I),I>13:+$P(DGAM0,"^",I+4),1:+$P(DGAM0,"^",I+1))
I DGSEG>334,DGSEG<342 F I=1:1:DGEND S $P(DGAM,"^",I)=$S(I<13:+$P(DGAM0,"^",I+1),I=15:0,1:+$P(DGAM0,"^",I+5))
S ^UTILITY($J,"DGAINP",DGMYR,DGSEG,DGDIV)=DGAM
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGAINP3 1557 printed Dec 13, 2024@02:41:21 Page 2
DGAINP3 ;ALB/RMO - Set-up Utility and Print Inpatient AMIS's 334-341 ; 27 DEC 89 1:37 pm
+1 ;;5.3;Registration;;Aug 13, 1993
+2 ;==============================================================
+3 ;Set-up Utility Global to print inpatient AMIS segments for
+4 ;a selected Month/Year.
+5 ;
+6 ;Input:
+7 ; DGMYR -(Optional) Month/Year being printed in internal date format
+8 ;==============================================================
EN ;Entry point for IMS and MAS Inpatient AMIS 334-341 Print
+1 IF '$DATA(DGMYR)
SET DIC("A")="Select AMIS 334-341 MONTH/YEAR: "
SET DIC="^DGAM(334,"
SET DIC(0)="AEMQ"
WRITE !
DO ^DIC
KILL DIC
if Y<0
GOTO Q
SET DGMYR=+Y
+2 SET DGPGM="START^DGAINP3"
SET DGVAR="DGMYR"
DO ZIS^DGUTQ
if POP
GOTO Q
+3 ;
START USE IO
KILL ^UTILITY($JOB,"DGAINP")
FOR DGSEG=0:0
SET DGSEG=$ORDER(^DGAM(334,DGMYR,"SE",DGSEG))
if 'DGSEG
QUIT
DO DIV
+1 DO ^DGAINP4
+2 ;
Q KILL ^UTILITY($JOB,"DGAINP"),%,DGAM,DGAM0,DGDIV,DGEND,DGMYR,DGPGM,DGSEG,DGVAR,I,POP
WRITE !
DO CLOSE^DGUTQ
+1 QUIT
+2 ;
DIV ;Loop through AMIS Segments by Division to set the Utility Global
+1 SET DGEND=$SELECT(DGSEG=334!(DGSEG=336):15,1:14)
+2 FOR DGDIV=0:0
SET DGDIV=$ORDER(^DGAM(334,DGMYR,"SE",DGSEG,"D",DGDIV))
if 'DGDIV
QUIT
IF $DATA(^(DGDIV,0))
SET DGAM0=^(0)
DO SET
+3 QUIT
+4 ;
SET ;Set Utility Global by Month/Year, Segment and Division
+1 SET DGAM=""
FOR I=1:1:DGEND
SET $PIECE(DGAM,"^",I)=0
+2 IF DGSEG=334
FOR I=1:1:DGEND
SET $PIECE(DGAM,"^",I)=$SELECT(I=12:+$PIECE(DGAM0,"^",24),I=13:+$PIECE(DGAM0,"^",I),I>13:+$PIECE(DGAM0,"^",I+4),1:+$PIECE(DGAM0,"^",I+1))
+3 IF DGSEG>334
IF DGSEG<342
FOR I=1:1:DGEND
SET $PIECE(DGAM,"^",I)=$SELECT(I<13:+$PIECE(DGAM0,"^",I+1),I=15:0,1:+$PIECE(DGAM0,"^",I+5))
+4 SET ^UTILITY($JOB,"DGAINP",DGMYR,DGSEG,DGDIV)=DGAM
+5 QUIT