source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCEST1.m@ 1464

Last change on this file since 1464 was 623, checked in by George Lilly, 15 years ago

revised back to 6/30/08 version

File size: 1.2 KB
Line 
1IBCEST1 ;ALB/ESG - IB 837 EDI Status Message Processing Cont ;18-JUL-2005
2 ;;2.0;INTEGRATED BILLING;**320**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 Q
6 ;
7CHKSUM(IBARRAY) ; Incoming 277STAT status message checksum calculation
8 ; This function calculates the checksum of the raw 277stat data from
9 ; the data in array IBARRAY. This is done to prevent duplicates.
10 ; Input parameter IBARRAY is the array reference where the data exists
11 ; at @IBARRAY@(n,0) where n is a sequential #
12 ; For file 364.2, IBARRAY = "^IBA(364.2,IBTDA,2)" where IBTDA = the ien
13 ; of the entry in file 364.2 being evaluated
14 ;
15 NEW Y,LN,DATA,IBREC,POS,STSFLG
16 S Y=0,STSFLG=0
17 S LN=0
18 F S LN=$O(@IBARRAY@(LN)) Q:'LN D
19 . S DATA=$$EXT($G(@IBARRAY@(LN,0))) Q:DATA=""
20 . S IBREC=$P(DATA,U,1)
21 . I IBREC="277STAT" S STSFLG=1 Q ; set the STS flag
22 . I IBREC<1 Q ; rec# too low
23 . I IBREC'<99 Q ; rec# too high
24 . F POS=1:1:$L(DATA) S Y=Y+($A(DATA,POS)*POS)
25 . Q
26 ;
27 I 'STSFLG S Y=0 ; if this array is not a 277stat message
28 Q Y
29 ;
30EXT(DATA) ; Extracts from the text in DATA if the text contains
31 ; "##RAW DATA: "
32 Q $S(DATA["##RAW DATA: ":$P(DATA,"##RAW DATA: ",2,99),1:DATA)
33 ;
Note: See TracBrowser for help on using the repository browser.