added checksum processing

This commit is contained in:
george 2009-03-24 23:53:12 +00:00
parent 2dccdced72
commit 2bf3550f5d
1 changed files with 32 additions and 2 deletions

View File

@ -85,8 +85,8 @@ PUTELS(DFN,ZTYPE,ZOCC,ZVALS) ; PUT CCR VALUES INTO THE CCR ELEMENTS FILE
; @ZVALS@("VAR1")="VALUE1" FOR ALL VARIABLES IN THIS ELEMENT
; AND @ZVALS@("M",SUBOCCUR,"VAR2")="VALUE2" FOR SUB VARIABLES
;
N ZSRC,PATN,ZTYPN,XD0,ZTYP
S ZSRC=1 ; CCR SOURCE IS ASSUMED TO BE THIS EHR, WHICH IS ALWAYS SOURCE 1
N PATN,ZTYPN,XD0,ZTYP
I '$D(ZSRC) S ZSRC=1 ; CCR SOURCE IS ASSUMED, 1 IF NOT SET
; PUT THIS IN PARAMETERS - SO SOURCE NUMBER FOR PROCESSING IN CONFIGURABLE
N C0CFPAT S C0CFPAT=171.101 ; FILE AT PATIENT LEVEL
N C0CFSRC S C0CFSRC=171.111 ; FILE AT CCR SOURCE LVL
@ -154,6 +154,36 @@ UPDIE ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
K C0CFDA
Q
;
CHECK ; CHECKSUM EXPERIMENTS
;
;B
S ZG=$NA(^C0CE(DA(2),1,DA(1),1,DA))
;S G2=$NA(^C0CE(8,1,1,1,2,1,6))
S X=$$CHKSUM^XUSESIG1(ZG)
W G1,!
Q
;
CHKELS(DFN) ; CHECKSUM ALL ELEMENTS FOR A PATIENT
;
S ZGLB=$NA(^TMP("C0CCHK"))
S ZPAT=$O(^C0CE("B",DFN,""))
K @ZGLB@(ZPAT) ; CLEAR PREVIOUS CHECKSUMS
S ZSRC=""
F S ZSRC=$O(^C0CE(ZPAT,1,"B",ZSRC)) Q:ZSRC="" D ;
. W "PAT:",ZPAT," SRC:",ZSRC,!
. S ZEL=""
. F S ZEL=$O(^C0CE(ZPAT,1,ZSRC,1,"B",ZEL)) Q:ZEL="" D ;ELEMENTS
. . W "ELEMENT:",ZEL," "
. . S ZELE=$$GET1^DIQ(170.101,ZEL,.01,"E") ;ELEMENT NAME
. . W ZELE," "
. . S ZELI=$O(^C0CE(ZPAT,1,ZSRC,1,"B",ZEL,""))
. . S ZG=$NA(^C0CE(ZPAT,1,ZSRC,1,ZELI))
. . S ZCHK=$$CHKSUM^XUSESIG1(ZG) ; CHECKSUM FOR THE ELEMENT
. . W ZCHK,!
. . S @ZGLB@(ZPAT,ZELE,ZSRC)=ZCHK
ZWR ^TMP("C0CCHK",ZPAT,*)
Q
;
PUTELSOLD(DFN,ZTYPE,ZOCC,ZVALS) ; PUT CCR VALUES INTO THE CCR ELEMENTS FILE
; 171.101, ^C0CE DFN IS THE PATIENT IEN PASSED BY VALUE
; ZTYPE IS THE NODE TYPE IE RESULTS,PROBLEMS PASSED BY VALUE