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

EAS122PT.m

Go to the documentation of this file.
  1. EAS122PT ; ALB/SCK - POST INSTALL CLEANUP PATCH EAS*1*22 ; 12/13/2002
  1. ;;1.0;ENROLLMENT APPLICATION SYSTEM;**22**;MAR 15,2001
  1. ;
  1. QUE ; Queued entry point for post install processing
  1. N ZTRTN,ZTDESC,ZTSAVE,ZTSK,ZTIO
  1. ;
  1. S ZTRTN="EN^EAS122PT"
  1. S ZTDESC="PATCH EAS*1*22 POST INSTALL"
  1. S XMDUZ="EAS MT LETTERS"
  1. S ZTSAVE("DUZ")=""
  1. S ZTIO=""
  1. ;
  1. D ^%ZTLOAD
  1. I $D(ZTSK)'>0 D BMES^XPDUTL("Post-Install was not tasked off")
  1. E D BMES^XPDUTL("Post-Install tasked: ["_$G(ZTSK)_"]")
  1. D HOME^%ZIS
  1. Q
  1. ;
  1. EN ; Main entry point for post install processing
  1. K ^TMP("EAS22",$J),^TMP("EAS22A",$J)
  1. D POST
  1. D MAIL1
  1. D MAIL2
  1. K ^TMP("EAS22",$J),^TMP("EAS22A",$J)
  1. Q
  1. ;
  1. POST ; Process files and generate cleanup list
  1. N DGIEN,DIK,DA,CNT,DFN,VA,EASMTDT
  1. ;
  1. ; Process EAS MT LETTER STATUS File, (#713.2)
  1. S DGIEN=0
  1. F S DGIEN=$O(^EAS(713.2,"C",-1,DGIEN)) Q:'DGIEN D
  1. . S ^TMP("EAS22",$J,DGIEN)=$P($G(^EAS(713.2,DGIEN,0)),U,1)
  1. . I $D(^EAS(713.2,DGIEN)) D ; if data entry exists, delete it
  1. . . S DIK="^EAS(713.2,",DA=DGIEN
  1. . . D ^DIK
  1. . E D ; if no data entry, only xref, kill off the xref
  1. . . K ^EAS(713.2,"C",-1,DGIEN)
  1. ;
  1. I $$S^%ZTLOAD D Q ; Check for stop request
  1. . S ^TMP("EAS22",$J,0)="STOP"
  1. ;
  1. POST2 ;Process EAS MT PATIENT STATUS File (#713.1)
  1. S DGIEN=0,CNT=1
  1. F S DGIEN=$O(^EAS(713.1,DGIEN)) Q:'DGIEN D Q:$D(^TMP("EAS22",$J,0))
  1. . S CNT=CNT+1 I (CNT#100)=0,$$S^ZTLOAD D Q ; Check for stop request
  1. . . S ^TMP("EAS22",$J,0)="STOP"
  1. . Q:$D(^EAS(713.1,"AP",1,DGIEN))
  1. . I '$D(^EAS(713.2,"C",DGIEN)) D
  1. . . S DFN=$P($G(^EAS(713.1,DGIEN,0)),U,1)
  1. . . D PID^VADPT
  1. . . S EASMTDT=$$LST^DGMTU(DFN)
  1. . . I +EASMTDT>0 S EASMTDT=$$FMTE^XLFDT($P(EASMTDT,U,2))
  1. . . I DFN>0 S ^TMP("EAS22A",$J,DGIEN)=$$GET1^DIQ(2,DFN,.01)_" ("_VA("BID")_")"_" "_EASMTDT
  1. Q
  1. ;
  1. MAIL1 ; Generate mail message with number of removed entries
  1. N XMY,XMSUB,XMTEXT,XMDUZ,MSG,DGIEN,DGDT,DGPRCDT,X
  1. ;
  1. S XMSUB="Post Install - EAS*1*22"
  1. S XMY("G.EAS MTLETTERS")=""
  1. S XMY("DUZ")=""
  1. S XMDUZ="PATCH EAS-1-22"
  1. ;
  1. S DGIEN=0
  1. F S DGIEN=$O(^TMP("EAS22",$J,DGIEN)) Q:'DGIEN D
  1. . Q:^TMP("EAS22",$J,DGIEN)'>0 ; Check for valid date value for DGRPCDT
  1. . S DGPRCDT(^TMP("EAS22",$J,DGIEN))=$G(DGPRCDT(^TMP("EAS22",$J,DGIEN)))+1
  1. ;
  1. S MSG(.1)="Entries were removed from the EAS MT LETTER STATUS File (#713.2)"
  1. S MSG(.2)="which did not have a valid pointer to the EAS MT PATIENT STATUS"
  1. S MSG(.3)="File (#713.1). The entries removed were for the processing dates"
  1. S MSG(.4)="listed below. This is provided as information only."
  1. S MSG(.5)=""
  1. S X=$$SETSTR^VALM1("Date Processed","",5,18)
  1. S X=$$SETSTR^VALM1("Records Removed",X,25,18)
  1. S MSG(.6)=X
  1. S DGDT=0
  1. F S DGDT=$O(DGPRCDT(DGDT)) Q:'DGDT D
  1. . S X=$$SETSTR^VALM1($$FMTE^XLFDT(DGDT,"2D"),"",5,18)
  1. . S X=$$SETSTR^VALM1(+$G(DGPRCDT(DGDT)),X,25,18)
  1. . S MSG(DGDT)=X
  1. S XMTEXT="MSG("
  1. D ^XMD
  1. Q
  1. ;
  1. MAIL2 ; Generate file cross-check message on patient names
  1. N XMY,XMSUB,XMTEXT,XMDUZ,MSG,DGIEN,DGDT
  1. ;
  1. S XMSUB="Post Install - EAS*1*22"
  1. S XMY("G.EAS MTLETTERS")=""
  1. S XMY("DUZ")=""
  1. S XMDUZ="PATCH EAS-1-22"
  1. ;
  1. S ^TMP("EAS22A",$J,.1)="The following patients in the EAS MT PATIENT STATUS File (#713.1)"
  1. S ^TMP("EAS22A",$J,.2)="do not have a corresponding entry in the EAS MT LETTER STATUS File (#713.2)."
  1. S ^TMP("EAS22A",$J,.3)="You can try re-generating the Means Test Letter dates for these"
  1. S ^TMP("EAS22A",$J,.4)="patients by running the REGEN procedure from the post-install"
  1. S ^TMP("EAS22A",$J,.5)="routine by entering 'D REGEN^EAS122PT' at the programmer prompt."
  1. S ^TMP("EAS22A",$J,.6)="See the Patch Instructions for more details."
  1. S ^TMP("EAS22A",$J,.7)=""
  1. S XMTEXT="^TMP(""EAS22A"",$J,"
  1. D ^XMD
  1. Q
  1. ;
  1. REGEN ;
  1. N DGIEN,MTLST,MTDT,DFN,CNT,EASDT,EADT,DIR,Y
  1. ;
  1. S DIR(0)="YAO",DIR("B")="NO"
  1. S DIR("A",1)="Re-generate Means Test Letter Dates for patients"
  1. S DIR("A")="identified in patch EAS*1*22 cleanup? "
  1. D ^DIR K DIR
  1. Q:'Y
  1. ;
  1. K ^TMP("EAS22A",$J)
  1. D POST2
  1. ;
  1. S EADT=$$DT^XLFDT
  1. S DGIEN=0
  1. F S DGIEN=$O(^TMP("EAS22A",$J,DGIEN)) Q:'DGIEN D
  1. . S DFN=$P($G(^EAS(713.1,DGIEN,0)),U,1)
  1. . S MTLST=$$LST^DGMTU(DFN)
  1. . S MTDT=$P(MTLST,U,2)
  1. . Q:'$G(MTDT)
  1. . S EASDT("ANV")=$$FMADD^XLFDT(MTDT)
  1. . S EASDT("60")=$$FMADD^XLFDT(EASDT("ANV"),305)
  1. . S EASDT("30")=$$FMADD^XLFDT(EASDT("ANV"),335)
  1. . S EASDT("0")=$$FMADD^XLFDT(EASDT("ANV"),365)
  1. . I $$NEWLTR^EASMTL2(DGIEN,.EASDT)
  1. K ^TMP("EAS22A",$J)
  1. Q