SCCVEGU1 ;ALB/TMP - UTILS FOR ENCNTR CNVRSN GLBL ESTMTR;20-JAN-1998
;;5.3;Scheduling;**211**;Aug 13, 1993
;
INCRTOT(SCTOT,INCRWHAT,HOWMUCH) ;Update local counters for estimate
; SCTOT -- The array containing the running estimate totals
; Subcripted by the piece it is stored on in the CST's node 2
; INCRWHAT -- The piece of the CST 2-node that stores the correspnding count
; 1 = Add/edits (Default)
; 2 = Ancillaries
; 3 = Appointments
; 4 = Credit stops
; 5 = Dispositions
; 7 = Encounters and Visits
; 8 = Visits only
; 9 = # V-Providers
; 10 = # V-Diagnoses
; 11 = # V-Procedures
; HOWMUCH -- The amount to add to the existing total
;
;OUTPUT :
; SCTOT(INCRWHAT) -- local array to hold the # found
;
I $G(HOWMUCH)="" N HOWMUCH S HOWMUCH=1
S SCTOT(+INCRWHAT)=$G(SCTOT(+INCRWHAT))+HOWMUCH
I +INCRWHAT=7 S SCTOT(8)=$G(SCTOT(8))+HOWMUCH
Q
;
UPDTOTL(PTRLOG,SCTOT) ;UPDATE CST WITH ESTIMATE TOTALS
;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION TEMPLATE
; file (#404.98)
; SCTOT - Array subscripted by storage pc and containing
; the totals to be stored for the estimate
;OUTPUT : None
;
N SC2,SCDATA,SCF
Q:'$D(^SD(404.98,+$G(PTRLOG),0))
S SC2=0 F S SC2=$O(SCTOT(SC2)) Q:'SC2 S SCF="2."_$S($L(SC2)<2:"0",1:"")_SC2,SCDATA(+SCF)=SCTOT(SC2)
; -- Update count(s)
D UPD^SCCVDBU(404.98,PTRLOG,.SCDATA)
Q
;
ESTGROW(ARRAY) ;RETURN ESTIMATED GLOBAL GROWTH FOR AFFECTED GLOBALS
;INPUT : ARRAY - Array to store output in (full global reference)
; Defaults to ^TMP("SCCVEG",$J,"SIZE")
;OUTPUT : None
; ARRAY will be returned as follows
; ARRAY(GLOBAL) = Estimated global growth
; Where GLOBAL will be
; SCE,
; AUPNVCPT, AUPNVPOV, AUPNVPRV, AUPNVSIT <- PCE Globals
;
N X,Y
S:($G(ARRAY)="") ARRAY="^TMP(""SCCVEG"","_$J_",""SIZE"")"
K @ARRAY
;
; Sets # of blocks per record by global at 70% Global Efficiency
;
S @ARRAY@("SCE","NEW")=$$SCE() ; New encounters
S @ARRAY@("SCE","UPD")=$$SCEUPD() ; Updated encounters (visit pointer/convert)
S @ARRAY@("AUPNVSIT")=$$AUPNVSIT() ; visits
S @ARRAY@("AUPNVCPT")=$$AUPNVCPT() ; procedures
S @ARRAY@("AUPNVPRV")=$$AUPNVPRV() ; providers
S @ARRAY@("AUPNVPOV")=$$AUPNVPOV() ; diagnoses
Q
;
FACTOR() ; -- determine block factor (1 := 1024/dsm 2 := 2048/openm)
Q $S($G(^%ZOSF("OS"))["DSM":1,1:2)
;
BLKSIZE() ; -- determine block size
Q $S($$FACTOR()=1:1024,1:2048)
;
PER(EST) ; -- adjust 'per' record size for os
Q $J(EST/$$FACTOR(),4,3)
;
; -- block per entry estimates for dsm (1024 bytes per block)
SCE() ; -- encounter
Q $$PER(.288)
SCEUPD() ; -- encounter update only
Q $$PER(.147)
AUPNVSIT() ; -- visit file
Q $$PER(.336) ; original est. was .325
AUPNVPRV() ; -- providers
Q $$PER(.139) ; original est. was .145
AUPNVPOV() ; -- dx
Q $$PER(.163) ; original est. was .132
AUPNVCPT() ; -- cpts
Q $$PER(.196) ; original est. was .159
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCCVEGU1 3281 printed Dec 13, 2024@02:38:55 Page 2
SCCVEGU1 ;ALB/TMP - UTILS FOR ENCNTR CNVRSN GLBL ESTMTR;20-JAN-1998
+1 ;;5.3;Scheduling;**211**;Aug 13, 1993
+2 ;
INCRTOT(SCTOT,INCRWHAT,HOWMUCH) ;Update local counters for estimate
+1 ; SCTOT -- The array containing the running estimate totals
+2 ; Subcripted by the piece it is stored on in the CST's node 2
+3 ; INCRWHAT -- The piece of the CST 2-node that stores the correspnding count
+4 ; 1 = Add/edits (Default)
+5 ; 2 = Ancillaries
+6 ; 3 = Appointments
+7 ; 4 = Credit stops
+8 ; 5 = Dispositions
+9 ; 7 = Encounters and Visits
+10 ; 8 = Visits only
+11 ; 9 = # V-Providers
+12 ; 10 = # V-Diagnoses
+13 ; 11 = # V-Procedures
+14 ; HOWMUCH -- The amount to add to the existing total
+15 ;
+16 ;OUTPUT :
+17 ; SCTOT(INCRWHAT) -- local array to hold the # found
+18 ;
+19 IF $GET(HOWMUCH)=""
NEW HOWMUCH
SET HOWMUCH=1
+20 SET SCTOT(+INCRWHAT)=$GET(SCTOT(+INCRWHAT))+HOWMUCH
+21 IF +INCRWHAT=7
SET SCTOT(8)=$GET(SCTOT(8))+HOWMUCH
+22 QUIT
+23 ;
UPDTOTL(PTRLOG,SCTOT) ;UPDATE CST WITH ESTIMATE TOTALS
+1 ;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION TEMPLATE
+2 ; file (#404.98)
+3 ; SCTOT - Array subscripted by storage pc and containing
+4 ; the totals to be stored for the estimate
+5 ;OUTPUT : None
+6 ;
+7 NEW SC2,SCDATA,SCF
+8 if '$DATA(^SD(404.98,+$GET(PTRLOG),0))
QUIT
+9 SET SC2=0
FOR
SET SC2=$ORDER(SCTOT(SC2))
if 'SC2
QUIT
SET SCF="2."_$SELECT($LENGTH(SC2)<2:"0",1:"")_SC2
SET SCDATA(+SCF)=SCTOT(SC2)
+10 ; -- Update count(s)
+11 DO UPD^SCCVDBU(404.98,PTRLOG,.SCDATA)
+12 QUIT
+13 ;
ESTGROW(ARRAY) ;RETURN ESTIMATED GLOBAL GROWTH FOR AFFECTED GLOBALS
+1 ;INPUT : ARRAY - Array to store output in (full global reference)
+2 ; Defaults to ^TMP("SCCVEG",$J,"SIZE")
+3 ;OUTPUT : None
+4 ; ARRAY will be returned as follows
+5 ; ARRAY(GLOBAL) = Estimated global growth
+6 ; Where GLOBAL will be
+7 ; SCE,
+8 ; AUPNVCPT, AUPNVPOV, AUPNVPRV, AUPNVSIT <- PCE Globals
+9 ;
+10 NEW X,Y
+11 if ($GET(ARRAY)="")
SET ARRAY="^TMP(""SCCVEG"","_$JOB_",""SIZE"")"
+12 KILL @ARRAY
+13 ;
+14 ; Sets # of blocks per record by global at 70% Global Efficiency
+15 ;
+16 ; New encounters
SET @ARRAY@("SCE","NEW")=$$SCE()
+17 ; Updated encounters (visit pointer/convert)
SET @ARRAY@("SCE","UPD")=$$SCEUPD()
+18 ; visits
SET @ARRAY@("AUPNVSIT")=$$AUPNVSIT()
+19 ; procedures
SET @ARRAY@("AUPNVCPT")=$$AUPNVCPT()
+20 ; providers
SET @ARRAY@("AUPNVPRV")=$$AUPNVPRV()
+21 ; diagnoses
SET @ARRAY@("AUPNVPOV")=$$AUPNVPOV()
+22 QUIT
+23 ;
FACTOR() ; -- determine block factor (1 := 1024/dsm 2 := 2048/openm)
+1 QUIT $SELECT($GET(^%ZOSF("OS"))["DSM":1,1:2)
+2 ;
BLKSIZE() ; -- determine block size
+1 QUIT $SELECT($$FACTOR()=1:1024,1:2048)
+2 ;
PER(EST) ; -- adjust 'per' record size for os
+1 QUIT $JUSTIFY(EST/$$FACTOR(),4,3)
+2 ;
+3 ; -- block per entry estimates for dsm (1024 bytes per block)
SCE() ; -- encounter
+1 QUIT $$PER(.288)
SCEUPD() ; -- encounter update only
+1 QUIT $$PER(.147)
AUPNVSIT() ; -- visit file
+1 ; original est. was .325
QUIT $$PER(.336)
AUPNVPRV() ; -- providers
+1 ; original est. was .145
QUIT $$PER(.139)
AUPNVPOV() ; -- dx
+1 ; original est. was .132
QUIT $$PER(.163)
AUPNVCPT() ; -- cpts
+1 ; original est. was .159
QUIT $$PER(.196)
+2 ;