Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ABSPOSH5

ABSPOSH5.m

Go to the documentation of this file.
  1. ABSPOSH5 ; IHS/SD/lwj - Post 5.1 Claim Response ;8/7/02 [ 09/04/2002 12:57 PM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
  1. ;----------------------------------------------------------------------
  1. ;----------------------------------------------------------------------
  1. ;File FDATA() Array Data in Claim Response File (9002313.03)
  1. ;
  1. ;Parameters: RESPIEN - Claim Response Record IEN (9002313.03)
  1. ;---------------------------------------------------------------------
  1. ; Called from ABSPOSH4 from ABSPECA4 from ABSPOSQL from ABSPOSQ4
  1. ;
  1. ;---------------------------------------------------------------------
  1. ; IHS/SD/lwj 8/7/02 NCPDP 5.1 changes
  1. ; NCPDP 5.1 response segments are completely different from 3.2
  1. ; response segments, and as such many new fields had to be added
  1. ; to ABSPR to store the information coming back. (52 new flds added)
  1. ; (There were several significant differences in the parsing of
  1. ; data from a 3.2 response and a 5.1 response - please refer to
  1. ; ABSPOSH4 for details regarding the parsing.)
  1. ; The purpose of this routine is to load the information from a 5.1
  1. ; response into the ^ABSPR global after the parsing is complete.
  1. ;(please see ABSPECA5 for the storing of information from a 3.2
  1. ; claim into ^ABSPR)
  1. ;
  1. ; Of interest - in 3.2, if the response was for a duplicate, the
  1. ; information for the response was duplicated in the Response subfile,
  1. ; on node 1000, in addition to be stored in node 500 and 504.
  1. ; With 5.1 being so much different, the node 1000 on the subfile
  1. ; will not be populated since the information is stored at all the
  1. ; other nodes.
  1. ;
  1. ; Special Note - The values are hard set into the ABSP response
  1. ; file within this routine and cross references are rebuilt
  1. ; manually. While this is not considered the optimum way of
  1. ; approaching this, it does two things. It works as documentation
  1. ; for what is being set where, and it stays consistent with the
  1. ; original coding of POS (please see the ABSPECA5 routine for
  1. ; loading of values for 3.2 claims).
  1. ;
  1. ; For ALL the repeating fields, we will make a general assumption
  1. ; that the counter field that goes with the repeating field section
  1. ; really does tell us how many occurences of the repeating fields
  1. ; there will be. This counter will be used to loop through the
  1. ; repeating fields.
  1. ;
  1. ;
  1. ;--------------------------------------------------------------------
  1. ;
  1. FILE(RESPIEN) ;EP - from ABSPOSH4
  1. ;
  1. I 'RESPIEN Q:$$IMPOSS^ABSPOSUE("P",,,,,$T(+0))
  1. ;
  1. N MEDN,COUNT,INDEX,RJTN,RJTCOUNT,RJTCODE,NEXT,CLAIMIEN
  1. ;
  1. D CLNDATA^ABSPOSHU ;clean out spaces and zeros
  1. D WRTTMSN ;write the transmission level data
  1. D WRTTRAN ;write the transaction level data
  1. ;
  1. ;
  1. Q
  1. WRTTMSN ; The purpose of this subroutine is to read through the
  1. ; FDATA transmission level fields, and write out the data
  1. ; to the ^ABSPR (ABSP Responses) file.
  1. ;
  1. ; first lets work on what we got from the header segment
  1. S $P(^ABSPR(RESPIEN,100),U,2)=$G(FDATA(102)) ;version/release #
  1. S $P(^ABSPR(RESPIEN,100),U,3)=$G(FDATA(103)) ;transaction code
  1. S $P(^ABSPR(RESPIEN,100),U,9)=$G(FDATA(109)) ;transaction count
  1. S $P(^ABSPR(RESPIEN,500),U,1)=$G(FDATA(501)) ;header response status
  1. S $P(^ABSPR(RESPIEN,200),U,1)=$G(FDATA(201)) ;service provider id
  1. S $P(^ABSPR(RESPIEN,200),U,2)=$G(FDATA(202)) ;service prov id qual
  1. S $P(^ABSPR(RESPIEN,400),U,1)=$G(FDATA(401)) ;date of service
  1. ;
  1. ; now lets look for a message, if there was one
  1. S $P(^ABSPR(RESPIEN,504),U,1)=$G(FDATA(504)) ;message
  1. ;
  1. ; if there was any insurance information passed back - let's record it
  1. S $P(^ABSPR(RESPIEN,300),U,1)=$G(FDATA(301)) ;group ID
  1. S $P(^ABSPR(RESPIEN,500),U,24)=$G(FDATA(524)) ;plan ID
  1. S $P(^ABSPR(RESPIEN,540),U,5)=$G(FDATA(545)) ;network reimbrsmnt id
  1. S $P(^ABSPR(RESPIEN,560),U,8)=$G(FDATA(568)) ;payer ID qualifier
  1. S $P(^ABSPR(RESPIEN,560),U,9)=$G(FDATA(569)) ;payer ID
  1. ;
  1. Q
  1. ;
  1. WRTTRAN ;The purpose of this routine is to write the transaction level
  1. ; information out to the ^ABSPR (ABSP Responses) file.
  1. ; **Special Note - the cross references and header for the subfiles
  1. ; are hard set within this subroutine - this is done to stay
  1. ; consistent with the original POS software (please see ABSPECA5)
  1. ;
  1. ; the logic for setting of COUNT and INDEX was borrowed from
  1. ; ABSPECA5 - INDEX will stay in line with the subfile ien on the
  1. ; claim 400 subfile, COUNT is used to update the subfile header in
  1. ; the response file
  1. ;
  1. N COUNT,INDEX,CLAIMIEN,MEDN
  1. ;
  1. ; claimien was set in ABSPOSQL
  1. S CLAIMIEN=$P($G(^ABSPR(RESPIEN,0)),U,1) ;claim pointer
  1. S INDEX=$S(CLAIMIEN="":0,1:$O(^ABSPC(CLAIMIEN,400,0))-1)
  1. S:INDEX<0 INDEX=0
  1. S COUNT=0
  1. ;
  1. ; now find where we need to start with the transaction data
  1. ; and loop through each one to write out to the response file
  1. S MEDN=""
  1. F D Q:MEDN=""
  1. . S MEDN=$O(FDATA("M",MEDN))
  1. . Q:MEDN=""
  1. . ;
  1. . S COUNT=COUNT+1 ;sub file record count
  1. . S INDEX=INDEX+1 ;sub file index
  1. . ;
  1. . S ^ABSPR(RESPIEN,1000,INDEX,0)=INDEX ;.01 fld Medication order
  1. . ;
  1. . ; let's take it a segment at a time - remember most everything
  1. . ; is optional
  1. . ; (all the below subroutines were originally in ABSPOSH5, but
  1. . ; because of SAC routine size limitations, they were relocated.)
  1. . D RESPSTS^ABSPOSH6 ;status segment
  1. . D RESPCLM^ABSPOSH6 ;claim segment
  1. . D RESPPRC^ABSPOSH7 ;pricing segment
  1. . D RESPDUR^ABSPOSH7 ;DUR segment
  1. . D RESPPA^ABSPOSH7 ;prior authorization segment
  1. . ;
  1. . ; now - lets update the "b" cross reference
  1. . S ^ABSPR(RESPIEN,1000,"B",INDEX,INDEX)=""
  1. ;
  1. ; last step - let's update the 0 node with the last rec and rec cnt
  1. S ^ABSPR(RESPIEN,1000,0)="^9002313.0301A^"_INDEX_"^"_COUNT
  1. ;
  1. Q