[613] | 1 | DGPMBSAR ;ALB/LM/MJK - RECALC ENTRY POINTS; 16 JAN 91
|
---|
| 2 | ;;5.3;Registration;**85**;Aug 13, 1993
|
---|
| 3 | ;
|
---|
| 4 | A D PCHK^DGPMGL I E G ERR^DGPMGL ; Parameter check
|
---|
| 5 | D RCCK G:'$D(RCCK) Q ; Check for ReCalc already running
|
---|
| 6 | D PAR^DGPMGL ; Display parameters
|
---|
| 7 | ;
|
---|
| 8 | ASK W ! S %DT("A")="RECALCULATE TOTALS FROM WHICH DATE: ",%DT="APE",%DT(0)=-(DT-1) D ^%DT K %DT G Q:Y'>0
|
---|
| 9 | S RC=+Y,X=$S($P(DGPM("G"),"^",7):$P(DGPM("G"),"^",7),1:+DGPM("G")) ; X=Earliest date ReCalc can be run ;
|
---|
| 10 | I RC<X S Y=X X ^DD("DD") W !!?4,*7,"Can't Recalculate data prior to ",Y,"!" G ASK
|
---|
| 11 | D DEFS
|
---|
| 12 | ;
|
---|
| 13 | RPD ;W !!,"Recalculation of patient days could take up to 30 minutes longer per date..."
|
---|
| 14 | PR ;W !,"DO YOU WANT TO RECALCULATE PATIENT DAYS" S %=2 D YN^DICN
|
---|
| 15 | ;I %=1!(%=2) S:%=1 REM=1 G QUE
|
---|
| 16 | ;I %=-1 G Q
|
---|
| 17 | ;W !?4,"Answer YES to recalculate patient days or NO to avoid this lengthy process.",!?4,"If you don't recalculate patient days then the appropriate statistical data"
|
---|
| 18 | ;W !?4,"will be calculated based on the prior days remaining totals and the current",!?4,"(recalculation) days actual gains and losses. Unless you have a lot of"
|
---|
| 19 | ;W !?4,"time on your hands or an obvious error exists recalculation of patient days",!?4,"is not normally recommended.",!
|
---|
| 20 | ;G PR
|
---|
| 21 | ;
|
---|
| 22 | QUE ; Recalculation Queue
|
---|
| 23 | S ZTRTN="GO1^DGPMBSAR",ZTIO="",ZTDESC="BSR RECALCULATION" F I="DGPM(""G"")","RC","RD","PD","REM","GL","BS","TSR","TSRI","DIV","MT","TS","CP","RM","OS","VN","SF","TSD","SNM","RCCK","GLS" S ZTSAVE(I)=""
|
---|
| 24 | K ZTSK D ^%ZTLOAD I $D(ZTSK) D UP43^DGPMBSR W !!,"Request Queued!"
|
---|
| 25 | G Q
|
---|
| 26 | ;
|
---|
| 27 | GO1 S DIE="^DG(43,",DA=1,DR="54////@;55////@;56////@" D ^DIE K DIE,DR,DA
|
---|
| 28 | GO D DAT,^DGPMBSR
|
---|
| 29 | Q K RCCK G DONE^DGPMGLG
|
---|
| 30 | Q
|
---|
| 31 | ;
|
---|
| 32 | DAT ; -- get params and chk data
|
---|
| 33 | D DAT^DGPMGL,DEFS S E=0
|
---|
| 34 | I DGPM(0)="" S E=1 G DATQ
|
---|
| 35 | F I=2,3,4,6:1:9 S C=I*.01 I $P(DGPM("G"),U,I)="" S E=1 ; modified re FORUM [#16205729]
|
---|
| 36 | DATQ Q
|
---|
| 37 | ;
|
---|
| 38 | CLEAN ; -- clean up corrections file
|
---|
| 39 | S DGCDT=0,X=$P(DGPM(0),U,29) I X S X1=DT,X2=-X D C^%DTC S DGCDT=X
|
---|
| 40 | F DGI=0:0 S DGI=$O(^DGS(43.5,DGI)) Q:'DGI!(DGI>DGCDT) S DA=DGI,DIK="^DGS(43.5," D ^DIK
|
---|
| 41 | K DA,DIK
|
---|
| 42 | F DGCDT=0:0 S DGCDT=$O(^DGS(43.5,"AGL",DGCDT)) Q:'DGCDT!(DGCDT>EGL) F DGI=0:0 S DGI=$O(^DGS(43.5,"AGL",DGCDT,DGI)) Q:'DGI S DR=".08///@",DA=DGI,DIE="^DGS(43.5," D ^DIE
|
---|
| 43 | K DR,DA,DIE,DQ,DE,DG,DGCDT
|
---|
| 44 | Q
|
---|
| 45 | ;
|
---|
| 46 | WDCHK ; -- chk first ward
|
---|
| 47 | S %=+$O(^DIC(42,"AGL",0)),WD=+$O(^(%,0))
|
---|
| 48 | S X=RC F J=1:1 S X1=X,X2=-1 D C^%DTC Q:X'>EGL!($D(^DG(41.9,WD,"C",X)))
|
---|
| 49 | S RC=X I X'=EGL S X1=X,X2=1 D C^%DTC S RC=X
|
---|
| 50 | K WD,%
|
---|
| 51 | Q
|
---|
| 52 | ;
|
---|
| 53 | RCCK ; Check for ReCalc already running
|
---|
| 54 | K RCCK
|
---|
| 55 | I $P(DGPM("GLS"),"^",3) D RCR^DGPMGL Q ; ReCalc running
|
---|
| 56 | I $P(DGPM("GLS"),"^",5),$P(DGPM("GLS"),"^",4),$P(DGPM("GLS"),"^",6)]"" S ZTSK=$P(DGPM("GLS"),"^",4),ZTCPU=$P(DGPM("GLS"),"^",6)
|
---|
| 57 | D ISQED^%ZTLOAD
|
---|
| 58 | I ZTSK(0) S Y=$P(DGPM("GLS"),"^",5) X ^DD("DD") W !,"ReCalc Already Scheduled for ",Y,! Q
|
---|
| 59 | I $P(DGPM("GLS"),"^",5) S Y=$P(DGPM("GLS"),"^",5) X ^DD("DD") W !,"ReCalc appears to be scheduled for ",Y,!,"Do you wish to continue" S %=2 D YN^DICN Q:%=2!(%=-1) G RCCK:'%
|
---|
| 60 | S RCCK=1
|
---|
| 61 | Q
|
---|
| 62 | ;
|
---|
| 63 | DEFS ; -- defaults for recalc
|
---|
| 64 | S %DT="",X="T" D ^%DT K %DT S DT=Y
|
---|
| 65 | S X1=DT,X2=-1 D C^%DTC S RD=X
|
---|
| 66 | S X1=X,X2=-1 D C^%DTC S PD=X
|
---|
| 67 | S (REM,GL,BS,TSR)=0
|
---|
| 68 | Q
|
---|
| 69 | ;
|
---|
| 70 | VAR ; RC=ReCalc from date ; RD=Report Date ;
|
---|
| 71 | ; PD=Previous Date ; REM=Recalc patient days ;
|
---|