AGEDBEE ; IHS/ASDS/TPF - EDIT/DISPLAY BENEFITS COORDINATOR - PATIENT APPLICATION SUBMISSIONS SCREEN ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
;AD0 AND AD1 WILL BE THE IENS NEEDED TO DISP THE 'PATIENTS APPLICATION
;SUBMISSION' WHICH WAS CHOSEN FROM THE PATIENT APPLICATIONS MAIN
;SCREEN (^AGEDBED)
EN(AD0,AD1,AD2,NEWENTRY) ;
;IF ITS A NEW ENTRY, DISP THE SCREEN, DISP A MESSAGE, THEN CALL THE
;EDITS TO FIELDS APPROPRIATE FOR ADDING A NEW ENTRY
I NEWENTRY D DRAW,WMSG,NEWENTRY I $G(Y)<0 W !,"Entry not made." H 2 D END Q
S NEWENTRY=0
;BELOW ASKS SEQUENCE OF QUESTIONS
;S EXIT=0
;I NEWENTRY D Q:EXIT S NEWENTRY=0
;.D DRAW,WMSG,NEWENTRY I $G(Y)<0 W !,"No entry made" H 2 S EXIT=1 Q
;.D APSUBVIA
;.D APPREAS
;.D APPSUBBY
;
VAR D DRAW
W !,AGLINE("EQ")
K DIR
I '$D(AGSEENLY) D
.S DIR("A")="Change which item (1-"_AG("N")_") OR Add <A>pplication Submission Status information"
I $D(AGSEENLY) D
.S DIR("A")="Press return to continue"
.S DIR="FO"
D READ^AGED1
I $D(AGSEENLY) Q
I $D(MYERRS("C","E")),(Y'?1N.N),(Y'="E") W !,"ERRORS ON THIS PAGE. PLEASE EDIT BEFORE EXITING!!" H 3 G VAR
Q:Y=$G(AGOPT("ESCAPE"))
G END:$D(DLOUT)!(Y["N")!$D(DUOUT),VAR:$D(AG("ERR"))
Q:$D(DFOUT)!$D(DTOUT)
I $G(Y)="A" D ADSUBSTA G VAR
I $D(DQOUT)!(+Y<1)!(+Y>AG("N")) W !!,"You must enter a number from 1 to ",AG("N"),!,"or 'A' to add Application Submission Status information." H 3 G VAR
;DEPENDING ON USER'S CHOICE ITEM MAY BE AN EDIT ON THIS SCREEN OR
;IT MAY BE A PATIENT APPLICATION SUBMISSION WHICH IS ON ^AGEDBEE
I $D(CHOICES(+Y)) S DORTN="APSUBDT",AD0=$P(CHOICES(+Y),U,2),AD1=$P(CHOICES(+Y),U,3),AD2=$P(CHOICES(+Y),U,4),AD3=$P(CHOICES(+Y),U,5) D @DORTN G VAR
I $D(Y) D
.S AGY=Y
.F AGI=1:1 S AG("SEL")=+$P(AGY,",",AGI) Q:AG("SEL")<1!(AG("SEL")>AG("N")) D @($P(AG("C"),",",AG("SEL")))
;I AGY=1,'$D(^AUPNAUTH(AD0,11,AD1,1,AD2)) D CLEAN(AD0,AD1,AD2) Q ;USER HAS DELETED THE APP. SUBMITTED DATE
; THEY CHOSE TO ENTER THIS SCREEN. IT IS GONE
; SO RETURN TO PREV. SCREEN
;D CLEAN(AD0,AD1,AD2)
I '$O(^AUPNAUTH(AD0,11,AD1,1,AD2,0)) Q
D UPDATE1^AGED(DUZ(2),DFN,3,"")
K AGI,AGY
G VAR
CLEAN(AD0,AD1,AD2) ;CLEAN EMPTY RECORD. IF NO SUBMISSION DATES HAVE
;BEEN ENTERED THEN THE RECORD IS MEANINGLESS
;CHECK HERE TO SEE IF ENTRIES HAVE ACTUALLY BEEN ENTERED. IF NOT
;CLEAR THE RECORD SINCE NOTHING REALLY EXISTS IN THIS
;RECORD AUPNAPPS(D0,11,D1,1,0)
I $O(^AUPNAPPS(AD0,11,AD1,1,0))="" D
.D CLEANZER(AD0,AD1)
.W !,"RECORD DELETED!" H 2
Q
CLEANZER(AD0,AD1) ;EP
K DIK,DA
S DA(3)=AD0,DA(2)=AD1,DA=AD2,DIK="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1," D ^DIK
Q
END ;CLEAN UP THE VARS USED
K AG,DLOUT,DTOUT,DFOUT,DQOUT,DA,DIC,DR,AGSCRN,Y,ADA,WDA,ADT,WDT,ADFN,WDFN,REC,NEWENTRY,CHOICES
Q
DRAW ;EP
K CHOICES
S AG("PG")="5BEE"
S ROUTID=$P($T(+1)," ")
D ^AGED
D GETAW
Q
GETAW ;DISP
K AG("C")
F AG=1:1 D Q:$G(AGSCRN)[("*END*")
. S AGSCRN=$P($T(@1+AG),";;",2,15)
. Q:AGSCRN[("*END*")
. S CAPTION=$P(AGSCRN,U) ;FLD CAP
. I $E(CAPTION)="-" D CAPPARSE(CAPTION) Q ;PARSE OUT CAP
. S DIC=$P(AGSCRN,U,3) ;FILE OR SUBFILE #
. S DR=$P(AGSCRN,U,4) ;FLD #
. S SKIPEXEC=$P(AGSCRN,"|",6) ;SKIP LOGIC. IF THIS IS TRUE WE
. ; DON'T DEAL WITH THIS FLD AT ALL
. I SKIPEXEC'="" X SKIPEXEC Q:$T
. S NEWLINE=$P(AGSCRN,U,5) ;NEWLINE OR INDENT
. S CAPDENT=$P(AGSCRN,U,2) ;CAP INDENT
. S ITEMNUM=$P(AGSCRN,U,6) ;ITEM #
. S TAGCALL=$P($P(AGSCRN,U,7),"|",1) ;TAG TO CALL TO EDIT THIS FLD
. S EXECUTE=$P(AGSCRN,"|",2) ;USE TO DISP FLD WHICH IS DEPENDENT ON ANOTHER FLD
. S PREEXEC=$P(AGSCRN,"|",3) ;PLACE CODE TO BE XECUTED PRIOR TO DISP OF THE FLD
. S PRECAPEX=$P(AGSCRN,"|",4) ;PLACE CODE TO EXECUTE BEF CAP/FLD LBL
. S POSTEXEC=$P(AGSCRN,"|",5) ;PLACE CODE HERE TO BE EXECUTED AFT DISP OF THE FLD
. S:TAGCALL'="" $P(AG("C"),",",ITEMNUM)=TAGCALL ;SELECTION STRING
. W @NEWLINE
. W ITEMNUM
. W $S(ITEMNUM'="":". ",1:"")
. I PRECAPEX="" W @CAPDENT,$S($G(CAPTION)'="":CAPTION_": ",$G(CAPTION)="":"",1:$P($G(^DD(DIC,DR,0)),U)_": ")
. I PRECAPEX'="" X PRECAPEX I $T W @CAPDENT,$S($G(CAPTION)'="":CAPTION_": ",$G(CAPTION)="":"",1:$P($G(^DD(DIC,DR,0)),U)_": ")
.;IF EDITING DISP DATA ONLY
.;E DISPLAY ONLY THE CAPS
.I 'NEWENTRY D
.. ;LOOP TO HANDLE MULTIPLE DR'S FOR ONE CAP
.. I DIC["9000045.1101" D
... S D0=AD2_","_AD1_","_AD0_","
... N PIECE
... S VDR=DR
... F PIECE=1:1 S DR=$P(VDR,";",PIECE) Q:DR="" D
.... I $P(PREEXEC,";",PIECE)'="" X $P(PREEXEC,";",PIECE)
.... I $P(EXECUTE,";",PIECE)="" W $$GET1^DIQ(DIC,D0,DR)
.... I $P(EXECUTE,";",PIECE)'="" S D0=$TR(D0,",") X $P(EXECUTE,";",PIECE)
.... I $P(POSTEXEC,";",PIECE)'="" X $P(POSTEXEC,";",PIECE)
...K PIECE
..;LIST SUBMISSION STATUS DATES
.. I DIC["9000045.110101" D
... S ITEM=4 ;PREVIOUS SECTION'S ITEMS END AT 4
... S VD0=AD0
... S VD1=AD1
... S VD2=AD2
... I '$O(^AUPNAPPS(VD0,11,VD1,1,VD2,1,0)) W !,"NO STATUSES ENTERED" Q
... S VD3=0
... F S VD3=$O(^AUPNAPPS(VD0,11,VD1,1,VD2,1,VD3)) Q:'VD3 D
.... S ITEM=ITEM+1
.... S CHOICES(ITEM)=DIC_U_VD0_U_VD1_U_VD2_U_VD3
.... S D0=VD3_","_VD2_","_VD1_","_VD0_","
.... W !,ITEM_"."
.... N PIECE
.... F PIECE=1:1 S DR=$P(VDR,";",PIECE) Q:DR="" D
..... I $P(PREEXEC,";",PIECE)'="" X $P(PREEXEC,";",PIECE)
..... I $P(EXECUTE,";",PIECE)="" W $$GET1^DIQ(DIC,D0,DR)
..... I $P(EXECUTE,";",PIECE)'="" X $P(EXECUTE,";",PIECE)
..... I $P(POSTEXEC,";",PIECE)'="" X $P(POSTEXEC,";",PIECE)
....K PIECE
S AG("N")=$G(ITEM)
W !,$G(AGLINE("-"))
K MYERRS,MYVARS
D FETCHERR^AGEDERR(AG("PG"),.MYERRS)
S MYVARS("DFN")=DFN,MYVARS("FINDCALL")="",MYVARS("SELECTION")=$G(AGSELECT),MYVARS("SITE")=DUZ(2)
D EDITCHEK^AGEDERR(.MYERRS,.MYVARS,1)
D VERIF^AGUTILS
Q
CAPPARSE(CAPTION) ;EP - PARSE OUT THE CAP
N LBRACKET,RBRACKET
S LBRACKET="[",RBRACKET="]"
I CAPTION'[LBRACKET W !,$E(CAPTION,2,199) Q ;- DENOTES SIMPLE SECTION
;PARSE OUT AND INSERT FLD VALUES
S FIELDS=$L(CAPTION,LBRACKET)
W !,$E($P(CAPTION,LBRACKET),2,199)
F PIECE=1:1:FIELDS D
.S FIELD=$P($P(CAPTION,LBRACKET,PIECE),RBRACKET)
.W $$GET1^DIQ($P(FIELD,";"),AD1_","_AD0_",",$P(FIELD,";",2))
W $P(CAPTION,RBRACKET,2)
K LBRACKET,RBRACKET
Q
WMSG ;DISP THIS MSG IF THERE IS NO AUTHORIZATION DT FOUND
W !,"You must first enter a APPLICATION SUBMISSION DATE"
Q
;;;;;;;;;;;;;;;;;;;;;;;;;
; EDIT AUTHORIZATION FLDS
;;;;;;;;;;;;;;;;;;;;;;;;;
NEWENTRY ;EP - NEW ENTRY
APDTSUB ;APPLICATION SUBMISSION DT
K DIC,DIE,DR,DA
S DA(1)=AD1
S DA(2)=AD0
S DIC="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
S DIC(0)="ALMEQ"
K DD,DO
D ^DIC
I +Y>0 S AD2=+Y Q
Q
APSUBVIA ;EP - EDIT APPLICATION SUBMITTED VIA
K DIC,DR,DIE,DA,DD,DO
S DA(1)=AD1
S DA(2)=AD0
S DA=AD2
S DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
S DR=.02
D ^DIE
K DIC,DR,DIE,DA
Q
APPREAS ;EP - EDIT REASON FOR SUBMISSION
K DIC,DR,DIE,DA,DD,DO
S DA(1)=AD1
S DA(2)=AD0
S DA=AD2
S DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
S DR=".03"
D ^DIE
K DIC,DR,DIE,DA
Q
APPSUBBY ;EP - EDIT REASON FOR SUBMISSION
K DIC,DR,DIE,DA,DD,DO
S DA(1)=AD1
S DA(2)=AD0
S DA=AD2
S DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
S DR=".04"
D ^DIE
K DIC,DR,DIE,DA
Q
ADSUBSTA ;EP - ADD APPLICATION SUBMISSION DT
K DIC,DIE,DR,DA
S DA(2)=AD1
S DA(3)=AD0
S DA(1)=AD2
S DIC="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1,"_DA(1)_",1,"
S DIC(0)="ALMEQ"
K DD,DO
D ^DIC
Q:+Y<0
S AD3=+Y
D APSUBST
Q
APSUBDT ;EP - EDIT APPLICATION SUBMISSION STATUS DT
K DIC,DR,DIE,DA,DD,DO
S DA(2)=AD1
S DA(3)=AD0
S DA(1)=AD2
S DA=AD3
S DIE="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1,"_DA(1)_",1,"
S DR=".01"
D ^DIE
Q:'$D(DA) ;SUBMISION STATUS DT DELETED
K DIC,DR,DIE,DA
D APSUBST
Q
APSUBST ;EP - EDIT SUBMISSION STATUS
K DIC,DR,DIE,DA,DD,DO
S DA(2)=AD1
S DA(3)=AD0
S DA(1)=AD2
S DA=AD3
S DIE="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1,"_DA(1)_",1,"
S DR=".02"
D ^DIE
K DIC,DR,DIE,DA
Q
EDDTSUB ;EDIT DT APPLICATION SUBMITTED
K DIC,DR,DIE,DA,DD,DO
S DA(1)=AD1
S DA(2)=AD0
S DA=AD2
S DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
S DR=".01"
D ^DIE
K DIC,DR,DIE,DA
Q
; ****************************************************************
; ON LINES BELOW:
; U "^" DELIMITED
; AGSCRN CONTAINS THE $TEXT OF EACH LINE BELOW STARTING AT TAG '1'
; PIECE VAR DESC
; ----- -------- -----------------------------------------------
; 1 CAPTION FLD CAP ASSIGNED BY PROGRAMMER OVERRIDES FLD LBL IF POPULATED
; 2 CAPDENT POSITION ON LINE TO DISP CAP
; 3 DIC FILE OR SUBFILE #
; 4 DR FLD # - THESE CAN BE SEPARATED BY ";" THIS ALLOWS
; MULTIPLE FLDS TO BE PRINTED WITH THE SAME CAP AS IN
; 'CITY,STATE,ZIP'
; 5 NEWLINE NEW LINE OR NOT (MUST BE EITHER A '!' OR '?#')
; USE THIS TO INDENT THE LINE
; 6 ITEMNUM ITEM # ASSIGNMENT. USE THIS TO ASSIGN THE ITEM #
; USED TO ALLOW USER TO CHOOSE THIS FLD TO EDIT
; 7 TAGCALL TAG TO CALL WHEN THIS FLD IS CHOSEN BY USER TO BE EDITED
;
; BAR "|" DELIMITED
; PIECE VAR DESC
; ----- -------- ----------------------------------------------
; 2 EXECUTE EXECUTE CODE TO GET FLD THAT ANOTHER IS POINTING TO.
; EXECUTED AFT FLD PRINT. IF MUTLIPLE FLDS ARE PRINTED
; THEN MULTIPLE EXECUTE CODES CAN BE SEPARATED BY ";".
; 3 PREEXEC EXECUTE CODE TO DO BEF FLD PRINTS. USE TO SCREEN OUT
; PRINTING A FLD VALUE. FOR MULTIPLES SEPARATE BY ";"
; 4 PRECAPEX EXECUTE CODE TO DO BEF PRINTING THE CAP OR FLD LBL.
; USE TO SCREEN OUT PRINTING A CAP/FLD LBL
; 5 POSTEXEC EXECUTE CODE TO DO AFT PRINTING THE FLD DATA
; FOR MULTIPLES SEPARATE BY ";"
; 6 SKIPEXEC EXECUTE CODE TO SKIP ENTIRE FLD
;
1 ;
;;--APPLICATION SUBMISSION DATA---------------------------------------------------
;;Date Submitted^?0^9000045.1101^.01^!?0^1^EDDTSUB||
;;App. Submitted via^?0^9000045.1101^.02^?40^2^APSUBVIA
;;Submission Reason^?0^9000045.1101^.03^!^3^APPREAS
;;Submitted by^?0^9000045.1101^.04^!^4^APPSUBBY
;;-
;;--SUBMISSION STATUS DATE------------SUBMISSION STATUS----------------------------
;;^?0^9000045.110101^.01;.02^?0^^APPSTADT||;W ?40
;;*END*
;;^?0^9000045.110101^.02^?40^4^APPSTAT
AGEDBEE ; IHS/ASDS/TPF - EDIT/DISPLAY BENEFITS COORDINATOR - PATIENT APPLICATION SUBMISSIONS SCREEN ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
+3 ;AD0 AND AD1 WILL BE THE IENS NEEDED TO DISP THE 'PATIENTS APPLICATION
+4 ;SUBMISSION' WHICH WAS CHOSEN FROM THE PATIENT APPLICATIONS MAIN
+5 ;SCREEN (^AGEDBED)
EN(AD0,AD1,AD2,NEWENTRY) ;
+1 ;IF ITS A NEW ENTRY, DISP THE SCREEN, DISP A MESSAGE, THEN CALL THE
+2 ;EDITS TO FIELDS APPROPRIATE FOR ADDING A NEW ENTRY
+3 IF NEWENTRY
DO DRAW
DO WMSG
DO NEWENTRY
IF $GET(Y)<0
WRITE !,"Entry not made."
HANG 2
DO END
QUIT
+4 SET NEWENTRY=0
+5 ;BELOW ASKS SEQUENCE OF QUESTIONS
+6 ;S EXIT=0
+7 ;I NEWENTRY D Q:EXIT S NEWENTRY=0
+8 ;.D DRAW,WMSG,NEWENTRY I $G(Y)<0 W !,"No entry made" H 2 S EXIT=1 Q
+9 ;.D APSUBVIA
+10 ;.D APPREAS
+11 ;.D APPSUBBY
+12 ;
VAR DO DRAW
+1 WRITE !,AGLINE("EQ")
+2 KILL DIR
+3 IF '$DATA(AGSEENLY)
Begin DoDot:1
+4 SET DIR("A")="Change which item (1-"_AG("N")_") OR Add <A>pplication Submission Status information"
End DoDot:1
+5 IF $DATA(AGSEENLY)
Begin DoDot:1
+6 SET DIR("A")="Press return to continue"
+7 SET DIR="FO"
End DoDot:1
+8 DO READ^AGED1
+9 IF $DATA(AGSEENLY)
QUIT
+10 IF $DATA(MYERRS("C","E"))
IF (Y'?1N.N)
IF (Y'="E")
WRITE !,"ERRORS ON THIS PAGE. PLEASE EDIT BEFORE EXITING!!"
HANG 3
GOTO VAR
+11 IF Y=$GET(AGOPT("ESCAPE"))
QUIT
+12 IF $DATA(DLOUT)!(Y["N")!$DATA(DUOUT)
GOTO END
IF $DATA(AG("ERR"))
GOTO VAR
+13 IF $DATA(DFOUT)!$DATA(DTOUT)
QUIT
+14 IF $GET(Y)="A"
DO ADSUBSTA
GOTO VAR
+15 IF $DATA(DQOUT)!(+Y<1)!(+Y>AG("N"))
WRITE !!,"You must enter a number from 1 to ",AG("N"),!,"or 'A' to add Application Submission Status information."
HANG 3
GOTO VAR
+16 ;DEPENDING ON USER'S CHOICE ITEM MAY BE AN EDIT ON THIS SCREEN OR
+17 ;IT MAY BE A PATIENT APPLICATION SUBMISSION WHICH IS ON ^AGEDBEE
+18 IF $DATA(CHOICES(+Y))
SET DORTN="APSUBDT"
SET AD0=$PIECE(CHOICES(+Y),U,2)
SET AD1=$PIECE(CHOICES(+Y),U,3)
SET AD2=$PIECE(CHOICES(+Y),U,4)
SET AD3=$PIECE(CHOICES(+Y),U,5)
DO @DORTN
GOTO VAR
+19 IF $DATA(Y)
Begin DoDot:1
+20 SET AGY=Y
+21 FOR AGI=1:1
SET AG("SEL")=+$PIECE(AGY,",",AGI)
IF AG("SEL")<1!(AG("SEL")>AG("N"))
QUIT
DO @($PIECE(AG("C"),",",AG("SEL")))
End DoDot:1
+22 ;I AGY=1,'$D(^AUPNAUTH(AD0,11,AD1,1,AD2)) D CLEAN(AD0,AD1,AD2) Q ;USER HAS DELETED THE APP. SUBMITTED DATE
+23 ; THEY CHOSE TO ENTER THIS SCREEN. IT IS GONE
+24 ; SO RETURN TO PREV. SCREEN
+25 ;D CLEAN(AD0,AD1,AD2)
+26 IF '$ORDER(^AUPNAUTH(AD0,11,AD1,1,AD2,0))
QUIT
+27 DO UPDATE1^AGED(DUZ(2),DFN,3,"")
+28 KILL AGI,AGY
+29 GOTO VAR
CLEAN(AD0,AD1,AD2) ;CLEAN EMPTY RECORD. IF NO SUBMISSION DATES HAVE
+1 ;BEEN ENTERED THEN THE RECORD IS MEANINGLESS
+2 ;CHECK HERE TO SEE IF ENTRIES HAVE ACTUALLY BEEN ENTERED. IF NOT
+3 ;CLEAR THE RECORD SINCE NOTHING REALLY EXISTS IN THIS
+4 ;RECORD AUPNAPPS(D0,11,D1,1,0)
+5 IF $ORDER(^AUPNAPPS(AD0,11,AD1,1,0))=""
Begin DoDot:1
+6 DO CLEANZER(AD0,AD1)
+7 WRITE !,"RECORD DELETED!"
HANG 2
End DoDot:1
+8 QUIT
CLEANZER(AD0,AD1) ;EP
+1 KILL DIK,DA
+2 SET DA(3)=AD0
SET DA(2)=AD1
SET DA=AD2
SET DIK="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1,"
DO ^DIK
+3 QUIT
END ;CLEAN UP THE VARS USED
+1 KILL AG,DLOUT,DTOUT,DFOUT,DQOUT,DA,DIC,DR,AGSCRN,Y,ADA,WDA,ADT,WDT,ADFN,WDFN,REC,NEWENTRY,CHOICES
+2 QUIT
DRAW ;EP
+1 KILL CHOICES
+2 SET AG("PG")="5BEE"
+3 SET ROUTID=$PIECE($TEXT(+1)," ")
+4 DO ^AGED
+5 DO GETAW
+6 QUIT
GETAW ;DISP
+1 KILL AG("C")
+2 FOR AG=1:1
Begin DoDot:1
+3 SET AGSCRN=$PIECE($TEXT(@1+AG),";;",2,15)
+4 IF AGSCRN[("*END*")
QUIT
+5 ;FLD CAP
SET CAPTION=$PIECE(AGSCRN,U)
+6 ;PARSE OUT CAP
IF $EXTRACT(CAPTION)="-"
DO CAPPARSE(CAPTION)
QUIT
+7 ;FILE OR SUBFILE #
SET DIC=$PIECE(AGSCRN,U,3)
+8 ;FLD #
SET DR=$PIECE(AGSCRN,U,4)
+9 ;SKIP LOGIC. IF THIS IS TRUE WE
SET SKIPEXEC=$PIECE(AGSCRN,"|",6)
+10 ; DON'T DEAL WITH THIS FLD AT ALL
+11 IF SKIPEXEC'=""
XECUTE SKIPEXEC
IF $TEST
QUIT
+12 ;NEWLINE OR INDENT
SET NEWLINE=$PIECE(AGSCRN,U,5)
+13 ;CAP INDENT
SET CAPDENT=$PIECE(AGSCRN,U,2)
+14 ;ITEM #
SET ITEMNUM=$PIECE(AGSCRN,U,6)
+15 ;TAG TO CALL TO EDIT THIS FLD
SET TAGCALL=$PIECE($PIECE(AGSCRN,U,7),"|",1)
+16 ;USE TO DISP FLD WHICH IS DEPENDENT ON ANOTHER FLD
SET EXECUTE=$PIECE(AGSCRN,"|",2)
+17 ;PLACE CODE TO BE XECUTED PRIOR TO DISP OF THE FLD
SET PREEXEC=$PIECE(AGSCRN,"|",3)
+18 ;PLACE CODE TO EXECUTE BEF CAP/FLD LBL
SET PRECAPEX=$PIECE(AGSCRN,"|",4)
+19 ;PLACE CODE HERE TO BE EXECUTED AFT DISP OF THE FLD
SET POSTEXEC=$PIECE(AGSCRN,"|",5)
+20 ;SELECTION STRING
IF TAGCALL'=""
SET $PIECE(AG("C"),",",ITEMNUM)=TAGCALL
+21 WRITE @NEWLINE
+22 WRITE ITEMNUM
+23 WRITE $SELECT(ITEMNUM'="":". ",1:"")
+24 IF PRECAPEX=""
WRITE @CAPDENT,$SELECT($GET(CAPTION)'="":CAPTION_": ",$GET(CAPTION)="":"",1:$PIECE($GET(^DD(DIC,DR,0)),U)_": ")
+25 IF PRECAPEX'=""
XECUTE PRECAPEX
IF $TEST
WRITE @CAPDENT,$SELECT($GET(CAPTION)'="":CAPTION_": ",$GET(CAPTION)="":"",1:$PIECE($GET(^DD(DIC,DR,0)),U)_": ")
+26 ;IF EDITING DISP DATA ONLY
+27 ;E DISPLAY ONLY THE CAPS
+28 IF 'NEWENTRY
Begin DoDot:2
+29 ;LOOP TO HANDLE MULTIPLE DR'S FOR ONE CAP
+30 IF DIC["9000045.1101"
Begin DoDot:3
+31 SET D0=AD2_","_AD1_","_AD0_","
+32 NEW PIECE
+33 SET VDR=DR
+34 FOR PIECE=1:1
SET DR=$PIECE(VDR,";",PIECE)
IF DR=""
QUIT
Begin DoDot:4
+35 IF $PIECE(PREEXEC,";",PIECE)'=""
XECUTE $PIECE(PREEXEC,";",PIECE)
+36 IF $PIECE(EXECUTE,";",PIECE)=""
WRITE $$GET1^DIQ(DIC,D0,DR)
+37 IF $PIECE(EXECUTE,";",PIECE)'=""
SET D0=$TRANSLATE(D0,",")
XECUTE $PIECE(EXECUTE,";",PIECE)
+38 IF $PIECE(POSTEXEC,";",PIECE)'=""
XECUTE $PIECE(POSTEXEC,";",PIECE)
End DoDot:4
+39 KILL PIECE
End DoDot:3
+40 ;LIST SUBMISSION STATUS DATES
+41 IF DIC["9000045.110101"
Begin DoDot:3
+42 ;PREVIOUS SECTION'S ITEMS END AT 4
SET ITEM=4
+43 SET VD0=AD0
+44 SET VD1=AD1
+45 SET VD2=AD2
+46 IF '$ORDER(^AUPNAPPS(VD0,11,VD1,1,VD2,1,0))
WRITE !,"NO STATUSES ENTERED"
QUIT
+47 SET VD3=0
+48 FOR
SET VD3=$ORDER(^AUPNAPPS(VD0,11,VD1,1,VD2,1,VD3))
IF 'VD3
QUIT
Begin DoDot:4
+49 SET ITEM=ITEM+1
+50 SET CHOICES(ITEM)=DIC_U_VD0_U_VD1_U_VD2_U_VD3
+51 SET D0=VD3_","_VD2_","_VD1_","_VD0_","
+52 WRITE !,ITEM_"."
+53 NEW PIECE
+54 FOR PIECE=1:1
SET DR=$PIECE(VDR,";",PIECE)
IF DR=""
QUIT
Begin DoDot:5
+55 IF $PIECE(PREEXEC,";",PIECE)'=""
XECUTE $PIECE(PREEXEC,";",PIECE)
+56 IF $PIECE(EXECUTE,";",PIECE)=""
WRITE $$GET1^DIQ(DIC,D0,DR)
+57 IF $PIECE(EXECUTE,";",PIECE)'=""
XECUTE $PIECE(EXECUTE,";",PIECE)
+58 IF $PIECE(POSTEXEC,";",PIECE)'=""
XECUTE $PIECE(POSTEXEC,";",PIECE)
End DoDot:5
+59 KILL PIECE
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
IF $GET(AGSCRN)[("*END*")
QUIT
+60 SET AG("N")=$GET(ITEM)
+61 WRITE !,$GET(AGLINE("-"))
+62 KILL MYERRS,MYVARS
+63 DO FETCHERR^AGEDERR(AG("PG"),.MYERRS)
+64 SET MYVARS("DFN")=DFN
SET MYVARS("FINDCALL")=""
SET MYVARS("SELECTION")=$GET(AGSELECT)
SET MYVARS("SITE")=DUZ(2)
+65 DO EDITCHEK^AGEDERR(.MYERRS,.MYVARS,1)
+66 DO VERIF^AGUTILS
+67 QUIT
CAPPARSE(CAPTION) ;EP - PARSE OUT THE CAP
+1 NEW LBRACKET,RBRACKET
+2 SET LBRACKET="["
SET RBRACKET="]"
+3 ;- DENOTES SIMPLE SECTION
IF CAPTION'[LBRACKET
WRITE !,$EXTRACT(CAPTION,2,199)
QUIT
+4 ;PARSE OUT AND INSERT FLD VALUES
+5 SET FIELDS=$LENGTH(CAPTION,LBRACKET)
+6 WRITE !,$EXTRACT($PIECE(CAPTION,LBRACKET),2,199)
+7 FOR PIECE=1:1:FIELDS
Begin DoDot:1
+8 SET FIELD=$PIECE($PIECE(CAPTION,LBRACKET,PIECE),RBRACKET)
+9 WRITE $$GET1^DIQ($PIECE(FIELD,";"),AD1_","_AD0_",",$PIECE(FIELD,";",2))
End DoDot:1
+10 WRITE $PIECE(CAPTION,RBRACKET,2)
+11 KILL LBRACKET,RBRACKET
+12 QUIT
WMSG ;DISP THIS MSG IF THERE IS NO AUTHORIZATION DT FOUND
+1 WRITE !,"You must first enter a APPLICATION SUBMISSION DATE"
+2 QUIT
+3 ;;;;;;;;;;;;;;;;;;;;;;;;;
+4 ; EDIT AUTHORIZATION FLDS
+5 ;;;;;;;;;;;;;;;;;;;;;;;;;
NEWENTRY ;EP - NEW ENTRY
APDTSUB ;APPLICATION SUBMISSION DT
+1 KILL DIC,DIE,DR,DA
+2 SET DA(1)=AD1
+3 SET DA(2)=AD0
+4 SET DIC="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
+5 SET DIC(0)="ALMEQ"
+6 KILL DD,DO
+7 DO ^DIC
+8 IF +Y>0
SET AD2=+Y
QUIT
+9 QUIT
APSUBVIA ;EP - EDIT APPLICATION SUBMITTED VIA
+1 KILL DIC,DR,DIE,DA,DD,DO
+2 SET DA(1)=AD1
+3 SET DA(2)=AD0
+4 SET DA=AD2
+5 SET DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
+6 SET DR=.02
+7 DO ^DIE
+8 KILL DIC,DR,DIE,DA
+9 QUIT
APPREAS ;EP - EDIT REASON FOR SUBMISSION
+1 KILL DIC,DR,DIE,DA,DD,DO
+2 SET DA(1)=AD1
+3 SET DA(2)=AD0
+4 SET DA=AD2
+5 SET DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
+6 SET DR=".03"
+7 DO ^DIE
+8 KILL DIC,DR,DIE,DA
+9 QUIT
APPSUBBY ;EP - EDIT REASON FOR SUBMISSION
+1 KILL DIC,DR,DIE,DA,DD,DO
+2 SET DA(1)=AD1
+3 SET DA(2)=AD0
+4 SET DA=AD2
+5 SET DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
+6 SET DR=".04"
+7 DO ^DIE
+8 KILL DIC,DR,DIE,DA
+9 QUIT
ADSUBSTA ;EP - ADD APPLICATION SUBMISSION DT
+1 KILL DIC,DIE,DR,DA
+2 SET DA(2)=AD1
+3 SET DA(3)=AD0
+4 SET DA(1)=AD2
+5 SET DIC="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1,"_DA(1)_",1,"
+6 SET DIC(0)="ALMEQ"
+7 KILL DD,DO
+8 DO ^DIC
+9 IF +Y<0
QUIT
+10 SET AD3=+Y
+11 DO APSUBST
+12 QUIT
APSUBDT ;EP - EDIT APPLICATION SUBMISSION STATUS DT
+1 KILL DIC,DR,DIE,DA,DD,DO
+2 SET DA(2)=AD1
+3 SET DA(3)=AD0
+4 SET DA(1)=AD2
+5 SET DA=AD3
+6 SET DIE="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1,"_DA(1)_",1,"
+7 SET DR=".01"
+8 DO ^DIE
+9 ;SUBMISION STATUS DT DELETED
IF '$DATA(DA)
QUIT
+10 KILL DIC,DR,DIE,DA
+11 DO APSUBST
+12 QUIT
APSUBST ;EP - EDIT SUBMISSION STATUS
+1 KILL DIC,DR,DIE,DA,DD,DO
+2 SET DA(2)=AD1
+3 SET DA(3)=AD0
+4 SET DA(1)=AD2
+5 SET DA=AD3
+6 SET DIE="^AUPNAPPS("_DA(3)_",11,"_DA(2)_",1,"_DA(1)_",1,"
+7 SET DR=".02"
+8 DO ^DIE
+9 KILL DIC,DR,DIE,DA
+10 QUIT
EDDTSUB ;EDIT DT APPLICATION SUBMITTED
+1 KILL DIC,DR,DIE,DA,DD,DO
+2 SET DA(1)=AD1
+3 SET DA(2)=AD0
+4 SET DA=AD2
+5 SET DIE="^AUPNAPPS("_DA(2)_",11,"_DA(1)_",1,"
+6 SET DR=".01"
+7 DO ^DIE
+8 KILL DIC,DR,DIE,DA
+9 QUIT
+10 ; ****************************************************************
+11 ; ON LINES BELOW:
+12 ; U "^" DELIMITED
+13 ; AGSCRN CONTAINS THE $TEXT OF EACH LINE BELOW STARTING AT TAG '1'
+14 ; PIECE VAR DESC
+15 ; ----- -------- -----------------------------------------------
+16 ; 1 CAPTION FLD CAP ASSIGNED BY PROGRAMMER OVERRIDES FLD LBL IF POPULATED
+17 ; 2 CAPDENT POSITION ON LINE TO DISP CAP
+18 ; 3 DIC FILE OR SUBFILE #
+19 ; 4 DR FLD # - THESE CAN BE SEPARATED BY ";" THIS ALLOWS
+20 ; MULTIPLE FLDS TO BE PRINTED WITH THE SAME CAP AS IN
+21 ; 'CITY,STATE,ZIP'
+22 ; 5 NEWLINE NEW LINE OR NOT (MUST BE EITHER A '!' OR '?#')
+23 ; USE THIS TO INDENT THE LINE
+24 ; 6 ITEMNUM ITEM # ASSIGNMENT. USE THIS TO ASSIGN THE ITEM #
+25 ; USED TO ALLOW USER TO CHOOSE THIS FLD TO EDIT
+26 ; 7 TAGCALL TAG TO CALL WHEN THIS FLD IS CHOSEN BY USER TO BE EDITED
+27 ;
+28 ; BAR "|" DELIMITED
+29 ; PIECE VAR DESC
+30 ; ----- -------- ----------------------------------------------
+31 ; 2 EXECUTE EXECUTE CODE TO GET FLD THAT ANOTHER IS POINTING TO.
+32 ; EXECUTED AFT FLD PRINT. IF MUTLIPLE FLDS ARE PRINTED
+33 ; THEN MULTIPLE EXECUTE CODES CAN BE SEPARATED BY ";".
+34 ; 3 PREEXEC EXECUTE CODE TO DO BEF FLD PRINTS. USE TO SCREEN OUT
+35 ; PRINTING A FLD VALUE. FOR MULTIPLES SEPARATE BY ";"
+36 ; 4 PRECAPEX EXECUTE CODE TO DO BEF PRINTING THE CAP OR FLD LBL.
+37 ; USE TO SCREEN OUT PRINTING A CAP/FLD LBL
+38 ; 5 POSTEXEC EXECUTE CODE TO DO AFT PRINTING THE FLD DATA
+39 ; FOR MULTIPLES SEPARATE BY ";"
+40 ; 6 SKIPEXEC EXECUTE CODE TO SKIP ENTIRE FLD
+41 ;
1 ;
+1 ;;--APPLICATION SUBMISSION DATA---------------------------------------------------
+2 ;;Date Submitted^?0^9000045.1101^.01^!?0^1^EDDTSUB||
+3 ;;App. Submitted via^?0^9000045.1101^.02^?40^2^APSUBVIA
+4 ;;Submission Reason^?0^9000045.1101^.03^!^3^APPREAS
+5 ;;Submitted by^?0^9000045.1101^.04^!^4^APPSUBBY
+6 ;;-
+7 ;;--SUBMISSION STATUS DATE------------SUBMISSION STATUS----------------------------
+8 ;;^?0^9000045.110101^.01;.02^?0^^APPSTADT||;W ?40
+9 ;;*END*
+10 ;;^?0^9000045.110101^.02^?40^4^APPSTAT