PSSMSTR ;BIR/PWC-Send Master Drug File to External Interface ;04/05/04
;;1.0;PHARMACY DATA MANAGEMENT;**82**;09/30/97
;Reference to ^PS(59 supported by IA # 1976
;
;This routine will walk through the Drug file and send all drugs
;to each dispensing machine for each outpatient site file.
;It will only send to each site that has a dispensing machine running
;HL7 V.2.4 and has the Master File Update enabled.
;Task this job out
;
S ZTRTN="BUILD^PSSMSTR",ZTDESC="MASTER DRUG FILE UPDATE",ZTIO=""
S ZTDTH=$H D NOW^%DTC S PSSDTM=% D ^%ZTLOAD
Q
;
BUILD N XX,DVER,DMFU,DNSNAM,DNSPORT
F XX=0:0 S XX=$O(^PSDRUG(XX)) Q:'XX D
. F YY=0:0 S YY=$O(^PS(59,YY)) Q:'YY D
.. S DVER=$$GET1^DIQ(59,YY_",",105,"I") Q:DVER'="2.4" ;HL7 2.4
.. S DMFU=$$GET1^DIQ(59,YY_",",105.2) Q:DMFU'="YES" ;enable MFU
.. S DNSNAM=$$GET1^DIQ(59,YY_",",2006) ;DNS name of dispense machine
.. S DNSPORT=$$GET1^DIQ(59,YY_",",2007) ;Port # of dispense machine
.. I DNSNAM'="" D DRG^PSSDGUPD(XX,"NEW",DNSNAM,DNSPORT)
K XX,YY,DVER,DMFU,DNSNAM,DNSPORT
Q
PSSMSTR ;BIR/PWC-Send Master Drug File to External Interface ;04/05/04
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**82**;09/30/97
+2 ;Reference to ^PS(59 supported by IA # 1976
+3 ;
+4 ;This routine will walk through the Drug file and send all drugs
+5 ;to each dispensing machine for each outpatient site file.
+6 ;It will only send to each site that has a dispensing machine running
+7 ;HL7 V.2.4 and has the Master File Update enabled.
+8 ;Task this job out
+9 ;
+10 SET ZTRTN="BUILD^PSSMSTR"
SET ZTDESC="MASTER DRUG FILE UPDATE"
SET ZTIO=""
+11 SET ZTDTH=$HOROLOG
DO NOW^%DTC
SET PSSDTM=%
DO ^%ZTLOAD
+12 QUIT
+13 ;
BUILD NEW XX,DVER,DMFU,DNSNAM,DNSPORT
+1 FOR XX=0:0
SET XX=$ORDER(^PSDRUG(XX))
IF 'XX
QUIT
Begin DoDot:1
+2 FOR YY=0:0
SET YY=$ORDER(^PS(59,YY))
IF 'YY
QUIT
Begin DoDot:2
+3 ;HL7 2.4
SET DVER=$$GET1^DIQ(59,YY_",",105,"I")
IF DVER'="2.4"
QUIT
+4 ;enable MFU
SET DMFU=$$GET1^DIQ(59,YY_",",105.2)
IF DMFU'="YES"
QUIT
+5 ;DNS name of dispense machine
SET DNSNAM=$$GET1^DIQ(59,YY_",",2006)
+6 ;Port # of dispense machine
SET DNSPORT=$$GET1^DIQ(59,YY_",",2007)
+7 IF DNSNAM'=""
DO DRG^PSSDGUPD(XX,"NEW",DNSNAM,DNSPORT)
End DoDot:2
End DoDot:1
+8 KILL XX,YY,DVER,DMFU,DNSNAM,DNSPORT
+9 QUIT