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

PRCHCLN.m

Go to the documentation of this file.
  1. PRCHCLN ;WISC/AKS-Routine to correct Food Groups in Item Master file ;7/7/93 09:35
  1. ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. K ^TMP($J) N N,FLG,FGRP,PRC,%,HDRFLG,M,POP,PRCHDT,PRCHDY,PRCHPAGE,PRCHPDAT,X,Y,ZTDESC,ZTDTH,ZTRTN,ZTSAVE,C,PRCHPDAT
  1. W !!,"This option will loop through your 'ITEM MASTER' file and correct any Food Group",!,"that it can i.e. from 01 to 1, 02 to 2 etc. If it finds any Food Group for which",!
  1. W "the correct Food Group can not be determined, it will print the report."
  1. S N="" F S N=$O(^PRC(441,N)) Q:N=""!(N'?1.N) I $P($G(^PRC(441,N,3)),U,7)]"" S FLG=0,FGRP=$P(^(3),U,7) S:((+FGRP>0)&(+FGRP<7)) $P(^PRC(441,N,3),U,7)=+FGRP,FLG=1 S:'FLG ^TMP($J,N)=FGRP
  1. I '$D(^TMP($J)) W !!,"No items with 'Uncorrectable' Food Groups have been found." Q
  1. I $D(^TMP($J)) S ZTRTN="EN^PRCHCLN" W !!,"Some items in your 'ITEM MASTER' file have invalid Food Groups that the system cannot correct. Select a device to print the list of those items."
  1. W ! D SELDEV^PRCHUTL1 Q:POP Q:'$D(IO(0)) Q:IO(0)=IO
  1. S M="Generate Invalid Food Groups report" D ENRDAT^PRCHUTL1 Q:X["^"
  1. S ZTDTH=PRCHPDAT,ZTDESC="Report of items with invalid Food Group"
  1. K ZTSAVE S ZTSAVE("PRC*")="",ZTSAVE("U")="",ZTSAVE("DUZ*")="",ZTSAVE("^TMP($J,")=""
  1. D ^%ZTLOAD,ENK3^PRCHUTL1 Q
  1. EN ;
  1. D NOW^%DTC S Y=$P(%,"."),PRCHDT=% D DD^%DT S PRCHPDAT=Y S M=0,PRCHPAGE=0,PRCHDY=0,HDRFLG=0 F S M=$O(^TMP($J,M)) Q:M="" G Q:$$S^%ZTLOAD D:'HDRFLG!(PRCHDY>(IOSL-5)) HDR D
  1. .W !," ",$J(M,8)," ---------------------- ",^TMP($J,M) S PRCHDY=PRCHDY+1
  1. G Q
  1. HDR S PRCHPAGE=PRCHPAGE+1 W @IOF,"Report Of Invalid Food Groups",?57,PRCHPDAT,?73,"PAGE ",PRCHPAGE,!
  1. W "-------------------------------------------------------------------------------- ",!
  1. W " ITEM NO. FOOD GROUP",! S PRCHDY=PRCHDY+3
  1. S HDRFLG=1
  1. QUIT
  1. Q I $$S^%ZTLOAD W !,$$SQUE^PRCHUTL1($T(+0)),!
  1. K ^TMP($J)
  1. Q