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

BCHPRDL.m

Go to the documentation of this file.
  1. BCHPRDL ; IHS/TUCSON/LAB - DOWNLOAD PROVIDER DATA TO REMOTE ; [ 08/21/02 11:14 AM ]
  1. ;;1.0;IHS RPMS CHR SYSTEM;**14**;OCT 28, 1996
  1. ;
  1. ;Routine to create a file of records containing providers
  1. ;demographic information to be downloaded to a remote computer.
  1. ;See START sub-routine for explanation.
  1. ;
  1. START ;EP
  1. W:$D(IOF) @IOF
  1. W !!?9,"**** DOWNLOAD PROVIDER DATA TO REMOTE ****",!!
  1. W "This routine is to be run whenever a CHR wants to download the list of",!,"CHR's to a laptop.",!
  1. W !,"A file of records will be created called 'chrprov.txt'."
  1. W !,"This file will be placed in the same directory that all export"
  1. W !,"files are placed. In most cases, that will be /usr/spool/uucppublic."
  1. W !,"See your site manager for assistance in finding the file once it has"
  1. W !,"been created.",!!
  1. ;
  1. CONT ;
  1. S DIR(0)="Y",DIR("A")="Do you wish to continue and create a download providers file",DIR("B")="N" K DA D ^DIR K DIR
  1. G:$D(DIRUT) XIT
  1. G:'Y XIT
  1. ZIS ;call to xbdbque
  1. D XIT
  1. QUEUE ;EP
  1. D WAIT^DICD,PROC,XIT,XIT1
  1. Q
  1. PROC ;
  1. S BCHC=0
  1. K ^CHRTMP($J,"CHR PROVIDERS")
  1. S BCHX=0 F S BCHX=$O(^VA(200,BCHX)) Q:BCHX'=+BCHX D
  1. .S X=$$VALI^XBDIQ1(200,BCHX,53.5)
  1. .Q:'X
  1. .Q:$P($G(^DIC(7,X,9999999)),U)'=53
  1. .D TX
  1. .Q
  1. D WRITEF
  1. Q
  1. ;
  1. TX ;
  1. S BCHY="",BCHC=BCHC+1
  1. S $P(BCHY,"|",1)=BCHX
  1. S $P(BCHY,"|",2)=$P($G(^VA(200,BCHX,9999999)),U,9)
  1. S $P(BCHY,"|",3)=$P(^AUTTLOC(DUZ(2),0),U,10)
  1. S $P(BCHY,"|",4)=DUZ(2)
  1. S $P(BCHY,"|",5)=""
  1. S $P(BCHY,"|",6)=""
  1. S $P(BCHY,"|",7)=""
  1. S X=$P(^VA(200,BCHX,0),U)
  1. S $P(BCHY,"|",10)=$P(X,",",1)
  1. S $P(BCHY,"|",9)=$P($P(X,",",2)," ",2)
  1. S $P(BCHY,"|",8)=$P($P(X,",",2)," ",1)
  1. S $P(BCHY,"|",11)=$$VAL^XBDIQ1(200,BCHX,.111)
  1. S $P(BCHY,"|",12)=$$VAL^XBDIQ1(200,BCHX,.112)
  1. S $P(BCHY,"|",13)=$$VAL^XBDIQ1(200,BCHX,.114)
  1. S $P(BCHY,"|",14)=$$VAL^XBDIQ1(200,BCHX,.115)
  1. S $P(BCHY,"|",15)=$$VAL^XBDIQ1(200,BCHX,.116)
  1. S $P(BCHY,"|",16)=""
  1. S $P(BCHY,"|",17)=$$VAL^XBDIQ1(200,BCHX,.131)
  1. S $P(BCHY,"|",18)=$$VAL^XBDIQ1(200,BCHX,.134)
  1. S ^CHRTMP($J,"CHR PROVIDERS",BCHC)=BCHY
  1. Q
  1. XIT ;clean up and exit
  1. K BCHSEL,BCHHIGH,BCHDISP,BCHQUIT,BCHANS,BCHCRIT,BCHCUT,BCHGBD,BCHGDE,BCHGDS,BCHI,BCHRAR,BCHTEXT,BCHY,BCHCNT
  1. K AMQQTAX
  1. K BCHFOUN,BCHJD,BCHPCNT,BCHPROC,BCHR,BCHSKIP,BCHX
  1. K D,D0,DIC,DFN,DI,DQ,J,XBFLG,Y
  1. Q
  1. XIT1 ;
  1. K BCHRPT,BCHPTVS,BCHTYPE,BCHCHR,BCHFILE
  1. Q
  1. WRITEF ;EP - write out flat file
  1. S XBGL="CHRTMP("_$J_",""CHR PROVIDERS"","
  1. S XBMED="F",XBFN="chrprov.txt",XBTLE="SAVE OF PROVIDERS FOR CHR DOWNLOAD"
  1. S XBF=0,XBQ="N",XBFLT=1,XBE=$J
  1. W:'$D(ZTQUEUED) !!
  1. D ^XBGSAVE
  1. ;
  1. WRITEFX ;
  1. W !!,$C(7),$C(7),"A TOTAL of *** ",BCHC," *** providers were downloaded.",!!
  1. K ^CHRTMP($J,"CHR PROVIDERS")
  1. Q