Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BOPBAT

BOPBAT.m

Go to the documentation of this file.
BOPBAT ;IHS/ILC/ALG/CIA/PLS - Batch ILC Messages ;06-Apr-2005 13:41;SM
 ;;1.0;AUTOMATED DISPENSING INTERFACE;;Jul 26, 2005
 ;
 Q
START S U="^",DIC="^DIC(42,",DIC(0)="AEQ" D ^DIC G:Y<1 END
 S BOPWDN=$P(Y,U,2)
 S BOPDIV=$P($G(^DIC(42,+Y,0)),U,11) G:'BOPDIV END
 G:'$P($G(^BOP(90355,1,3,BOPDIV,0)),U,6) END
 S ZTRTN="EN1^BOPBAT",ZTIO="",ZTSAVE("BOPDIV")="",ZTSAVE("BOPWDN")=""
 D ^%ZTLOAD G START
EN1 S U="^"
 F BOPPI=0:0 S BOPPI=$O(^DPT("CN",BOPWDN,BOPPI)) Q:BOPPI<1  D
 .S (DFN,PSGP,BOPDFN)=BOPPI
 .D INIT^BOPCAP Q:$D(BOPQ)
 .D PID^BOPCP,PV1^BOPCP,OBXH^BOPCP,OBXW^BOPCP,AL1^BOPCP,DG1^BOPCP
 .S BOP(.02)="A01",BOP(.04)="ADT"
 .S BOP(10.2)=$G(^DPT(DFN,.1)),BOP(10.3)=$P($G(^DPT(DFN,.101)),U)
 .S X=$P($G(^DPT(DFN,.1041)),U),BOP(10.4)=$P($G(^VA(200,+X,0)),U)
 .S X=$P($G(^DPT(DFN,.105)),U),BOP(10.6)=$P($G(^DGPM(+X,0)),U)
 .S BOP(.03)=BOP(10.6)
 .S BOP10=U_BOP(10.2)_U_BOP(10.3)_U_BOP(10.4)_U_U_BOP(10.6)
 .K BOPQ D MSH^BOPCAP Q:$G(BOPQ)  D FLAG^BOPCAP
 .F BOPO=0:0 S BOPO=$O(^PS(55,DFN,5,BOPO)) Q:BOPO<1  D
 ..S BOPN0=$G(^PS(55,DFN,5,BOPO,0)) Q:'BOPN0
 ..S PSGORD=BOPO ;Order Number
 ..Q:$P(BOPN0,U,9)'="A"  ;Status
 ..Q:'$P($G(^PS(55,DFN,5,BOPO,4)),U,9)  ;Verified
 ..D NEW^BOPCAP
 ..Q
 S ZTREQ="@"
END K DFN,DIC,PSGORD,PSGP
 K BOP,BOP10,BOPDFN,BOPDIV,BOPN0,BOPO,BOPPI,BOPWDN,BOPQ Q
 ;
EOR ;BOPBAT - Batch ILC Messages