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

BCHDCOMM.m

Go to the documentation of this file.
  1. BCHDCOMM ; IHS/CMI/LAB - COMMUNITY DOWNLOAD ROUTINE ;
  1. ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
  1. ;
  1. ;Generates COMMUNITY file for uploading onto the remote
  1. ;computer systems.
  1. ;
  1. EP ;
  1. W:$D(IOF) @IOF
  1. W !!,"This utility routine is used to download, by Area, all communities in the",!,"COMMUNITY file to the remote computer."
  1. W !!,"You will be asked to enter your Area. A unix file will be created",!,"called communit.imp. It must be then put in the C:\CHR directory on the ",!,"remote and uploaded into that machine.",!!
  1. ;
  1. S C=0
  1. K ^XTMP("BCH COMMUNITIES",$J)
  1. S ^XTMP("BCH COMMUNITIES",0)=$$FMADD^XLFDT(DT,14)_U_DT_"CHR DOWNLOAD"
  1. D AREA
  1. Q:'BCHQ
  1. D COMM
  1. D WRITEF
  1. D XIT
  1. Q
  1. ;
  1. ;---------------------------------------------
  1. AREA ;select desired area
  1. S BCHQ=1
  1. S DIC="^AUTTAREA(",DIC(0)="AEMQ" D ^DIC
  1. I Y=-1 W:'$D(^XTMP("BCH COMMUNITIES")) !!,"NO AREA SELECTED." S BCHQ=0 Q
  1. S BCHAREA=+Y
  1. Q
  1. COMM ;get communities and set in ^XTMP
  1. S BCHIEN=0 F S BCHIEN=$O(^AUTTCOM(BCHIEN)) Q:BCHIEN'=+BCHIEN D
  1. . Q:$P(^AUTTCOM(BCHIEN,0),U,6)'=BCHAREA
  1. . S C=C+1
  1. . S ^XTMP("BCH COMMUNITIES",$J,C)=""""_$P(^AUTTCOM(BCHIEN,0),U,8)_""""_","_""""_$P(^AUTTCOM(BCHIEN,0),U)_""""
  1. . Q
  1. Q
  1. ;
  1. WRITEF ;EP - write out flat file
  1. I '$D(^XTMP("BCH COMMUNITIES")) W !!,"NO COMMUNITIES SELECTED." G XIT
  1. W !,"You have selected ",C," communites to be downloaded. Here they are: " H 2 S X=0 F S X=$O(^XTMP("BCH COMMUNITIES",$J,X)) Q:X'=+X W !,^XTMP("BCH COMMUNITIES",$J,X)
  1. W !
  1. S DIR(0)="Y",DIR("A")="Do you wish to continue",DIR("B")="Y" K DA D ^DIR K DIR
  1. I $D(DIRUT)!('Y) W !!,"BYE",! G XIT
  1. S XBGL="TMP("_"""BCH COMMUNITIES"""_","_$J_","
  1. S XBMED="F",XBFN="communit.imp",XBTLE="SAVE OF COMMUNITIES"
  1. S XBF=0,XBQ="N",XBFLT=1,XBE=$J
  1. D ^XBGSAVE
  1. Q
  1. XIT ;
  1. K ^XTMP("BCH COMMUNITIES",$J)
  1. K BCHQ,C,X
  1. Q