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

VPRHST2.m

Go to the documentation of this file.
  1. VPRHST2 ;OIT/CMF - Monitor SDA upload global ;09/18/18 4:36pm
  1. ;;1.0;VIRTUAL PATIENT RECORD;**25**;Sep 01, 2011;Build 12
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; External References DBIA#
  1. ; ------------------- -----
  1. ; XLFDT 10103
  1. ; XLFSTR 10104
  1. ;
  1. EN ; -- Monitor upload global, write results to screen
  1. N DFN,TYPE
  1. S DFN(0)=0,TYPE(0)=0
  1. S DFN=$$PATIENT^VPRHST Q:$D(DUOUT)!$D(DTOUT) S:+DFN>0 DFN(0)=1
  1. S TYPE=$$CONTNR^VPRHST Q:$D(DUOUT)!$D(DTOUT) S:TYPE'="" TYPE(0)=1
  1. D RUN(.DFN,.TYPE)
  1. Q
  1. ;
  1. RUN(DFN,TYPE) ; -- display list
  1. N VPR,I,J,K,X,Y,DIR,DUOUT,DTOUT,LCNT,DONE
  1. ;S VIEW=0,MAX=9999 ;$$TOTAL()
  1. S DIR(0)="YA",DIR("B")="YES" ;,DIR("T")=5
  1. S DIR("A")="Do you wish to continue to monitor the upload global? "
  1. S DIR("?")="Enter YES to refresh the list, or NO to exit"
  1. LOOP K VPR,I,J,K
  1. M VPR=^VPR("AVPR")
  1. D HDR S DONE=0
  1. S I=0 F S I=$O(VPR(I)) Q:+I<1 D Q:DONE
  1. . S J=+$O(VPR(I,0)) Q:(DFN(0)=1)&(J'=+DFN)
  1. . S K=$P($G(VPR(I,J)),U,2) Q:(TYPE(0)=1)&(K'=TYPE)
  1. . W !,I,?10,J,?20,VPR(I,J)
  1. . S LCNT=LCNT+1 Q:LCNT#22
  1. . W !!,"Press <return> to continue or ^ to exit ..."
  1. . R X:DTIME I '$T!(X["^") S DONE=1 Q
  1. . D HDR
  1. W !!,"Current Sequence#: ",$G(^VPR(1,1))
  1. D ^DIR
  1. Q:'Y!$D(DUOUT)!$D(DTOUT)
  1. G LOOP ;G:Y=1!($D(DTOUT))&(VIEW<MAX) LOOP
  1. Q
  1. ;
  1. HDR ; -- write header
  1. ;S VIEW=VIEW+1
  1. W @IOF,"VPR Global Upload Monitor",?55,$$FMTE^XLFDT($$NOW^XLFDT)
  1. W !,"SEQ",?10,"DFN",?20,$S(TYPE(0):TYPE,1:"All containers")
  1. W " for "_$S(DFN(0):$P(DFN,U,2),1:"all patients")
  1. W !,$$REPEAT^XLFSTR("-",79) S LCNT=3
  1. ;W !,$$FMTE^XLFDT($$NOW^XLFDT)_" View: "_VIEW_" of "_MAX_".",!
  1. Q
  1. ;
  1. TOTAL() ; -- select the max# of iterations
  1. N X,Y,DIR,DUOUT,DTOUT
  1. S DIR(0)="NAO^1:9999",DIR("A")="Select the maximum number of views to process: ",DIR("B")=9999
  1. S DIR("?")="Enter the maximum number of iterations for the upload global to be read, up to 240"
  1. D ^DIR S:$D(DTOUT) Y="^"
  1. Q Y