source: WorldVistAEHR/trunk/r/NATIONAL_DRUG_FILE-PSN/PSNSTCK.m@ 1042

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

initial load of WorldVistAEHR

File size: 1.8 KB
RevLine 
[613]1PSNSTCK ;BIR/CCH&WRT-size and type check ; 02/01/99 7:29
2 ;;4.0; NATIONAL DRUG FILE;**5**; 30 Oct 98
3 ;
4 ; reference to ^PSDRUG supported by IA# 221
5 ;
6 K LIST,^TMP($J,"PSNPSPS"),^TMP($J,"PSNDFPK") S PSNARY=0,DDD=$O(^PS(50.609,"B","OTHER",0)),EEE=$O(^PS(50.608,"B","OTHER",0)) D PACKAGE,ARR0,SIZE
7 K DDD,EEE,FFF,GGG
8 Q
9PACKAGE S PSNFORM=$P(^PSNDF(50.68,PSNFNM,0),"^")
10 S K=PSNFNM,X=$$PSPT^PSNAPIS(,K,.LIST) S PTPS="" F S PTPS=$O(LIST(PTPS)) Q:'PTPS S XX=LIST(PTPS) F ST=1:1:X S ^TMP($J,"PSNPSPS",$P(XX,"^",2),$P(XX,"^",4))=$P(XX,"^",1)_"^"_$P(XX,"^",3),^TMP($J,"PSNPSPS","OTHER","OTHER")=DDD_"^"_EEE
11 Q
12SIZE ; Pick Size & Type Combo
13 R !?10,"Enter Package Size & Type Combination: ",ANS:DTIME S:'$T ANS="^" I ANS["^" S PSNFL=1 Q
14 I ANS["?" D SZ1^PSNHELP K ANS G SIZE
15 I ANS="" S PSNSIZE=$O(^PS(50.609,"B","OTHER",0)),PSNTYPE=$O(^PS(50.608,"B","OTHER",0)) G ASK
16 I '$D(^TMP($J,"PSNDFPK",ANS)) W !,"Invalid Answer" G SIZE
17 G:'$D(^TMP($J,"PSNDFPK",ANS)) SIZE S FFF=$O(^TMP($J,"PSNDFPK",ANS,0)),GGG=$O(^TMP($J,"PSNDFPK",ANS,FFF,0)),PSNSZ=$P(^TMP($J,"PSNDFPK",ANS,FFF,GGG),"^"),PSNTYP=$P(^TMP($J,"PSNDFPK",ANS,FFF,GGG),"^",2),PSNSIZE=PSNSZ,PSNTYPE=PSNTYP
18ASK D PKSIZE^PSNOUT,PKTYPE^PSNOUT W !!,"Local drug ",$P(^PSDRUG(PSNB,0),"^",1),!,"matches ",?11,PSNFORM,!,"PACKAGE SIZE: ",PSNSZE,!,"PACKAGE TYPE: ",PSNTPE
19 W !!,"< Enter ""Y"" for yes >"
20 W !,"< Enter ""N"" for no >"
21 W:'$D(Z9) !,"< Press return for next drug or ""^"" to quit>"
22 W ?50 R "OK? : ",ANS:DTIME S:'$T ANS="^" I ANS']"" W ?60,"Drug not matched" S:$D(Z9) PSNFL=1 Q
23 I "Nn"[$E(ANS) G @PSNVAR
24 I ANS["^" S PSNFL=1 Q
25 I "YNyn"'[$E(ANS) D ASK1^PSNHELP G ASK
26 Q
27ARR0 W !,"CHOOSE FROM: " S PP="" F S PP=$O(^TMP($J,"PSNPSPS",PP)) Q:PP="" S QQ="" F S QQ=$O(^TMP($J,"PSNPSPS",PP,QQ)) Q:QQ="" S RR=^TMP($J,"PSNPSPS",PP,QQ) D ARR1
28 Q
29ARR1 S PSNARY=PSNARY+1 S ^TMP($J,"PSNDFPK",PSNARY,PP,QQ)=RR W !?2,PSNARY," ",PP," ",QQ
30 Q
Note: See TracBrowser for help on using the repository browser.