source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOLLL5.m@ 1211

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

initial load of WorldVistAEHR

File size: 6.0 KB
RevLine 
[613]1PSOLLL5 ;BIR/RJS - LASER LABEL CONTINUED ;11/14/05 10:09am
2 ;;7.0;OUTPATIENT PHARMACY;**120,161,230,200**;DEC 1997;Build 7
3 ;
4START ;
5 N TEXT,BLNKLIN
6 S $P(BLNKLIN,"_",90)="_"
7 D MAIL^PSOLLL7
8 I $G(PSOIO("ACI"))]"" X PSOIO("ACI")
9 S TEXT="HAS YOUR ADDRESS CHANGED?" D STRT^PSOLLU1("SEC2",TEXT,.L)
10 S OPSOX=PSOX,PSOX=4.2-L($E(PSOHFONT,2,99))*300/2+OPSOX
11 S OFONT=PSOFONT,PSOFONT=$G(PSOHFONT,OFONT) D PRINT(TEXT,1) S PSOX=OPSOX,PSOY=PSOY+10,PSOFONT=OFONT
12 S TEXT="Write address changes in the blanks, sign the form, and return to" D PRINT(TEXT,0)
13 S TEXT="your pharmacy." D PRINT(TEXT,0)
14 S X=$S($D(^DPT(DFN,0))#2:^(0),1:""),PNM=$P(X,"^")
15 D PID^VADPT6,ADD^VADPT S SSNP=$G(VA("BID"))
16 S PSOY=PSOY+PSOYI,TEXT=PNM_" "_SSNP D PRINT(TEXT,0)
17 I $G(VAPA(1))="" G ALLERGY
18 F I=1:1:3 I $G(VAPA(I))]"" S TEXT=$G(VAPA(I))_$E(BLNKLIN,1,80-$L(VAPA(I))) D PRINT(TEXT,0)
19 S A=+$G(VAPA(5)) I A S A=$S($D(^DIC(5,A,0)):$P(^(0),"^",2),1:"UNKNOWN")
20 S B=$G(VAPA(4))_", "_A_" "_$S($G(VAPA(11)):$P(VAPA(11),"^",2),1:$G(VAPA(6)))
21 S TEXT=B_$E(BLNKLIN,1,80-$L(B)) D PRINT(TEXT,0)
22 S B=VAPA(8)
23 S TEXT=B_$E(BLNKLIN,1,80-$L(B)) D PRINT(TEXT,0)
24 S:$G(VAPA(3))="" PSOY=PSOY+PSOYI
25 S TEXT="[ ] Permanent [ ] Temporary until ____/____/____" D PRINT(TEXT,0)
26 S PSOY=$G(PSOFY),TEXT="Signature "_$E(BLNKLIN,1,45) D PRINT(TEXT,0)
27 ;
28ALLERGY ;ALLERGIES & REACTIONS
29 K ^TMP($J,"PSOALWA")
30 S GMRA="0^0^111" D ^GMRADPT
31 I $G(GMRAL) S PSORY=0 F S PSORY=$O(GMRAL(PSORY)) Q:'PSORY S ^TMP($J,"PSOALWA",$S($P(GMRAL(PSORY),"^",4):1,1:2),$S('$P(GMRAL(PSORY),"^",5):1,1:2),$P(GMRAL(PSORY),"^",7),$P(GMRAL(PSORY),"^",2))=""
32 S ^TMP($J,"PSOAPT",1)=$G(PNM)_" "_$G(SSNP),^(2)="Verified Allergies"
33 S ALCNT=0,EEE=0,(PSOLG,PSOLGA)="" F S PSOLG=$O(^TMP($J,"PSOALWA",1,1,PSOLG)) Q:PSOLG="" F S PSOLGA=$O(^TMP($J,"PSOALWA",1,1,PSOLG,PSOLGA)) Q:PSOLGA="" S EEE=1,ALCNT=ALCNT+1,^TMP($J,"PSOAPT",2,ALCNT)=PSOLGA
34 I 'EEE,$G(GMRAL)=0 S ALCNT=ALCNT+1,^TMP($J,"PSOAPT",2,ALCNT)="NKA"
35 S ALCNT=0,^TMP($J,"PSOAPT",3)="Non-Verified Allergies"
36 S EEE=0,(PSOLG,PSOLGA)="" F S PSOLG=$O(^TMP($J,"PSOALWA",2,1,PSOLG)) Q:PSOLG="" F S PSOLGA=$O(^TMP($J,"PSOALWA",2,1,PSOLG,PSOLGA)) Q:PSOLGA="" S EEE=EEE+1,ALCNT=ALCNT+1,^TMP($J,"PSOAPT",3,ALCNT)=PSOLGA
37 I 'EEE,$G(GMRAL)=0 S ALCNT=ALCNT+1,^TMP($J,"PSOAPT",3,ALCNT)="NKA"
38 S ALCNT=0,^TMP($J,"PSOAPT",4)="Verified Adverse Reactions"
39 S (PSOLG,PSOLGA)="" F S PSOLG=$O(^TMP($J,"PSOALWA",1,2,PSOLG)) Q:PSOLG="" F S PSOLGA=$O(^TMP($J,"PSOALWA",1,2,PSOLG,PSOLGA)) Q:PSOLGA="" S ALCNT=ALCNT+1,^TMP($J,"PSOAPT",4,ALCNT)=PSOLGA
40 S ALCNT=0,^TMP($J,"PSOAPT",5)="Non-Verified Adverse Reactions"
41 S (PSOLG,PSOLGA)="" F S PSOLG=$O(^TMP($J,"PSOALWA",2,2,PSOLG)) Q:PSOLG="" F S PSOLGA=$O(^TMP($J,"PSOALWA",2,2,PSOLG,PSOLGA)) Q:PSOLGA="" S ALCNT=ALCNT+1,^TMP($J,"PSOAPT",5,ALCNT)=PSOLGA
42 I $G(PSOIO("ALI"))]"" X PSOIO("ALI")
43 S XFONT=$E($G(PSOFONT),2,99)
44 S OFONT=PSOFONT,PSOFONT=$G(PSOHFONT,PSOFONT) S TEXT=^TMP($J,"PSOAPT",1) D PRINT(TEXT,1) S PSOFONT=OFONT
45 I $$GET1^DIQ(44,$P(RXY,"^",5),2,"I")="W" S TEXT="INPATIENT" D PRINT(TEXT,0)
46 F CCC=3,4,5 I '$O(^TMP($J,"PSOAPT",CCC,0)) K ^TMP($J,"PSOAPT",CCC)
47 D ASSESS
48 I CCC="NKA" S ^TMP($J,"PSOAPT",2,1)="No Known Allergies" K ^TMP($J,"PSOAPT",3)
49 S CCC=1,OUT=0
50 F S CCC=$O(^TMP($J,"PSOAPT",CCC)) Q:CCC="" D Q:OUT
51 .S TEXT=$G(^TMP($J,"PSOAPT",CCC))
52 .I $G(PSOIO(PSOFONT))]"" X PSOIO(PSOFONT)
53 .S PSOY=PSOY+PSOYI D PRINT(TEXT,0,1)
54 .I TEXT="No Assessment Made" Q
55 .I PSOY>PSOYM S OUT=1 Q
56 .S (TEXT,PTEXT,CCC2)="",LENGTH=0
57 .F S CCC2=$O(^TMP($J,"PSOAPT",CCC,CCC2)) Q:CCC2="" S TEXT=^(CCC2) D Q:OUT
58 ..D STRT^PSOLLU1("SEC2",TEXT,.L)
59 ..I LENGTH+L(XFONT)<3.7 S PTEXT=PTEXT_TEXT_",",LENGTH=LENGTH+L(XFONT) Q
60 ..I PTEXT="" D Q
61 ... F JJ=$L(TEXT):-1 S PTEXT=$E(TEXT,1,JJ) D STRT^PSOLLU1("SEC2",PTEXT,.L) I L(XFONT)<3.7 D PRINT(PTEXT,0) S PTEXT=$E(TEXT,JJ+1,512)_"," Q
62 ... D STRT^PSOLLU1("SEC2",PTEXT,.L) S LENGTH=L(XFONT)
63 ..S LENGTH=0,CCC2=CCC2-1
64 ..I PSOY>PSOYM S OUT=1 Q
65 ..D PRINT(PTEXT,0) S PTEXT=""
66 .I 'OUT,PTEXT]"" D PRINT($P(PTEXT,",",1,$L(PTEXT,",")-1),0)
67 I OUT S T="Additional Allergies or Adverse Reactions Exist." D PRINT(T,0) S T="Talk to your Physician or Pharmacist." D PRINT(T,0)
68 K ^TMP($J,"PSOALWA"),^TMP($J,"PSOAPT"),PSONKA,PSONULL,WWW,GMRA,GMRAL,JJJ,WCNT,RRR,ALG,ALCNT,EEE,FFF,PSOLG,PSOLGA,PSORY,CCC,CCC2,FNTFLG,TEXT,TEXT2
69SUSPEN S PSODFN=DFN,(SPPL,RXX,STA)="",XXS=1
70 I $G(PSODTCUT)']"" S X1=DT,X2=-120 D C^%DTC S PSODTCUT=X
71 D ^PSOBUILD S (STA,RXX)=""
72 F S STA=$O(PSOSD(STA)) Q:STA="" F S RXX=$O(PSOSD(STA,RXX)) Q:RXX="" I $P(PSOSD(STA,RXX),"^",2)=5 S SPPL=$P(PSOSD(STA,RXX),"^")_","_SPPL
73 I SPPL="" Q
74SUSP1 I $G(PSOIO("SPI"))]"" X PSOIO("SPI")
75 S TOF=0,TEXT=PNM_" "_SSNP_" "_$G(PSONOW) D PRINT(TEXT,0)
76 S TEXT="The following prescription(s) have been requested and will be" D PRINT(TEXT,0)
77 S TEXT="mailed to you on or after the date indicated." D PRINT(TEXT,0)
78 S PSOY=PSOY+PSOYI,TEXT="Rx# Date "
79 D PRINT(TEXT,0,1)
80 F XX=XXS:1 Q:$P(SPPL,",",XX)="" S RX=$P(SPPL,",",XX) D Q:TOF
81 . S SPNUM=$O(^PS(52.5,"B",RX,0)) I SPNUM S SPDATE=$P($G(^PS(52.5,SPNUM,0)),"^",2) S Y=SPDATE X ^DD("DD") S SPDATE=Y
82 . S T=$P(^PSRX(RX,0),"^") D PRINT(T,0)
83 . S PSOY=PSOY-PSOYI,OPSOX=PSOX,PSOX=PSOCX,T=$G(SPDATE) D PRINT(T,0)
84 . S PSOX=OPSOX+20,T=$$ZZ^PSOSUTL(RX) D PRINT(T,0) K SPNUM,SPDATE,Y,ZDRUG
85 . S PSOX=OPSOX,PSOY=PSOY+PSOYI
86 . I PSOY>PSOYM S XXS=XX+1,TOF=1 W:$P(SPPL,",",XXS)]"" @IOF Q
87 I TOF,$P(SPPL,",",XXS)]"" G SUSP1
88 Q
89PRINT(T,B,UL) ;
90 S BOLD=$G(B),UL=$G(UL)
91 I 'BOLD,$G(PSOIO(PSOFONT))]"" X PSOIO(PSOFONT)
92 I BOLD,$G(PSOIO(PSOFONT_"B"))]"" X PSOIO(PSOFONT_"B")
93 I $G(PSOIO("ST"))]"" X PSOIO("ST")
94 I UL,$G(PSOIO("FWU"))]"" X PSOIO("FWU")
95 W T,!
96 I UL,$G(PSOIO("FDU"))]"" X PSOIO("FDU")
97 I $G(PSOIO("ET"))]"" X PSOIO("ET")
98 I BOLD,$G(PSOIO(PSOFONT))]"" X PSOIO(PSOFONT) ;TURN OFF BOLDING
99 Q
100ASSESS ;
101 N FLG3,FLG4,FLG5
102 S CCC=$G(^TMP($J,"PSOAPT",2,1))
103 S FLG3=$G(^TMP($J,"PSOAPT",3,1))
104 S FLG4=$G(^TMP($J,"PSOAPT",4,1))
105 S FLG5=$G(^TMP($J,"PSOAPT",5,1))
106 I CCC="",FLG3="",FLG4="",FLG5="" S ^TMP($J,"PSOAPT",2,1)="No Assessment Made" K ^TMP($J,"PSOAPT",3)
107 Q
Note: See TracBrowser for help on using the repository browser.