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

ABSPOSHR.m

Go to the documentation of this file.
  1. ABSPOSHR ; IHS/SD/lwj - 3.2 to 5.1 clm reversal format ; [ 10/24/2002 8:18 AM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
  1. ;
  1. ;-------------------------------------------------------
  1. ; IHS/SD/lwj 10/22/02 NCPDP 5.1 changes
  1. ; We ran into a big snag - some processors are doing an all or nothing
  1. ; switch to 5.1 with no grace period for 3.2 and 5.1 claims. What this
  1. ; means is that we have to be able to reverse a previously submitted
  1. ; 3.2 claim in 5.1 reversal format since they won't accept 3.2 any
  1. ; more. The biggest problem with this is that 3.2 and 5.1 fields
  1. ; are formatted differently, and the reversal process was used to
  1. ; simply copy the information from the original claim into the
  1. ; reversal claim. To get around this, this routine was created
  1. ; to try and reformat those fields that require the 5.1 format to
  1. ; reverse properly.
  1. ;
  1. ; This routine should only be called from within the ABSPECA8 - it
  1. ; is dependent on variables set there.
  1. ;
  1. ; Basic logic:
  1. ; Read the format for the designated segment
  1. ; Read through the fields on the segment (no xref - very few fields)
  1. ; Determine if there are "special" values for the field
  1. ; Format the field with the proper value
  1. ; Set the TMP field to the formatted value
  1. ;
  1. Q
  1. ;
  1. REFORM(ABSPFORM) ;EP main driver of problem and entry point - everything
  1. ; should call through to here
  1. ;
  1. N ABSP
  1. ;
  1. D REFRMH(ABSPFORM)
  1. D REFRMD(ABSPFORM)
  1. ;
  1. Q
  1. REFRMH(ABSPFORM) ;
  1. ; This routine will only attempt to reset the "header" fields that need
  1. ; adjusting for 5.1. There are four fields in the header segment that
  1. ; need to be reformatted - we will leave the others since they may have
  1. ; gone through extensive formatting for the original claim and are fine
  1. ; the way they are. These four fields were either new to the reversal
  1. ; in 5.1, or changed value/length in 5.1. The fields are:
  1. ; 109 Transaction Count (not on 3.2 reversal)
  1. ; 110 Software Vendor/Certificationd ID (new field to 5.1)
  1. ; 201 Service Provider ID (changed length in 5.1)
  1. ; 202 Service Provider ID Qualifier (new to 5.1)
  1. ;
  1. ; Remember - the header is stagnate - that's the only reason we look
  1. ; specifically for those two fields.
  1. ;
  1. ; IEN and TMP are set in ABSPECA8
  1. ;
  1. ; The header segment is small, and there isn't a xref by field #, so we
  1. ; will read the entire segment here.
  1. ;
  1. N FLDIEN,PMODE,ORDER,RECMIEN,FIELD
  1. ;
  1. S ORDER=0
  1. F S ORDER=$O(^ABSPF(9002313.92,ABSPFORM,100,"B",ORDER)) Q:'ORDER D
  1. . S RECMIEN=$O(^ABSPF(9002313.92,ABSPFORM,100,"B",ORDER,0))
  1. . Q:'RECMIEN
  1. . S FLDIEN=$P($G(^ABSPF(9002313.92,ABSPFORM,100,RECMIEN,0)),U,2)
  1. . S FIELD=$P($G(^ABSPF(9002313.91,FLDIEN,0)),U)
  1. . Q:(FIELD'=110)&(FIELD'=202)&(FIELD'=201)&(FIELD'=109)
  1. . ;
  1. . ; check to see if the format has a "special" value for this field
  1. . S PMODE=$P($G(^ABSPF(9002313.92,ABSPFORM,100,RECMIEN,0)),U,3)
  1. . I PMODE="X" D XSPCCODE^ABSPOSCF(ABSPFORM,100,RECMIEN)
  1. . I PMODE'="X" S ABSP("X")=TMP(9002313.02,IEN,FIELD,"I")
  1. . ;
  1. . D FORMAT
  1. . ;
  1. . S TMP(9002313.02,IEN,FIELD,"I")=ABSP("X")
  1. ;
  1. ;
  1. Q
  1. ;
  1. REFRMD(ABSPFORM) ;
  1. ; This routine is going to try and reformat the "detail" portion of the
  1. ; claim. For now, the only segment we are going to look at is 130
  1. ; which is the claim segment. If other reversal formats become
  1. ; available, and they require other segments - this section will have
  1. ; to change. Since the claim segment full of optional fields, we wil
  1. ; read through the format and take it a field at a time.
  1. ;
  1. ; IEN, RX, and TMP were set in ABSPECA8
  1. ;
  1. ;
  1. N FLDIEN,PMODE,ORDER,RECMIEN,NODE,IDIEN,DOFORM,FIELD
  1. S NODE=130
  1. ;
  1. S ORDER=0
  1. F S ORDER=$O(^ABSPF(9002313.92,ABSPFORM,NODE,"B",ORDER)) Q:'ORDER D
  1. . S RECMIEN=$O(^ABSPF(9002313.92,ABSPFORM,NODE,"B",ORDER,0))
  1. . Q:'RECMIEN
  1. . S FLDIEN=$P($G(^ABSPF(9002313.92,ABSPFORM,NODE,RECMIEN,0)),U,2)
  1. . S FIELD=$P($G(^ABSPF(9002313.91,FLDIEN,0)),U)
  1. . Q:FIELD=111 ;(SEGMENT IDENTIFIER - SKIP)
  1. . ;
  1. . ; check to see if the format has a "special" value for this field
  1. . S PMODE=$P($G(^ABSPF(9002313.92,ABSPFORM,NODE,RECMIEN,0)),U,3)
  1. . I PMODE="X" D XSPCCODE^ABSPOSCF(ABSPFORM,NODE,RECMIEN)
  1. . ;
  1. . ; if this isn't a special value field in 5.1, we need to make sure
  1. . ; it wasn't an optional field in 3.2. If it was, the field ID is
  1. . ; already a part of the field, and we don't need to reformat it
  1. . ;
  1. . S DOFORM=1
  1. . I PMODE'="X" D
  1. .. S:$P($G(^ABSPF(9002313.91,FLDIEN,0)),U,2)'="" DOFORM=0
  1. .. S:DOFORM ABSP("X")=TMP(9002313.0201,RX,FIELD,"I")
  1. . ;
  1. . ; format it only if it needs it
  1. . ;
  1. . I DOFORM D
  1. .. D FORMAT
  1. .. S TMP(9002313.0201,RX,FIELD,"I")=ABSP("X")
  1. ;
  1. ;
  1. Q
  1. ;
  1. FORMAT ; This routine will format the field to 5.1 standards - remember it
  1. ; will set ABSP("X") based on what is in the ABSP NCPDP Field Defs file
  1. ;
  1. N INDEX,MCODE,NODE
  1. S NODE=25 ;we only want the 5.1 format code
  1. ;
  1. S INDEX=0
  1. F D Q:'+INDEX
  1. . S INDEX=$O(^ABSPF(9002313.91,FLDIEN,NODE,INDEX))
  1. . Q:'+INDEX
  1. . S MCODE=$G(^ABSPF(9002313.91,FLDIEN,NODE,INDEX,0))
  1. . Q:MCODE=""
  1. . Q:$E(MCODE,1)=";"
  1. . X MCODE
  1. ;
  1. ;
  1. Q