PRC5CON ;WISC/PLT-IFCAP V5 STATION MERGE/CALM CODE SHEET CONVERSION ; 08/22/95  3:18 PM
V ;;5.0;IFCAP;**27**;4/21/95
 ;QUIT  ; invalid entry
 ;
EN ;start station merge/convert CALM code sheet to FMS
 N PRCIVER,PRCRI,PRCFIXV,PRCOPT,PRC5INST,PRCQ21,PRCDUZ
Q1 D EN^DDIOL(" ") S PRCFIXV="IFCAP"_$P($T(+2^PRCINIT),";",3)
 S PRCIVER=$$IVER("IFCAP",PRCFIXV)
 I +PRCIVER'=5 D EN^DDIOL("Your site must install IFCAP v5 before running this patch routine.") G EXIT
 D EN^DDIOL(" "),EN^DDIOL("If your site has substations and you are not a Conversion III site, run"),EN^DDIOL("     Options 1 & 2 only.")
 D EN^DDIOL("If your site has substations and you are a Conversion III site, run "),EN^DDIOL("     Options 1, 2, 3 & 4.")
  D EN^DDIOL("If your site has no substations and you are a Conversion III site, run"),EN^DDIOL("     Options 3 & 4.")
 D EN^DDIOL("If your site has no substations and you are not a Conversion III site,"),EN^DDIOL("    DO NOT run ANY Options.")
 D EN^DDIOL(" ")
 D SC^PRC0A(.X,.Y,"Select IFCAP V5 option","OM^1:Requests(1996-) Substation ENTER/EDIT;2:Purchase Orders(1996-) Substation ENTER/EDIT;3:Convert PO CALM Code Sheets(1996-) to FMS Documents;4:CALM Code Sheet Conversion Exception List","")
 G:X["^"!(X="") EXIT
 S PRCOPT=X
 I PRCOPT=3 D  G:X["^"!(X="") Q1 S PRCQ21=Y G Q3
 . D YN^PRC0A(.X,.Y,"Submit the File 442 Conversion & Generating FMS Doc. to the TASK MANAGER","O","")
 . QUIT
 I PRCOPT=4 G Q3
 ;
Q2 ;select auto/single
 D SC^PRC0A(.X,.Y,"Select "_$P("REQUESTS^PURCHASE ORDER","^",PRCOPT)_" Substation Option","OM^1:AUTO PROMPT TRANSACTION #;2:MANUAL SELECT TRANSACTION #","")
 G:X["^"!(X="") Q1
 S $P(PRCOPT,"^",2)=X
Q3 D YN^PRC0A(.X,.Y,"Ready to run the selected option(s) '"_$TR(PRCOPT,"^","-")_"'","O","NO")
 G:X["^"!(X="")!(Y<1) Q1
 I +PRCOPT<3,'$O(^PRC(411,"UP","")) D EN^DDIOL("No substations are in file, use substation ENTER/EDIT to add first.") G Q1
 I +PRCOPT<3 D  D EN^PRC5CON1:$P(PRCOPT,"^",2)=1,EN1^PRC5CON1:$P(PRCOPT,"^",2)=2 G Q1
 . S PRCDD=$S(PRCOPT-2:410,1:442)
 . QUIT
 I PRCOPT=4 D EN1 G Q1
 S PRCDUZ=DUZ
 I PRCQ21=1 D  G EXIT
 . D EN^DDIOL("NOTE: Please schedule this task with a date '10/14/95'.")
 . D EN^DDIOL("IFCAP V5 CALM CODE SHEET CONVERSION SUBMITTED TO TASK MANAGER AT "_$$NOW^PRC5A)
 . S A=$$TASK^PRC0B2("EN^PRC5CON2~IFCAP V5 CALM CODE SHEET CONVERSION","PRCDUZ",1)
 . I A D EN^DDIOL("IFCAP V5 CALM CODE SHEET CONVERSION HAS TASK NUMBER "_$P(A,"^"))
 . QUIT
 D:DT>2951013 EN^PRC5CON2
 I DT<2951014 D EN^DDIOL("It is too early to run the CALM code sheet conversion."),EN^DDIOL("Please run after 10/13/95.")
EXIT ;
 QUIT
 ;
EN1 ;calm code sheet conversion exception list
 S PRCRI(420.92)=$O(^PRCU(420.92,"B","PRCCALM","")) D:'PRCRI(420.92)
 I 'PRCRI(420.92) D EN^DDIOL("Nothing in file. You must run this list after Option 3 has completed")
 D
 . N L,DIC,FLDS,BY,FR,TO,DHD
 . S L=0,DIC=420.92,FLDS="4;""""",BY="@NUMBER",FR=PRCRI(420.92),TO=FR
 . S DHD="CALM CODE SHEET CONVERSION EXCEPTION LIST"
 . D EN1^DIP
 . QUIT
 QUIT
 ;
 ;prca=package name .01 in file 9.4, prcb=fix value .01 in file 420.92
IVER(PRCA,PRCB) ;get initial version #
 N A
 S A="",PRCRI(420.92)=$O(^PRCU(420.92,"B",PRCB,0)) I PRCRI(420.92) D
 . S A=$P(^PRCU(420.92,PRCRI(420.92),0),"^",2),A=$P(A,"/",2)
 . QUIT
 I A="" S PRCRI(9.4)=$O(^DIC(9.4,"B",PRCA,0)) I PRCRI(9.4) D
 . S A=$P(^DIC(9.4,PRCRI(9.4),"VERSION"),"^",1)
 . QUIT
 QUIT +A
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRC5CON   3430     printed  Sep 23, 2025@19:36:03                                                                                                                                                                                                     Page 2
PRC5CON   ;WISC/PLT-IFCAP V5 STATION MERGE/CALM CODE SHEET CONVERSION ; 08/22/95  3:18 PM
V         ;;5.0;IFCAP;**27**;4/21/95
 +1       ;QUIT  ; invalid entry
 +2       ;
EN        ;start station merge/convert CALM code sheet to FMS
 +1        NEW PRCIVER,PRCRI,PRCFIXV,PRCOPT,PRC5INST,PRCQ21,PRCDUZ
Q1         DO EN^DDIOL(" ")
           SET PRCFIXV="IFCAP"_$PIECE($TEXT(+2^PRCINIT),";",3)
 +1        SET PRCIVER=$$IVER("IFCAP",PRCFIXV)
 +2        IF +PRCIVER'=5
               DO EN^DDIOL("Your site must install IFCAP v5 before running this patch routine.")
               GOTO EXIT
 +3        DO EN^DDIOL(" ")
           DO EN^DDIOL("If your site has substations and you are not a Conversion III site, run")
           DO EN^DDIOL("     Options 1 & 2 only.")
 +4        DO EN^DDIOL("If your site has substations and you are a Conversion III site, run ")
           DO EN^DDIOL("     Options 1, 2, 3 & 4.")
 +5        DO EN^DDIOL("If your site has no substations and you are a Conversion III site, run")
           DO EN^DDIOL("     Options 3 & 4.")
 +6        DO EN^DDIOL("If your site has no substations and you are not a Conversion III site,")
           DO EN^DDIOL("    DO NOT run ANY Options.")
 +7        DO EN^DDIOL(" ")
 +8        DO SC^PRC0A(.X,.Y,"Select IFCAP V5 option","OM^1:Requests(1996-) Substation ENTER/EDIT;2:Purchase Orders(1996-) Substation ENTER/EDIT;3:Convert PO CALM Code Sheets(1996-) to FMS Documents;4:CALM Code Sheet Conversion Exception List","")
 +9        if X["^"!(X="")
               GOTO EXIT
 +10       SET PRCOPT=X
 +11       IF PRCOPT=3
               Begin DoDot:1
 +12               DO YN^PRC0A(.X,.Y,"Submit the File 442 Conversion & Generating FMS Doc. to the TASK MANAGER","O","")
 +13               QUIT 
               End DoDot:1
               if X["^"!(X="")
                   GOTO Q1
               SET PRCQ21=Y
               GOTO Q3
 +14       IF PRCOPT=4
               GOTO Q3
 +15      ;
Q2        ;select auto/single
 +1        DO SC^PRC0A(.X,.Y,"Select "_$PIECE("REQUESTS^PURCHASE ORDER","^",PRCOPT)_" Substation Option","OM^1:AUTO PROMPT TRANSACTION #;2:MANUAL SELECT TRANSACTION #","")
 +2        if X["^"!(X="")
               GOTO Q1
 +3        SET $PIECE(PRCOPT,"^",2)=X
Q3         DO YN^PRC0A(.X,.Y,"Ready to run the selected option(s) '"_$TRANSLATE(PRCOPT,"^","-")_"'","O","NO")
 +1        if X["^"!(X="")!(Y<1)
               GOTO Q1
 +2        IF +PRCOPT<3
               IF '$ORDER(^PRC(411,"UP",""))
                   DO EN^DDIOL("No substations are in file, use substation ENTER/EDIT to add first.")
                   GOTO Q1
 +3        IF +PRCOPT<3
               Begin DoDot:1
 +4                SET PRCDD=$SELECT(PRCOPT-2:410,1:442)
 +5                QUIT 
               End DoDot:1
               if $PIECE(PRCOPT,"^",2)=1
                   DO EN^PRC5CON1
               if $PIECE(PRCOPT,"^",2)=2
                   DO EN1^PRC5CON1
               GOTO Q1
 +6        IF PRCOPT=4
               DO EN1
               GOTO Q1
 +7        SET PRCDUZ=DUZ
 +8        IF PRCQ21=1
               Begin DoDot:1
 +9                DO EN^DDIOL("NOTE: Please schedule this task with a date '10/14/95'.")
 +10               DO EN^DDIOL("IFCAP V5 CALM CODE SHEET CONVERSION SUBMITTED TO TASK MANAGER AT "_$$NOW^PRC5A)
 +11               SET A=$$TASK^PRC0B2("EN^PRC5CON2~IFCAP V5 CALM CODE SHEET CONVERSION","PRCDUZ",1)
 +12               IF A
                       DO EN^DDIOL("IFCAP V5 CALM CODE SHEET CONVERSION HAS TASK NUMBER "_$PIECE(A,"^"))
 +13               QUIT 
               End DoDot:1
               GOTO EXIT
 +14       if DT>2951013
               DO EN^PRC5CON2
 +15       IF DT<2951014
               DO EN^DDIOL("It is too early to run the CALM code sheet conversion.")
               DO EN^DDIOL("Please run after 10/13/95.")
EXIT      ;
 +1        QUIT 
 +2       ;
EN1       ;calm code sheet conversion exception list
 +1        SET PRCRI(420.92)=$ORDER(^PRCU(420.92,"B","PRCCALM",""))
           if 'PRCRI(420.92)
               Begin DoDot:1
               End DoDot:1
 +2        IF 'PRCRI(420.92)
               DO EN^DDIOL("Nothing in file. You must run this list after Option 3 has completed")
 +3        Begin DoDot:1
 +4            NEW L,DIC,FLDS,BY,FR,TO,DHD
 +5            SET L=0
               SET DIC=420.92
               SET FLDS="4;"""""
               SET BY="@NUMBER"
               SET FR=PRCRI(420.92)
               SET TO=FR
 +6            SET DHD="CALM CODE SHEET CONVERSION EXCEPTION LIST"
 +7            DO EN1^DIP
 +8            QUIT 
           End DoDot:1
 +9        QUIT 
 +10      ;
 +11      ;prca=package name .01 in file 9.4, prcb=fix value .01 in file 420.92
IVER(PRCA,PRCB) ;get initial version #
 +1        NEW A
 +2        SET A=""
           SET PRCRI(420.92)=$ORDER(^PRCU(420.92,"B",PRCB,0))
           IF PRCRI(420.92)
               Begin DoDot:1
 +3                SET A=$PIECE(^PRCU(420.92,PRCRI(420.92),0),"^",2)
                   SET A=$PIECE(A,"/",2)
 +4                QUIT 
               End DoDot:1
 +5        IF A=""
               SET PRCRI(9.4)=$ORDER(^DIC(9.4,"B",PRCA,0))
               IF PRCRI(9.4)
                   Begin DoDot:1
 +6                    SET A=$PIECE(^DIC(9.4,PRCRI(9.4),"VERSION"),"^",1)
 +7                    QUIT 
                   End DoDot:1
 +8        QUIT +A