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

PSS1P191.m

Go to the documentation of this file.
PSS1P191 ;ALB/DRP POST INSTALL TO UPDATE ORDERABLE ITEM FILE ;06/18/15
 ;;1.0;PHARMACY DATA MANAGEMENT;**191**;9/30/97;Build 40
 ;
INIT ; Initialize Variables
 N PSSOIEN,PSSDRG,PSSDRGP,PSSDSG,PSSSPCE,PSSDUZ,PSSLN,PSSDDRG,PSSINACT,PSSINACTP,PSSDDIEN,PSSDSGF
 N XMDUZ,XMSUB,XMTEXT,XMY,X
 S PSSDUZ=DUZ
 K ^TMP($J,"PSS191"),^XTMP("PSS191")
 D MAIN,QUE^PSSP191A
 Q
 ;
MAIN ;
 D UPD50P7,MAKERPT,SENDRPT
 Q
 ;
UPD50P7 ;
 S PSSDRG=""
 F  S PSSDRG=$O(^PS(50.7,"ADF",PSSDRG)) Q:PSSDRG=""  D
 .S PSSDSG=""
 . F  S PSSDSG=$O(^PS(50.7,"ADF",PSSDRG,PSSDSG)) Q:PSSDSG=""  D
 .. S PSSOIEN=""
 .. F  S PSSOIEN=$O(^PS(50.7,"ADF",PSSDRG,PSSDSG,PSSOIEN)) Q:PSSOIEN=""  D
 ... I $G(^PS(50.606,PSSDSG,0))["PATCH",'+$G(^PS(50.7,PSSOIEN,4)) D
 .... S PSSDSGF=^PS(50.606,PSSDSG,0)
 .... S DIE="^PS(50.7,",DR="12////1",DA=PSSOIEN D ^DIE K DA,DR,DIE
 .... S PSSDDIEN=""
 .... F  S PSSDDIEN=$O(^PS(50.7,"A50",PSSOIEN,PSSDDIEN)) Q:PSSDDIEN=""  D
 ..... S:$G(PSSDDIEN)]"" PSSDDRG=$P(^PSDRUG(PSSDDIEN,0),"^"),PSSINACT=$G(^PSDRUG(PSSDDIEN,"I"),"NONE")
 ..... S ^XTMP("PSS191",$J,PSSDRG_" - "_PSSDSGF,PSSINACT,PSSDDRG,PSSDDIEN)=""
 .....Q
 ....Q
 ...Q
 ..Q
 .Q
 Q
 ;
MAKERPT ;
 S ^TMP($J,"PSS191")=""
 S ^TMP($J,"PSS191",0)=" "
 S ^TMP($J,"PSS191",1)=" "
 S ^TMP($J,"PSS191",2)="     The following Orderable Items have the Dosage Form Patch and "
 S ^TMP($J,"PSS191",3)="     the Prompt for Removal in BCMA field was updated to a value"
 S ^TMP($J,"PSS191",4)="     of 1 by Patch PSS*1*191"
 S ^TMP($J,"PSS191",5)=" "
 S ^TMP($J,"PSS191",6)="ORDERABLE ITEM                  INACTIVE      DISPENSE DRUG     "
 S ^TMP($J,"PSS191",7)="NAME - DOSAGE FORM              DATE          NAME                       IEN "
 S ^TMP($J,"PSS191",8)="------------------------------  ------------  -------------------------  ------"
 S ^TMP($J,"PSS191",9)=" "
 S ^TMP($J,"PSS191",10)=" "
 I $O(^XTMP("PSS191",$J,""))="" S ^TMP($J,"PSS191",11)="NO DRUGS TO LIST" Q
 S PSSLN=11,$P(PSSSPCE," ",30)=""
 S PSSDRG=""
 F  S PSSDRG=$O(^XTMP("PSS191",$J,PSSDRG)) Q:PSSDRG=""  D
 . S PSSINACT="",PSSDRGP=PSSDRG
 . F  S PSSINACT=$O(^XTMP("PSS191",$J,PSSDRG,PSSINACT)) Q:PSSINACT=""  D
 .. S PSSDDRG="",PSSINACTP=PSSINACT
 .. F  S PSSDDRG=$O(^XTMP("PSS191",$J,PSSDRG,PSSINACT,PSSDDRG)) Q:PSSDDRG=""  D
 ... S PSSDDIEN=""
 ... F  S PSSDDIEN=$O(^XTMP("PSS191",$J,PSSDRG,PSSINACT,PSSDDRG,PSSDDIEN)) Q:PSSDDIEN=""  D
 .... S ^TMP($J,"PSS191",PSSLN)=$E(PSSDRGP_PSSSPCE,1,30)_"  "_$E($$FMTE^XLFDT(PSSINACTP,5)_PSSSPCE,1,12)_"  "_$E(PSSDDRG_PSSSPCE,1,25)_"  "_$E(PSSDDIEN_PSSSPCE,1,6)
 .... S (PSSDRGP,PSSINACTP)=" "
 .... S PSSLN=PSSLN+1
 ....Q
 ...Q
 ..Q
 .Q
 Q
SENDRPT ;Send report to user
 N DIFROM ; Prevent pre-mature termination of mailman
 S X="" F  S X=$O(^XUSEC("PSJI MGR",X)) Q:'X  S XMY(X)=""
 S X="" F  S X=$O(^XUSEC("PSJU MGR",X)) Q:'X  S XMY(X)=""
 S XMSUB="PHARMACY ORDERABLE ITEM MANAGEMENT",XMTEXT="^TMP("_$J_","_"""PSS191"""_",",XMDUZ=.5,XMY(PSSDUZ)=""
 D ^XMD
 K ^TMP($J,"PSS191"),^XTMP("PSS191")
 Q