[613] | 1 | PRCHHI ;WISC/TGH-IFCAP EDI ENTRY ROUTINE ;1/30/98 1100
|
---|
| 2 | V ;;5.1;IFCAP;;Oct 20, 2000
|
---|
| 3 | ;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
| 4 | Q
|
---|
| 5 | NEW(VAR1,PRCHTYP,PRCHPAR) ; VAR1 = Record Number
|
---|
| 6 | ; PRCHTYP = Transaction Type
|
---|
| 7 | ; PRCHPAR = Partial Number if type is RC1
|
---|
| 8 | ;
|
---|
| 9 | N A,A1,A2,TC,PRCHTYPE,CNTR,NUM,KEPNUM
|
---|
| 10 | S U="^"
|
---|
| 11 | S A=$G(^PRC(442,VAR1,0)) Q:A="" S ZA=A S PRC("SITE")=$P($P(A,U),"-")
|
---|
| 12 | S YR=$E(DT,2,3),MO=$E(DT,4,5),PRC("FY")=$E(100+$S(MO>9:YR+1,1:YR),2,3)
|
---|
| 13 | S A1=$G(^PRC(442,VAR1,1)) S ZA1=A1 Q:A1=""
|
---|
| 14 | ;N A6 S A6=$G(^PRC(442,VAR1,6,0)) I A6]"" G:$P(A6,U,4)>0 POM
|
---|
| 15 | K PRCHTP
|
---|
| 16 | S (CNTR,NUM)=0
|
---|
| 17 | S PRCHTP(1)="442,"_VAR1_",^PRC(442,"
|
---|
| 18 | S PRCHTYPE=$E(PRCHTYP)
|
---|
| 19 | S PRCFA("TT")=PRCHTYP,(PRCFA("SYS"),PRCHSYS)="ISM",PRCFASYS="ISM"
|
---|
| 20 | K ^TMP($J)
|
---|
| 21 | W !!,"Now building Code sheet..."
|
---|
| 22 | I PRCHTYPE="R" D RECT
|
---|
| 23 | I PRCHTYPE="P" D OBL
|
---|
| 24 | I $F("ST",$E(PRCHTYPE)) D REQ
|
---|
| 25 | S NUM=NUM+1,^TMP($J,"STRING",NUM)="$"
|
---|
| 26 | ;
|
---|
| 27 | W !!,"Now Transmitting Code sheet..."
|
---|
| 28 | S W1=PRC("SITE"),W2="PO1",V3=$P($P(A,U),"-")_$P($P(A,U),"-",2),V4="IST",V5=200
|
---|
| 29 | D TRANSMIT^PRCPSMCS(W1,W2,V3,V4,V5) S XMZ=$O(PRCPXMZ(0)) I XMZ>0 S $P(^PRC(442,VAR1,12),U,10)=PRCPXMZ(XMZ)
|
---|
| 30 | ;S PRC("PER")=$P(A1,U,10),PRCFA("TTF")="ISM" D ^PRCFACX2
|
---|
| 31 | ;S CSDA=PRCFA("CSDA") D ^PRCFACB Q:'$D(PRCF("BTCH"))
|
---|
| 32 | ;N PRCOPODA S PRCOPODA=VAR1 D ^PRCFACBT S ZTREQ="@"
|
---|
| 33 | K PRCHTP,PRCHTP1 ;use if we do not build 423
|
---|
| 34 | Q
|
---|
| 35 | REQ ;Requistion
|
---|
| 36 | S TC=$P(A,U,19),A2=$P(A1,U,9)
|
---|
| 37 | S A2=$S(A2="ST":1,A2="SP":2,A2="EM":3,1:1)
|
---|
| 38 | I TC'=2 S TC="SO"
|
---|
| 39 | E S TC="TO"
|
---|
| 40 | S A2=TC_A2
|
---|
| 41 | S PRCFA("TT")=A2,PRCFA("SYS")="ISM",PRCFASYS="ISM"
|
---|
| 42 | D CNTL^PRCHHI0(A,A1,A2,.CNTR)
|
---|
| 43 | S PRCHSYS="ISM"
|
---|
| 44 | D CNTL^PRCHHI0(A,A1,A2,.CNTR)
|
---|
| 45 | D HE^PRCHHI1(A,A1,A2,VAR1,.CNTR,.NUM)
|
---|
| 46 | D CU^PRCHHI3(A,.CNTR,.NUM)
|
---|
| 47 | D BI^PRCHHI2(A,A2,VAR1,.CNTR,.NUM)
|
---|
| 48 | D ST^PRCHHI4(A,A1,A2,.CNTR,.NUM)
|
---|
| 49 | D AC^PRCHHI5(A,A1,VAR1,.CNTR,.NUM)
|
---|
| 50 | S PRCHVAR1=VAR1
|
---|
| 51 | ;S PRCHTP(1,CNTR+1)="D IT^PRCHHI6(PRCHVAR1) S X=""|$"";507"
|
---|
| 52 | D IT^PRCHHI6(PRCHVAR1,.NUM)
|
---|
| 53 | S PRCHLI="QUIT"
|
---|
| 54 | Q
|
---|
| 55 | ;KILL VARS
|
---|
| 56 | RECT ;
|
---|
| 57 | D CNTL^PRCHHI0(A,A1,PRCHTYP,.CNTR)
|
---|
| 58 | D DH^PRCHHI8(A,A1,PRCHTYP,VAR1,.CNTR,.NUM)
|
---|
| 59 | S PRCHVAR1=VAR1,PRCHPAR1=PRCHPAR
|
---|
| 60 | ;S PRCHTP(1,CNTR+1)="D DL^PRCHHI10(PRCHVAR1,PRCHPAR1) S X=""|$"";507"
|
---|
| 61 | D DL^PRCHHI10(PRCHVAR1,PRCHPAR1,.NUM)
|
---|
| 62 | Q
|
---|
| 63 | OBL ;
|
---|
| 64 | S PRCFA("SYS")="ISM"
|
---|
| 65 | D CNTL^PRCHHI0(A,A1,PRCHTYP,.CNTR)
|
---|
| 66 | D AC^PRCHHI5(A,A1,VAR1,.CNTR,.NUM)
|
---|
| 67 | D DH^PRCHHI8(A,A1,PRCHTYP,VAR1,.CNTR,.NUM)
|
---|
| 68 | ;The following line picks up comments
|
---|
| 69 | S A2=4,A3="CO",ITEM=""
|
---|
| 70 | S KEPNUM=NUM
|
---|
| 71 | ;S PRCHTP(1,CNTR+1)="D CO^PRCHHI9(4,""CO"",PRCHPO,ITEM,.NUM) S X=""|$"";507"
|
---|
| 72 | ;D CO^PRCHHI9(4,"CO",PRCHPO,ITEM,.NUM)
|
---|
| 73 | D CO^PRCHHI9(4,"CO",VAR1,ITEM,.NUM)
|
---|
| 74 | ;
|
---|
| 75 | ;#DE SEGMENT(NUMBER DESC'S OF DH SEGMENT) FORMATTED UPTO 3 CHARS
|
---|
| 76 | S PRCHNUM=NUM-KEPNUM
|
---|
| 77 | S PRCHNUM="00"_PRCHNUM
|
---|
| 78 | S PRCHNUM=$E(PRCHNUM,$L(PRCHNUM)-2,99)
|
---|
| 79 | ;
|
---|
| 80 | S $P(^TMP($J,"STRING",KEPNUM),U,21)=PRCHNUM
|
---|
| 81 | ;The following is for items and decriptions
|
---|
| 82 | ;S PRCHTP(1,CNTR+2)="D DL^PRCHHI7(PRCHA,PRCHPO,.NUM) S X=""|$"";507"
|
---|
| 83 | S DLCNT=0
|
---|
| 84 | ;D DL^PRCHHI7(PRCHA,PRCHPO,.NUM,.DLCNT)
|
---|
| 85 | D DL^PRCHHI7(PRCHA,VAR1,.NUM,.DLCNT)
|
---|
| 86 | ;
|
---|
| 87 | ;S $P(^TMP($J,"STRING",KEPNUM),U,22)=DLCNT
|
---|
| 88 | Q
|
---|
| 89 | POM ;
|
---|
| 90 | Q
|
---|