source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLLL6.m@ 1582

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1PSOLLL6 ;BHAM/BHW - LABEL TRAILER ;12/02/2002
2 ;;7.0;OUTPATIENT PHARMACY;**120,141,135,162,161**;DEC 1997
3 ;
4 I $G(PSOBLALL),$P(PPL,",",PI+1)'="" Q
5 S PRCOPAY=$S('$D(PSOCPN):0,1:1)
6NARR ;NARRATIVES
7 S (PSSIXFL,PSSEVFL,LENGTH,OUT)=0,PTEXT=""
8 I $G(PSOIO("RNI"))]"" X PSOIO("RNI")
9 S XFONT=$E(PSOFONT,2,99)
10 I $D(^PS(59,PSOSITE,6))!($D(^PS(59,PSOSITE,7))) S T=PNM_" "_SSNP_" "_$G(PSONOW) D PRINT(T) S PSOY=PSOY+PSOYI
11 F JJ=6,7 S TEXT="" D P(JJ) S PSOY=PSOY+PSOYI Q:OUT
12 I $G(PSOIO("CNI"))]"" X PSOIO("CNI")
13 I $G(PSOCHAMP),$G(PSOTRAMT) S T="REMIT $"_PSOTRAMT_" TO AGENT CASHIER." D PRINT(T) G END
14 I 'PRCOPAY G END
15 S OUT=0,TEXT=""
16 I $D(^PS(59,PSOSITE,4)) S T=PNM_" "_SSNP_" "_$G(PSONOW) D PRINT(T) S PSOY=PSOY+PSOYI D P(4)
17END K DIWF,DIWL,DIWR,EDT,LLL,PRCOPAY,PSNACNT,PSNOADDR,PSNOBOTH,PSNONARR,PSNOSUSP,PSNTHREE,PSOLGTH,PSOSD,PSOTRAIL,PSOTRDFN,PSSEVFL,PSSIXFL,PSSPCNT,PSSSRX,PSSUFLG,RXX,SPDATE,SPNUM,SPPL,TTT,VAADDR1,VADM,VAEL,VAPA,VASTREET,ZZ,ZZZ W @IOF
18 Q
19P(JJ) ;NARRATIVE PRINT CONTROL
20 N TEXTLEN,PSOCNT
21 S TEXTLEN=0,PSOCNT=0
22 S ZZ=0 F S ZZ=$O(^PS(59,PSOSITE,JJ,ZZ)) Q:'ZZ S PSOCNT=PSOCNT+1 Q:PSOCNT>7 I $D(^(ZZ,0)) S TEXT=^(0),TEXTLEN=TEXTLEN+$L(TEXT) S:TEXTLEN>560 TEXTLEN=TEXTLEN-$L(TEXT),TEXT=$E(TEXT,1,560-TEXTLEN) Q:TEXT="" D Q:OUT
23 . N IC
24 . D STRT^PSOLLU1("SEC2",TEXT,.L)
25 . I L(XFONT)>4.1 D Q
26 .. S IC=0 F J=1:1:$L(TEXT," ") D STRT^PSOLLU1("SEC2",$P(TEXT," ",J)_" ",.L) I L(XFONT)>4.1 S IC=1
27 .. I IC D Q:OUT
28 ... F J=$L(TEXT):-1:1 S PTEXT=$E(TEXT,1,J) D STRT^PSOLLU1("SEC2",PTEXT,.L) D Q:OUT
29 .... I L(XFONT)<4.1 D PRINT(PTEXT) S TEXT=$E(TEXT,J+1,512),J=$L(TEXT)+1,PTEXT="" I PSOY>PSOYM S OUT=1
30 .... Q
31 ... Q
32 .. I IC D:PTEXT]"" PRINT(PTEXT) S:PSOY>PSOYM OUT=1 Q
33 .. F J=$L(TEXT," "):-1 S PTEXT=$P(TEXT," ",1,J) Q:OUT Q:'$L(PTEXT) D STRT^PSOLLU1("SEC2",PTEXT,.L) I L(XFONT)<4.1 D
34 ... D PRINT(PTEXT) S TEXT=$P(TEXT," ",J+1,99) I PSOY>PSOYM S OUT=1
35 ... ;Reset $L of TEXT +1 so J loop continues properly
36 ... S J=$L(TEXT," ")+1
37 ... Q
38 .. Q
39 . D PRINT(TEXT) S TEXT=""
40 . I PSOY>PSOYM S OUT=1
41 . Q
42 I 'OUT I TEXT]"" D PRINT(TEXT)
43 Q
44PRINT(T) ;
45 I $G(PSOIO(PSOFONT))]"" X PSOIO(PSOFONT)
46 I $G(PSOIO("ST"))]"" X PSOIO("ST")
47 W T,!
48 I $G(PSOIO("ET"))]"" X PSOIO("ET")
49 Q
Note: See TracBrowser for help on using the repository browser.