RORP001 ;HCIOFO/SG - PATCH ROR*1.5*1 INSTALLATION ROUTINE ; 7/18/06 9:38am
 ;;1.5;CLINICAL CASE REGISTRIES;**1**;Feb 17, 2006;Build 24
 ;
 ;***** ENVIRONMENT CHECK
 N RC
 ;--- Check the User ID
 I $G(DUZ)'>0  D  S XPDABORT=2  Q
 . W !!,"The DUZ variable must be defined!",!
 ;--- Check the required security key
 I '$D(^XUSEC("ROR VA IRM",DUZ))  D  S XPDABORT=2  Q
 . W !!,"You must have the ROR VA IRM security key!",!
 ;
 ;=== Installation section
 Q:'$G(XPDENV)
 ;--- Check the scheduled option
 I $$CHKOPT^RORKIDS("ROR TASK")<0  S XPDABORT=2  Q
 ;--- Override the "Want to DISABLE Options, and Protocols?" question
 S XPDDIQ("XPZ1")=0
 Q
 ;
 ;***** ERROR PROCESSING
ERROR ;
 N TMP  S XPDABORT=1
 I $D(ZTQUEUED)  D  D ALERT^RORKIDS(DUZ,-43,REGNAME,,TMP)
 . S TMP=+$G(RORPARM("KIDS"))
 . S TMP=$S(TMP=1:"pre-",TMP=2:"post-",1:"")_"install"
 D DSPSTK^RORERR(),ABTMSG^RORKIDS()
 Q
 ;
 ;***** POST-INSTALL ENTRY POINT
POS ;
 N RORERROR      ; Error processing data
 N RORLOG        ; Log subsystem constants & variables
 N RORPARM       ; Application parameters
 ;
 N DA,RC,RORHIV,TMP
 S RORPARM("DEVELOPER")=1   ; Enable modifications
 S RORPARM("ERR")=1         ; Enable error processing
 S RORPARM("KIDS")=2        ; Post-install indicator
 S RORPARM("LOG")=1         ; Enable log recording
 ;
 ;--- Open a new log
 K TMP  S TMP("VA HIV")=""
 S TMP=$$OPEN^RORLOG(.TMP,0,XPDNM_" POST-INSTALL STARTED")
 K TMP
 ;
 ;--- Initialize variables
 S RORHIV=$$REGIEN^RORUTL02("VA HIV")  G:RORHIV<0 ERROR
 S RORHIV=RORHIV_U_"VA HIV"
 ;
 ;--- ROR GENERIC DRUG file (#799.51)
 G:$$CP^RORKIDS("POS05","$$RS79951^RORPUT02")<0 ERROR
 ;
 ;--- Restore the CDC definition
 G:$$CP^RORKIDS("POS10","$$CDCDEF^RORPUT01")<0 ERROR
 ;
 ;--- Restore predefined report templates
 G:$$CP^RORKIDS("POS15","$$RSPRT^RORPUT02")<0 ERROR
 ;
 ;--- Close the log
 D CLOSE^RORLOG(XPDNM_" POST-INSTALL COMPLETED")
 Q
 ;
 ;***** PRE-TRANSPORTATION ENTRY POINT
PTR ;
 N RORBUF,TMP
 ;--- Copy the CDC definition to the transport global
 D GETPARM^RORRP038(.RORBUF,"ICRCDCDEF","PKG")
 K RORBUF(0)  M @XPDGREF@("RORCDCDEF")=RORBUF
 ;--- Load the records of the ROR GENERIG DRUG file
 D LD79951^RORPUT02()
 ;--- Load predefined report templates
 D LDPRT^RORPUT02()
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORP001   2299     printed  Sep 23, 2025@19:18:15                                                                                                                                                                                                     Page 2
RORP001   ;HCIOFO/SG - PATCH ROR*1.5*1 INSTALLATION ROUTINE ; 7/18/06 9:38am
 +1       ;;1.5;CLINICAL CASE REGISTRIES;**1**;Feb 17, 2006;Build 24
 +2       ;
 +3       ;***** ENVIRONMENT CHECK
 +4        NEW RC
 +5       ;--- Check the User ID
 +6        IF $GET(DUZ)'>0
               Begin DoDot:1
 +7                WRITE !!,"The DUZ variable must be defined!",!
               End DoDot:1
               SET XPDABORT=2
               QUIT 
 +8       ;--- Check the required security key
 +9        IF '$DATA(^XUSEC("ROR VA IRM",DUZ))
               Begin DoDot:1
 +10               WRITE !!,"You must have the ROR VA IRM security key!",!
               End DoDot:1
               SET XPDABORT=2
               QUIT 
 +11      ;
 +12      ;=== Installation section
 +13       if '$GET(XPDENV)
               QUIT 
 +14      ;--- Check the scheduled option
 +15       IF $$CHKOPT^RORKIDS("ROR TASK")<0
               SET XPDABORT=2
               QUIT 
 +16      ;--- Override the "Want to DISABLE Options, and Protocols?" question
 +17       SET XPDDIQ("XPZ1")=0
 +18       QUIT 
 +19      ;
 +20      ;***** ERROR PROCESSING
ERROR     ;
 +1        NEW TMP
           SET XPDABORT=1
 +2        IF $DATA(ZTQUEUED)
               Begin DoDot:1
 +3                SET TMP=+$GET(RORPARM("KIDS"))
 +4                SET TMP=$SELECT(TMP=1:"pre-",TMP=2:"post-",1:"")_"install"
               End DoDot:1
               DO ALERT^RORKIDS(DUZ,-43,REGNAME,,TMP)
 +5        DO DSPSTK^RORERR()
           DO ABTMSG^RORKIDS()
 +6        QUIT 
 +7       ;
 +8       ;***** POST-INSTALL ENTRY POINT
POS       ;
 +1       ; Error processing data
           NEW RORERROR
 +2       ; Log subsystem constants & variables
           NEW RORLOG
 +3       ; Application parameters
           NEW RORPARM
 +4       ;
 +5        NEW DA,RC,RORHIV,TMP
 +6       ; Enable modifications
           SET RORPARM("DEVELOPER")=1
 +7       ; Enable error processing
           SET RORPARM("ERR")=1
 +8       ; Post-install indicator
           SET RORPARM("KIDS")=2
 +9       ; Enable log recording
           SET RORPARM("LOG")=1
 +10      ;
 +11      ;--- Open a new log
 +12       KILL TMP
           SET TMP("VA HIV")=""
 +13       SET TMP=$$OPEN^RORLOG(.TMP,0,XPDNM_" POST-INSTALL STARTED")
 +14       KILL TMP
 +15      ;
 +16      ;--- Initialize variables
 +17       SET RORHIV=$$REGIEN^RORUTL02("VA HIV")
           if RORHIV<0
               GOTO ERROR
 +18       SET RORHIV=RORHIV_U_"VA HIV"
 +19      ;
 +20      ;--- ROR GENERIC DRUG file (#799.51)
 +21       if $$CP^RORKIDS("POS05","$$RS79951^RORPUT02")<0
               GOTO ERROR
 +22      ;
 +23      ;--- Restore the CDC definition
 +24       if $$CP^RORKIDS("POS10","$$CDCDEF^RORPUT01")<0
               GOTO ERROR
 +25      ;
 +26      ;--- Restore predefined report templates
 +27       if $$CP^RORKIDS("POS15","$$RSPRT^RORPUT02")<0
               GOTO ERROR
 +28      ;
 +29      ;--- Close the log
 +30       DO CLOSE^RORLOG(XPDNM_" POST-INSTALL COMPLETED")
 +31       QUIT 
 +32      ;
 +33      ;***** PRE-TRANSPORTATION ENTRY POINT
PTR       ;
 +1        NEW RORBUF,TMP
 +2       ;--- Copy the CDC definition to the transport global
 +3        DO GETPARM^RORRP038(.RORBUF,"ICRCDCDEF","PKG")
 +4        KILL RORBUF(0)
           MERGE @XPDGREF@("RORCDCDEF")=RORBUF
 +5       ;--- Load the records of the ROR GENERIG DRUG file
 +6        DO LD79951^RORPUT02()
 +7       ;--- Load predefined report templates
 +8        DO LDPRT^RORPUT02()
 +9        QUIT