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

PSS160EN.m

Go to the documentation of this file.
  1. PSS160EN ;BIR/RTR-Environment check routine for patch PSS*1*160 ;02/18/11
  1. ;;1.0;PHARMACY DATA MANAGEMENT;**160**;9/30/97;Build 76
  1. ;
  1. Q:'$G(XPDENV)
  1. ;
  1. ;
  1. EN ;Check to see if all Local Med Routes are mapped and Local Possible Dosages are completed
  1. N PSSMRMFM,PSSMRMLP,PSSMRMNM,PSSMRMFD,PSSMRMAR,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,DIC,DA,DLAYGO
  1. N PSSMRMCT,PSSMRMXX,PSSMRMIN,PSSMRMZR,PSSMRMN1,PSSMRMN3,PSSMRMOK,PSSMRM22,PSSMRMBB,PSSMRMT1,PSSMRMD1,PSSMRMD2,PSSMRMTC
  1. ;
  1. ;
  1. S (PSSMRMFM,PSSMRMFD)=0
  1. ;Med Route check, using PSSMRMFM as flag
  1. D BMES^XPDUTL("Checking for any remaining unmapped Local Medication Routes...")
  1. S PSSMRMNM="" F S PSSMRMNM=$O(^PS(51.2,"B",PSSMRMNM)) Q:PSSMRMNM=""!(PSSMRMFM) D
  1. .F PSSMRMLP=0:0 S PSSMRMLP=$O(^PS(51.2,"B",PSSMRMNM,PSSMRMLP)) Q:'PSSMRMLP!(PSSMRMFM) D
  1. ..I '$P($G(^PS(51.2,PSSMRMLP,0)),"^",4) Q
  1. ..I '$P($G(^PS(51.2,PSSMRMLP,1)),"^") S PSSMRMFM=1
  1. I 'PSSMRMFM D BMES^XPDUTL("All Local Medication Routes have been mapped!!") G DOS
  1. K PSSMRMAR
  1. S PSSMRMAR(1)=" "
  1. S PSSMRMAR(2)="There are still local Medication Routes marked for 'ALL PACKAGES' not yet"
  1. S PSSMRMAR(3)="mapped. Any orders containing an unmapped medication route will not have"
  1. S PSSMRMAR(4)="dosage checks performed. Please refer to the 'Medication Route Mapping Report'"
  1. S PSSMRMAR(5)="option for more details."
  1. S PSSMRMAR(6)=" "
  1. D MES^XPDUTL(.PSSMRMAR) K PSSMRMAR
  1. ;
  1. ;
  1. DOS ;Check to see if all Local Possible Dosages are mapped
  1. ;Local Possible Dosage check, using PSSMRMFD as flag
  1. D BMES^XPDUTL("Checking for any remaining Local Possible Dosages missing data...")
  1. ;
  1. S (PSSMRMFD,PSSMRMCT)=0
  1. S PSSMRMXX="" F S PSSMRMXX=$O(^PSDRUG("B",PSSMRMXX)) Q:PSSMRMXX=""!(PSSMRMFD) F PSSMRMIN=0:0 S PSSMRMIN=$O(^PSDRUG("B",PSSMRMXX,PSSMRMIN)) Q:'PSSMRMIN!(PSSMRMFD) D
  1. .K PSSMRMZR,PSSMRMN1,PSSMRMN3
  1. .S PSSMRMZR=$G(^PSDRUG(PSSMRMIN,0)),PSSMRMN1=$P($G(^PSDRUG(PSSMRMIN,"ND")),"^"),PSSMRMN3=$P($G(^PSDRUG(PSSMRMIN,"ND")),"^",3)
  1. .S PSSMRMCT=PSSMRMCT+1 I '(PSSMRMCT#2000) D BMES^XPDUTL("...Still checking Local Possible Dosages...")
  1. .S PSSMRMOK=$$TEST
  1. .Q:'PSSMRMOK
  1. .S PSSMRM22=0 F PSSMRMBB=0:0 S PSSMRMBB=$O(^PSDRUG(PSSMRMIN,"DOS2",PSSMRMBB)) Q:'PSSMRMBB!(PSSMRM22) S PSSMRMT1=$G(^PSDRUG(PSSMRMIN,"DOS2",PSSMRMBB,0)) I $P(PSSMRMT1,"^")'="" I '$P(PSSMRMT1,"^",5)!($P(PSSMRMT1,"^",6)="") S PSSMRM22=1
  1. .Q:'PSSMRM22
  1. .S PSSMRMFD=1
  1. I 'PSSMRMFD D BMES^XPDUTL("Population of data for eligible Local Possible Dosages has been completed!!") D BMES^XPDUTL(" ") G PRC
  1. K PSSMRMAR
  1. S PSSMRMAR(1)=" "
  1. S PSSMRMAR(2)="There are still local possible dosages eligible for dosage checks that have"
  1. S PSSMRMAR(3)="missing data in the Numeric Dose and Dose Unit fields. Any orders containing"
  1. S PSSMRMAR(4)="such local possible dosages may not have dosage checks performed. Please"
  1. S PSSMRMAR(5)="refer to the 'Local Possible Dosages Report' option for more details."
  1. S PSSMRMAR(6)=" "
  1. D MES^XPDUTL(.PSSMRMAR) K PSSMRMAR
  1. ;
  1. ;
  1. PRC ;Ask to continue
  1. I 'PSSMRMFM,'PSSMRMFD G MAIL
  1. K DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. S DIR(0)="Y",DIR("B")="Y",DIR("A")="Do you want to continue to install this patch" D ^DIR
  1. I Y'=1!($D(DUOUT))!($D(DTOUT)) S XPDABORT=2 Q
  1. K DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. ;
  1. ;
  1. MAIL ;set up mail recipients for Post Init
  1. D REC
  1. S @XPDGREF@("PSSMLMSG",1)="Installation of Patch PSS*1.0*160 has been completed!"
  1. S @XPDGREF@("PSSMLMSG",2)=" "
  1. S PSSMRMTC=3
  1. I 'PSSMRMFM S @XPDGREF@("PSSMLMSG",PSSMRMTC)="All Local Medication Routes have been mapped!!" G LMESS
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="There are still local Medication Routes marked for 'ALL PACKAGES' not yet" S PSSMRMTC=PSSMRMTC+1
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="mapped. Any orders containing an unmapped medication route will not have" S PSSMRMTC=PSSMRMTC+1
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="dosage checks performed. Please refer to the 'Medication Route Mapping Report'" S PSSMRMTC=PSSMRMTC+1
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="option for more details."
  1. ;
  1. ;
  1. LMESS ;
  1. D INC I 'PSSMRMFD S @XPDGREF@("PSSMLMSG",PSSMRMTC)="Population of data for eligible Local Possible Dosages has been completed!!" D INC Q
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="There are still local possible dosages eligible for dosage checks that have" S PSSMRMTC=PSSMRMTC+1
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="missing data in the Numeric Dose and Dose Unit fields. Any orders containing" S PSSMRMTC=PSSMRMTC+1
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="such local possible dosages may not have dosage checks performed. Please" S PSSMRMTC=PSSMRMTC+1
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)="refer to the 'Local Possible Dosages Report' option for more details." D INC
  1. Q
  1. ;
  1. ;
  1. TEST() ;See if drug need Dose Unit and Numeric Dose defined
  1. I 'PSSMRMN3!('PSSMRMN1) Q 0
  1. I $P($G(^PSDRUG(PSSMRMIN,"I")),"^"),$P($G(^PSDRUG(PSSMRMIN,"I")),"^")<DT Q 0
  1. I '$O(^PSDRUG(PSSMRMIN,"DOS2",0)) Q 0
  1. I $P(PSSMRMZR,"^",3)["S"!($E($P(PSSMRMZR,"^",2),1,2)="XA") Q 0
  1. N PSSMRMVV
  1. S PSSMRMVV=""
  1. I PSSMRMN1,PSSMRMN3,$T(OVRIDE^PSNAPIS)]"" S PSSMRMVV=$$OVRIDE^PSNAPIS(PSSMRMN1,PSSMRMN3)
  1. K PSSMRMD1,PSSMRMD2
  1. I PSSMRMN1,PSSMRMN3 S PSSMRMD1=$$DFSU^PSNAPIS(PSSMRMN1,PSSMRMN3) S PSSMRMD2=$P(PSSMRMD1,"^")
  1. I $G(PSSMRMD2)'>0,$P($G(^PSDRUG(PSSMRMIN,2)),"^") S PSSMRMD2=$P($G(^PS(50.7,+$P($G(^PSDRUG(PSSMRMIN,2)),"^"),0)),"^",2)
  1. I PSSMRMVV=""!('$G(PSSMRMD2))!($P($G(^PS(50.606,+$G(PSSMRMD2),1)),"^")="") Q 1
  1. I $P($G(^PS(50.606,+$G(PSSMRMD2),1)),"^"),'PSSMRMVV Q 0
  1. I '$P($G(^PS(50.606,+$G(PSSMRMD2),1)),"^"),PSSMRMVV Q 0
  1. Q 1
  1. ;
  1. ;
  1. REC ;Set up mail message recipients
  1. S @XPDGREF@("PSSMLMDZ",DUZ)=""
  1. S @XPDGREF@("PSSMLMDZ","G.PSS ORDER CHECKS")=""
  1. Q
  1. ;
  1. ;
  1. PRMP ;
  1. K DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. S DIR(0)="E",DIR("A")="Press Return to Continue" D ^DIR
  1. K DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. Q
  1. ;
  1. ;
  1. INC ;
  1. S PSSMRMTC=PSSMRMTC+1
  1. S @XPDGREF@("PSSMLMSG",PSSMRMTC)=" "
  1. S PSSMRMTC=PSSMRMTC+1
  1. Q