- INHPCO ; FRW ; 1 Mar 96 13:44; Manipulate GIS control files
- ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- ;COPYRIGHT 1991-2000 SAIC
- ;
- EN ;Main entry point
- ;
- Q
- ;
- ACTIVATE ;Activate everything in a production environment
- ;fall thru to PRD
- ;
- PRD ;Activate a produciton environment
- ;
- D ALL^INHPSAM(1)
- S $P(^INRHT("ALAST"),U,2)=$$NOW^%ZTFDT
- Q
- ;
- ;D ACTONE^INHPCO1(1)
- Q
- ;
- DEV ;Activate a development environment
- D ACTONE^INHPCO1(0)
- Q
- ;
- PACK ;How to Package the GIS Control Files
- ;
- ;Prep globals - D PREP
- ;set default directory - D ^%SPAWN(SET DEF)
- ;Call global COM file - D ^%SPAWN(@GLOBAL)
- ; Set working directory
- ; Save globals
- ; Do diff
- ;Reactivate environment - D DEV^INHPCO
- ;Verify diff - manual
- ;Set default directory - SET DEF
- ;Call global COM file - @GLOBAL
- ; Replace globals into CMS
- ; Insert globals into class
- ;Create/Insert .DOC file into class - D ^ZCMS
- ;Mark class ready in CMS and Forum
- ;
- Q
- ;
- PREP ;Prep globals for packaging
- ;Verbose mode => 0 - verbose ; 1 - not verbose
- D PREP^INHPCO1
- Q
- ;
- DEACTST ;Deactive non-production stuff
- ;
- W:'$G(INVERBOS) !,"*** Deactivating non-production entries ***"
- ;Loop through transaction types
- D LOOP("^INRHT(""B"")","D TTONE(DA)","^INRHT")
- ;Loop through messages
- D LOOP("^INTHL7M(""B"")","D MSGONE(DA)","^INTHL7M")
- ;Loop through the background process control file
- D LOOP("^INTHPC(""B"")","D BPCONE(DA,0)","^INTHPC")
- ;
- ;Delete the PARENT field from the TT if
- ; the parent = "HL" and the .01 '= "HL"
- ;Delete from Message Replication (4020) file if
- ; Originating TT = "HL" and the .01 '= "HL"
- ;
- Q
- ;
- ACTIVTST ;Activate test stuff
- ;
- ;Activate messages
- D LOOP("^INTHL7M(""B"")","D ACTSTONE(DA)","^INTHL7M")
- ;Activate transaction types
- D LOOP("^INRHT(""B"")","D TTONE(DA,1)","^INRHT")
- ;Activate background processses
- D LOOP("^INTHPC(""B"")","D BPCONE(DA,1)","^INTHPC")
- Q
- ;
- LOOP(INGL,INEXE,INGLDAT) ;Local LOOP call
- ;
- D LOOP^INHPCO1($G(INGL),$G(INEXE),$G(INGLDAT))
- Q
- ;
- REMEMBER ;Remember environemntal information
- ;
- I '$G(INVERBOS) W !,"*** Storing environmental information ***"
- N INHPREP S INHPREP=$O(^UTILITY("INSAVE","GIS PREP",""))
- I INHPREP W !,"WARNING: You already have environment data stored.",!,"<CR> to continue, Control C to abort." R %:DTIME
- S INHPREP=$H,%=$$BACKUP^INHSYSUL("GIS PREP",INHPREP)
- I '% W !,"*** Backup failed. some data may not be refreshed. ***" Q
- S ^UTILITY("INSAVE","GIS PREP","REMEMBER")=INHPREP_U_$$NOW^%ZTFDT
- Q
- ; old remember code follows
- ;N DA K INENV S INENV="^UTILITY(""INENV"","_+$G(DUZ)_")"
- ;If INENV global exists and has not been restored ask user if they want to continue (or refresh)
- ;I $D(@INENV) W !,"WARNING: You already have environment data stored." R %:DTIME
- ;K @INENV
- ;;IP PORT (^5) and CLIENT ADDR fields (^6) in BPC file
- ;S @INENV@(4004)="",DA=0
- ;F S DA=$O(^INTHPC(DA)) Q:'DA D
- ;. M @INENV@(4004,DA,5)=^INTHPC(DA,5)
- ;. M @INENV@(4004,DA,6)=^INTHPC(DA,6)
- ;S @INENV@("STORE")=$$NOW^%ZTFDT
- ;
- REFRESH ;Replace environmental information
- I '$G(INVERBOS) W !,"*** Replacing environmental information ***"
- N INHPREP S INHPREP=$O(^UTILITY("INSAVE","GIS PREP",""))
- I 'INHPREP W:'$G(INVERBOS) !,"*** No backup exists to refresh from. ***" Q
- S %=$$RESTORE^INHSYSUL("GIS PREP",INHPREP)
- K:% ^UTILITY("INSAVE","GIS PREP")
- Q
- ;
- ;N DA S:'$L($G(INENV)) INENV="^UTILITY(""INENV"","_+$G(DUZ)_")"
- ;IP PORT (^5) and CLIENT ADDR fields (^6) in BPC file
- ;S DA=0 F S DA=$O(@INENV@(4004,DA)) Q:'DA D
- ;. M ^INTHPC(DA,5)=@INENV@(4004,DA,5)
- ;. M ^INTHPC(DA,6)=@INENV@(4004,DA,6)
- ;S $P(@INENV@("STORE"),U,2)=$$NOW^%ZTFDT
- ;K @INENV
- ;
- BCKCLN ;Clean up Background Process Control file
- I '$G(INVERBOS) W !,"*** Cleaning up Background Process Control File ***"
- ;Clean up - IP PORT (^5) and CLIENT ADDR fields (^6)
- ; D/T last started, $J fields
- ;Loop through background process control file
- N DA,DIE,DR S DA=0,DIE=4004,DR=".04///@;.05///@"
- F S DA=$O(^INTHPC(DA)) Q:'DA K ^INTHPC(DA,5),^(6) D ^DIE
- Q
- ;
- MISC ;miscellaneous things to do
- N DA,DIE
- S DA=+$$DIC^INHSYS05(4000,"HL GIS APPL ACKNOWLEDGEMENT",4000,"X")
- I DA<0 W !,"HL GIS APPL ACKNOWLEDGEMENT not found" Q
- S DIE=4000,DR=".16///5" D ^DIE
- Q
- INHPCO ; FRW ; 1 Mar 96 13:44; Manipulate GIS control files
- +1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- +2 ;COPYRIGHT 1991-2000 SAIC
- +3 ;
- EN ;Main entry point
- +1 ;
- +2 QUIT
- +3 ;
- ACTIVATE ;Activate everything in a production environment
- +1 ;fall thru to PRD
- +2 ;
- PRD ;Activate a produciton environment
- +1 ;
- +2 DO ALL^INHPSAM(1)
- +3 SET $PIECE(^INRHT("ALAST"),U,2)=$$NOW^%ZTFDT
- +4 QUIT
- +5 ;
- +6 ;D ACTONE^INHPCO1(1)
- +7 QUIT
- +8 ;
- DEV ;Activate a development environment
- +1 DO ACTONE^INHPCO1(0)
- +2 QUIT
- +3 ;
- PACK ;How to Package the GIS Control Files
- +1 ;
- +2 ;Prep globals - D PREP
- +3 ;set default directory - D ^%SPAWN(SET DEF)
- +4 ;Call global COM file - D ^%SPAWN(@GLOBAL)
- +5 ; Set working directory
- +6 ; Save globals
- +7 ; Do diff
- +8 ;Reactivate environment - D DEV^INHPCO
- +9 ;Verify diff - manual
- +10 ;Set default directory - SET DEF
- +11 ;Call global COM file - @GLOBAL
- +12 ; Replace globals into CMS
- +13 ; Insert globals into class
- +14 ;Create/Insert .DOC file into class - D ^ZCMS
- +15 ;Mark class ready in CMS and Forum
- +16 ;
- +17 QUIT
- +18 ;
- PREP ;Prep globals for packaging
- +1 ;Verbose mode => 0 - verbose ; 1 - not verbose
- +2 DO PREP^INHPCO1
- +3 QUIT
- +4 ;
- DEACTST ;Deactive non-production stuff
- +1 ;
- +2 IF '$GET(INVERBOS)
- WRITE !,"*** Deactivating non-production entries ***"
- +3 ;Loop through transaction types
- +4 DO LOOP("^INRHT(""B"")","D TTONE(DA)","^INRHT")
- +5 ;Loop through messages
- +6 DO LOOP("^INTHL7M(""B"")","D MSGONE(DA)","^INTHL7M")
- +7 ;Loop through the background process control file
- +8 DO LOOP("^INTHPC(""B"")","D BPCONE(DA,0)","^INTHPC")
- +9 ;
- +10 ;Delete the PARENT field from the TT if
- +11 ; the parent = "HL" and the .01 '= "HL"
- +12 ;Delete from Message Replication (4020) file if
- +13 ; Originating TT = "HL" and the .01 '= "HL"
- +14 ;
- +15 QUIT
- +16 ;
- ACTIVTST ;Activate test stuff
- +1 ;
- +2 ;Activate messages
- +3 DO LOOP("^INTHL7M(""B"")","D ACTSTONE(DA)","^INTHL7M")
- +4 ;Activate transaction types
- +5 DO LOOP("^INRHT(""B"")","D TTONE(DA,1)","^INRHT")
- +6 ;Activate background processses
- +7 DO LOOP("^INTHPC(""B"")","D BPCONE(DA,1)","^INTHPC")
- +8 QUIT
- +9 ;
- LOOP(INGL,INEXE,INGLDAT) ;Local LOOP call
- +1 ;
- +2 DO LOOP^INHPCO1($GET(INGL),$GET(INEXE),$GET(INGLDAT))
- +3 QUIT
- +4 ;
- REMEMBER ;Remember environemntal information
- +1 ;
- +2 IF '$GET(INVERBOS)
- WRITE !,"*** Storing environmental information ***"
- +3 NEW INHPREP
- SET INHPREP=$ORDER(^UTILITY("INSAVE","GIS PREP",""))
- +4 IF INHPREP
- WRITE !,"WARNING: You already have environment data stored.",!,"<CR> to continue, Control C to abort."
- READ %:DTIME
- +5 SET INHPREP=$HOROLOG
- SET %=$$BACKUP^INHSYSUL("GIS PREP",INHPREP)
- +6 IF '%
- WRITE !,"*** Backup failed. some data may not be refreshed. ***"
- QUIT
- +7 SET ^UTILITY("INSAVE","GIS PREP","REMEMBER")=INHPREP_U_$$NOW^%ZTFDT
- +8 QUIT
- +9 ; old remember code follows
- +10 ;N DA K INENV S INENV="^UTILITY(""INENV"","_+$G(DUZ)_")"
- +11 ;If INENV global exists and has not been restored ask user if they want to continue (or refresh)
- +12 ;I $D(@INENV) W !,"WARNING: You already have environment data stored." R %:DTIME
- +13 ;K @INENV
- +14 ;;IP PORT (^5) and CLIENT ADDR fields (^6) in BPC file
- +15 ;S @INENV@(4004)="",DA=0
- +16 ;F S DA=$O(^INTHPC(DA)) Q:'DA D
- +17 ;. M @INENV@(4004,DA,5)=^INTHPC(DA,5)
- +18 ;. M @INENV@(4004,DA,6)=^INTHPC(DA,6)
- +19 ;S @INENV@("STORE")=$$NOW^%ZTFDT
- +20 ;
- REFRESH ;Replace environmental information
- +1 IF '$GET(INVERBOS)
- WRITE !,"*** Replacing environmental information ***"
- +2 NEW INHPREP
- SET INHPREP=$ORDER(^UTILITY("INSAVE","GIS PREP",""))
- +3 IF 'INHPREP
- IF '$GET(INVERBOS)
- WRITE !,"*** No backup exists to refresh from. ***"
- QUIT
- +4 SET %=$$RESTORE^INHSYSUL("GIS PREP",INHPREP)
- +5 IF %
- KILL ^UTILITY("INSAVE","GIS PREP")
- +6 QUIT
- +7 ;
- +8 ;N DA S:'$L($G(INENV)) INENV="^UTILITY(""INENV"","_+$G(DUZ)_")"
- +9 ;IP PORT (^5) and CLIENT ADDR fields (^6) in BPC file
- +10 ;S DA=0 F S DA=$O(@INENV@(4004,DA)) Q:'DA D
- +11 ;. M ^INTHPC(DA,5)=@INENV@(4004,DA,5)
- +12 ;. M ^INTHPC(DA,6)=@INENV@(4004,DA,6)
- +13 ;S $P(@INENV@("STORE"),U,2)=$$NOW^%ZTFDT
- +14 ;K @INENV
- +15 ;
- BCKCLN ;Clean up Background Process Control file
- +1 IF '$GET(INVERBOS)
- WRITE !,"*** Cleaning up Background Process Control File ***"
- +2 ;Clean up - IP PORT (^5) and CLIENT ADDR fields (^6)
- +3 ; D/T last started, $J fields
- +4 ;Loop through background process control file
- +5 NEW DA,DIE,DR
- SET DA=0
- SET DIE=4004
- SET DR=".04///@;.05///@"
- +6 FOR
- SET DA=$ORDER(^INTHPC(DA))
- IF 'DA
- QUIT
- KILL ^INTHPC(DA,5),^(6)
- DO ^DIE
- +7 QUIT
- +8 ;
- MISC ;miscellaneous things to do
- +1 NEW DA,DIE
- +2 SET DA=+$$DIC^INHSYS05(4000,"HL GIS APPL ACKNOWLEDGEMENT",4000,"X")
- +3 IF DA<0
- WRITE !,"HL GIS APPL ACKNOWLEDGEMENT not found"
- QUIT
- +4 SET DIE=4000
- SET DR=".16///5"
- DO ^DIE
- +5 QUIT