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

PSJ431P.m

Go to the documentation of this file.
  1. PSJ431P ;HPS/DSK - PSJ*5.0*431 PATCH POST INSTALL ROUTINE ;Apr 20, 2022@17:40
  1. ;;5.0;INPATIENT MEDICATIONS;**431**;16 DEC 97;Build 5
  1. ;
  1. Q
  1. ;
  1. ;This routine checks for any unit dose or IV "zero level" subscripts
  1. ;which do not have the sub-file indicator field populated.
  1. ;
  1. EN ;
  1. N PSJDUZ
  1. S ZTRTN="START^PSJ431P"
  1. S ZTDESC="PSJ*5.0*431 Post-Install Routine"
  1. S ZTIO="",ZTDTH=$H
  1. S PSJDUZ=DUZ
  1. S ZTSAVE("PSJDUZ")=""
  1. D ^%ZTLOAD
  1. W !!,"PSJ*5.0*431 Post-Install Routine has been tasked."
  1. W !,"TASK NUMBER: ",$G(ZTSK)
  1. W !!,"The installer will receive a MailMan message"
  1. W !,"when the search completes.",!
  1. Q
  1. ;
  1. START ;
  1. N PSJPT,PSJCOUNT,PSJUDCT,PSJIVCT
  1. ;Kill in case install re-started for some reason.
  1. K ^XTMP("PSJ431 POST")
  1. S ^XTMP("PSJ431 POST",0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^PSJ*5.0*431 Post-Install Routine"
  1. S ^XTMP("PSJ431 POST",1)="Any internal entry number (IEN) in the PHARMACY PATIENT (#55) file which was"
  1. S ^XTMP("PSJ431 POST",2)="missing a sub-file entry for Unit Dose (subscript 5) or IV (subscript ""IV"")"
  1. S ^XTMP("PSJ431 POST",3)="is listed as a subscript under ""UD"" or ""IV""."
  1. S (PSJPT,PSJCOUNT,PSJUDCT,PSJIVCT)=0
  1. F S PSJPT=$O(^PS(55,PSJPT)) Q:'PSJPT D
  1. . S PSJCOUNT=PSJCOUNT+1
  1. . ;It might not be necessary to pause so as to not consume
  1. . ;system resources. But pausing anyway to be on the safe side.
  1. . I PSJCOUNT#50000=0 H 15
  1. . I $D(^PS(55,PSJPT,5,0)),$P(^(0),"^",2)="" D
  1. . . S $P(^PS(55,PSJPT,5,0),"^",2)="55.06IA"
  1. . . S PSJUDCT=PSJUDCT+1
  1. . . S ^XTMP("PSJ431 POST","UD",PSJPT)=""
  1. . I $D(^PS(55,PSJPT,"IV",0)),$P(^(0),"^",2)="" D
  1. . . S $P(^PS(55,PSJPT,"IV",0),"^",2)=55.01
  1. . . S PSJIVCT=PSJIVCT+1
  1. . . S ^XTMP("PSJ431 POST","IV",PSJPT)=""
  1. ;Set total counts for Unit Dose (5) and IV entries which were corrected.
  1. S ^XTMP("PSJ431 POST","UD")=$S(PSJUDCT=0:"None",1:PSJUDCT)
  1. S ^XTMP("PSJ431 POST","IV")=$S(PSJIVCT=0:"None",1:PSJIVCT)
  1. D XTMP,MAIL
  1. S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. ;
  1. XTMP ;Generate MailMan message and keep in ^XTMP for 60 days
  1. N PSJSUB
  1. S PSJSUB="PSJ431 MAILMAN MESSAGE"
  1. ;Kill in case install re-started for some reason.
  1. K ^XTMP(PSJSUB)
  1. S ^XTMP(PSJSUB,0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^PSJ*5.0*431 POST INSTALL"
  1. S ^XTMP(PSJSUB,1)=" "
  1. S ^XTMP(PSJSUB,2)="The post-install routine for PSJ*5.0*431 has completed."
  1. S ^XTMP(PSJSUB,3)=" "
  1. S ^XTMP(PSJSUB,4)="The number of instances in the PHARMACY PATIENT (#55) file which"
  1. S ^XTMP(PSJSUB,5)="were missing sub-file entries in the second piece of the zero"
  1. S ^XTMP(PSJSUB,6)="node for Unit Dose (subscript 5) and IV (subscript ""IV"") are:"
  1. S ^XTMP(PSJSUB,7)=" "
  1. S ^XTMP(PSJSUB,8)="Unit Dose: "_^XTMP("PSJ431 POST","UD")
  1. S ^XTMP(PSJSUB,9)=" IV: "_^XTMP("PSJ431 POST","IV")
  1. S ^XTMP(PSJSUB,10)=" "
  1. I PSJUDCT>0!(PSJIVCT>0) D
  1. . S ^XTMP(PSJSUB,11)="The appropriate sub-file entries have been filed if they were missing."
  1. . S ^XTMP(PSJSUB,12)="Details as to which instances were missing sub-file entries can be"
  1. . S ^XTMP(PSJSUB,13)="found in ^XTMP(""PSJ431 POST"" for the next 60 days."
  1. Q
  1. ;
  1. MAIL ;
  1. N PSJMY,PSJMIN,PSJMSUB,PSJTEXT
  1. S PSJMY(PSJDUZ)=""
  1. S PSJMIN("FROM")="PSJ*5.0*431 Post-Install Routine PSJ431P"
  1. S PSJMSUB="PSJ*5.0*431 Post-Install Findings"
  1. S PSJTEXT="^XTMP(""PSJ431 MAILMAN MESSAGE"")"
  1. D SENDMSG^XMXAPI(PSJDUZ,PSJMSUB,PSJTEXT,.PSJMY,.PSJMIN,"","")
  1. Q