source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPBALB.m@ 1800

Last change on this file since 1800 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.8 KB
RevLine 
[613]1PRCPBALB ;WISC/RGY,RFJ-process barcode data (build array) ;04 Dec 92
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6 ;
7BUILD ; build array
8 N COUNT,DATA,INVDATA,INVPT,ITEMDA,LINE,QTY,RECORD
9 K ^TMP($J,"PRCPBALM"),^TMP($J,"PRCPBALMD"),^TMP($J,"PRCPBALME"),^TMP($J,"PRCPBALMU")
10 S RECORD=1 F S RECORD=$O(^PRCT(446.4,PRCTDA,2,PRCTDA1,1,RECORD)) Q:'RECORD S DATA=^(RECORD,0) I DATA'="" D
11 . S INVPT=+$P($P(DATA," "),"IE",2),ITEMDA=+$P(DATA," ",2),QTY=+$P(DATA," ",3)
12 . S ^TMP($J,"PRCPBALMD",RECORD)=INVPT_"^"_ITEMDA_"^"_QTY
13 . I $E(DATA)="*" S ^TMP($J,"PRCPBALME",RECORD)="Data has been previously uploaded" Q
14 . I $E(DATA,1,2)'="IE" S ^TMP($J,"PRCPBALME",RECORD)="First two characters should equal IE" Q
15 . I DATA'?1"IE"1N.N1" "1N.N1" ",DATA'?1"IE"1N.N1" "1N.N1" "1N.N S ^TMP($J,"PRCPBALME",RECORD)="Record data is not in expected format" Q
16 . I 'INVPT!('ITEMDA) S ^TMP($J,"PRCPBALME",RECORD)="Record data has inventory point or item equal zero" Q
17 . I PRCPTYPE="U",QTY=0 S ^TMP($J,"PRCPBALME",RECORD)="Quantity is equal to zero for usage" Q
18 . I '$D(^PRCP(445,INVPT,4,DUZ)) S ^TMP($J,"PRCPBALME",RECORD)="You are not an authorized user for this inventory point" Q
19 . I '$D(^PRCP(445,INVPT,1,ITEMDA,0)) S ^TMP($J,"PRCPBALME",RECORD)="Item is not stored in inventory point" Q
20 . I $D(^PRCP(445,"AC","W",INVPT)) S ^TMP($J,"PRCPBALME",RECORD)="Warehouse inventory items cannot be uploaded" Q
21 . S ^TMP($J,"PRCPBALMU",INVPT,ITEMDA,RECORD)=QTY
22 ; build array
23 S LINE=0
24 ; show errors first
25 I $D(^TMP($J,"PRCPBALME")) D
26 . D SET("* * * ERRORS: ITEMS WHICH WILL NOT BE UPLOADED TO THE INVENTORY POINTS * * *",1,1,80,IORVON,IORVOFF)
27 . D SET("LINE INVENTORY POINT IM# DESCRIPTION QUANTITY",2,1,80,IORVON,IORVOFF)
28 . S LINE=2
29 . S RECORD=0 F S RECORD=$O(^TMP($J,"PRCPBALME",RECORD)) Q:'RECORD S DATA=^TMP($J,"PRCPBALMD",RECORD) D
30 . . S LINE=LINE+1
31 . . D SET(RECORD,LINE,1,80)
32 . . D SET($$INVNAME^PRCPUX1($P(DATA,"^")),LINE,7,30)
33 . . D SET($P(DATA,"^",2),LINE,32,40)
34 . . D SET($$DESCR^PRCPUX1($P(DATA,"^"),$P(DATA,"^",2)),LINE,42,70)
35 . . D SET($J($P(DATA,"^",3),10),LINE,71,80)
36 . . S LINE=LINE+1
37 . . D SET(" "_^TMP($J,"PRCPBALME",RECORD),LINE,1,80)
38 ; show records to upload
39 K PRCPFSCA ;this flag is used to mark items scanned more than once
40 I LINE'=0 S LINE=LINE+1 D SET("",LINE,1,80)
41 S LINE=LINE+1
42 D SET("* * * INVENTORY POINTS AND ITEMS TO UPLOAD * * *",LINE,1,80,IORVON,IORVOFF)
43 S INVPT=0 F S INVPT=$O(^TMP($J,"PRCPBALMU",INVPT)) Q:'INVPT D
44 . S LINE=LINE+1
45 . D SET("",LINE,1,80)
46 . S LINE=LINE+1
47 . D SET(" INVENTORY POINT: "_$$INVNAME^PRCPUX1(INVPT),LINE,1,80,IORVON,IORVOFF)
48 . S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPBALMU",INVPT,ITEMDA)) Q:'ITEMDA D
49 . . S INVDATA=$G(^PRCP(445,INVPT,1,ITEMDA,0))
50 . . S RECORD=0 F COUNT=0:1 S RECORD=$O(^TMP($J,"PRCPBALMU",INVPT,ITEMDA,RECORD)) Q:'RECORD D
51 . . . S LINE=LINE+1
52 . . . D SET(RECORD,LINE,1,80)
53 . . . D SET($E($$DESCR^PRCPUX1(INVPT,ITEMDA),1,27),LINE,7,35)
54 . . . D SET(ITEMDA,LINE,36,43)
55 . . . D SET($TR($$NSN^PRCPUX1(ITEMDA),"-"),LINE,44,63)
56 . . . D SET($J($$UNIT^PRCPUX1(INVPT,ITEMDA),8),LINE,57,64)
57 . . . D SET($J($P(INVDATA,"^",7)+$P(INVDATA,"^",19),8),LINE,65,72)
58 . . . D SET($J(+^TMP($J,"PRCPBALMU",INVPT,ITEMDA,RECORD),8),LINE,73,80)
59 . . I COUNT'=1 S LINE=LINE+1 D SET(" WARNING -- ITEM WAS SCANNED MORE THAN ONCE",LINE,1,80) S PRCPFSCA=1
60 S VALMCNT=LINE
61 Q
62 ;
63 ;
64SET(STRING,LINE,COLUMN,CLREND,ON,OFF) ; set array
65 I '$D(@VALMAR@(LINE,0)) D SET^VALM10(LINE,$J("",80))
66 D SET^VALM10(LINE,$$SETSTR^VALM1(STRING,@VALMAR@(LINE,0),COLUMN,CLREND))
67 I $G(ON)]""!($G(OFF)]"") D CNTRL^VALM10(LINE,COLUMN,$L(STRING),ON,OFF)
68 Q
Note: See TracBrowser for help on using the repository browser.