VistA-WorldVistAEHR/r/LAB_SERVICE-LR-LS/LRARLMW.m

60 lines
2.5 KiB
Mathematica

LRARLMW ;DALISC/CKA - ARCHIVE LAB MONTHLY WORKLOADS (67.9);2/1/95
;;5.2;LAB SERVICE;**59**;July 31, 1995
S LRART=67.9,LRARFL="" D CHECK^LRARU G:LRARFL=1 EXIT
S LRAR=1 D NEW^LRARU
DATE ;Called from LR ARCHIVE 67.9 option
;Message
W !!,"First enter a date range selection to archive the"
W !,"LAB MONTHLY WORKLOADS file (67.9)."
;Prompt for a range of dates
D DT^DICRW
BEGDT W !!,"**** Date Range Selection ****",! S %DT="AE",%DT(0)="-T",%DT("A")="Beginning DATE: " D ^%DT
I Y<0 D DELETE G:LRARFL BEGDT G EXIT
S LRPBD=Y,LRBD=LRPBD-100
ENDDT W ! S %DT="AE",%DT("A")="Ending DATE: " D ^%DT
I Y<0 D DELETE G:LRARFL ENDDT G EXIT
G:Y<LRBD HELP W ! S LRPED=Y,LRED=LRPED+.99
;SAVE SELECTION CRITERIA IN LAB ARCHIVAL ACTIVITY FILE
D SAVESEL^LRARU1
;OPTIONAL PRINT SELECTED ENTRIES
ASKPRT S DIR(0)="Y",DIR("A")="WOULD YOU LIKE TO PRINT SELECTED ENTRIES",DIR("B")="YES" D ^DIR K DIR
I $D(DIRUT)!('Y) G COMP
PRT ;EN1^DIP CALL
S L=0,DIC="^LRO(67.9,",BY=".01,1,1,.01",FR=","_LRBD,TO=","_LRED
D EN1^DIP
COMP ;ARCHIVING ACTION COMPLETED
D COMP^LRARU1
EXIT K BY,DA,DIC,DIK,DIR,DIRUT,DTOUT,DUOUT,FR,L,LRARF,LRAI,LRAINST,LRANUM,LRAR,LRARC,LRARFL,LRARI,LRARP,LRARST,LRART,LRARU,LRARX,LRBD,LRED,LRPBD,LRPED,TO,Y
D CLN^LRARU1
Q
DELETE K DIR S LRARFL=0,DIR(0)="Y",DIR("A")="Do you want to delete this archival activity and forget this for now",DIR("B")="YES"
D ^DIR
I $D(DIRUT)!('Y) W !,"You must enter a beginning and ending date." S LRARFL=1 Q
W !!,"Now deleting this archival activity..."
S DIK="^LAB(95.11,",DA=LRARC D ^DIK W !!,">>> DONE <<<"
Q
HELP W "??",!?5,"Ending date must not be on or before beginning date" G DATE
CLEAR ;REMOVE DATA FROM ARCHIVED LAB MONTHLY WORKLOADS FILE
;CHECK LAB ARCHIVAL ACTIVITY FILE
W !!,"This will clear the data from the Archived Lab Monthly Workloads file."
ASKCLR K DIR S DIR(0)="Y",DIR("A")="ARE YOU SURE YOU WANT TO DO THIS",DIR("B")="YES" D ^DIR K DIR
I $D(DIRUT)!('Y) G EXIT
S LRAR=3,LRART=67.9,LRARC=0 S LRARC=$O(^LAB(95.11,"O",2,LRART,LRARC)) G:LRARC="" ERROR D FILE^LRARU G:'$D(LRARC) EXIT
;CLEARING IN PROGRESS
D MRK^LRARU1
W !!,"I will now CLEAR out the global."
S LRARX="" F LRARI=0:0 S LRARX=$O(^LAR(67.99999,LRARX)) Q:LRARX="" K ^LAR(67.99999,LRARX)
S ^LAR(67.99999,0)="ARCHIVED LAB MONTHLY WORKLOADS^67.99999"
;UPDATE ENTRY IN LAB ARCHIVAL ACTIVITY FILE
S LRAR=3 D UPDATE^LRARU1
D COMP^LRARU1
W !!,">>> DONE <<<"
G EXIT
Q
ERROR W !!,$C(7),"I cannot find an archival activity for file 67.9 that has the correct archival status."
G EXIT
Q
;LRARC=LAB ARCHIVAL ACTIVITY INTERNAL FILE #
;LRARFL= OUTSTANDING ARCHIVAL ACTIVITY FLAG
Q