Posted: Tue Feb 08, 2011 1:05 pm Post subject: Convert 837 Health care claims to single record
Hi All,
I am planning to convert the 837 Health Care Claims (professional and institutional ) file's into single record fixed field file in mainframe. Both these files have a 227 segments for each claim and the total record length is more than 800K bytes. Can you please let me know if any one is converting this file to flat file in Mainframe.
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Tue Feb 08, 2011 1:14 pm Post subject:
chandra,
With limited knowledge about 837 Health Care Claims, I can say it is possible to club all the records using WHEN=GROUP, however you need to provide more details.
We are planing to spilt this text file into different segments as shown below. The segment can be identified as follows
1) Each segment start with segment id (two or three charecter id)
2) Each field is separated by *
3) End of segment is marked with "~"
4) subfields are separated by ":"
5) Each claim start with ST segment and ends with SE segment
6) ISA and GS are header
7) GE and IEA are trailer
Then FTP into Mainframe and write a COBOL program to convert this multisegment per contract/policy into single record as follows. The following code shows only the simple code, it doesn't account for multiple occurance of each segment with in a segment.
Code:
PERFORM 100-READ-ALL-SEGMENT THRU
UNTIL SE-SEG-FOUND OR NO-MORE-LTC-RECORDS.
2100-READ-ALL-SEGMENT.
READ LTC-FILE
*---------------------------------- assuming maximum 40 fields are there in each segment
UNSTRING INP-RECORD DELIMITED BY '*' OR '~' OR ':'
INTO WS-TRLR
WS-FIELD-1 WS-FIELD-2 WS-FIELD-3 WS-FIELD-4 WS-FIELD-5
.
.
.
WS-FIELD-36 WS-FIELD-37 WS-FIELD-38 WS-FIELD-39 WS-FIELD-40.
PERFORM 200-EVALUATE-SEGMENTS.
200-EVALUATE-SEGMENTS.
EVALUATE WS-TRLR
WHEN 'ST '
PERFORM 300-MOVE-ST-SEGMENT
WHEN 'BHT'
PERFORM 310-MOVE-BHT-SEGMENT
WHEN 'REF'
PERFORM 320-MOVE-REF-SEGMENT
.
.
.
.
WHEN 'SE '
PERFORM 399-MOVE-SE-SEGMENT
WRITE OUT-RECORD
END-EVALUATE.
300-MOVE-ST-SEGMENT.
*
MOVE WS-FIELD-1 TO ST-TRX-SET-ID-CD.
MOVE WS-FIELD-2 TO ST-TRX-SET-CNTR-NBR.
310-MOVE-BHT-SEGMENT.
MOVE WS-FIELD-1 TO BHT-HRCH-STRC-CD.
MOVE WS-FIELD-2 TO BHT-TRX-SET-PURP-CD.
MOVE WS-FIELD-3 TO BHT-REF-ID.
MOVE WS-FIELD-4 TO BHT-PRV-SUB-DT.
MOVE WS-FIELD-5 TO BHT-PRV-SUB-TIME.
MOVE WS-FIELD-6 TO BHT-TRX-TYP-CD.
.
.
.
.
.
399-MOVE-SE-SEGMENT.
MOVE WS-FIELD-1 TO SE-NBR-INC-SEG.
MOVE WS-FIELD-2 TO SE-TRX-CNTR-NBR.
Superk -
Thanks for the reply. Is this ANSI X.12 tool is mainframe tool or windows tool ? Is this free tool for 837 file mapping ?
If any one have any better idea please let me know.
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Tue Feb 08, 2011 6:34 pm Post subject:
chandra,
It is quite easy to parse such input and split the records. With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to easily create larger records from smaller records, or smaller records from larger records.
Here I showed a max of 10 parsed fields each with a length of 200 bytes , you can expand that upto 100 parsed fields.
If there are rather few records, REXX might be ok. If the data is high volume, REXX is not a good choice. . .
COBOL code should dramatically use less system resources than REXX. Once implemented, the COBOL code will be more easily understood by more of the developers (even now most application developers do not write REXX). _________________ All the best,
Can you post the expected output you are trying to get from this?
I am assuming that you need ST to SE segments without the delimeters. Following COBOL logic should work. You may get something nicer using Sort or SAS.
Code:
05 ws-for-process-switch pic X(1).
88 Process-Segments value 'Y'.
if (in-rec(1:2) = 'ST')
set Process-Segments to true
end-f
if (Process-Segments)
perform varying (in-col from 1 by 1) until (in-rec(in-col:1) = '~')
if (in-rec(in-col:1) = '*', ':')
continue
else
add 1 to out-col
move in-rec (in-col:1) to out-rec (out-col:1)
end-if
end-perform
end-if
if (in-rec(1:2) = 'SE')
write out-rec
perform Initialize-Para
end-if
In our shop they don't allow REXX to use for this type of work.
Diba -
According to your solution all the segments and their fields will be appended one after the other but I want each segment and their fields should come in fixed position.
For example I am showing you the BHT segment and their fields
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum