MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert 837 Health care claims to single record

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Tue Feb 08, 2011 1:05 pm    Post subject: Convert 837 Health care claims to single record Reply with quote

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.

Thanks,
Chandra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Feb 08, 2011 1:14 pm    Post subject: Reply with quote

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.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Feb 08, 2011 3:19 pm    Post subject: Reply with quote

Most people would be using an ANSI x.12 Data Mapping tool to accomplish this task.
Back to top
View user's profile Send private message
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Tue Feb 08, 2011 5:08 pm    Post subject: Reply with quote

Hi Kolusu,

I will try to explain the how the file looks and what I want to do with it.

The file will be recieved in windows server as a single record text file as shown below.

Quote:
ISA*00**00**ZZ*133052274*ZZ*ABCCORP*100923*1331*U*00401*000000043*0*P*:~GS*HC*133052274*ABCCORP*20100923*1331*43*X*004010X096A1~ST*837*000000001~BHT*0019*00*001195*20100923*1331*CH~
.
.
.
.
GE*17*47~IEA*1*000000047~


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


Quote:
ISA*00* *00* *ZZ*133052274 *ZZ*ABC CORP *100923*1331*U*00401*000000043*0*P*:~
GS*HC*133052274*ABCCORP*20100923*1331*43*X*004010X096A1~
ST*837*000000001~
BHT*0019*00*0028F2*20100923*1842*CH~
REF*87*004010X098A1~
.
.
SE*62*000000001~
.
.
.
GE*17*47~
IEA*1*000000047~

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.

Thank you,
Chandra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Feb 08, 2011 6:34 pm    Post subject: Reply with quote

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.

Code:

//STEP0100 EXEC PGM=ICETOOL                       
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN       DD DSN=Your input file,DISP=SHR
//OUT      DD SYSOUT=*                           
//TOOLIN   DD *                                   
  RESIZE FROM(IN) TO(OUT) TOLEN(200) USING(CTL1) 
//CTL1CNTL DD *
  INREC PARSE=(%00=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %01=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %02=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %03=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %04=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %05=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %06=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %07=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %08=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200), 
               %09=(ENDAT=C':~',ENDAT=C':',ENDAT=C'~',FIXLEN=200)),
        BUILD=(%00,%01,%02,%03,%04,%05,%06,%07,%08,%09)     
                                                                   
  OUTFIL OMIT=(1,1,CH,EQ,C' ')                                     
//*


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Tue Feb 08, 2011 7:25 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks for the solution. In our shop we are using synctool and I think in synctool doesnt have a resize option.

I know you don't answer synctool questions anyway thanks for the information.


Regards,
Chandra.
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
moyeenkhan
Beginner


Joined: 04 Dec 2002
Posts: 64
Topics: 21

PostPosted: Wed Feb 16, 2011 11:58 am    Post subject: Reply with quote

You ca do it very easily with REXX
Back to top
View user's profile Send private message Send e-mail
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Wed Feb 16, 2011 1:32 pm    Post subject: Reply with quote

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,

di
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Wed Feb 16, 2011 2:38 pm    Post subject: Reply with quote

Quote:
ISA*00* *00* *ZZ*133052274 *ZZ*ABC CORP *100923*1331*U*00401*000000043*0*P*:~
GS*HC*133052274*ABCCORP*20100923*1331*43*X*004010X096A1~
ST*837*000000001~
BHT*0019*00*0028F2*20100923*1842*CH~
REF*87*004010X098A1~
.
.
SE*62*000000001~
.
.
.
GE*17*47~
IEA*1*000000047~


Chandra,

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'.

  Perform Initalize Para
  Perform Process-Para

Initailize-Para.
  Initialize out-rec, ws-for-process-switch, out-col
  .

Process-Para.

  Perform Until End-Of-File

    read in-file

    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

  end-perform
  .
 

_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Sat Feb 19, 2011 11:40 am    Post subject: Reply with quote

Thanks Moyeenkhan and Diba.

Moyeen Khan -

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

Code:

BHT*0019*00*0028F2*20100923*1842*CH~
BHT*0019**0028F2*20100923*1842*CH~
BHT*0019*00*0028F2**1842*CH~

The values should be written as follows

Code:

BHT 0019 00 0028F2 20100923 1842 CH
BHT 0019    0028F2 20100923 1842 CH
BHT 0019 00 0028F2          1842 CH

_________________
Regards,
Chandra
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group