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

BHL3MS.m

Go to the documentation of this file.
  1. BHL3MS ;cmi/flag/maw - BHL Setup 3m Workstations [ 07/05/2002 2:22 PM ]
  1. ;;3.01;BHL IHS Interfaces with GIS;**1**;JUN 01, 2002
  1. ;
  1. ;
  1. ;
  1. ;this routine will allow the medical records staff to setup
  1. ;3M workstations. It will add the IP address to the background
  1. ;process file, set up the destination properly, and then activate
  1. ;the transaction type and add it to the message multiple
  1. ;
  1. MAIN ;EP - this is the main routine driver
  1. S BHLCONT=$$READY
  1. I '$G(BHLCONT) D Q
  1. . W !,"Get IP address and 3m Port, run option again"
  1. . D EOJ
  1. SET S BHLWS=$$ASK
  1. I '$G(BHLWS) W !,"Invalid Workstation Entered" D EOJ Q
  1. S BHLMN=$$MN("3M")
  1. D ACT(BHLWS)
  1. S BHLAN=$$AGAIN
  1. I $G(BHLAN) G SET
  1. D EOJ
  1. Q
  1. ;
  1. READY() ;-- write message and ask for confirmation
  1. W !!,"You must know the IP address and 3M port number"
  1. S DIR(0)="Y",DIR("A")="Continue "
  1. S DIR("B")="N"
  1. D ^DIR
  1. K DIR
  1. Q $G(Y)
  1. ;
  1. ASK() ;-- ask the workstation id
  1. S DIR(0)="N^2:14"
  1. S DIR("A")="What workstation number should I activate"
  1. D ^DIR
  1. Q:Y<0
  1. K DIR
  1. Q $G(Y)
  1. ;
  1. AGAIN() ;-- ask the workstation id
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you wish to activate another"
  1. D ^DIR
  1. Q:Y<0
  1. K DIR
  1. Q $G(Y)
  1. ;
  1. ACT(WS) ;-- activate the workstation and interface
  1. S BHLBP=$O(^INTHPC("B","HL IHS 3M SENDER "_WS,0))
  1. S BHLDS="HL IHS 3M CODER "_WS
  1. S BHLTT="HL IHS A08 OUT 3M "_WS
  1. S BHLTTI=$O(^INRHT("B",BHLTT,0))
  1. S BHLTTP="HL IHS A08 OUT 3M P "_WS
  1. S BHLTTPI=$O(^INRHT("B",BHLTTP,0))
  1. S BHLMI=$O(^INTHL7M("B","HL IHS A08 OUT 3M",0))
  1. S BHLMII=$O(^INTHL7M("B","HL IHS A08 IN 3M",0))
  1. S BHLBP0=$G(^INTHPC(BHLBP,6,0))
  1. K ^INTHPC(BHLBP,6)
  1. S ^INTHPC(BHLBP,6,0)=$G(BHLBP0)
  1. S $P(^INTHPC(BHLBP,6,0),U,3)=""
  1. S $P(^INTHPC(BHLBP,6,0),U,4)=""
  1. W !!,"Now setting up the IP address of workstation ID "_WS
  1. K DIE,DR,DA,Y
  1. S DIE="^INTHPC("_BHLBP,DA=BHLBP,DR=".02///1;.07///"_BHLDS
  1. D ^DIE
  1. S DIC=DIE_",6,",DIC(0)="AELMQZ"
  1. S DIC("P")=$P(^DD(4004,6,0),U,2)
  1. S DA(1)=BHLBP
  1. D ^DIC
  1. Q:Y<0
  1. S BHLIPI=+Y
  1. K DA
  1. S DIC=DIC_BHLIPI_",1,"
  1. S DA(2)=BHLBP,DA(1)=BHLIPI
  1. S DIC("P")=$P(^DD(4004.03,.02,0),U,2)
  1. D ^DIC
  1. Q:Y<0
  1. K DIC,DIE,DR,DA
  1. W !!,"IP Address now set up, continuing with transaction setup..."
  1. S DIE="^INRHT(",DA=BHLTTI
  1. S DR=".02///"_BHLDS_";.05///ACTIVE"
  1. D ^DIE
  1. S DA=BHLTTPI,DR=".05///ACTIVE"
  1. D ^DIE
  1. K DIE
  1. K DD,DO,DA
  1. S DIC="^INTHL7M("_BHLMI_",2,",DIC(0)="L"
  1. S DA(1)=BHLMI
  1. S DIC("P")=$P(^DD(4011,2,0),U,2)
  1. S X=BHLTTI
  1. D FILE^DICN
  1. W !!,"Now compiling the message"
  1. F BHLY=BHLMI,BHLMII D COMPILE^BHLU(BHLY)
  1. W !!,"3M Workstation ID "_WS_" is now ready for use"
  1. Q
  1. ;
  1. MN(MN) ;-- activate the mnemonic
  1. S BHLMNI=$O(^APCDTKW("B",MN,0))
  1. I 'BHLMNI Q ""
  1. S DIE="^APCDTKW(",DA=BHLMNI,DR=".07///A"
  1. D ^DIE
  1. K DIE,DR,DA
  1. Q +Y
  1. ;
  1. EOJ ;-- kill variables and quit
  1. D ^XBFMK
  1. D EN^XBVK("BHL")
  1. Q
  1. ;