CHECKSUM processing in ANALYZE^C0CRIMA

This commit is contained in:
george 2009-04-01 00:23:06 +00:00
parent 4ab2c073d0
commit 717776c2a3
1 changed files with 28 additions and 0 deletions

View File

@ -74,6 +74,9 @@ ANALYZE(BEGDFN,DFNCNT,APARMS) ; RIM COHERANCE ANALYSIS ROUTINE
. I $D(^TMP("C0CCCR",$J,"RESULTS",0)) D ; RESULTS EXIST . I $D(^TMP("C0CCCR",$J,"RESULTS",0)) D ; RESULTS EXIST
. . W "FOUND RESULTS VARS",! . . W "FOUND RESULTS VARS",!
. . M @RIMBASE@("VARS",RIMDFN,"RESULTS")=^TMP("C0CCCR",$J,"RESULTS") . . M @RIMBASE@("VARS",RIMDFN,"RESULTS")=^TMP("C0CCCR",$J,"RESULTS")
. I $$CHKSUM(RIMDFN) D ; CHECKSUM HAS CHANGED
. . W "CHECKSUM IS NEW OR HAS CHANGED",!
. . ZWR ^TMP("C0CRIM","CHKSUM",RIMDFN,*)
. K ^TMP("C0CCCR",$J) ; KILL WORK AREA FOR CCR BUILDING . K ^TMP("C0CCCR",$J) ; KILL WORK AREA FOR CCR BUILDING
. ; . ;
. ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP . ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP
@ -198,6 +201,31 @@ CPUSH(CATRTN,CBASE,CTBL,CDFN,CATTR) ; ADD PATIENTS TO CATEGORIES
; ;
Q Q
; ;
CHKSUM(CKDFN) ; DOES A CHECKSUM AND STORES IT IN MUMPS GLOBALS
;
S C0CCKB=$NA(^TMP("C0CRIM","CHKSUM")) ;CHECKSUM BASE
S C0CGLB=$NA(^TMP("C0CRIM","VARS")) ;CCR VARIABLE BASE
S C0CI=""
F S C0CI=$O(@C0CGLB@(CKDFN,C0CI)) Q:C0CI="" D ;FOR EACH DOMAIN
. ;W "DFN:",DFN," DOMAIN:",C0CI,!
. S C0CJ=$NA(@C0CGLB@(CKDFN,C0CI))
. I C0CI="HEADER" D ; HAVE TO TAKE OUT THE "DATE GENERATED"
. . S C0CDT=@C0CGLB@(CKDFN,C0CI,1,"DATETIME")
. . K @C0CGLB@(CKDFN,C0CI,1,"DATETIME")
. S C0CCK(C0CI)=$$CHKSUM^XUSESIG1(C0CJ)
. I C0CI="HEADER" D ; PUT IT BACK
. . S @C0CGLB@(CKDFN,C0CI,1,"DATETIME")=C0CDT
S C0CK="C0CCK" ;
S C0CALL=$$CHKSUM^XUSESIG1(C0CK) ;CHECKSUM OF ALL DOMAIN CHECKSUMS
S CHKR=0 ; RESULT DEFAULT
I $D(^TMP("C0CRIM","CHKSUM",CKDFN,"ALL")) D ; OLD CHECKSUM EXISTS
. I @C0CCKB@(CKDFN,"ALL")'=C0CALL S CHKR=1
E S CHKR=1 ;CHECKSUM IS NEW
S @C0CCKB@(CKDFN,"ALL")=C0CALL
M @C0CCKB@(CKDFN,"DOMAIN")=C0CCK
ZWR ^TMP("C0CRIM","CHKSUM",CKDFN,*)
Q CHKR
;
CCOUNT ; RECOUNT THE CATEGORIES.. USE IN CASE OF RESTART OF ANALYZE CCOUNT ; RECOUNT THE CATEGORIES.. USE IN CASE OF RESTART OF ANALYZE
; ;
I '$D(RIMBASE) D ASETUP ; FOR COMMAND LINE CALLS I '$D(RIMBASE) D ASETUP ; FOR COMMAND LINE CALLS