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

BWMDEU1.m

Go to the documentation of this file.
  1. BWMDEU1 ;IHS/ANMC/MWR - MDE FUNCTIONS.;29-Oct-2003 21:38;PLS
  1. ;;2.0;WOMEN'S HEALTH;**8,9**;MAY 16, 1996
  1. ; CDC Utility functions to extract building.
  1. ;
  1. HFS ; EP - Save data from ^BWTMP( to host file server.
  1. ;
  1. I '$D(^BWTMP($J)) D Q
  1. . D ^%ZISC
  1. . Q:$D(BWSILENT)
  1. . W !!?5,"NO RECORDS TO BE EXPORTED." D DIRZ^BWUTL3
  1. ;
  1. ; If this is an extract then offer to write file out to screen.
  1. S BWCAPT="h"
  1. I 'BWXPORT D Q:BWPOP
  1. . N DIR U IO(0)
  1. . W !!?3,"Do you wish to save this to the Host File ",BWPATH,BWFLNM,","
  1. . W !?3,"or write it to your screen for capture by a PC?",!
  1. . S DIR("A")=" Select HOST or SCREEN: ",DIR("B")="HOST"
  1. . S DIR(0)="SAM^h:HOST;s:SCREEN" D HELP1^BWMDE4
  1. . D ^DIR
  1. . I $D(DIRUT) S BWPOP=1 Q
  1. . S BWCAPT=Y
  1. . I Y="s" D Q
  1. . . U IO(0)
  1. . . W !!?5,"Screen print of the file will follow immediately."
  1. . . D DIRZ^BWUTL3
  1. . . U IO
  1. I BWXPORT D Q:BWPOP
  1. . S BWPATH=$P(^BWSITE(DUZ(2),0),U,14) ;K IO(1)
  1. . S BWFLNM=$P(^BWSITE(DUZ(2),0),U,13)_$E(DT,4,5)_$E(DT,2,3)_$S($G(BWXPORT):"",1:"LC")_BWCDCV
  1. . S BWPOP=$$OPEN^%ZISH(BWPATH,BWFLNM,"W")
  1. . I BWPOP D ^%ZISC,ERROR S BWPOP=1
  1. U IO W ""
  1. N N,M S N=0,BWCOUNT=0
  1. F S N=$O(^BWTMP($J,N)) Q:'N D
  1. . S M=0
  1. . F S M=$O(^BWTMP($J,N,M)) Q:'M D
  1. . . U IO W ^BWTMP($J,N,M),! S BWCOUNT=BWCOUNT+1
  1. . . I '$D(BWSILENT) U 0 W "/" ;IHS/CMI/THL PATCH 7 ;PATCH 8
  1. D ^%ZISC
  1. I '$D(BWSILENT),BWCAPT="s" D DIRZ^BWUTL3 Q
  1. I '$D(BWSILENT) D ;IHS/CIM/THL PATCH 8
  1. . W !!?5,"File ",BWPATH_BWFLNM
  1. . W " successfully saved to Host File Server."
  1. . W !!?5,"Records exported...........................................: "
  1. . W $J(BWCOUNT,6)
  1. . D NOFAC,DIRZ^BWUTL3
  1. ; Quit if this was only an exrtact (BWXPORT=0).
  1. I 'BWXPORT Q
  1. E D SAVELOG^BWMDE4
  1. Q
  1. ;
  1. ;
  1. ERROR ;EP
  1. I $D(BWSILENT)!($D(ZTQUEUED)) Q
  1. W !!?5,"* Save to Host File Server FAILED. Contact your sitemanager."
  1. D DIRZ^BWUTL3
  1. Q
  1. ;
  1. ;
  1. NOFAC ;EP
  1. W !?5,"Total Procedures rejected: "
  1. W ?33,"Not done at a selected facility: ",$J(BWOFAC,6)
  1. W !?33,"No facility entered............: ",$J(BWNOFAC,6)
  1. Q