source: FOIAVistA/tag/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHMOL1.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1PRCHMOL1 ;WISC/RWS-TRANSMIT OLS TRANS TO MAILMAN (CONT) ;1/26/98 1100
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4LOOKUP ;LOOKUP INDIVIDUAL LINES
5 F S X=$Q(@X),SEG=@X,SEGTYP=$E(SEG,1,2) Q:SEG="" D:"ML RE"[SEGTYP @SEGTYP Q:SEG["$" S A=$F(X,"PRCF"),B=$E(X,A-4,999) I $P(B,",",2)'=PRCDA S ERR="Information in transaction is incomplete." Q
6 QUIT
7ML K RSNS S LIN=LIN+1,^XMB(3.9,XMZ,2,LIN,0)=""
8 S NSN=$P(SEG,U,6) S:NSN NSN=$E(NSN,1,4)_"-"_$E(NSN,5,6)_"-"_$E(NSN,7,9)_"-"_$E(NSN,10,20)
9 S LIN=LIN+1,LIN2=LIN,^XMB(3.9,XMZ,2,LIN,0)=$J($P(SEG,U,3),4)_$J($P(SEG,U,9),3)_" "_$J($P(SEG,U,10),3)_" ORIG "_$J($P(SEG,U,8),7)_" "_$J($P(SEG,U,7),3)_" "_NSN
10 I $P(SEG,U,11) S LIN=LIN+1,^XMB(3.9,XMZ,2,LIN,0)=" RLSD"_$J($P(SEG,U,11)/100,14,2)
11 I $P(SEG,U,12) S LIN=LIN+1,^XMB(3.9,XMZ,2,LIN,0)=" B/O "_$J($P(SEG,U,12)/100,14,2)
12 I $P(SEG,U,16) S LIN=LIN+1,NSN=$P(SEG,U,15),NSN=$E(NSN,1,4)_"-"_$E(NSN,5,6)_"-"_$E(NSN,7,9)_"-"_$E(NSN,10,20) D
13 .S ^XMB(3.9,XMZ,2,LIN,0)=" SUBS "_$J($P(SEG,U,17),4)_$J($P(SEG,U,16)/100,9,2)_" "_NSN
14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MHL2($P(SEG,U,17))
23 I $P(SEG,U,2)="A" S ^XMB(3.9,XMZ,2,LIN,0)=" ALLOCATED"
24 Q
25RE S LIN=LIN+1,^XMB(3.9,XMZ,2,LIN,0)=$$MSG^PRCHMHL2($P(SEG,U,3)) Q
26JDN ; CHANGE JULIAN DATE (JDN) TO DA-MON-YEAR (JDF)
27 S YR=$E(JDN,1,4),DA=$E(JDN,5,7)
28 S $P(DAYS,U,2)=$S(YR#400=0:29,(YR#4=0&(YR#100'=0)):29,1:28)
29 F MO=1:1 S DA=DA-$P(DAYS,U,MO) Q:DA'>0
30 S DA=DA+$P(DAYS,U,MO),JDF=DA_" "_$P(MONS,U,MO)_" "_YR Q
Note: See TracBrowser for help on using the repository browser.