GMRCFPA ;DSS/MBS - GMRC FEE PARAM List Utilities ;2/21/12 9:35am
;;3.0;CONSULT/REQUEST TRACKING;**74**;DEC 27, 1997;Build 4
Q
ADD ;Adds stuff
N DIC,I
S DIC=123.5,DIC(0)="AEMQ" D ^DIC
Q:+$G(Y)'>0
I $$INLIST(Y) S VALMSG="**SERVICE ALREADY IN LIST**" Q
S GMRCFPX(VALMCNT+1,0)=+Y
D BUILD^GMRCFP
S VALMSG="**"_$P(Y,U,2)_" ADDED**"
S GMRCCHNG=1
S VALMBCK="R"
Q
INLIST(IEN) ;Is the item already in the list?
N I,RET
S RET=0
F I=1:1:VALMCNT D Q:RET
. I +IEN=$G(GMRCFPX(I,0)) S RET=1
Q RET
;
REMOVE ;Removes stuff
N J,END,IEN,NAME,DIR
S DIR(0)="N^1:"_VALMCNT_":0"
S DIR("A")="Select service by number in list above"
D ^DIR
S END=VALMCNT-1
Q:'+X
S IEN=GMRCFPX(Y,0)
S NAME=$$GET1^DIQ(123.5,IEN_",",".01")
F J=Y:1:END D
. M GMRCFPX(J)=GMRCFPX(J+1)
K GMRCFPX(VALMCNT)
D BUILD^GMRCFP
S VALMSG="**"_NAME_" REMOVED**"
S GMRCCHNG=1
S VALMBCK="R"
Q
SAVE ;Saves
N GMRCER
I $D(GMRCFPX)<10 S GMRCFPX="@"
D EN^XPAR("SYS","GMRC FEE SERVICES",,.GMRCFPX,.GMRCER)
S VALMSG="**CURRENT LIST SAVED**"
S GMRCCHNG=0
Q
EXIT ;Checks for unsaved changes and asks if user would like to save before quitting
N DIR
S VALMBCK=""
I +$G(GMRCCHNG) D
. S DIR(0)="Y",DIR("B")="NO"
. S DIR("A")="Would you like to save your changes to the list"
. D ^DIR
. I Y D SAVE
S VALMBCK="Q"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRCFPA 1344 printed Dec 13, 2024@01:45:37 Page 2
GMRCFPA ;DSS/MBS - GMRC FEE PARAM List Utilities ;2/21/12 9:35am
+1 ;;3.0;CONSULT/REQUEST TRACKING;**74**;DEC 27, 1997;Build 4
+2 QUIT
ADD ;Adds stuff
+1 NEW DIC,I
+2 SET DIC=123.5
SET DIC(0)="AEMQ"
DO ^DIC
+3 if +$GET(Y)'>0
QUIT
+4 IF $$INLIST(Y)
SET VALMSG="**SERVICE ALREADY IN LIST**"
QUIT
+5 SET GMRCFPX(VALMCNT+1,0)=+Y
+6 DO BUILD^GMRCFP
+7 SET VALMSG="**"_$PIECE(Y,U,2)_" ADDED**"
+8 SET GMRCCHNG=1
+9 SET VALMBCK="R"
+10 QUIT
INLIST(IEN) ;Is the item already in the list?
+1 NEW I,RET
+2 SET RET=0
+3 FOR I=1:1:VALMCNT
Begin DoDot:1
+4 IF +IEN=$GET(GMRCFPX(I,0))
SET RET=1
End DoDot:1
if RET
QUIT
+5 QUIT RET
+6 ;
REMOVE ;Removes stuff
+1 NEW J,END,IEN,NAME,DIR
+2 SET DIR(0)="N^1:"_VALMCNT_":0"
+3 SET DIR("A")="Select service by number in list above"
+4 DO ^DIR
+5 SET END=VALMCNT-1
+6 if '+X
QUIT
+7 SET IEN=GMRCFPX(Y,0)
+8 SET NAME=$$GET1^DIQ(123.5,IEN_",",".01")
+9 FOR J=Y:1:END
Begin DoDot:1
+10 MERGE GMRCFPX(J)=GMRCFPX(J+1)
End DoDot:1
+11 KILL GMRCFPX(VALMCNT)
+12 DO BUILD^GMRCFP
+13 SET VALMSG="**"_NAME_" REMOVED**"
+14 SET GMRCCHNG=1
+15 SET VALMBCK="R"
+16 QUIT
SAVE ;Saves
+1 NEW GMRCER
+2 IF $DATA(GMRCFPX)<10
SET GMRCFPX="@"
+3 DO EN^XPAR("SYS","GMRC FEE SERVICES",,.GMRCFPX,.GMRCER)
+4 SET VALMSG="**CURRENT LIST SAVED**"
+5 SET GMRCCHNG=0
+6 QUIT
EXIT ;Checks for unsaved changes and asks if user would like to save before quitting
+1 NEW DIR
+2 SET VALMBCK=""
+3 IF +$GET(GMRCCHNG)
Begin DoDot:1
+4 SET DIR(0)="Y"
SET DIR("B")="NO"
+5 SET DIR("A")="Would you like to save your changes to the list"
+6 DO ^DIR
+7 IF Y
DO SAVE
End DoDot:1
+8 SET VALMBCK="Q"
+9 QUIT