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

BPSOS2A.m

Go to the documentation of this file.
  1. BPSOS2A ;BHAM ISC/FCS/DRS/DLF - continuation of BPSOS2 ;06/01/2004
  1. ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;Statistics & Misc Options Screen - Zero Stats
  1. ;
  1. ;Protocol - BPS P2 ZERO - clearing stats
  1. ZERO N ZTYP,X
  1. S ZTYP=$$SELZTYP() I ZTYP="^" W !!!,"Nothing changed.",! D ANY
  1. I ZTYP'="^" D
  1. .I $$SURE'=1 W !!!,"Nothing changed.",! D ANY Q
  1. .;
  1. .;Clear Local Stats
  1. .I ZTYP=0 D ZLOCAL
  1. .;
  1. .;Clear Permanent Stats
  1. .I ZTYP=1 D ZPERM,FETCHES^BPSOS2(0) ; fetch all these zeroes into BASE(*)
  1. D UPD^BPSOS2
  1. S VALMBCK=""
  1. Q
  1. ;
  1. ;Zero Local Statistics
  1. ;
  1. ;Reset Base Numbers to Current Numbers
  1. ZLOCAL K BASE M BASE=CURR
  1. Q
  1. ;
  1. ;Zero Permanent Statistics
  1. ; This logic will create a strange order - Record 1 is always the newest.
  1. ; Record 2 will be the oldest, Record 3 is next oldest, etc.
  1. ZPERM N FILE
  1. S FILE=9002313.58
  1. L +^BPSECX("S"):300 I '$T W "LOCK failed",! Q
  1. ;
  1. ; Increment zero node for the database
  1. N I,N
  1. F I=3,4 D
  1. . S N=$P(^BPSECX("S",0),U,I)+1
  1. . S $P(^BPSECX("S",0),U,I)=N
  1. ;
  1. ; Merge current data into new record
  1. S N=$P(^BPSECX("S",0),U,3)
  1. M ^BPSECX("S",N)=^BPSECX("S",1)
  1. S $P(^BPSECX("S",N,0),U)=N ; fix up the .01 field
  1. N DIK,DA S DIK="^BPSECX(""S"",",DA=N D IX^DIK ; trivial indexing
  1. ;
  1. ; Update fields to be zero, except date/time cleared
  1. N FIELD S FIELD=.01
  1. F S FIELD=$O(^DD(FILE,FIELD)) Q:'FIELD D
  1. . N VALUE
  1. . I FIELD=2 D ; date/time last cleared
  1. .. N %,%H,%I,X D NOW^%DTC S VALUE=%
  1. . E S VALUE=0
  1. . N DIE,DA,DR S DIE=FILE,DA=1,DR=FIELD_"////"_VALUE D ^DIE
  1. ;
  1. ; Unlock record
  1. L -^BPSECX("S")
  1. Q
  1. ;
  1. SELZTYP() ;
  1. N DFLT,DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. S DFLT="Local Copy"
  1. S DIR(0)="S^L:Local Copy;P:Permanent Copy",DIR("A")="Delete (L)ocal Copy or (P)ermanent Copy of the statistics",DIR("B")=DFLT
  1. D ^DIR
  1. I ($G(DUOUT)=1)!($G(DTOUT)=1) S Y="^"
  1. S Y=$S(Y="P":1,Y="L":0,1:Y)
  1. Q Y
  1. ;
  1. SURE(DEF) ;
  1. N SURE,PMT,OPT,ANS
  1. S PMT="Are you sure"
  1. I '$D(DEF) S DEF="N"
  1. S OPT=1 ; answer is optional
  1. S ANS=$$YESNO^BPSOSU3(PMT,DEF,OPT)
  1. Q ANS ; 1 or 0 or -1 or ^ or ^^ or null
  1. ANY ;EP
  1. W:$X ! D PRESSANY^BPSOSU5() Q ; Press any key