source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPCRDK.m@ 1739

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1PRCPCRDK ;WISC/RFJ-instrument kit definition ;01 Sep 93
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 D ^PRCPUSEL Q:'$G(PRCP("I"))
5 N ALLKITS,X
6 K X S X(1)="The Definition Instrument Kit Report will print a list of selected instrument kits displaying the items and quantities needed to assemble a instrument kit."
7 S X(2)="The items in the instrument kit are sorted by the sequence number."
8 D DISPLAY^PRCPUX2(40,79,.X)
9 D INSTRKIT^PRCPCRU1
10 I '$O(^TMP($J,"PRCPKITS",0)),'$D(ALLKITS) Q
11 I $D(ALLKITS) W !!,"NOTE -- This option will use a lot of paper!"
12 W ! S %ZIS="Q" D ^%ZIS Q:POP I $D(IO("Q")) D D ^%ZTLOAD K IO("Q"),ZTSK D Q Q
13 . S ZTDESC="Instrument Kit Definition Report",ZTRTN="DQ^PRCPCRDK"
14 . S ZTSAVE("PRCP*")="",ZTSAVE("ALLKITS")="",ZTSAVE("^TMP($J,""PRCPKITS"",")="",ZTSAVE("ZTREQ")="@"
15 W !!,"<*> please wait <*>"
16DQ ; queue starts here
17 N IKITEM,PRCPFLAG,SCREEN,X,Y
18 S SCREEN=$$SCRPAUSE^PRCPUREP
19 I $D(ALLKITS) S IKITEM=0 F S IKITEM=$O(^PRCP(445.8,IKITEM)) Q:'IKITEM!($G(PRCPFLAG)) D
20 . D PRINT I $G(PRCPFLAG) Q
21 . I SCREEN,$O(^PRCP(445.8,IKITEM)) D P^PRCPUREP
22 ;
23 I '$D(ALLKITS) S IKITEM=0 F S IKITEM=$O(^TMP($J,"PRCPKITS",IKITEM)) Q:'IKITEM D PRINT
24Q D ^%ZISC K ^TMP($J,"PRCPKITS"),^TMP($J,"PRCPCRDK")
25 Q
26 ;
27 ;
28PRINT ; print a instrument kit definition
29 N %,%I,CATALOG,IKDATA,IKDATE,IKLOC,IKNAME,IKUSER,DATA,EDITDATE,EDITUSER,ITEMDA,LOCATION,NOW,ONHAND,PAGE,PRCPINNM,PRCPINPT,REUSABLE,SEQUENCE,VENDOR
30 ; sort by sequence number
31 K ^TMP($J,"PRCPCRDK")
32 S ITEMDA=0 F S ITEMDA=$O(^PRCP(445.8,IKITEM,1,ITEMDA)) Q:'ITEMDA S DATA=$G(^(ITEMDA,0)),^TMP($J,"PRCPCRDK",+$P(DATA,"^",3),ITEMDA)=""
33 ;
34 S IKDATA=$G(^PRCP(445.8,IKITEM,0))
35 S PRCPINPT=+$P(IKDATA,"^",2),PRCPINNM=$$INVNAME^PRCPUX1(PRCPINPT)
36 S IKNAME=$$DESCR^PRCPUX1(PRCPINPT,IKITEM),IKUSER=$$USER^PRCPUREP($P(IKDATA,"^",3)),Y=$P(IKDATA,"^",4) D DD^%DT S IKDATE=Y,EDITUSER=$$USER^PRCPUREP($P(IKDATA,"^",5)),Y=$P(IKDATA,"^",6) D DD^%DT S EDITDATE=Y
37 S IKLOC=$$STORAGE^PRCPESTO(PRCPINPT,IKITEM),ONHAND=$G(^PRCP(445,PRCPINPT,1,IKITEM,0)),ONHAND=$S(ONHAND="":"NOT STORED IN INVENTORY POINT",1:+$P(ONHAND,"^",7))
38 D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1 U IO D H
39 S SEQUENCE="" F S SEQUENCE=$O(^TMP($J,"PRCPCRDK",SEQUENCE)) Q:SEQUENCE=""!($G(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPCRDK",SEQUENCE,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) D
40 . S DATA=$G(^PRCP(445.8,IKITEM,1,ITEMDA,0)) I DATA="" Q
41 . S VENDOR=$$MANDSRCE^PRCPU441(ITEMDA),CATALOG=$P($G(^PRC(441,ITEMDA,2,+VENDOR,0)),"^",4) I $E(CATALOG,16)'="" S CATALOG=$E(CATALOG,1,15)_"+"
42 . S LOCATION=$$STORAGE^PRCPESTO(PRCPINPT,ITEMDA)
43 . S REUSABLE=$$REUSABLE^PRCPU441(ITEMDA),REUSABLE=$S(REUSABLE:"R",1:"D")
44 . W !,$J(+$P(DATA,"^",2),7),?10,$E($$DESCR^PRCPUX1(PRCPINPT,ITEMDA),1,20),?31,ITEMDA,?38,REUSABLE,?40,VENDOR,?48,CATALOG,?67,$E(LOCATION,1,12)
45 . I $Y>(IOSL-4) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
46 I $G(PRCPFLAG) Q
47 I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
48 W !!,"METHOD OF STERILIZATION : ",$$STERILE(IKITEM)
49 W !,"METHOD OF WRAPPING/PACKAGING: ",$$WRAPPING(IKITEM)
50 I $Y>(IOSL-7) D:SCREEN P^PRCPUREP Q:$G(PRCPFLAG) D H
51 W !!,"SPECIAL INSTRUCTIONS/REMARKS:"
52 S X=0 F S X=$O(^PRCP(445.8,IKITEM,2,X)) Q:'X!($G(PRCPFLAG)) S DATA=$G(^(X,0)) D
53 . I $Y>(IOSL-4) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
54 . W !,DATA
55 D END^PRCPUREP
56 Q
57 ;
58 ;
59H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
60 W $C(13),"DEFINITION OF INSTRUMENT KIT REPORT FOR: ",$E(PRCPINNM,1,20),?(80-$L(%)),%
61 W !?9,"NAME: ",IKNAME," (#",IKITEM,") ",?46,"LOCATION: ",IKLOC
62 W !?15,"CURRENT QUANTITY ASSEMBLED: ",ONHAND
63 W !?3,"CREATED BY: ",IKUSER,?50,"DATE: ",IKDATE
64 W !?1,"LAST EDIT BY: ",EDITUSER,?50,"DATE: ",EDITDATE
65 S %="",$P(%,"-",81)=""
66 W !,$J("QTY",7),?10,"DESCRIPTION",?31,"MI#",?37,"RD",?40,"VEND#",?48,"CATALOG#",?67,"LOCATION",!,%
67 Q
68 ;
69 ;
70STERILE(V1) ; return method of sterilization for ik v1
71 N %
72 S %=$P($G(^PRCP(445.8,+V1,0)),"^",7) I %'="" S %=$P($P($P(^DD(445.8,11,0),"^",3),%_":",2),";")
73 Q %
74 ;
75 ;
76WRAPPING(V1) ; return method of wrapping for ik v1
77 N %
78 S %=$P($G(^PRCP(445.8,+V1,0)),"^",8) I %'="" S %=$P($P($P(^DD(445.8,12,0),"^",3),%_":",2),";")
79 Q %
Note: See TracBrowser for help on using the repository browser.