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

ABSPOS2A.m

Go to the documentation of this file.
  1. ABSPOS2A ; IHS/FCS/DRS - continuation of ABSPOS2 ;
  1. ;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
  1. Q
  1. JOBS ; protocol ABSP P2 TMIT JOBS
  1. N WHAT S WHAT="Maximum number of transmitter-receiver jobs: "
  1. N PMT S PMT=WHAT
  1. S DEF=$$MAXJOBS^ABSPOSQ3
  1. N OPT,MIN,MAX,DEC S OPT=1,MIN=1,MAX=10,DEC=0
  1. N ANS S ANS=$$NUMERIC^ABSPOSU2(PMT,DEF,OPT,MIN,MAX,DEC)
  1. I ANS?1N.N D MAXJOBS^ABSPOSQ3(ANS)
  1. S ANS=$$MAXJOBS^ABSPOSQ3
  1. W !,WHAT," = ",ANS,!
  1. D ANY
  1. S VALMBCK=""
  1. Q
  1. WOW ; protocol ABSP P2 WINNOW ; Winnow or Erase data or Big erase data
  1. ; This is going to be put on the manager menu proper, instead.
  1. ; Re-development is underway in ABSPOSK*
  1. W !,"This option is temporarily disabled.",! D ANY S VALMBCK="R" Q
  1. ZERO ; protocol ABSP P2 ZERO ; clearing stats
  1. N PMT S PMT="Clear your local copy of stats (L) or clear the permanent copy (P)? "
  1. N DEF S DEF="L" ; default: my local copy
  1. N OPT S OPT=1 ; answer is optional
  1. N DISP S DISP="N" ; no display (it's in the prompt)
  1. N CHC S CHC="L:my Local copy;P:the Permanent copy"
  1. N ANS S ANS=$$SET^ABSPOSU3(PMT,DEF,OPT,DISP,CHC)
  1. ; ANS = "" or -1 or ^ or ^^ or L or P
  1. I ANS="L" D
  1. .W !,"Clearing local stats - in testing - copying CURR to BASE:",!
  1. .D DIFF^ABSPOS2 ; compute DIFF=CURR-BASE one last time
  1. .D ZLOCAL ; now we copy CURR into BASE; next time DIFFs will be 0
  1. E I ANS="P" D
  1. .W !,"Clear the permanent stats? " I $$SURE'=1 Q
  1. .D ZPERM
  1. .D FETCHES^ABSPOS2(0) ; fetch all these zeroes into BASE(*)
  1. E D ; nothing if "" or -1 or ^ or ^^
  1. .W !,"Nothing changed.",!
  1. D ANY ; press any key
  1. ; then UPD calls UPDATE(1) calls UPD1 calls FETCHES(1) and DIFF,
  1. ; which will set lots of CHG nodes = 0, and display should show that
  1. D UPD^ABSPOS2
  1. S VALMBCK=""
  1. Q
  1. ZLOCAL W !,"Clearing local stats - in testing",!
  1. W "we copy CURR(*) to BASE(*)",!
  1. K BASE M BASE=CURR
  1. Q
  1. ZPERM W !,"Clearing permanent stats - in testing",!
  1. W "We do it by setting many fields in file 9002313.58 to zero",!
  1. N FILE S FILE=9002313.58
  1. L +^ABSPECX("S"):300 I '$T W "LOCK failed",! Q
  1. ;W "Idea: save old copies in higher-numbered nodes.",!
  1. D
  1. .N I F I=3,4 D
  1. . . N N S N=$P(^ABSPECX("S",0),U,I)+1
  1. . . S $P(^ABSPECX("S",0),U,I)=N
  1. . N N S N=$P(^ABSPECX("S",0),U,3)
  1. .M ^ABSPECX("S",N)=^ABSPECX("S",1)
  1. .S $P(^ABSPECX("S",N,0),U)=N ; fix up the .01 field
  1. .N DIK,DA S DIK="^ABSPECX(""S"",",DA=N D IX^DIK ; trivial indexing
  1. W "Now we zero out lots of fields: " H 1
  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. W "Done",!
  1. L -^ABSPECX("S")
  1. Q
  1. TMR ; Protocol ABSP P2 TRANSMITTER ; Transmitter on/off
  1. N CURR S CURR=$$SHUTDOWN^ABSPOSQ3 ; currently, the shutdown flag is:
  1. D TMNOW
  1. N PMT,DEF,OPT,ANS S PMT="Do you wish to "_$S(CURR:"en",1:"dis")
  1. S PMT=PMT_"able the transmitter-receiver"
  1. S DEF="N"
  1. S OPT=1
  1. S ANS=$$YESNO^ABSPOSU3(PMT,DEF,OPT)
  1. I ANS=1 I $$SHUTDOWN^ABSPOSQ3('CURR)
  1. S CURR=$$SHUTDOWN^ABSPOSQ3
  1. D TMNOW,ANY
  1. S VALMBCK=""
  1. Q
  1. TMNOW W !,"The transmitter-receiver is currently "
  1. W $S(CURR:"dis",1:"en"),"abled.",! Q
  1. POK ; protocol ABSP P2 POKE ; Poke the queues
  1. W !,"Poke the queues? " I $$SURE=1 D POKE^ABSPOS2D
  1. S VALMBCK=""
  1. Q
  1. SURE(DEF) N SURE
  1. S PMT="Are you sure"
  1. I '$D(DEF) S DEF="Y"
  1. N OPT S OPT=1 ; answer is optional
  1. N ANS S ANS=$$YESNO^ABSPOSU3(PMT,DEF,OPT)
  1. Q ANS ; 1 or 0 or -1 or ^ or ^^ or null
  1. ANY ;EP - from ABSPOS6D,ABSPOS6K
  1. W:$X ! D PRESSANY^ABSPOSU5() Q ; Press any key