DGPFLF2 ;ALB/KCL - PRF FLAG MANAGEMENT LM PROTOCOL ACTIONS ; 3/18/03
 ;;5.3;Registration;**425**;Aug 13, 1993 
 ;
 ;no direct entry
 QUIT
 ;
 ;
SL ;Entry point for DGPF SORT FLAG LIST action protocol.
 ;
 ;  Input:
 ;   DGSRTBY - flag list sort by criteria (N=Flag Name, T=Flage Type)
 ;
 ; Output:
 ;   DGSRTBY - flag list sort by criteria (N=Flag Name, T=Flage Type)
 ;   VALMBCK - 'R' = refresh screen
 ;
 N DGCODE,DGFG
 ;
 ;set screen to full scrolling region
 D FULL^VALM1
 ;
 D
 . ;- prompt for sort criteria
 . W !
 . S DGFG=DGSRTBY  ;save original sort to default to
 . S DGCODE="Y"    ;DIC(0)="Y" for Yes/No answering
 . S DGSRTBY=$$ANSWER^DGPFUT("Would you like to sort the list by '"_$S($G(DGFG)="N":"Flag Type",1:"Flag Name")_"'","Yes",DGCODE)
 . I $G(DGSRTBY)'=1 S DGSRTBY=DGFG Q      ;no sort change
 . S DGSRTBY=$S($G(DGFG)="N":"T",1:"N")  ;change sort (flip / flop)
 . ;
 . ;- re-build list for selected sort criteria
 . D BLD^DGPFLF
 ;
 ;return to LM (refresh screen)
 S VALMBCK="R"
 Q
 ;
 ;
CC ;Entry point for DGPF CHANGE CATEGORY action protocol.
 ;
 ;  Input:
 ;   DGCAT - flag category (1=National, 2=Local)
 ;
 ; Output:
 ;    DGCAT - flag category (1=National, 2=Local)
 ;  VALMBCK - 'R' = refresh screen
 ;
 N DGCODE
 N DGFG
 ;
 ;set screen to full scrolling region
 D FULL^VALM1
 ;
 ;change category
 S DGCAT=$S($G(DGCAT)=1:2,1:1)
 ;
 ;re-build list for category change
 D BLD^DGPFLF
 ;
 ;return to LM (refresh screen)
 S VALMBCK="R"
 Q
 ;
 ;
DF ;Entry point for DGPF DISPLAY FLAG DETAIL action protocol.
 ;
 ; Input:
 ;
 ; Output:
 ;   VALMBCK - 'R' = refresh screen
 ;
 N SEL     ;user selection
 N VALMY   ;output of EN^VALM2 call, array of user selected entries
 N DGPFIEN ;IEN of record in PRF NATIONAL FLAG or PRF LOCAL FLAG file
 ;          [ex: "1;DGPF(26.15,"]
 ;
 ;set screen to full scroll region
 D FULL^VALM1
 ;
 ;is action selection allowed?
 I '$D(@VALMAR@("IDX")) D  Q
 . W !!?2,">>> '"_$P($G(XQORNOD(0)),U,3)_"' action not allowed at this point.",*7
 . W !?6,"There are no record flags to display."
 . D PAUSE^VALM1
 . S VALMBCK="R"
 ;
 ;ask user to select a single flag for displaying details
 S (SEL,DGPFIEN,VALMBCK)=""
 D EN^VALM2($G(XQORNOD(0)),"S")
 ;
 ;process user selection
 S SEL=$O(VALMY(""))
 I SEL,$D(@VALMAR@("IDX",SEL)) D
 . S DGPFIEN=$P($G(@VALMAR@("IDX",SEL)),U)
 . ;- display flag details
 . N VALMHDR
 . D EN^DGPFLFD
 ;
 ;return to LM (refresh screen)
 S VALMBCK="R"
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGPFLF2   2532     printed  Sep 23, 2025@20:23:56                                                                                                                                                                                                     Page 2
DGPFLF2   ;ALB/KCL - PRF FLAG MANAGEMENT LM PROTOCOL ACTIONS ; 3/18/03
 +1       ;;5.3;Registration;**425**;Aug 13, 1993 
 +2       ;
 +3       ;no direct entry
 +4        QUIT 
 +5       ;
 +6       ;
SL        ;Entry point for DGPF SORT FLAG LIST action protocol.
 +1       ;
 +2       ;  Input:
 +3       ;   DGSRTBY - flag list sort by criteria (N=Flag Name, T=Flage Type)
 +4       ;
 +5       ; Output:
 +6       ;   DGSRTBY - flag list sort by criteria (N=Flag Name, T=Flage Type)
 +7       ;   VALMBCK - 'R' = refresh screen
 +8       ;
 +9        NEW DGCODE,DGFG
 +10      ;
 +11      ;set screen to full scrolling region
 +12       DO FULL^VALM1
 +13      ;
 +14       Begin DoDot:1
 +15      ;- prompt for sort criteria
 +16           WRITE !
 +17      ;save original sort to default to
               SET DGFG=DGSRTBY
 +18      ;DIC(0)="Y" for Yes/No answering
               SET DGCODE="Y"
 +19           SET DGSRTBY=$$ANSWER^DGPFUT("Would you like to sort the list by '"_$SELECT($GET(DGFG)="N":"Flag Type",1:"Flag Name")_"'","Yes",DGCODE)
 +20      ;no sort change
               IF $GET(DGSRTBY)'=1
                   SET DGSRTBY=DGFG
                   QUIT 
 +21      ;change sort (flip / flop)
               SET DGSRTBY=$SELECT($GET(DGFG)="N":"T",1:"N")
 +22      ;
 +23      ;- re-build list for selected sort criteria
 +24           DO BLD^DGPFLF
           End DoDot:1
 +25      ;
 +26      ;return to LM (refresh screen)
 +27       SET VALMBCK="R"
 +28       QUIT 
 +29      ;
 +30      ;
CC        ;Entry point for DGPF CHANGE CATEGORY action protocol.
 +1       ;
 +2       ;  Input:
 +3       ;   DGCAT - flag category (1=National, 2=Local)
 +4       ;
 +5       ; Output:
 +6       ;    DGCAT - flag category (1=National, 2=Local)
 +7       ;  VALMBCK - 'R' = refresh screen
 +8       ;
 +9        NEW DGCODE
 +10       NEW DGFG
 +11      ;
 +12      ;set screen to full scrolling region
 +13       DO FULL^VALM1
 +14      ;
 +15      ;change category
 +16       SET DGCAT=$SELECT($GET(DGCAT)=1:2,1:1)
 +17      ;
 +18      ;re-build list for category change
 +19       DO BLD^DGPFLF
 +20      ;
 +21      ;return to LM (refresh screen)
 +22       SET VALMBCK="R"
 +23       QUIT 
 +24      ;
 +25      ;
DF        ;Entry point for DGPF DISPLAY FLAG DETAIL action protocol.
 +1       ;
 +2       ; Input:
 +3       ;
 +4       ; Output:
 +5       ;   VALMBCK - 'R' = refresh screen
 +6       ;
 +7       ;user selection
           NEW SEL
 +8       ;output of EN^VALM2 call, array of user selected entries
           NEW VALMY
 +9       ;IEN of record in PRF NATIONAL FLAG or PRF LOCAL FLAG file
           NEW DGPFIEN
 +10      ;          [ex: "1;DGPF(26.15,"]
 +11      ;
 +12      ;set screen to full scroll region
 +13       DO FULL^VALM1
 +14      ;
 +15      ;is action selection allowed?
 +16       IF '$DATA(@VALMAR@("IDX"))
               Begin DoDot:1
 +17               WRITE !!?2,">>> '"_$PIECE($GET(XQORNOD(0)),U,3)_"' action not allowed at this point.",*7
 +18               WRITE !?6,"There are no record flags to display."
 +19               DO PAUSE^VALM1
 +20               SET VALMBCK="R"
               End DoDot:1
               QUIT 
 +21      ;
 +22      ;ask user to select a single flag for displaying details
 +23       SET (SEL,DGPFIEN,VALMBCK)=""
 +24       DO EN^VALM2($GET(XQORNOD(0)),"S")
 +25      ;
 +26      ;process user selection
 +27       SET SEL=$ORDER(VALMY(""))
 +28       IF SEL
               IF $DATA(@VALMAR@("IDX",SEL))
                   Begin DoDot:1
 +29                   SET DGPFIEN=$PIECE($GET(@VALMAR@("IDX",SEL)),U)
 +30      ;- display flag details
 +31                   NEW VALMHDR
 +32                   DO EN^DGPFLFD
                   End DoDot:1
 +33      ;
 +34      ;return to LM (refresh screen)
 +35       SET VALMBCK="R"
 +36       QUIT