source: FOIAVistA/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSWRNC.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 4.1 KB
Line 
1PSSWRNC ;DAL/RJS-NEW WARNING SOURCE CUSTOM WARNING LIST BUILDER CONT;
2 ;;1.0;PHARMACY DATA MANAGEMENT;**98**;10/12/05
3 ;
4 ;IA: 3735 ^PSNDF(50.68
5 ;IA: 4445 ^PS(50.625
6 ;IA: 4446 ^PS(50.626
7 ;IA: 4448 ^PS(50.627
8SEL1 ;
9 S DR=0 F S DR=$O(^PSDRUG(DR)) Q:'DR D
10 .I '$D(^PSDRUG(DR,0)) Q
11 .S WARN54=$P(^PSDRUG(DR,0),"^",8) I WARN54="" Q
12 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
13 .D ACTIVE^PSSWRNB I 'ACTIVE Q
14 .D DRUG^PSSWRNB I PSSWRN="" S ^TMP("PSSWRNB",$J,$P(^PSDRUG(DR,0),"^"))=WARN54_"^"_NDF
15 Q
16SEL2 ;
17 S DR=0 F S DR=$O(^PSDRUG(DR)) Q:'DR D
18 .I '$D(^PSDRUG(DR,0)) Q
19 .S WARN54=$P(^PSDRUG(DR,0),"^",8) I WARN54="" Q
20 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
21 .D ACTIVE^PSSWRNB I 'ACTIVE Q
22 .F I=1:1:$L(WARN54,",") S WARN=$P(WARN54,",",I) I WARN>20 D
23 ..I '$D(^PS(54,WARN)) Q
24 ..S ^TMP("PSSWRNB",$J,$P(^PSDRUG(DR,0),"^"))=WARN54
25 Q
26SEL3 ;
27 W ! K DIR S DIR(0)="FO^1:30",DIR("A")="Enter starting drug name" D ^DIR K DIR I Y["^"!(Y="") S QUIT=1 Q
28 S X=$$ENLU^PSSGMI(Y)
29 S DRUG=X
30 W ! K DIR S DIR(0)="FO^1:30",DIR("A")="Enter ending drug name" D ^DIR K DIR I Y["^"!(Y="") S QUIT=1 Q
31 S EDRUG=Y
32 W !!,"WARNINGS FOR DRUGS FROM "_DRUG_" TO "_EDRUG
33 W ! K DIR S DIR(0)="E" D ^DIR K DIR I 'Y S PSSOUT=1,QUIT=1 Q
34 I $D(^PSDRUG("B",DRUG)) S I=$L(DRUG),DRUG=$E(DRUG,1,I-1)
35 F S DRUG=$O(^PSDRUG("B",DRUG)) Q:DRUG="" Q:DRUG]EDRUG D
36 .S DR=$O(^PSDRUG("B",DRUG,0)) I DR="" Q
37 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
38 .D ACTIVE^PSSWRNB I 'ACTIVE Q
39 .S ^TMP("PSSWRNB",$J,DRUG)=""
40 Q
41SEL4 ;
42 S DR=0 F S DR=$O(^PSDRUG(DR)) Q:'DR D
43 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
44 .D ACTIVE^PSSWRNB I 'ACTIVE Q
45 .D DRUG^PSSWRNB I PSSWRN="" Q
46 .N XX S XX=DR D CHECK20^PSSWRNA
47 .I $L(PSSWRN,",")>5 S ^TMP("PSSWRNB",$J,$P(^PSDRUG(DR,0),"^"))=PSSWRN
48 Q
49SEL59 ;
50 S DIC=54,DIC(0)="AEQM",DIC("A")="Select drugs containing RX Consult number:" D ^DIC K DIC I Y<0 Q
51 S RXNUM=$P(Y,"^")
52 I '$D(^PS(54,RXNUM)) W !,RXNUM_" is not in the RX Consult file.",! K DIR S DIR(0)="E" D ^DIR K DIR I 'Y S PSSOUT=1 Q
53 I SEL=9,'$G(^PS(54,RXNUM,2)) W !,RXNUM," is not mapped to a new data source warning",! K DIR S DIR(0)="E" D ^DIR K DIR I 'Y S PSSOUT=1 Q
54 I SEL=9 S PSO9=$G(^PS(54,RXNUM,2))_"N" W " ",RXNUM," is mapped to ",PSO9 H 1
55 S DR=0 F S DR=$O(^PSDRUG(DR)) Q:'DR D
56 .I '$D(^PSDRUG(DR,0)) Q
57 .S WARN54=$P(^PSDRUG(DR,0),"^",8) I WARN54="" Q
58 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
59 .D ACTIVE^PSSWRNB I 'ACTIVE Q
60 .I ","_WARN54_","[(","_RXNUM_",") D
61 ..I SEL=9 D DRUG^PSSWRNB I PSSWRN="" Q
62 ..I SEL=9,","_PSSWRN_","[(","_PSO9_",") Q
63 ..S ^TMP("PSSWRNB",$J,$P(^PSDRUG(DR,0),"^"))=WARN54
64 Q
65SEL6 ;
66 S DR=0 F S DR=$O(^PSDRUG(DR)) Q:'DR D
67 .I '$D(^PSDRUG(DR,0)) Q
68 .S WARN54=$P(^PSDRUG(DR,0),"^",8) I WARN54="" Q
69 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
70 .D ACTIVE^PSSWRNB I 'ACTIVE Q
71 .F I=1:1:$L(WARN54,",") S WARN=$P(WARN54,",",I) I WARN,$D(^PS(54,WARN,1)),$G(^PS(54,WARN,2))="" D
72 ..S ^TMP("PSSWRNB",$J,$P(^PSDRUG(DR,0),"^"))=WARN54
73 Q
74SEL7 ;
75 W !! K DIR S DIR("A")="Select drugs containing New warning number"
76 S DIR("?",1)="Answer using format # or #N"
77 S DIR("?")="Example: 15 or 15N"
78 S DIR(0)="FO"
79 D ^DIR S RXNUM=Y
80 I Y="N"!(Y="n")!(Y="Y")!(Y="y") W !,$C(7),?5,RXNUM_" is not a valid entry" H 2 S QUIT=1 Q
81 I RXNUM["N"!(RXNUM["n") S RXNUM=$TR(RXNUM,"Nn","")
82 I RXNUM="^"!(RXNUM="")!(RXNUM=" ") S QUIT=1 Q
83 I '$D(^PS(50.625,RXNUM)) W !,$C(7),RXNUM_" is not in the New warning file" H 1 S QUIT=1 Q
84 W @IOF
85 W "Searching for drugs that contain new warning number "_RXNUM
86 S PSOWARN=RXNUM_"N",STAR="" D NEWWARN^PSSWRNE
87 K DIR S DIR(0)="E" D ^DIR K DIR I 'Y S PSSOUT=1 Q
88 S DR=0 F S DR=$O(^PSDRUG(DR)) Q:'DR D
89 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
90 .D ACTIVE^PSSWRNB I 'ACTIVE Q
91 .D DRUG^PSSWRNB I PSSWRN="" Q
92 .I ","_PSSWRN_","[(","_RXNUM_"N,") S ^TMP("PSSWRNB",$J,$P(^PSDRUG(DR,0),"^"))=PSSWRN
93 Q
94SEL8 ;
95 N WARN,GEND
96 S WARN=0 F S WARN=$O(^PS(50.625,WARN)) Q:'WARN I $G(^PS(50.625,WARN,2))'="" S GEND(WARN_"N")=""
97 I $O(GEND(""))="" Q
98 S DR=0 F S DR=$O(^PSDRUG(DR)) Q:'DR D
99 .I SKIP,$P($G(^PSDRUG(DR,"WARN")),"^")'="" Q
100 .D ACTIVE^PSSWRNB I 'ACTIVE Q
101 .D DRUG^PSSWRNB I PSSWRN="" Q
102 .S WARN=0 F S WARN=$O(GEND(WARN)) Q:'WARN I ","_PSSWRN_","[(","_WARN_",") D
103 ..S ^TMP("PSSWRNB",$J,$P(^PSDRUG(DR,0),"^"))=PSSWRN
104 Q
Note: See TracBrowser for help on using the repository browser.