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

PSSP198.m

Go to the documentation of this file.
PSSP198 ;DAL/DSK-PSS*1.0*198 POST INSTALL ROUTINE ; 31 May 2016  7:07 PM
 ;;1.0;PHARMACY DATA MANAGEMENT;**198**;9/30/97;Build 15
 ;;Reference to $$SETSTR^VALM1 is covered by DBIA #10116
 ;;Reference to ^XMD is covered by DBIA #10070
 ;;
 Q
 ;
POST ;Check DRUG (#50) file and also DOSE UNITS (#51.24) file 
 N PSSCNT S PSSCNT=1
 D DOSE
 D DRUG
 Q
 ;
DOSE ;Change needed to the DOSE UNITS (#51.24) file
 ; (1) FIRST DATABANK DOSE UNIT (#1) field:
 ;     (a) APPLICATORFUL/S changed to APPLICATORFUL
 ;     (b) SUPPOSITORY/IES changed to SUPPOSITORY
 ; (2) Add SUPPOSITORY/IES as a synonym
 ;
 N DIE,DA,DR,PSSDOSE,PSSFLG
 S DIE="^PS(51.24,",PSSFLG=0
 S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="This mail message has been sent to those holding the PSNMGR security key",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="as well as the installer of the PSS*1.0*198 patch.",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="This mail message should also be forwarded to the Pharmacy ADPAC for review."
 S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="Changes made to the DOSE UNITS (#51.24) file:",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="  FIRST DATABANK (FDB) DOSE UNIT (#1) field",PSSCNT=PSSCNT+1
 S DA=$O(^PS(51.24,"C","APPLICATORFUL/S",0))
 I DA="" D
 .S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="       * No change needed to correct ""APPLICATORFUL/S"".",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="         Post-install routine for patch PSS*1.0*198 may have been",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="         already run or the file was corrected in the past.",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 I DA]"" D
 . S PSSDOSE=$G(^PS(51.24,DA,0))
 . S ^TMP($J,"PSSP198",PSSCNT)="      * Name: "_$P(PSSDOSE,"^")_" Old: "_$P(PSSDOSE,"^",2)_"  New: APPLICATORFUL",PSSCNT=PSSCNT+1
 . S DR="1////APPLICATORFUL" D ^DIE K DA,DR
 S DA=$O(^PS(51.24,"C","SUPPOSITORY/IES",0))
 I DA="" D
 .S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="       * No change needed to correct ""SUPPOSITORY/IES"".",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="         Post-install routine for patch PSS*1.0*198 may have been",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="         already run or the file was corrected in the past.",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 I DA]"" D
 . S PSSDOSE=$G(^PS(51.24,DA,0))
 . S ^TMP($J,"PSSP198",PSSCNT)="      * Name: "_$P(PSSDOSE,"^")_"  Old: "_$P(PSSDOSE,"^",2)_"  New: SUPPOSITORY",PSSCNT=PSSCNT+1
 . S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 . S ^TMP($J,"PSSP198",PSSCNT)="   SYNONYM (#2) field corresponding to the NAME (#.01) field:",PSSCNT=PSSCNT+1
 . S ^TMP($J,"PSSP198",PSSCNT)="      ""SUPPOSITORY/IES"" added as a synonym for ""SUPPOSITOR(IES)"".",PSSCNT=PSSCNT+1
 . S ^TMP($J,"PSSP198",PSSCNT)="      (""APPLICATORFUL/S"" is already a synonym for ""APPLICATORFUL(S)"").",PSSCNT=PSSCNT+1
 . S DR="1////SUPPOSITORY" D ^DIE
 . S DR="2////SUPPOSITORY/IES" D ^DIE
 . K DA,DR
 S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 K DIE
 Q
 ;
DRUG ;Loop through the DRUG (#50) file and search for drugs that are
 ;defined with MEMANTINE HCL 5MG/10MG TAB TITRATION PAK,49
 ;in the PSNDF VA PRODUCT NAME ENTRY (#22) field
 ;
 ;This field points to the VA PRODUCT (#50.68) file
 ;
 ;The internal entry number (ien) for MEMANTINE HCL 5MG/10MG TAB
 ;TITRATION PAK,49 in file 50.68 is 16512
 ;
 ;If the NCPDP DISPENSE UNIT (#82) field is defined with "RA"
 ;(which is invalid), change the value to "EA".
 ;
 N PSSIEN,PSSNCP,PSSNAM,PSSDU,PSSUNIT,DIE,DA,DR,XMSUB,PSSTXT,PSSCTR
 S PSSIEN=0 F  S PSSIEN=$O(^PSDRUG(PSSIEN)) Q:'PSSIEN  D
 .S PSSNCP=+$P($G(^PSDRUG(PSSIEN,"ND")),"^",3)
 .I PSSNCP=16512,$P($G(^PSDRUG(PSSIEN,"EPH")),"^",2)="RA"  D
 ..S PSSNAM=$P(^PSDRUG(PSSIEN,0),"^",1),PSSDU=$P($G(^PSDRUG(PSSIEN,"EPH")),"^",2)
 ..S PSSUNIT="EA",DIE="^PSDRUG(",DA=PSSIEN,DR="82////"_PSSUNIT D ^DIE K DA,DIE,DR
 ..S ^TMP($J,"PSSP198-1",PSSIEN,1)=PSSNAM_"^RA^"_PSSUNIT
 S PSSIEN=0
 S ^TMP($J,"PSSP198",PSSCNT)="PSS*1*198 NCPDP Disp Unit Corrections",PSSCNT=PSSCNT+1,PSSTXT=""
 F PSSCTR=1:1:79 S PSSTXT=PSSTXT_"-"
 S ^TMP($J,"PSSP198",PSSCNT)=PSSTXT,PSSCNT=PSSCNT+1,^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="The following drug(s) is/are associated with the VA Product",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="MEMANTINE HCL 5MG/10MG TAB TITRATION PAK and the",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="NCPDP Dispense Unit have been changed to EA (Each).",PSSCNT=PSSCNT+1
 S ^TMP($J,"PSSP198",PSSCNT)="",PSSTXT="",PSSCNT=PSSCNT+1
 F PSSCTR=1:1:79 S PSSTXT=PSSTXT_"="
 S ^TMP($J,"PSSP198",PSSCNT)=PSSTXT,PSSCNT=PSSCNT+1
 I '$D(^TMP($J,"PSSP198-1")) D  G EXIT
 .S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="         All drugs associated with",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="  MEMANTINE HCL 5MG/10MG TAB TITRATION PAK",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="           are marked correctly.",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="          No changes were needed.",PSSCNT=PSSCNT+1
 .S ^TMP($J,"PSSP198",PSSCNT)="",PSSCNT=PSSCNT+1
 .D MAIL
 D HDR
 S PSSIEN=0 F  S PSSIEN=$O(^TMP($J,"PSSP198-1",PSSIEN)) Q:'PSSIEN  D
 .S PSSTXT="" D TXT($P($G(^TMP($J,"PSSP198-1",PSSIEN,1)),"^",1)_" ("_PSSIEN_")",1)
 .D TXT("RA",57),TXT($P($G(^TMP($J,"PSSP198-1",PSSIEN,1)),"^",3),63)
 .S PSSCNT=PSSCNT+1,^TMP($J,"PSSP198",PSSCNT)=PSSTXT
 .S PSSCNT=PSSCNT+1,^TMP($J,"PSSP198",PSSCNT)=""
 D MAIL
 ;
EXIT ; CLEAN UP
 K ^TMP($J),PSSCNT,PSSCTR,PSSDU,PSSIEN,PSSINS,PSSNAM,PSSNCP,PSSTXT,PSSUNIT,PSSUSER,XMDUZ,XMSUB,XMTEXT,XMY
 Q
TXT(PSSVAL,PSSCAL) S:'$D(PSSTXT) PSSTXT="" S PSSTXT=$$SETSTR^VALM1(PSSVAL,PSSTXT,PSSCAL,$L(PSSVAL))
 Q
MAIL N DIFROM
 S XMSUB="PSS*1*198 Post-Install Report"
 S PSSCNT=PSSCNT+1,^TMP($J,"PSSP198",PSSCNT)="***** End Of Report *****"
 S XMTEXT="^TMP($J,""PSSP198"",",XMDUZ="PSS*1*198 Post Install",XMY(DUZ)=""
 F PSSUSER=0:0 S PSSUSER=$O(^XUSEC("PSNMGR",PSSUSER)) Q:'PSSUSER  S:PSSUSER'=.5 XMY(PSSUSER)="",XMY(DUZ)=""
 D ^XMD
 Q
HDR ;SET REPORT HEADER
 S PSSTXT="" D TXT("NCPDP Disp Unit",55) S ^TMP($J,"PSSP198",PSSCNT)=PSSTXT,PSSTXT="",PSSCNT=PSSCNT+1
 S PSSTXT="" D TXT("Drug",1),TXT("Old",57),TXT("New",63) S ^TMP($J,"PSSP198",PSSCNT)=PSSTXT,PSSCNT=PSSCNT+1
 S PSSTXT=""
 F PSSCTR=1:1:79 S PSSTXT=PSSTXT_"-"
 S ^TMP($J,"PSSP198",PSSCNT)=PSSTXT,PSSCNT=PSSCNT+1
 Q