PSS102RP ;OIFO BAY PINES/VGF - TEMP RTN TO UPDATE PLACE OF VISIT IN FILE 1020.2;3/30/04
;;1.0;PHARMACY DATA MANAGEMENT;**102**;9/30/97
N PSSIEN,PSSDRG,PSSDRUGT,PSSSPCE,PSSDUZ,PSSLN,PSSDRUG
N XMDUZ,XMSUB,XMTEXT,XMY
S PSSDUZ=DUZ
K ^TMP($J,"PSS102"),^XTMP("PSS102")
S PSSIEN="" F S PSSIEN=$O(^PS(50.7,PSSIEN)) Q:PSSIEN="" D
.S PSSDRG="" F S PSSDRG=$O(^PS(50.7,PSSIEN,1,"B",PSSDRG)) Q:PSSDRG="" D
..S PSSDRUGT=$G(^PS(51.7,PSSDRG,0))
..I $D(^PS(50.7,PSSIEN,2,"B",PSSDRUGT)) Q
..S ^XTMP("PSS102",PSSIEN,PSSDRUGT)=""
I $O(^XTMP("PSS102",""))="" S ^XTMP("PSS102","NO DRUGS TO LIST","NO DRUGS TO LIST")=""
S ^TMP($J,"PSS102")=""
S ^TMP($J,"PSS102",0)=" "
S ^TMP($J,"PSS102",1)=" "
S ^TMP($J,"PSS102",2)="DRUG TEXT REPORT"
S ^TMP($J,"PSS102",3)=" "
S ^TMP($J,"PSS102",4)="This report will list the Drug Text entries in the Pharmacy"
S ^TMP($J,"PSS102",5)="Orderable Item file (#50.7) which are not also set up as"
S ^TMP($J,"PSS102",6)="Synonyms"
S ^TMP($J,"PSS102",7)=" "
S ^TMP($J,"PSS102",8)="DRUG NAME DRUG TEXT ENTRY"
S ^TMP($J,"PSS102",9)="--------- ---------------"
S ^TMP($J,"PSS102",10)=" "
S PSSLN=11,$P(PSSSPCE," ",25)=""
S PSSIEN="" F S PSSIEN=$O(^XTMP("PSS102",PSSIEN)) Q:PSSIEN="" D
.S PSSDRUG=$P($G(^PS(50.7,PSSIEN,0)),"^")
.S PSSDRUGT="" F S PSSDRUGT=$O(^XTMP("PSS102",PSSIEN,PSSDRUGT)) Q:PSSDRUGT="" D
..S ^TMP($J,"PSS102",PSSLN)=$E(PSSDRUG_PSSSPCE,1,25)_" "_$E(PSSDRUGT_PSSSPCE,1,25)
..S PSSLN=PSSLN+1
QUEUE ;Send report to user
S XMSUB="PHARMACY DATA MANAGEMENT",XMTEXT="^TMP("_$J_","_"""PSS102"""_",",XMDUZ="PATCH PSS*1.0*102",XMY(PSSDUZ)=""
D SENDMSG^XMXAPI(PSSDUZ,XMSUB,"^TMP("_$J_","_"""PSS102"""_")",PSSDUZ)
K ^TMP($J)
Q
PSS102RP ;OIFO BAY PINES/VGF - TEMP RTN TO UPDATE PLACE OF VISIT IN FILE 1020.2;3/30/04
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**102**;9/30/97
+2 NEW PSSIEN,PSSDRG,PSSDRUGT,PSSSPCE,PSSDUZ,PSSLN,PSSDRUG
+3 NEW XMDUZ,XMSUB,XMTEXT,XMY
+4 SET PSSDUZ=DUZ
+5 KILL ^TMP($JOB,"PSS102"),^XTMP("PSS102")
+6 SET PSSIEN=""
FOR
SET PSSIEN=$ORDER(^PS(50.7,PSSIEN))
IF PSSIEN=""
QUIT
Begin DoDot:1
+7 SET PSSDRG=""
FOR
SET PSSDRG=$ORDER(^PS(50.7,PSSIEN,1,"B",PSSDRG))
IF PSSDRG=""
QUIT
Begin DoDot:2
+8 SET PSSDRUGT=$GET(^PS(51.7,PSSDRG,0))
+9 IF $DATA(^PS(50.7,PSSIEN,2,"B",PSSDRUGT))
QUIT
+10 SET ^XTMP("PSS102",PSSIEN,PSSDRUGT)=""
End DoDot:2
End DoDot:1
+11 IF $ORDER(^XTMP("PSS102",""))=""
SET ^XTMP("PSS102","NO DRUGS TO LIST","NO DRUGS TO LIST")=""
+12 SET ^TMP($JOB,"PSS102")=""
+13 SET ^TMP($JOB,"PSS102",0)=" "
+14 SET ^TMP($JOB,"PSS102",1)=" "
+15 SET ^TMP($JOB,"PSS102",2)="DRUG TEXT REPORT"
+16 SET ^TMP($JOB,"PSS102",3)=" "
+17 SET ^TMP($JOB,"PSS102",4)="This report will list the Drug Text entries in the Pharmacy"
+18 SET ^TMP($JOB,"PSS102",5)="Orderable Item file (#50.7) which are not also set up as"
+19 SET ^TMP($JOB,"PSS102",6)="Synonyms"
+20 SET ^TMP($JOB,"PSS102",7)=" "
+21 SET ^TMP($JOB,"PSS102",8)="DRUG NAME DRUG TEXT ENTRY"
+22 SET ^TMP($JOB,"PSS102",9)="--------- ---------------"
+23 SET ^TMP($JOB,"PSS102",10)=" "
+24 SET PSSLN=11
SET $PIECE(PSSSPCE," ",25)=""
+25 SET PSSIEN=""
FOR
SET PSSIEN=$ORDER(^XTMP("PSS102",PSSIEN))
IF PSSIEN=""
QUIT
Begin DoDot:1
+26 SET PSSDRUG=$PIECE($GET(^PS(50.7,PSSIEN,0)),"^")
+27 SET PSSDRUGT=""
FOR
SET PSSDRUGT=$ORDER(^XTMP("PSS102",PSSIEN,PSSDRUGT))
IF PSSDRUGT=""
QUIT
Begin DoDot:2
+28 SET ^TMP($JOB,"PSS102",PSSLN)=$EXTRACT(PSSDRUG_PSSSPCE,1,25)_" "_$EXTRACT(PSSDRUGT_PSSSPCE,1,25)
+29 SET PSSLN=PSSLN+1
End DoDot:2
End DoDot:1
QUEUE ;Send report to user
+1 SET XMSUB="PHARMACY DATA MANAGEMENT"
SET XMTEXT="^TMP("_$JOB_","_"""PSS102"""_","
SET XMDUZ="PATCH PSS*1.0*102"
SET XMY(PSSDUZ)=""
+2 DO SENDMSG^XMXAPI(PSSDUZ,XMSUB,"^TMP("_$JOB_","_"""PSS102"""_")",PSSDUZ)
+3 KILL ^TMP($JOB)
+4 QUIT