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

PRCPCSP.m

Go to the documentation of this file.
  1. PRCPCSP ;WISC/RFJ/DXH - convert secondary to primary ;9.9.99
  1. V ;;5.1;IFCAP;**1**;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ; prcpflvl=1 => accept existing stock levels for some or all
  1. ;
  1. EN D ^PRCPUSEL Q:'$G(PRCP("I"))
  1. I PRCP("DPTYPE")'="P" W !,"THIS OPTION SHOULD ONLY BE USED FROM WITHIN A PRIMARY INVENTORY POINT." Q
  1. ;
  1. N D0,DA,DATA,DELETE,DI,DIC,DIE,DIR,DQ,DR,EACHONE,ESCAPE,ITEMCNT,ITEMDA
  1. N IMFDATA,INVPT,IPVND,LASTONE,NUMBER,PIECE,PRIM,PRCPINPT,PRCPITEM
  1. N PRCPTYPE,UP,UR,VENDA,VENDATA,VENDOR,XH,XP
  1. ASKNP ; ask for secondary inventory point to be converted
  1. S PRIM=$$INVNAME^PRCPUX1(PRCP("I"))
  1. K X
  1. S X(1)="Select the SECONDARY inventory point to CONVERT."
  1. S X(2)="It must be one of the DISTRIBUTION POINTS for "_PRIM_"."
  1. W ! D DISPLAY^PRCPUX2(1,60,.X)
  1. S INVPT=$$TO^PRCPUDPT(PRCP("I")) I 'INVPT Q
  1. I '$D(^PRCP(445,INVPT,4,DUZ)) D G ASKNP
  1. . K X
  1. . S X(1)="ERROR: You are not an authorized user for this inventory point."
  1. . D DISPLAY^PRCPUX2(5,75,.X)
  1. S ITEMCNT=+$P($G(^PRCP(445,INVPT,1,0)),"^",4)
  1. I 'ITEMCNT,'$O(^PRCP(445,INVPT,1,0)) D Q:$G(ESCAPE)
  1. . K X
  1. . S X(1)="There are no items stored in the selected secondary inventory point."
  1. . S X(2)="Data base unchanged."
  1. . S ESCAPE=1
  1. . D DISPLAY^PRCPUX2(5,75,.X)
  1. I $P($G(^PRCP(445,INVPT,5)),"^",1)]"" D QUIT
  1. . K X
  1. . S X(1)="This inventory point is linked to a supply station and cannot be converted."
  1. . D DISPLAY^PRCPUX2(5,75,.X)
  1. W !!?5,"Number of items currently stored: ",ITEMCNT
  1. W !! K X
  1. S X(1)="Existing PROCUREMENT and MANDATORY SOURCES for this secondary"
  1. S X(2)="will be replaced with data taken from its supplying primary"
  1. S X(3)="("_PRIM_") during the conversion. You can change these data"
  1. S X(4)="later if you need to."
  1. D DISPLAY^PRCPUX2(20,75,.X)
  1. ;
  1. D CONVRT^PRCPCSP1
  1. Q
  1. ;
  1. HOLD ; can get here only from a crt
  1. W !,"Press <RETURN> to continue, '^' to escape..." R X:DTIME
  1. I '$T!($E(X)="^") S ESCAPE=1
  1. Q
  1. ;PRCPCSP