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

IBCNSC0.m

Go to the documentation of this file.
  1. IBCNSC0 ;ALB/NLR - INSURANCE COMPANY EDIT - ; 12-MAR-1993
  1. ;;2.0;INTEGRATED BILLING;**371,547,592,702**;21-MAR-94;Build 53
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. CLAIMS1 ; display Inpatient Claims information
  1. N OFFSET,START,IBCNS12,IBADD
  1. ;WCJ;IB*2.0*547
  1. ;S START=27,OFFSET=2
  1. S START=28+(2*$G(IBACMAX)),OFFSET=2
  1. CLMS1AD ; KDM US2487 IB*2.0*592 call in tag from IBCNSI
  1. D SET^IBCNSP(START,OFFSET+20," Inpatient Claims Office Information ",IORVON,IORVOFF)
  1. ;
  1. ;WCJ;IB*2.0*547;Call New API
  1. ;S IBCNS12=$$ADDRESS(IBCNS,.12,5)
  1. S IBCNS12=$$ADD2(IBCNS,.12,5)
  1. ;
  1. D SET^IBCNSP(START+1,OFFSET," Company Name: "_$P($G(^DIC(36,+$P(IBCNS12,"^",7),0)),"^",1))
  1. D SET^IBCNSP(START+2,OFFSET," Street: "_$P(IBCNS12,"^",1))
  1. D SET^IBCNSP(START+3,OFFSET," Street 2: "_$P(IBCNS12,"^",2))
  1. N OFFSET S OFFSET=45
  1. D SET^IBCNSP(START+1,OFFSET," Street 3: "_$P(IBCNS12,"^",3)) S IBADD=1
  1. D SET^IBCNSP(START+1+IBADD,OFFSET," City/State: "_$E($P(IBCNS12,"^",4),1,15)_$S($P(IBCNS12,"^",4)="":"",1:", ")_$P($G(^DIC(5,+$P(IBCNS12,"^",5),0)),"^",2)_" "_$E($P(IBCNS12,"^",6),1,5))
  1. D SET^IBCNSP(START+2+IBADD,OFFSET," Phone: "_$P(IBCNS12,"^",8))
  1. D SET^IBCNSP(START+3+IBADD,OFFSET," Fax: "_$P(IBCNS12,"^",9))
  1. Q
  1. ;
  1. R1Q Q
  1. CLAIMS2 ; display Outpatient Claims information
  1. ;
  1. N OFFSET,START,IBCNS16,IBADD
  1. ;WCJ;IB*2.0*547
  1. ;S START=34,OFFSET=2
  1. S START=35+(2*$G(IBACMAX)),OFFSET=2
  1. CLMS2AD ; KDM US2487 IB*2.0*592 call in tag from IBCNSI
  1. D SET^IBCNSP(START,OFFSET+20," Outpatient Claims Office Information ",IORVON,IORVOFF)
  1. ;
  1. ;WCJ;IB*2.0*547;Call New API
  1. ;S IBCNS16=$$ADDRESS(IBCNS,.16,6)
  1. S IBCNS16=$$ADD2(IBCNS,.16,6)
  1. ;
  1. D SET^IBCNSP(START+1,OFFSET," Company Name: "_$P($G(^DIC(36,+$P(IBCNS16,"^",7),0)),"^",1))
  1. D SET^IBCNSP(START+2,OFFSET," Street: "_$P(IBCNS16,"^",1))
  1. D SET^IBCNSP(START+3,OFFSET," Street 2: "_$P(IBCNS16,"^",2))
  1. N OFFSET S OFFSET=45
  1. D SET^IBCNSP(START+1,OFFSET," Street 3: "_$P(IBCNS16,"^",3)) S IBADD=1
  1. D SET^IBCNSP(START+1+IBADD,OFFSET," City/State: "_$E($P(IBCNS16,"^",4),1,15)_$S($P(IBCNS16,"^",4)="":"",1:", ")_$P($G(^DIC(5,+$P(IBCNS16,"^",5),0)),"^",2)_" "_$E($P(IBCNS16,"^",6),1,5))
  1. D SET^IBCNSP(START+2+IBADD,OFFSET," Phone: "_$P(IBCNS16,"^",8))
  1. D SET^IBCNSP(START+3+IBADD,OFFSET," Fax: "_$P(IBCNS16,"^",9))
  1. Q
  1. ;
  1. ; Only adding comments on patch 547. Changes are on the ADD2 tag below.
  1. ; This tag is called from the Output formatter.
  1. ; It returns a "complete" address
  1. ; It judges an address complete if it has a state (don't ask why, I am just adding the comments)
  1. ; If the address it wants is not complete, it returns the main address.
  1. ; These addresses go out on claims and claims (X12 837) don't like partial addresses.
  1. ADDRESS(INS,NODE,PH) ; -- generic find address
  1. ;
  1. N IBX,INSSAVE,IBPH,IBFX,IBCNT,IBA
  1. S IBX="" ;S IBPH="",IBFX="",IBA=""
  1. ;
  1. REDO ; gather insurance carrier's main address information
  1. S IBX=$G(^DIC(36,+INS,.11)),IBPH=$P($G(^DIC(36,+INS,.13)),"^",1),IBFX=$P(IBX,"^",9)
  1. ;S IBCNT=$G(IBCNT)+1
  1. ;
  1. ; -- if process the same co. more than once you are in an infinite loop
  1. ;I $D(IBCNT(IBCNS)) G ADDREQ
  1. ;S IBCNT(IBCNS)=""
  1. ;
  1. ; -- gather address information from specific office (Claims, Appeals, Inquiry, Dental)
  1. ;JWS;IB*2.0*592;Changed below for DENTAL insurance mailing address
  1. ;IA #5292
  1. I $P($G(^DIC(36,+INS,+NODE)),"^",5) D
  1. . S IBX=$G(^DIC(36,+INS,+NODE))
  1. . I +NODE=.19 S IBPH=$P(IBX,"^",PH)
  1. . E S IBPH=$P($G(^DIC(36,+INS,.13)),"^",PH)
  1. . S IBFX=$P($G(IBX),"^",9)
  1. I $P($G(^DIC(36,+INS,+NODE)),"^",7) S INSSAVE=INS,INS=$P($G(^DIC(36,+INS,+NODE)),"^",7) I INSSAVE'=INS G REDO
  1. ;
  1. ADDRESQ ; concatenate company name, address, phone and fax
  1. S $P(IBA,"^",1,6)=$P($G(IBX),"^",1,6)
  1. S $P(IBA,"^",7)=INS
  1. S $P(IBA,"^",8)=IBPH
  1. S $P(IBA,"^",9)=IBFX
  1. ADDREQ Q IBA
  1. ;
  1. ; WCJ;IB*2.0*547;
  1. ; This is a new tag which is just called from the insurance company editor screens.
  1. ; The billers/insurance verifiers want to see what data is actually in the insurance company file.
  1. ; They don't care if it's complete. Heck, a phone number may be enough.
  1. ; This will just return what is in the file for the ins company that handles that type of claims.
  1. ; Input: INS - IREN to file 36
  1. ; NODE - Node in File 36 (corresponds to Claims, Appeals, Inquiry...)
  1. ; PH - Location of Phone number in node .13
  1. ADD2(INS,NODE,PH) ;
  1. N IBX,INSSAVE,IBFX,IBPH,IBA
  1. F S IBX=$G(^DIC(36,+INS,+NODE)) Q:'$P(IBX,U,7) S INSSAVE=INS,INS=$P(IBX,U,7) Q:INSSAVE=INS
  1. ; concatenate company name, address, phone and fax
  1. S IBPH=$P($G(^DIC(36,+INS,.13)),U,PH),IBFX=$P(IBX,U,9)
  1. ;JWS;IB*2.0*592;Dental mailing address
  1. ;IA# 5292
  1. I +NODE=.19 S IBPH=$P($G(^DIC(36,+INS,.19)),U,11)
  1. S $P(IBA,U,1,6)=$P(IBX,U,1,6),$P(IBA,U,7)=INS,$P(IBA,U,8)=IBPH,$P(IBA,U,9)=IBFX
  1. Q IBA
  1. ;
  1. ;IB*2.0*702/ckb - the following code is called by the Input Template, IBEDIT
  1. ; INS CO1. It will prompt for 3 Filing Time Frame (FTF) fields that are stored
  1. ; in File #36. The fields are .12 FILING TIME FRAME, .18 STANDARD FTF and
  1. ; .19 STANDARD FTF VALUE
  1. ;
  1. FTF(IBIEN,IBEXIT) ; Edit Filing Time Frame fields
  1. ; Input: IBIEN - IEN of the entry being checked
  1. ; IBEXIT - 0 default value from input template
  1. ; Returns: 1 - if user entered '^' to exit for any of the FTF fields
  1. N DELETE,DIC,DIR,DIRUT,IB12,IB12PRE,IB18,IB18PE,IB18PRE,IB19,IB19PRE
  1. N IBFLG12,IBFLG18,IBFLG19,IBGARR,IBGCT,IBIENS,IBSKIP,U,X,Y
  1. ;
  1. S IBIENS=IBIEN_","
  1. ;
  1. ; Capture the value of the FTF fields before any edits
  1. S IB18PE=$$GET1^DIQ(36,IBIENS,.18),IB18PRE=$$GET1^DIQ(36,IBIENS,.18,"I")
  1. S IB19PRE=$$GET1^DIQ(36,IBIENS,.19)
  1. S IB12PRE=$$GET1^DIQ(36,IBIENS,.12)
  1. ;
  1. S (IBFLG18,IBFLG19,IBFLG12,IBSKIP)=0
  1. S (IB18,IB19,IB12)=""
  1. ;
  1. ;Prompt for field .18
  1. D PFLD18
  1. I X="^" S IBEXIT=1 G CHECK
  1. ; If field .18 was deleted or has no value (IBSKIP=1),
  1. ; DO NOT prompt for field .19, go to prompt for field .12
  1. I IBSKIP=1 G P12
  1. ;
  1. ;Prompt for field .19
  1. D PFLD19
  1. I X="^" S IBEXIT=1 G CHECK
  1. ;
  1. P12 ;Prompt for field .12
  1. D PFLD12
  1. I X="^" S IBEXIT=1 G CHECK
  1. ;
  1. CHECK ;
  1. ; If NONE of the 3 fields were updated, quit
  1. I 'IBFLG12&'IBFLG18&'IBFLG19 G QUIT
  1. ;
  1. ; Add updated FTF fields to Insurance Co in File #36
  1. D UPDINS
  1. ; Get count of all Active group plans, if none were found quit
  1. D GETGRP
  1. I IBGCT=0 G QUIT ; in no active grps don't continue with 'Are you sure' prompts
  1. ;
  1. ;Ask user if they want to change the FTF fields for all ACTIVE group plans
  1. ; default is NO
  1. W !
  1. K DIR,DIRUT,X,Y
  1. S DIR(0)="Y"
  1. S DIR("A",1)="Do you want to change the Filing Time Frame for all"
  1. S DIR("A")="ACTIVE group plans ("_IBGCT_" Groups)"
  1. S DIR("B")="NO"
  1. S DIR("?",1)="Answering YES will change the Filing Time Frame for all ACTIVE"
  1. S DIR("?",2)="group plans for this insurance company. This does not affect"
  1. S DIR("?",3)="individual plans. Inaccurate Filing Time Frames can negatively"
  1. S DIR("?",4)="impact billing. Answering NO will not affect the current values"
  1. S DIR("?")="of the Filing Time Frame for any group plans."
  1. D ^DIR
  1. I X="^" S IBEXIT=1 G QUIT
  1. I $D(DIRUT)!(Y=0) G QUIT
  1. ;
  1. ;If YES above, display values of FTF fields and prompt "Are you sure....?"
  1. ; default is NO
  1. W !!,"The Filing Time Frame for all ACTIVE group plans will be changed to:"
  1. W !," STANDARD FILING TIME FRAME: ",$S(IB18="@":"<deleted>",1:$$GET1^DIQ(36,IBIENS,.18))
  1. W !,"STANDARD FILING TIME FRAME VALUE: ",$S(IB19="@":"<deleted>",1:$$GET1^DIQ(36,IBIENS,.19))
  1. W !," FILING TIME FRAME: ",$S(IB12="@":"<deleted>",1:$$GET1^DIQ(36,IBIENS,.12))
  1. W !
  1. K DIR,DIRUT,X,Y
  1. S DIR(0)="Y"
  1. S DIR("A",1)="Are you sure you would like to change the Filing Time"
  1. S DIR("A")="Frame for all ACTIVE group plans"
  1. S DIR("B")="NO"
  1. S DIR("?",1)="Answering YES will change the Filing Time Frame for all ACTIVE"
  1. S DIR("?",2)="group plans for this insurance company. This does not affect"
  1. S DIR("?",3)="individual plans. Inaccurate Filing Time Frames can negatively"
  1. S DIR("?",4)="impact billing. Answering NO will not affect the current values"
  1. S DIR("?")="of the Filing Time Frame for any group plans."
  1. D ^DIR
  1. I X="^" S IBEXIT=1 G QUIT
  1. I $D(DIRUT)!(Y=0) G QUIT
  1. ;
  1. ;Update all ACTIVE group plans
  1. D UPDGRP
  1. W !
  1. ;
  1. QUIT ;
  1. Q IBEXIT
  1. ;
  1. ;
  1. UPDINS ; Update Insurance Co FTF fields (added with IB*702)
  1. N INSERR,INSUPD
  1. S INSUPD(36,IBIENS,.18)=IB18 ; STANDARD FTF
  1. S INSUPD(36,IBIENS,.19)=IB19 ; STANDARD FTF VALUE
  1. S INSUPD(36,IBIENS,.12)=IB12 ; FILING TIME FRAME
  1. D FILE^DIE("I","INSUPD","INSERR") ; currently not evaluating INSERR
  1. Q
  1. ;
  1. GETGRP ; Get count of all Active group plans (added with IB*702)
  1. N IBAGP,IBGIEN,IBGIENS,IBINACT
  1. S IBGCT=0
  1. S IBGIEN=0 F S IBGIEN=$O(^IBA(355.3,"B",IBIEN,IBGIEN)) Q:('IBGIEN)!(IBGIEN="") D
  1. . S IBGIENS=IBGIEN_","
  1. . S IBINACT=$$GET1^DIQ(355.3,IBGIENS,.11,"I") ;INACTIVE
  1. . I IBINACT Q ; The Plan is Inactive
  1. . S IBAGP=$$GET1^DIQ(355.3,IBGIENS,.02,"I") ;IS THIS A GROUP POLICY?
  1. . I IBAGP=0 Q ; Not a Group Plan (skips individual plans)
  1. . S IBGCT=IBGCT+1
  1. . S IBGARR(IBGIEN)=""
  1. Q
  1. ;
  1. UPDGRP ; Update all Active group plans with ALL Insurance Co FTF fields (added with IB*702)
  1. N GRPERR,GRPUPD,IBG
  1. S IBG=0 F S IBG=$O(IBGARR(IBG)) Q:'IBG D
  1. . S GRPUPD(355.3,IBG_",",.16)=IB18 ;PLAN STANDARD FTF
  1. . S GRPUPD(355.3,IBG_",",.17)=IB19 ;PLAN STANDARD FTF VALUE
  1. . S GRPUPD(355.3,IBG_",",.13)=IB12 ;PLAN FILING TIME FRAME
  1. . D FILE^DIE("I","GRPUPD","GRPERR") ; currently not evaluating GRPERR
  1. Q
  1. ;
  1. PFLD18 ; Prompt for field .18 STANDARD FTF (added with IB*702)
  1. K DIR,X,Y
  1. S DELETE=""
  1. S DIR(0)="PO^355.13:AEMQ"
  1. S DIR("A")="STANDARD FILING TIME FRAME"
  1. S DIR("B")=IB18PE
  1. ;The user should not be presented with the 'replace'..'with' when the filing time
  1. ; frame "external" value stored is greater than 19
  1. I $L(IB18PE)>19 D
  1. . S DIR("A",1)="STANDARD FILING TIME FRAME: "_IB18PE
  1. . S DIR("A")=" "
  1. . S DIR("B")=""
  1. D ^DIR I X="^" Q
  1. S IB18=X I +Y>0 S IB18=+Y
  1. ;
  1. ;If the user didn't change the default value (they hit enter), no change was
  1. ; made. If IB18=7 or IB18=8 DO NOT prompt for field .19 (IBSKIP)
  1. I IB18="",IB18PRE'="" S:(IB18PRE=7)!(IB18PRE=8) IBSKIP=1 Q
  1. I IB18=IB18PRE S:(IB18=7)!(IB18=8) IBSKIP=1 Q
  1. D EVFLD18
  1. Q
  1. ;
  1. EVFLD18 ;Evaluate field .18. Determine if field .18 should be updated (IBFLG18=1) and
  1. ; if the user should be prompted to enter STANDARD FTF VALUE field .19
  1. ;
  1. ;If user deletes field .18, field .19 will also be deleted.
  1. ; DO NOT prompt for .19 (IBSKIP=1). Both fields have been updated (IBFLG18,IBFLG19)
  1. I IB18="@" D I 'DELETE W " <NOTHING DELETED>" G PFLD18
  1. . S DELETE=$$DELETE()
  1. . I DELETE D
  1. . . S (IBSKIP,IBFLG18)=1
  1. ;If the user DID NOT enter 7-END OF FOLLOWING YEAR or 8-NO FILING TIME FRAME, update field .18
  1. ; (IBFLG18=1) and prompt user for field .19
  1. I IB18'=7,IB18'=8 S IBFLG18=1
  1. ;If the user entered 7-END OF FOLLOWING YEAR and 8-NO FILING TIME FRAME, update field .18 (IBFLG18).
  1. ; DO NOT prompt user for field .19 (IBSKIP=1). If there is data in field .19 delete it and
  1. ; update field .19 (IBFLG19)
  1. I (IB18=7)!(IB18=8) S IBSKIP=1,IBFLG18=1
  1. ;If field .18 is changed/deleted, delete field .19
  1. I IBFLG18 I IB19PRE'="" S IB19PRE="",IB19="@",IBFLG19=1
  1. Q
  1. ;
  1. PFLD19 ; Prompt for field .19 STANDARD FTF VALUE (added with IB*702)
  1. K DIR,DIRUT,X,Y
  1. S DELETE=""
  1. S DIR(0)="NAO^0:999999:1"
  1. S DIR("A")="STANDARD FILING TIME FRAME VALUE: "
  1. ;Only display the default if there was an existing value for field .19
  1. I IB19PRE'="" S DIR("B")=IB19PRE
  1. S DIR("?")=" Type a Number between 0 and 999999, 1 Decimal Digit"
  1. D ^DIR I X="^" Q
  1. S IB19=X
  1. ;If user hit enter to accept the default, no change was made, quit
  1. I IB19=IB19PRE Q
  1. ;If user entered '@', ask "Are you sure?", if 'NO' Prompt user again
  1. I IB19="@" D I 'DELETE W " <NOTHING DELETED>" G PFLD19
  1. . S DELETE=$$DELETE()
  1. . I DELETE S IBFLG19=1
  1. ;User changed the value, set IBFLG19
  1. I IB19PRE'=IB19 S IBFLG19=1
  1. Q
  1. ;
  1. PFLD12 ; Prompt for field .12 FILING TIME FRAME (added with IB*702)
  1. K DIR,DIRUT,X,Y
  1. S DELETE=""
  1. S DIR(0)="FO^3:30"
  1. S DIR("A")="FILING TIME FRAME"
  1. ;Only display the default if there was an existing value for field .12
  1. I IB12PRE'="" S DIR("B")=IB12PRE
  1. S DIR("?",1)=" Enter maximum amount of time from date of service that the insurance"
  1. S DIR("?",2)=" company allows for submitting claims. Answer must be 3-30 characters in"
  1. S DIR("?")=" length."
  1. D ^DIR I X="^" Q
  1. S IB12=X
  1. ;If user hit enter to accept the default, no change was made, quit
  1. I IB12=IB12PRE Q
  1. ;If user entered '@', ask "Are you sure?", if 'NO' Prompt user again
  1. I IB12="@" D I 'DELETE W " <NOTHING DELETED>" G PFLD12
  1. . S DELETE=$$DELETE()
  1. . I DELETE S IBFLG12=1
  1. ;User changed the value, set IBFLG12
  1. I IB12PRE'=IB12 S IBFLG12=1
  1. Q
  1. ;
  1. DELETE() ; Confirm Deletion (added with IB*702)
  1. ; Returns: 1 - YES
  1. ; 0 - NO or user entered "^"
  1. K DIR,DIRUT,X,Y
  1. S DIR(0)="Y"
  1. S DIR("A")=" SURE YOU WANT TO DELETE"
  1. S DIR("B")="Yes"
  1. D ^DIR
  1. I $D(DIRUT) Q 0
  1. Q Y