source: WorldVistAEHR/trunk/r/CMOP-PSX/PSXLKUP.m@ 1764

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1PSXLKUP ;BIR/BAB,HTW-Prescription Inquiry for Host Facility ;MAR 1,2002@16:11:17
2 ;;2.0;CMOP;**23,32,47**;11 Apr 97
3 ;;Reference to File #200 supported by DBIA #10060
4EN ;
5 S DIC("A")="Select Facility Batch Reference # :",DIC=552.4,DIC(0)="AEQMZ" D ^DIC K DIC Q:Y<0!($D(DTOUT)) S REF=+Y
6 S BAT=+$G(^PSX(552.4,REF,0)) W !!,?2,"TRANSMITTED :" S Y=$P(^PSX(552.1,BAT,0),U,3) X ^DD("DD") W Y
7 W ?40,"RECEIVED : " S Y=$P(^PSX(552.1,BAT,0),U,4) X ^DD("DD") W Y
8 W !,?40,"TO VENDOR : " S Y=$P(^PSX(552.1,BAT,0),U,6) X ^DD("DD") W Y
9 S DIC("A")="RX # :",DIC(0)="AEQMZ",DA(1)=REF,DIC="^PSX(552.4,"_DA(1)_",1," D ^DIC K DIC G:Y<0!($D(DTOUT)) EXIT S DA=+Y
10 I $P($G(Y(0)),"^",14)=1 W ?25,"CONTROLLED SUBSTANCE"
11 S QRY=+$P($G(Y(0)),U,8) I QRY>0 S QRYN=$O(^PSX(553.1,"B",QRY,0)) I QRYN>0 S Y=$P(^PSX(553.1,QRYN,0),U,4) X ^DD("DD")
12 I QRY>0 W !?2,"REC'D FROM VENDOR : ",Y
13 W ! S IND=+$P(Y(0),"^",12) W !,?2,$S(IND=0:"ORIGINAL",IND>0:"REFILL #"_IND,1:"") K IND
14 W ?18,"DRUG ID : ",$P(Y(0),"^",4),?40,"QTY : ",$P(Y(0),"^",13),?55,"COST : ",$P(Y(0),"^",11)
15 S ST=$P(Y(0),U,10) W !!,?2,"RX STATUS : ",$S(ST=1:"RELEASED",ST=2:"RETURNED",ST=3:"PROCESSED",ST=4:"REJECTED",ST=5:"RECEIVED",1:"UNKNOWN") G:ST=5 EXIT
16 S Y=$P(Y(0),U,9) X ^DD("DD") S TYP=+^PSX(552.4,DA(1),1,DA,2)
17 W ?30,$S($P(Y(0),U,2)=1:"COMPLETED",$P(Y(0),U,2)=2:"CANCELED",1:"UNKNOWN")_" "_Y_" "_$S(TYP=1:"AUTOMATED",TYP=2:"MANUAL",1:"")
18 I $P(Y(0),U,2)=2 W !,?5,"CANCELLATION REASON : ",$P(Y(0),U,3)
19 W !!,?2,"NDC : ",$S($P(Y(0),U,5)]"":$P(Y(0),U,5),1:"")
20 W ?30,"BY EMPLOYEE : ",$$GET1^DIQ(200,$P(Y(0),U,6),.01)
21 I $P(Y(0),U,7)>0 W !!,?2,"PROCESSED DT/TM : " S Y=$P(Y(0),U,7) X ^DD("DD") W Y
22 I $P(Y(0),U,7)'>0 W !!
23 I $G(QRY)>0 W ?50,"QUERY ID # ",QRY
24 S RELTYPE=$P($G(^PSX(552.4,DA(1),1,DA,2)),"^")
25 ;I $G(RELTYPE)]"" W !!," RELEASE TYPE: ",$S(RELTYPE=2:"MANUAL",RELTYPE=1:"AUTOMATED",1:"UNKNOWN")
26 S RER=$P($G(^PSX(552.4,DA(1),1,DA,2)),"^",2)
27 I $G(RER)]"" W !!," REMOTE ERROR CONDITION: "
28 I W $S(RER=1:"Release date already exists.",RER=2:"Rx entry missing.",RER=3:"Fill mismatch.",RER=4:"Transmission number mismatch.",RER=5:"No CMOP event multiple.",RER=6:"Fill does not exist",1:"UNKNOWN")
29 S PSX=0 W ! F S PSX=$O(^PSX(552.4,DA(1),1,DA,1,PSX)) Q:'PSX D
30 . S LOT=$P(^PSX(552.4,DA(1),1,DA,1,PSX,0),U),Y=$P(^(0),U,2) X ^DD("DD") W !,?10,"LOT # : ",LOT,?30,"EXP DATE : ",Y
31 W !!," CARRIER: "_$P($G(^PSX(552.4,DA(1),1,DA,2)),"^",5),?25,"PACKAGE ID "_$P($G(^PSX(552.4,DA(1),1,DA,2)),"^",6)
32 W !!," DATE SHIPPED: " S Y=$P($G(^PSX(552.4,DA(1),1,DA,2)),"^",4) X ^DD("DD") W Y
33 G EXIT
34LOT S LOT=$P(^PSX(552.4,DA(1),1,DA,1,PSX,0),U),Y=$P(^(0),U,2) X ^DD("DD") W !,?10,"LOT # : ",LOT,?30,"EXP DATE : ",Y
35 Q
36EXIT K DA,DIC,REF,X,Y,TYP,ST,IND,BAT,LOT,PSX,QRY,QRYN,QDT
37 K REMOERR,RELTYPE,DUOUT,DTOUT,RER
38 W !! G EN
Note: See TracBrowser for help on using the repository browser.