FBXIP132 ;WOIFO/SAB - PATCH INSTALL ROUTINE ;4/25/2012
 ;;3.5;FEE BASIS;**132**;JAN 30, 1995;Build 17
 ; 
 ; ICRs
 ;  #10141  BMES^XPDUTL, MES^XPDUTL, $$NEWCP^XPDUTL, $$PATCH^XPDUTL
 ;  #4440   $$PROD^XUPROD
 ;
 ; the top of the routine is the environment check entry point
 ;
 N FBSKIP
 S FBSKIP=""
 ;
 ; determine if environmental check should be skipped
 I FBSKIP="",$G(XPDENV)'=1 S FBSKIP="Not a KIDS Install phase."
 I FBSKIP="",$$PROD^XUPROD()'=1 S FBSKIP="Not a production account."
 I FBSKIP="",$$PATCH^XPDUTL("FB*3.5*132")=1 S FBSKIP="Patch was previously installed."
 I FBSKIP]"" D
 . D BMES^XPDUTL(FBSKIP)
 . D MES^XPDUTL("Skipping environmental check.")
 ;
 I FBSKIP="" D
 . N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
 . D BMES^XPDUTL("Performing environmental check.")
 . I $O(^FBAA(161.7,"AC","T",0)) D  Q
 . . D MES^XPDUTL("This patch cannot be installed because there are.")
 . . D MES^XPDUTL("batches with status equal to TRANSMITTED.")
 . . D MES^XPDUTL("The Active Batch Listing by Status option can be used")
 . . D MES^XPDUTL("to generate a list of the batches with this status.")
 . . S XPDQUIT=2
 . ;
 . ; ask user for confirmation
 . D BMES^XPDUTL("The Chief Fiscal Officer or representative must verify")
 . D MES^XPDUTL("there are no pending payments on Central Fee report")
 . D MES^XPDUTL("number 12007 for your site.")
 . D MES^XPDUTL(" ")
 . S DIR(0)="Y"
 . S DIR("A")="Has the Chief Fiscal Officer approved installation of this patch"
 . D ^DIR K DIR
 . I $D(DIRUT)!'Y S XPDQUIT=2
 Q
 ;
PR ; pre-install entry point
 ; create KIDS checkpoints with call backs
 N FBX,Y
 F FBX="DELAJ" D
 . S Y=$$NEWCP^XPDUTL(FBX,FBX_"^FBXIP132")
 . I 'Y D BMES^XPDUTL("ERROR Creating "_FBX_" Checkpoint.")
 Q
 ;
DELAJ ; Delete AJ x-ref definition
 D BMES^XPDUTL("    Deleting traditional AJ x-ref from file 162 ...")
 ;
 ; delete traditional mumps AJ x-ref definition from INVOICE NUMBER
 ; it will be replaced by an equivalent new-style regular AJ x-ref
 ;   during the KIDS install of the partial DD
 ; the cross-referance data will not be impacted
 D DELIX^DDMOD(162.03,14,2,"","")
 ;
 D MES^XPDUTL("    Done.")
 Q
 ;
PS ; post-install entry point
 ; create KIDS checkpoints with call backs
 N FBX,Y
 F FBX="XREF" D
 . S Y=$$NEWCP^XPDUTL(FBX,FBX_"^FBXIP132")
 . I 'Y D BMES^XPDUTL("ERROR Creating "_FBX_" Checkpoint.")
 Q
 ;
XREF ; Set new x-ref
 N DIK
 D BMES^XPDUTL("    Setting File 161.45 AN x-ref...")
 ;
 S DIK="^FBAA(161.45,"
 S DIK(1)="2^AN"
 D ENALL^DIK
 ;
 D MES^XPDUTL("    Done.")
 Q
 ;
 ;FBXIP132
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFBXIP132   2599     printed  Sep 23, 2025@19:37:19                                                                                                                                                                                                    Page 2
FBXIP132  ;WOIFO/SAB - PATCH INSTALL ROUTINE ;4/25/2012
 +1       ;;3.5;FEE BASIS;**132**;JAN 30, 1995;Build 17
 +2       ; 
 +3       ; ICRs
 +4       ;  #10141  BMES^XPDUTL, MES^XPDUTL, $$NEWCP^XPDUTL, $$PATCH^XPDUTL
 +5       ;  #4440   $$PROD^XUPROD
 +6       ;
 +7       ; the top of the routine is the environment check entry point
 +8       ;
 +9        NEW FBSKIP
 +10       SET FBSKIP=""
 +11      ;
 +12      ; determine if environmental check should be skipped
 +13       IF FBSKIP=""
               IF $GET(XPDENV)'=1
                   SET FBSKIP="Not a KIDS Install phase."
 +14       IF FBSKIP=""
               IF $$PROD^XUPROD()'=1
                   SET FBSKIP="Not a production account."
 +15       IF FBSKIP=""
               IF $$PATCH^XPDUTL("FB*3.5*132")=1
                   SET FBSKIP="Patch was previously installed."
 +16       IF FBSKIP]""
               Begin DoDot:1
 +17               DO BMES^XPDUTL(FBSKIP)
 +18               DO MES^XPDUTL("Skipping environmental check.")
               End DoDot:1
 +19      ;
 +20       IF FBSKIP=""
               Begin DoDot:1
 +21               NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
 +22               DO BMES^XPDUTL("Performing environmental check.")
 +23               IF $ORDER(^FBAA(161.7,"AC","T",0))
                       Begin DoDot:2
 +24                       DO MES^XPDUTL("This patch cannot be installed because there are.")
 +25                       DO MES^XPDUTL("batches with status equal to TRANSMITTED.")
 +26                       DO MES^XPDUTL("The Active Batch Listing by Status option can be used")
 +27                       DO MES^XPDUTL("to generate a list of the batches with this status.")
 +28                       SET XPDQUIT=2
                       End DoDot:2
                       QUIT 
 +29      ;
 +30      ; ask user for confirmation
 +31               DO BMES^XPDUTL("The Chief Fiscal Officer or representative must verify")
 +32               DO MES^XPDUTL("there are no pending payments on Central Fee report")
 +33               DO MES^XPDUTL("number 12007 for your site.")
 +34               DO MES^XPDUTL(" ")
 +35               SET DIR(0)="Y"
 +36               SET DIR("A")="Has the Chief Fiscal Officer approved installation of this patch"
 +37               DO ^DIR
                   KILL DIR
 +38               IF $DATA(DIRUT)!'Y
                       SET XPDQUIT=2
               End DoDot:1
 +39       QUIT 
 +40      ;
PR        ; pre-install entry point
 +1       ; create KIDS checkpoints with call backs
 +2        NEW FBX,Y
 +3        FOR FBX="DELAJ"
               Begin DoDot:1
 +4                SET Y=$$NEWCP^XPDUTL(FBX,FBX_"^FBXIP132")
 +5                IF 'Y
                       DO BMES^XPDUTL("ERROR Creating "_FBX_" Checkpoint.")
               End DoDot:1
 +6        QUIT 
 +7       ;
DELAJ     ; Delete AJ x-ref definition
 +1        DO BMES^XPDUTL("    Deleting traditional AJ x-ref from file 162 ...")
 +2       ;
 +3       ; delete traditional mumps AJ x-ref definition from INVOICE NUMBER
 +4       ; it will be replaced by an equivalent new-style regular AJ x-ref
 +5       ;   during the KIDS install of the partial DD
 +6       ; the cross-referance data will not be impacted
 +7        DO DELIX^DDMOD(162.03,14,2,"","")
 +8       ;
 +9        DO MES^XPDUTL("    Done.")
 +10       QUIT 
 +11      ;
PS        ; post-install entry point
 +1       ; create KIDS checkpoints with call backs
 +2        NEW FBX,Y
 +3        FOR FBX="XREF"
               Begin DoDot:1
 +4                SET Y=$$NEWCP^XPDUTL(FBX,FBX_"^FBXIP132")
 +5                IF 'Y
                       DO BMES^XPDUTL("ERROR Creating "_FBX_" Checkpoint.")
               End DoDot:1
 +6        QUIT 
 +7       ;
XREF      ; Set new x-ref
 +1        NEW DIK
 +2        DO BMES^XPDUTL("    Setting File 161.45 AN x-ref...")
 +3       ;
 +4        SET DIK="^FBAA(161.45,"
 +5        SET DIK(1)="2^AN"
 +6        DO ENALL^DIK
 +7       ;
 +8        DO MES^XPDUTL("    Done.")
 +9        QUIT 
 +10      ;
 +11      ;FBXIP132