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

BCHPOS1.m

Go to the documentation of this file.
  1. BCHPOS1 ; IHS/TUCSON/LAB - POST INIT - 2 ; [ 10/28/96 2:05 PM ]
  1. ;;1.0;IHS RPMS CHR SYSTEM;;OCT 28, 1996
  1. ; - This routine finds or creates the CHR MANAGER mail group
  1. ; - adds the CHR MANAGER mail group to the following bulletins:
  1. ; BCH CHR TRANSMISSION ERROR
  1. ; BCH PCC PACKAGE LINK FAIL
  1. ; - creates the BCH entry in the HL7 APPLICATION PARAMETER file
  1. ; - adds the 1-99 CHRPC## entries to the HL7 APPLICATION PARAMETER file
  1. ;
  1. ;
  1. START ;start of routine
  1. Q:'$D(^HL(771))
  1. S BCHFAC=$P(^AUTTLOC($P($G(^AUTTSITE(1,0)),U,1),0),U,10)
  1. I 'BCHFAC W !,"Unable to determine facility ASUFAC 6-digit number." Q
  1. S BCHCODE=$O(^HL(779.004,"B","USA",""))
  1. I 'BCHCODE W !,"Unable to determine Country Code." Q
  1. D SETVAR ; set up DIC variables
  1. D BCHENTRY ; create the BCH entry
  1. D ADD99 ; populate the file with 99 entries
  1. ;
  1. EOJ ;
  1. K DIC,X,Y,DD,DO,D0,DA,DDH,DI,DIE,DR,DLAYGO
  1. K BCHN,BCHFAC,BCHCODE,BCHMGRP
  1. Q
  1. ;end of routine
  1. ;----------------------------------
  1. SETVAR ;set up variables for DIC call
  1. S DIC="^HL(771,",DIC(0)="L",DLAYGO=771
  1. S DIC("DR")="2////a;3////"_BCHFAC_";4////"_BCHMGRP_";7////"_BCHCODE_";101////~|\&"
  1. Q
  1. ;
  1. BCHENTRY ;create the BCH entry
  1. K DD,DO
  1. S X="BCH"
  1. I $D(^HL(771,"B","BCH")) W !,"....exists: ",X K X Q
  1. D FILE^DICN K DIC
  1. I Y<0 W !,"Entry was unsuccessful: ",X K X Q
  1. W !,"....adding: ",X
  1. K Y,X
  1. Q
  1. ;
  1. ADD99 ;populate the file with 99 entries
  1. ;
  1. F BCHN=1:1:99 S:BCHN<10 BCHN=0_BCHN D Q:BCHN>99
  1. . K DD,D0 D SETVAR
  1. . S X="CHRPC"_BCHN
  1. . I $D(^HL(771,"B",X)) W !,"....exists: ",X Q
  1. . D FILE^DICN
  1. . I Y<0 W !,"Entry was unsuccessful: ",X K X Q
  1. . W !,"....adding: ",X
  1. . K X
  1. . Q
  1. K DIC,X,Y
  1. Q