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

VPRP16.m

Go to the documentation of this file.
  1. VPRP16 ;SLC/MKB -- SDA utilities for patch 16 ;11/8/18 14:11
  1. ;;1.0;VIRTUAL PATIENT RECORD;**16**;Sep 01, 2011;Build 3
  1. ;;Per VHA Directive 6402, this routine should not be modified.
  1. ;
  1. ; External References DBIA#
  1. ; ------------------- -----
  1. ; %ZTLOAD 10063
  1. ; XLFDT 10103
  1. ; XPDUTL 10141
  1. ; XUPROD 4440
  1. ;
  1. ;
  1. POST ; -- postinit tasks
  1. D TASK
  1. Q
  1. ;
  1. TASK ; -- task job to clean up ^VPR
  1. I '$$PROD^XUPROD D MES^XPDUTL("No task queued: not a production system") Q
  1. I '$D(^VPR("AVPR")),'$D(^VPR("ANEW")) D MES^XPDUTL("No task queued: no entries in update lists.") Q
  1. ;
  1. N ZTRTN,ZTDTH,ZTDESC,ZTIO,ZTSAVE,ZTUCI,ZTCPU,ZTPRI,ZTKIL,ZTSYNC,ZTSK
  1. S ZTRTN="LIST^VPRP16",ZTDTH=$$NOW^XLFDT,ZTIO=""
  1. S ZTDESC="Remove test patients from VPR update lists"
  1. D ^%ZTLOAD I '$G(ZTSK) D MES^XPDUTL("Unable to queue clean up task.") Q
  1. D MES^XPDUTL("Task #"_ZTSK_" was queued to clean up ^VPR")
  1. Q
  1. ;
  1. LIST ; -- clean up ^VPR update lists for TEST and MERGED patients
  1. N DFN,SEQ,TYPE,ID
  1. ;
  1. S DFN=0 F S DFN=$O(^DPT(DFN)) Q:DFN<1 D
  1. . I '$D(^VPR(1,2,DFN)) Q ;not subscribed
  1. . I '$$TESTPAT^VADPT(DFN),'$$MERGED^VPRHS(DFN) Q ;ok
  1. . ; remove entries for test or merged patients
  1. . D ANEW,AVPR
  1. Q
  1. ;
  1. ANEW ; ANEW = new subscribe
  1. S SEQ=$G(^VPR(1,2,DFN,"ANEW"))
  1. I SEQ K ^VPR("ANEW",SEQ,DFN),^VPR(1,2,DFN,"ANEW")
  1. Q
  1. ;
  1. AVPR ; AVPR = data updates
  1. S TYPE="" F S TYPE=$O(^VPR(1,2,DFN,"AVPR",TYPE)) Q:TYPE="" D
  1. . S ID="" F S ID=$O(^VPR(1,2,DFN,"AVPR",TYPE,ID)) Q:ID="" S SEQ=+$G(^(ID)) D
  1. .. K ^VPR("AVPR",SEQ,DFN)
  1. .. K ^VPR(1,2,DFN,"AVPR",TYPE,ID)
  1. Q