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

PSSP194.m

Go to the documentation of this file.
  1. PSSP194 ;DAL/DSK-PSS*1.0*194 POST INSTALL ROUTINE
  1. ;;1.0;PHARMACY DATA MANAGEMENT;**194**;9/30/97;Build 9
  1. ;;
  1. Q
  1. ;
  1. POSTINT ; POST INSTALL ENTRY POINT.
  1. ;
  1. N ZTDESC,ZTIO,ZTDTH,ZTRTN,ZTSAVE
  1. S ZTDESC="PSS*1*194 Post Install",ZTIO="",ZTDTH=$H,ZTRTN="POST^PSSP194",ZTSAVE("DUZ")=""
  1. D ^%ZTLOAD
  1. D BMES^XPDUTL("PSS*1*194 Post Install Task Queued.")
  1. D BMES^XPDUTL("You will receive a MailMan message")
  1. D BMES^XPDUTL("when task #"_$G(ZTSK)_" has completed.")
  1. K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
  1. Q
  1. ;
  1. POST ;correct cross references and send mail message
  1. ;
  1. ; ^XTMP("PSSP194" used to document changes made
  1. ; Changes are sent in MailMan message to installer
  1. ; ^XTMP is kept for 90 days in case questions arise later
  1. ; and mail message has been deleted
  1. ;
  1. N PSSNOW
  1. S PSSNOW=$$NOW^XLFDT()
  1. ;in case this routine is run more than once, delete old ^XTMP entry
  1. K ^XTMP("PSSP194")
  1. S ^XTMP("PSSP194",0)=$$FMADD^XLFDT(PSSNOW,90)_"^"_PSSNOW_"^PSS*1.0*194 Post Install Routine PSSP194"
  1. D NAME,MAIL
  1. Q
  1. ;
  1. NAME ;Search for incorrect cross references
  1. ;If length is exactly 30, pre-PSS*1*194 version of PSSTXT
  1. ;may not have deleted or changed the cross reference correctly
  1. ;If length is more than 30, change to 30 to be consistent
  1. ;with FileMan logic
  1. ;
  1. N PSSEQ,PSSTR,PSSIEN,PSSINDEX
  1. D CHECK
  1. ;
  1. S PSSEQ=""
  1. ;
  1. ;Delete cross references which need to be deleted
  1. F S PSSEQ=$O(^XTMP("PSSP194","CROSS",PSSEQ)) Q:PSSEQ="" D
  1. . S PSSTR=^XTMP("PSSP194","CROSS",PSSEQ)
  1. . S PSSIEN=$P(PSSTR,"^"),PSSINDEX=$P(PSSTR,"^",3)
  1. . K ^PS(51.7,"B",PSSINDEX,PSSIEN)
  1. ;
  1. ;Set cross references which need to be set
  1. F S PSSEQ=$O(^XTMP("PSSP194","B_SET",PSSEQ)) Q:PSSEQ="" D
  1. . S PSSTR=^XTMP("PSSP194","B_SET",PSSEQ)
  1. . S PSSIEN=$P(PSSTR,"^"),PSSINDEX=$P(PSSTR,"^",3)
  1. . S ^PS(51.7,"B",PSSINDEX,PSSIEN)=""
  1. ;
  1. ;Kill long cross references and set truncated cross references
  1. F S PSSEQ=$O(^XTMP("PSSP194","LONG",PSSEQ)) Q:PSSEQ="" D
  1. . S PSSTR=^XTMP("PSSP194","LONG",PSSEQ)
  1. . ;kill the >30 length cross reference
  1. . S PSSIEN=$P(PSSTR,"^"),PSSINDEX=$P(PSSTR,"^",2)
  1. . K ^PS(51.7,"B",PSSINDEX,PSSIEN)
  1. . ;set correct cross reference.
  1. . ;This set could potentially occur twice due to part IND
  1. . ;but at least it would be set.
  1. . S PSSINDEX=$P(PSSTR,"^",3)
  1. . ;check for null value in case this was a file fragment
  1. . I PSSINDEX]"" S ^PS(51.7,"B",PSSINDEX,PSSIEN)=""
  1. Q
  1. ;
  1. CHECK ;Check cross reference and correct if necessary
  1. ;
  1. N PSSNAME,PSSUB
  1. S PSSINDEX="",PSSEQ=0
  1. F S PSSINDEX=$O(^PS(51.7,"B",PSSINDEX)) Q:PSSINDEX="" D
  1. . Q:$L(PSSINDEX)<30
  1. . S PSSIEN=""
  1. . F S PSSIEN=$O(^PS(51.7,"B",PSSINDEX,PSSIEN)) Q:PSSIEN="" D
  1. . . S PSSNAME=$P($G(^PS(51.7,PSSIEN,0)),"^")
  1. . . I $E(PSSNAME,1,30)'=PSSINDEX D
  1. . . . ;"CROSS" subscript = cross reference was not deleted
  1. . . . ; because of previous logic issue
  1. . . . ; in routine PSSTXT so need to delete
  1. . . . ;"LONG" subscript = cross reference is longer than
  1. . . . ; 30 characters; truncate to 30
  1. . . . ; to be consistent with FileMan
  1. . . . S PSSEQ=PSSEQ+1,PSSUB=$S($L(PSSINDEX)=30:"CROSS",1:"LONG")
  1. . . . ;set data string for ease of sending MailMan message later
  1. . . . S ^XTMP("PSSP194",PSSUB,PSSEQ)=PSSIEN_"^"_$S(PSSUB="CROSS":PSSNAME,1:PSSINDEX)_"^"_$S(PSSUB="CROSS":PSSINDEX,1:$E(PSSNAME,1,30))
  1. . . . D IND
  1. Q
  1. ;
  1. IND ;double check to make sure there is a valid index
  1. ;
  1. I PSSNAME'="",'$D(^PS(51.7,"B",PSSNAME,PSSIEN)),'$D(^PS(51.7,"B",$E(PSSNAME,1,30),PSSIEN)) D
  1. . ;For an unknown reason, the name is not present -- truncated or not
  1. . ; -- as a cross reference.
  1. . ;This is probably not a real issue at sites, but am allowing for the
  1. . ;possibility.
  1. . ;
  1. . ;If PSSNAME is null, a file fragment probably exists which was caused
  1. . ;by a previous error. Leave the file fragment "as is" because side
  1. . ;effects of deleting file fragments are not known.
  1. . ;
  1. . S ^XTMP("PSSP194","B_SET",PSSEQ)=PSSIEN_"^"_PSSNAME_"^"_$E(PSSNAME,1,30)
  1. Q
  1. ;
  1. MAIL ;send Mail message
  1. ;
  1. N XMY,PSLINE,PSSPACE,XMDUZ,XMY,XMSUB,A,XMTEXT,PSFLG
  1. K XMY
  1. S PSFLG=0,PSLINE=1,PSSPACE=" "
  1. ;send MailMan message to installer
  1. S XMDUZ="POST-INSTALL,PSS*1.0*194",XMY(DUZ)="",XMSUB="POST-INSTALL PSS*1.0*194 INFORMATION"
  1. S A(PSLINE)=""
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" PSS*1.0*194 POST-INSTALL"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" "
  1. S A(PSLINE)=" The content of this message is informational only."
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" No action needs to be taken."
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" "
  1. S PSSEQ=""
  1. F S PSSEQ=$O(^XTMP("PSSP194",PSSEQ)) Q:PSSEQ="" D
  1. . I PSSEQ="CROSS" S PSFLG=1 D MCROSS
  1. . I PSSEQ="B_SET" S PSFLG=1 D MBSET
  1. . I PSSEQ="LONG" S PSFLG=1 D MLONG
  1. I 'PSFLG D
  1. . S PSLINE=PSLINE+1
  1. . S A(PSLINE)=" The DRUG TEXT (#51.7) file was checked and no issues were found."
  1. ;set mail message in ^XTMP in case mail message accidentally deleted
  1. M ^XTMP("PSSP194","MAIL")=A
  1. ;send mail message
  1. S XMTEXT="A(" D ^XMD
  1. ;delete task from TaskManager list
  1. S ZTREQ="@"
  1. Q
  1. ;
  1. MCROSS ;Incorrect cross reference was deleted
  1. ;
  1. N PSSUB,PSSTR,PSSIEN,PSSNAME,PSSCROSS
  1. ;set top level of ^XMTP subscript for ease of troublehshooting later if necessary
  1. S ^XTMP("PSSP194",PSSEQ)="Incorrect Cross References which were deleted by post-install routine PSSP194"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" "
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)="The following entries in the DRUG TEXT (#51.7) file had"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)="incorrect cross references deleted."
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" "
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" IEN Name"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" ------------ ---------------------------------------------"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" Incorrect Cross Reference Deleted"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" ---------------------------------------"
  1. D STR
  1. Q
  1. ;
  1. MBSET ;No cross references existed, so cross references were set
  1. ;
  1. N PSSUB,PSSTR,PSSIEN,PSSNAME,PSSCROSS
  1. ;set top level of ^XTMP subscript for ease of troubleshooting later if necessary
  1. S ^XTMP("PSSP194",PSSEQ)="No cross references existed, so cross reference was set"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)="The following entries in the DRUG TEXT (#51.7) file had no cross references,"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)="so cross references were set."
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=""
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" IEN Name"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" ------------ ---------------------------------------------"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" Cross Reference Set"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" ------------------------------"
  1. D STR
  1. Q
  1. ;
  1. MLONG ;Long cross references which were truncated
  1. ;
  1. N PSSUB,PSSTR,PSSIEN,PSSCROSS
  1. ;set top level of ^XTMP subscript for ease of troubleshooting later if necessary
  1. S ^XTMP("PSSP194",PSSEQ)="Long cross references which were truncated"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" "
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)="The following entries in the DRUG TEXT (#51.7) file had long"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)="cross references deleted and truncated cross references set."
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=""
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" IEN Long Cross Reference Deleted"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" ------------ ---------------------------------------------"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" Truncated Cross Reference Set"
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" ------------------------------"
  1. D STR
  1. Q
  1. ;
  1. STR ;set data in mail message array
  1. S PSLINE=PSLINE+1
  1. S A(PSLINE)=" "
  1. S PSSUB=""
  1. F S PSSUB=$O(^XTMP("PSSP194",PSSEQ,PSSUB)) Q:PSSUB="" D
  1. . S PSSTR=^XTMP("PSSP194",PSSEQ,PSSUB),PSSIEN=$P(PSSTR,"^"),PSSNAME=$P(PSSTR,"^",2),PSSCROSS=$P(PSSTR,"^",3)
  1. . S PSLINE=PSLINE+1
  1. . S A(PSLINE)=" "_PSSIEN_$E(PSSPACE,1,14-$L(PSSIEN))_$S(PSSNAME]"":PSSNAME,1:"No name on entry")
  1. . S PSLINE=PSLINE+1
  1. . S A(PSLINE)=" "_$S(PSSCROSS]"":PSSCROSS,1:"None -- no name on entry")
  1. Q
  1. ;