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

APSPMAN1.m

Go to the documentation of this file.
APSPMAN1 ; IHS/DSD/ENM - MANUFACTURER DATA FOR REFILL RX'S ;  [ 02/20/2001  1:48 PM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;**1,3**;09/03/97
EP ;ENTRY POINT -  FOR REFILL RX (W/edit 'all' mfg data set to 'yes')
 I APSPMAN'=1 Q
 S (APSPMM,APSPL,APSPD)=""
 ;I $D(^PSRX(PSOREF("IRXN"),1,0)) S LASTRF=$P(^(0),"^",3) D LAST
 I $P($G(^PSRX(PSOREF("IRXN"),1,0)),"^",3)]"" S LASTRF=$P(^(0),"^",3) D LAST ;IHS/DSD/ENM/POC 01/20/98 PREVENTS ERR WHEN REF DELETED
 I APSPMM]""!(APSPL]"")!(APSPD]"") G WR
 S APSPLTYP="R"
 I $G(PSOREF("RX2"))']"" G ACT
 S APSPMM=$P($G(PSOREF("RX2")),"^",8),APSPL=$P($G(PSOREF("RX2")),"^",4),APSPD=$P($G(PSOREF("RX2")),"^",11) G WR
LAST ;CK MAN DATA IN LAST REFILL
 S APSPLRF=^PSRX(PSOREF("IRXN"),1,LASTRF,0)
 S APSPMM=$P(APSPLRF,"^",14),APSPL=$P(APSPLRF,"^",6),APSPD=$P(APSPLRF,"^",15)
 Q
DTO ;EP FOR REFILL RX (W/mfg 'date only' set) IHS/DSD/ENM 01/29/96
 S APSPRXX=$P($G(^PSRX(PSOREF("IRXN"),0)),"^",6) Q:APSPRXX']""  ;
 S DA=APSPRXX,DR="9999999.26",DIE="^PSDRUG(" D ^DIE
 ;SET VARIABLES FOR PSOR52 GLOBAL SET
 S PSOREF("LOT #")="",PSOREF("MANUFACTURER")="",PSOREF("EXPIRATION DATE")=$P($G(^PSDRUG(APSPRXX,999999924)),"^",3)
 ;GET LABEL VARIABLE DATA
 S APSPMF="",APSPLOT=""
 I PSOREF("EXPIRATION DATE")']"" S APSPDY="" Q
 S APSPDY=$E(PSOREF("EXPIRATION DATE"),4,5)_"/"_$E(PSOREF("EXPIRATION DATE"),2,3)
 Q
NMFG ;EP FOR REFILL RX (W/no mfg set) IHS/DSD/ENM 02/15/96
 ;SET VARIABLES FOR PSOR52 GLOBAL SET
 S PSOREF("LOT #")="",PSOREF("MANUFACTURER")="",PSOREF("EXPIRATION DATE")=""
 ;GET LABEL VARIABLE DATA
 S APSPMF="",APSPLOT=""
 S APSPDY=""
 Q
WR W !,"Manufacturer: ",APSPMM,?30,"Lot #: ",APSPL,?50,"Mfg Expiration Date: "_$E(APSPD,4,5)_"/"_$E(APSPD,2,3)
ACT I APSPMAN=1 S DIR(0)="Y",DIR("A")="Edit Manufacturer Data? :",DIR("B")="N",DIR("?")="Answer 'Yes' if the Manufacturer, Lot # or Expiration date has changed" D ^DIR K DIR I Y=1 S APSPRXX=$P(PSOREF("RX0"),U,6) D ASK^APSPMAN G OUT
 S APSPRXX=$P(PSOREF("RX0"),U,6) D MAN2^APSPMAN
OUT ;SET VARIABLES FOR PSOR52 GLOBAL SET
 S PSOREF("LOT #")=PSONEW("LOT #"),PSOREF("MANUFACTURER")=PSONEW("MANUFACTURER"),PSOREF("EXPIRATION DATE")=PSONEW("EXPIRATION DATE")
 ;GET LABEL VARIABLE DATA
 S APSPMF=$E(PSONEW("MANUFACTURER"),1,5),APSPLOT=$E(PSONEW("LOT #"),1,8),APSPDY=$E(PSONEW("EXPIRATION DATE"),4,5)_"/"_$E(PSONEW("EXPIRATION DATE"),2,3)
 D EXIT Q
EP1 ;ENTRY POINT FOR EDIT RX OPT
 Q:APSPMAN'=1
 I $G(APSPLTYP)="V",$G(RX2)']"" S (APSPL,APSPMM,APSPD)="" Q  ;IHS/DSD/ENM 09/02/96
 I $G(APSPLTYP)="V" S APSPMM=$P($G(RX2),"^",8),APSPL=$P($G(RX2),"^",4),APSPD=$P($G(RX2),"^",11) Q
 I $G(PSORXED("RX2"))']"" S (APSPL,APSPMM,APSPD)="" Q
 S APSPMM=$P($G(PSORXED("RX2")),"^",8),APSPL=$P($G(PSORXED("RX2")),"^",4),APSPD=$P($G(PSORXED("RX2")),"^",11)
 ;I APSPLTYP="V" D WR1
 I $G(APSPLTYP)="E" D WR1,ACT1 ;IHS/DSD/ENM 09/02/96
 Q
 ;
WR1 W !,"Manufacturer: ",APSPMM,?30,"Lot #: ",APSPL,?50,"Mfg Expiration Date: "_$E(APSPD,4,5)_"/"_$E(APSPD,2,3)
 Q
ACT1 ;EP
 I APSPMAN=1 S DIR(0)="Y",DIR("A")="Edit Manufacturer Data? :",DIR("B")="N",DIR("?")="Answer 'Yes' if the Manufacturer, Lot # or Expiration date has changed" D ^DIR K DIR S APSPYN=Y I Y=1 D ASK^APSPMAN G OUT1
 I PS="PARTIAL",$G(APSPYN)'=1 S PSONEW("LOT #")=$G(APSP("PL")),PSONEW("MANUFACTURER")=$G(APSP("PM")),PSONEW("EXPIRATION DATE")=$G(APSP("PD")) ;IHS/DSD/ENM 09/05/96
 ;W !,"Mfg Expiration Date is required!",!
 I APSPMAN=""!(APSPMAN=3) D NOMAN^APSPMAN ;IHS/DSD/ENM 02/15/96
 I APSPMAN=2 D MAN2^APSPMAN ;IHS/DSD/ENM 02/15/96
OUT1 ;SET VARIABLES FOR GLOBAL SET
 S PSOREF("LOT #")=PSONEW("LOT #"),PSOREF("MANUFACTURER")=PSONEW("MANUFACTURER"),PSOREF("EXPIRATION DATE")=PSONEW("EXPIRATION DATE")
 ;GET LABEL VARIABLE DATA
 I APSPMAN=""!(APSPMAN=3) S (APSPMF,APSPLOT,APSPDY)="" G EXIT ;IHS/DSD/ENM 02/15/96
 I APSPMAN=2 S APSPMF="",APSPLOT="",APSPDY=$E(PSONEW("EXPIRATION DATE"),4,5)_"/"_$E(PSONEW("EXPIRATION DATE"),2,3) G EXIT ;IHS/DSD/ENM 02/15/96
 S APSPMF=$E(PSONEW("MANUFACTURER"),1,5),APSPLOT=$E(PSONEW("LOT #"),1,8),APSPDY=$E(PSONEW("EXPIRATION DATE"),4,5)_"/"_$E(PSONEW("EXPIRATION DATE"),2,3)
 G EXIT
DCQ ;CHECK FOR CHNG'ed DATA AFTER EDITING AN RX
 Q:APSPMAN<1
 S (APSPXED,APSPXMF,APSPXLT)=""
 I APSPMAN=1 D ALLCK G DCQX
 I APSPMAN=""!(APSPMAN=2) D DTCK
DCQX Q
ALLCK I PSONEW("EXPIRATION DATE")'=$P($G(PSORXED("RX2")),"^",11) S APSPXED=PSONEW("EXPIRATION DATE")
 I PSONEW("LOT #")'=$P($G(PSORXED("RX2")),"^",4) S APSPXLT=PSONEW("LOT #")
 I PSONEW("MANUFACTURER")'=$P($G(PSORXED("RX2")),"^",8) S APSPXMF=PSONEW("MANUFACTURER")
 I APSPXED]"" S DR="29///^S X=APSPXED",COM=COM_$P(^DD(52,29,0),"^")_" ("_APSPXED_"),"
 I APSPXLT]"" S DR=DR_";24///^S X=APSPXLT",COM=COM_$P(^DD(52,24,0),"^")_" ("_APSPXLT_"),"
 I APSPXMF]"" S DR=DR_";28///^S X=APSPXMF",COM=COM_$P(^DD(52,28,0),"^")_" ("_APSPXMF_"),"
 I DR]"" S DIE="^PSRX(",DA=PSORXED("IRXN") D ^DIE K DIE,DR,DA,X,Y
 Q
DTCK ;MFG DATE CHECK FOR CHANGE
 I PSOREF("EXPIRATION DATE")'=$P($G(PSORXED("RX2")),"^",11) S APSPXED=PSOREF("EXPIRATION DATE")
 I APSPXED]"" S DR="29///^S X=APSPXED",COM=COM_$P(^DD(52,29,0),"^")_" ("_APSPXED_"),",DIE="^PSRX(",DA=PSORXED("IRXN") D ^DIE K DIE,DR,DA,X,Y
 Q
EXIT ;K APSPN,APSPL,APSPM,APSPMM,APSPD,PSONEW("LOT #"),PSONEW("MANUFACTURER"),PSONEW("EXPIRATION DATE")
 ;K APSPN,APSPL,APSPM,APSPMM,APSPD
 Q
ZPAR ;GET MFG DATA FOR PARTIAL RX OPT
 ;S APSPN=$G(^PSRX(RX0,"P")) I APSPN']"" S (APSPL,APSPM,APSPD)="" Q
 ;S APSPM=$P($G(APSPN),"^",1),APSPL=$P($G(APSPN),"^",2),APSPD=$P($G(APSPN),"^",3)
 Q