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

PXICLN1.m

Go to the documentation of this file.
  1. PXICLN1 ;ISL/dee - Cleanup routine for PX*1.0*1 ;9/3/96
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**1**;Aug 12, 1996
  1. ;
  1. D PACKAGE
  1. D QUE
  1. Q
  1. ;
  1. PACKAGE ;Fix the PCE package file entry.
  1. N PXPCE,PXPCE,PXPCE22,PXVT,PXVTC,PXVT22,PXFDA,PXERROR
  1. S PXPCE=$$PKG2IEN^VSIT("PX")
  1. S PXPCEC=PXPCE_","
  1. Q:PXPCE'>0
  1. S PXVT=$$PKG2IEN^VSIT("VSIT")
  1. S PXVTC=PXVT_","
  1. D
  1. . N DIC,X,Y
  1. . S DIC="^DIC(9.4,"_PXPCE_",22,"
  1. . S DIC(0)="LX"
  1. . S DIC("P")=$P(^DD(9.4,22,0),"^",2)
  1. . S DA(1)=PXPCE
  1. . S X="1.0"
  1. . D ^DIC
  1. . S PXPCE22=+Y
  1. I $$GET1^DIQ(9.4,PXPCEC,2,"I","","PXERROR")="" D
  1. . S PXFDA(9.4,PXPCEC,2)="Patient Care Encounter"
  1. I $$GET1^DIQ(9.4,PXPCEC,11.01,"I","","PXERROR")="" D
  1. . S PXFDA(9.4,PXPCEC,11.01)="SLC"
  1. I $$GET1^DIQ(9.4,PXPCEC,11.3,"I","","PXERROR")="" D
  1. . S PXFDA(9.4,PXPCEC,11.3)="I"
  1. I $$GET1^DIQ(9.4,PXPCEC,13,"I","","PXERROR")'="1.0" D
  1. . S PXFDA(9.4,PXPCEC,13)="1.0"
  1. I PXVT>0,$G(PXPCE22)>0 D
  1. . D
  1. .. N DIC,X,Y
  1. .. S DIC="^DIC(9.4,"_PXVT_",22,"
  1. .. S DIC(0)="X"
  1. .. S DIC("P")=$P(^DD(9.4,22,0),"^",2)
  1. .. S DA(1)=PXVT
  1. .. S X="2.0"
  1. .. D ^DIC
  1. .. S PXVT22=+Y
  1. . I PXVT22>0 D
  1. .. N PXP22,PXV22
  1. .. S PXP22=PXPCE22_","_PXPCEC
  1. .. S PXV22=PXVT22_","_PXVTC
  1. .. I $$GET1^DIQ(9.49,PXP22,1,"I","","PXERROR")="" D
  1. ... S X=$$GET1^DIQ(9.49,PXV22,1,"I","","PXERROR")
  1. ... I X]"" S PXFDA(9.49,PXP22,1)=X
  1. .. I $$GET1^DIQ(9.49,PXP22,2,"I","","PXERROR")="" D
  1. ... S X=$$GET1^DIQ(9.49,PXV22,2,"I","","PXERROR")
  1. ... I X]"" S PXFDA(9.49,PXP22,2)=X
  1. .. I $$GET1^DIQ(9.49,PXP22,3,"I","","PXERROR")="" D
  1. ... S X=$$GET1^DIQ(9.49,PXV22,3,"I","","PXERROR")
  1. ... I X]"" S PXFDA(9.49,PXP22,3)=X
  1. I $D(PXFDA) D FILE^DIE("","PXFDA")
  1. Q
  1. ;
  1. QUE ; Queue job to deleting the 800 node on all Stop Code Visits.
  1. N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK,ZTSAVE
  1. D BMES^XPDUTL("Deleting the 800 node on all Stop Code Visits.")
  1. S ZTRTN="STOP800^PXICLN1"
  1. S ZTIO=""
  1. S ZTDESC="PX*1.0*1 tasked cleanup job"
  1. S ZTDTH=$H
  1. D ^%ZTLOAD
  1. I $D(ZTSK) D MES^XPDUTL("The job is task # "_ZTSK)
  1. I '$D(ZTSK) D MES^XPDUTL("Could not start the task job.") D BMES^XPDUTL("You should start it by doing: D QUE^PXICLN1 at the programmers prompt.")
  1. Q
  1. ;
  1. STOP800 ;Delete the 800 node from all Stop Code visits
  1. N PXIVSIT,VSIT
  1. S PXIVSIT=0
  1. F S PXIVSIT=$O(^AUPNVSIT(PXIVSIT)) Q:'PXIVSIT D
  1. . Q:'$D(^AUPNVSIT(PXIVSIT,800))
  1. . Q:$P($G(^AUPNVSIT(PXIVSIT,150)),"^",3)'="S"
  1. . K VSIT
  1. . I $P(^AUPNVSIT(PXIVSIT,800),"^",1)]"" S VSIT("SC")="@"
  1. . I $P(^AUPNVSIT(PXIVSIT,800),"^",2)]"" S VSIT("AO")="@"
  1. . I $P(^AUPNVSIT(PXIVSIT,800),"^",3)]"" S VSIT("IR")="@"
  1. . I $P(^AUPNVSIT(PXIVSIT,800),"^",4)]"" S VSIT("EC")="@"
  1. . I $D(VSIT) S VSIT("IEN")=PXIVSIT D UPD^VSIT K ^AUPNVSIT(PXIVSIT,800)
  1. ;
  1. MAIL ;Send mail messge that job is done. Also send to SLC IRMFO.
  1. N XMY,XMSUB,PXTEXT,XMTEXT
  1. S XMY(DUZ)=""
  1. S XMY("G.PCEINSTAL@ISC-SLC.DOMAIN.EXT")=""
  1. S XMSUB="PX*1.0*1 Cleanup is finished"
  1. S PXTEXT(1)="PX*1.0*1 Cleanup job is done."
  1. S:$D(ZTQUEUED) PXTEXT(2)="The task job number "_ZTQUEUED_" is finished."
  1. S PXTEXT(3)=" "
  1. S PXTEXT(4)="The site part if the Visit ID for this site is:"
  1. S PXTEXT(5)=" "_$G(^VSIT(150.2,+$P($G(^DIC(150.9,1,4)),"^",2),0))
  1. S XMTEXT="PXTEXT("
  1. D ^XMD
  1. Q
  1. ;