Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: INHPCO1

INHPCO1.m

Go to the documentation of this file.
  1. INHPCO1 ; FRW ; 12 Nov 97 13:36; Manipulate GIS control files - cont.
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;;
  1. ;
  1. Q
  1. ;
  1. ACTONE(INPROD) ;Fully activate an environment
  1. ;INPROD - production flag ( 1 - production ; 0 - development )
  1. ;
  1. S INVERBOS=1
  1. ACTIVVB ;activate in Verbose mode
  1. S INPROD=+$G(INPROD)
  1. D:'$G(DUZ) ENV^UTIL
  1. ;Activate non-production stuff
  1. I 'INPROD D ACTIVTST
  1. ;Turn on all background processes
  1. D BCKPROC(1)
  1. ;Activate all transaction types (Except MHCMIS?)
  1. D TTALL(1)
  1. ;Reconnect replicated transaction types
  1. D REP(1)
  1. ;Deactivate development stuff if production area
  1. I INPROD D DEACTST
  1. ;Recompile all messages
  1. D RECOMP
  1. ;Repopulate environmental control data
  1. D REFRESH
  1. ;Update last active date
  1. S $P(^INRHT("ALAST"),U,2)=$$NOW^%ZTFDT
  1. K INVERBOS
  1. Q
  1. ;
  1. PREP ;Prep globals for packaging
  1. ;Verbose mode => 0 - verbose ; 1 - not verbose
  1. S INVERBOS=1
  1. PREPVB ;Verbose mode
  1. D:'$G(DUZ) ENV^UTIL
  1. ;Gather environemental information
  1. D REMEMBER
  1. ;Deactivate non-production stuff
  1. D DEACTST
  1. ;Turn off all background processes
  1. D BCKPROC(0)
  1. ;Clean up background process file
  1. D BCKCLN
  1. ;Deactivate all trasnsaction types
  1. D TTALL(0)
  1. ;Clean up destination file
  1. D DEST(0)
  1. ;Disconnect REPlicated transaction types - delete Parent TT field
  1. D REP(0)
  1. ;Recompile all messages
  1. ;D RECOMP ;The SCRIPT file is no longer sent out populated
  1. ;Re-index control files
  1. D CONTROLS^INHPCO2
  1. ;Do miscellaneous
  1. D MISC^INHPCO
  1. K INVERBOS
  1. ;Update last prep date
  1. S $P(^INRHT("ALAST"),U,1)=$$NOW^%ZTFDT
  1. Q
  1. ;
  1. RECOMP ;Recompile all messages
  1. ;
  1. ;Kill off script file
  1. K ^INRHS S ^INRHS(0)="INTERFACE SCRIPT^4006"
  1. ;Delete SCRIPT field from all transaction types
  1. K DR,DIE S DIE=4000,DA=0,DR=".03///@"
  1. F C=0:1 S DA=$O(^INRHT(DA)) Q:'DA D ^DIE I '$G(INVERBOS) I '$G(INVERBOS) W !,"SCRIPT field deleted for Transaction Type: ",$P(^INRHT(DA,0),U)
  1. ;delete script fieldS from all messages
  1. K DR,DIE S DIE=4011,DA=0,DR="100///@;101///@"
  1. F C=0:1 S DA=$O(^INTHL7M(DA)) Q:'DA D ^DIE I '$G(INVERBOS) I '$G(INVERBOS) W !,"SCRIPT field(s) deleted for Script Generator Message: ",$P(^INTHL7M(DA,0),U)
  1. ;Recompile all messages
  1. D ALLAUTO^INHSGZ
  1. ;
  1. Q
  1. ;
  1. TTALL(INST) ;Deactivate/Activate all transaction types
  1. ;
  1. W:'$G(INVERBOS) !,"*** Processing Transaction Type file ***"
  1. ;Loop through all transaction types and take action
  1. S INST=+$G(INST) N DIE,DR,INSTMSG
  1. S INSTMSG=$S('INST:"DEACTIVATED",1:"ACTIVATED")
  1. S DIE=4000,DR=".05///"_INST
  1. ;Loop through background process control file
  1. S DA=0
  1. F S DA=$O(^INRHT(DA)) Q:'DA D
  1. . D ^DIE
  1. . I '$G(INVERBOS) W !,"Transaction Type: ",$P(^INRHT(DA,0),U)," ",INSTMSG
  1. Q
  1. ;
  1. BPCONE(DA,INST) ;Activate/Deactivate one background process
  1. ;INPUT:
  1. ; DA - entry to process (ien)
  1. ; INST - what to do 0 - deactivate (def) ; 1 - activate
  1. ;
  1. S INST=+$G(INST) N DIE,DR,INSTMSG
  1. S INSTMSG=$S('INST:"DEACTIVATED",1:"ACTIVATED")
  1. S DIE=4004,DR=".02///"_INST D ^DIE
  1. W:'$G(INVERBOS) !,"Background Process: ",$P(^INTHPC(DA,0),U)," ",INSTMSG
  1. Q
  1. ;
  1. TTONE(DA,INST) ;Deactivate/activate one transaction type
  1. ;
  1. S INST=+$G(INST) N DIE,DR,INSTMSG
  1. ;Do not activate MHCMIS I (DGM*) tt's
  1. S INSTMSG=$P($G(^INRHT(DA,0)),U,1) Q:$E(INSTMSG,1,3)="DGM"&INST
  1. S INSTMSG=$S('INST:"DEACTIVATED",1:"ACTIVATED")
  1. S DIE=4000,DR=".05///"_INST D ^DIE
  1. W:'$G(INVERBOS) !,"Transaction Type: ",$P(^INRHT(DA,0),U)," ",INSTMSG
  1. Q
  1. ;
  1. ;Should script also be deleted when deactivating?
  1. ; - YES for non-production stuff
  1. ;Should PARENT be deactivated if it has no other active children
  1. ; - probably
  1. ;Should anything be done with the Message Replication File
  1. ;Should script be recompiled if activating
  1. ; - probably
  1. ;Should parent be activated if not already
  1. ; - probably
  1. ; - display warning if parent was inactive but had active children
  1. ;
  1. MSGONE(DA,INST) ;Deactivate one message
  1. ;
  1. S INST=+$G(INST) N DIE,DR,INSTMSG
  1. ;Do not activate MHCMIS I (DGM*) msgs
  1. S INSTMSG=$P($G(^INTHL7M(DA,0)),U,1) Q:$E(INSTMSG,1,3)="DGM"&INST
  1. S INSTMSG=$S('INST:"DEACTIVATED",1:"ACTIVATED")
  1. ;Set INACTIVE flag
  1. S DIE=4011,DR=".08///"_$S('INST:1,1:0) D ^DIE
  1. W:'$G(INVERBOS) !,"Script Generator Message: ",$P(^INTHL7M(DA,0),U)," ",INSTMSG
  1. Q
  1. ;
  1. ;?? Should transaction types for messages also be deactivated
  1. ;?? Should scripts for message also be deactivated
  1. ;?? Should anything be done with the Message Replication File
  1. Q
  1. ;
  1. LOOP(INGL,INEXE,INGLDAT) ;Loop through a "B" x-ref
  1. ;INBGL - global to loop down
  1. ;INEXE - Executable code - DA will be the ien
  1. ;INGLDAT - global storage of file
  1. ;WON'T GET ANYTHNG THAT STARTS WITH inname
  1. N INNAME,INLEN,INLOOP,DA
  1. F INNAME="DGM","PROTO","TEST" D
  1. . S INLEN=$L(INNAME),INLOOP=INNAME
  1. . F S INLOOP=$O(@INGL@(INLOOP)) Q:$E(INLOOP,1,INLEN)'=INNAME D
  1. .. S DA=0 F S DA=$O(@INGL@(INLOOP,DA)) Q:'DA D
  1. ... X INEXE
  1. Q
  1. ;
  1. BCKPROC(INST) ;Deactivate/Activate background processes
  1. ;
  1. W:'$G(INVERBOS) !,"*** Processing Background Process Control File ***"
  1. S INST=+$G(INST) N DIE,DR,INSTMSG
  1. S INSTMSG=$S('INST:"DEACTIVATED",1:"ACTIVATED")
  1. S DIE=4004,DR=".02///"_INST
  1. ;Loop through background process control file
  1. S DA=2
  1. F S DA=$O(^INTHPC(DA)) Q:'DA D
  1. . D ^DIE
  1. . I '$G(INVERBOS) W !,"Background Process: ",$P(^INTHPC(DA,0),U)," ",INSTMSG
  1. Q
  1. ;
  1. ACTSTONE(DA) ;Activate one non-production message
  1. ;
  1. Q:$E($P(^INTHL7M(DA,0),U),1,3)="DGM"
  1. N DR,DIE S DR=".08///0",DIE=4011
  1. D ^DIE
  1. I '$G(INVERBOS) W !,"Message: ",$P(^INTHL7M(DA,0),U)," ","ACTIVATED"
  1. Q
  1. ;
  1. DEST(INST) ;Destination file
  1. ;
  1. S INST=+$G(INST) N DA,INSTMSG
  1. S INSTMSG=$S('INST:"DEACTIVATED",1:"ACTIVATED")
  1. I '$G(INVERBOS) W !,"*** Processing Destination file ***"
  1. S DIE=4005,DR="7.02///@"
  1. ;Clean up ADDRESS ID and ROUTE ID field
  1. I 'INST D
  1. . S DA=0 F S DA=$O(^INRHD(DA)) Q:'DA K ^INRHD(DA,5),^(9) D ^DIE
  1. . I '$G(INVERBOS) W !,"Destination file cleaned up"
  1. ;
  1. Q
  1. ;
  1. REP(INST) ;Disconnect/Connect replicated transactions
  1. ;
  1. ;;DO NOT ACTIVATE THIS MODULE WITHOUT DETAILED ANALYSIS OF IMPACTS
  1. ;
  1. Q
  1. ;
  1. I INST Q ;Currently not supporting replication
  1. I '$G(INVERBOS) W !,"*** Processing Replicated Transaction Types ***"
  1. S INST=+$G(INST) N DA,INSTMSG
  1. S INSTMSG=$S('INST:"Parent deleted",1:"Parent = ")
  1. N DA,DIE,DR S DA=2,DIE=4000,DR=".06///^S X=INEDIT"
  1. S INEDIT="@"
  1. F S DA=$O(^INRHT(DA)) Q:'DA D
  1. . Q:$P(^INRHT(DA,0),U)'["(REP)"
  1. . I INST D Q:'$L(INEDIT)
  1. .. S INEDIT=$P($P(^INRHT(DA,0),U),"(REP)")_"(PARENT)"
  1. .. I '$D(^INRHT("B",INEDIT)) W !,"Parent: ",INEDIT," not foud for Transaction Type: ",$P(^INRHT(DA,0),U) S INEDIT="" Q
  1. . D ^DIE
  1. . I '$G(INVERBOS) W !,$P(^INRHT(DA,0),U)," ",INSTMSG,INEDIT
  1. Q
  1. ;
  1. DEACTST ;Deactivate test stuff
  1. D DEACTST^INHPCO Q
  1. ;
  1. ACTIVTST ;Activate test stuff
  1. D ACTIVTST^INHPCO Q
  1. ;
  1. REMEMBER ;Remember environmental variables
  1. D REMEMBER^INHPCO Q
  1. ;
  1. REFRESH ;Refresh environmental variables
  1. D REFRESH^INHPCO Q
  1. ;
  1. BCKCLN ;Clean up background process control file
  1. D BCKCLN^INHPCO Q
  1. ;