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

IVMPINS.m

Go to the documentation of this file.
  1. IVMPINS ;ALB/CPM,PHH - INSURANCE EVENT DRIVER INTERFACE ; 01-MAY-94
  1. ;;2.0;INCOME VERIFICATION MATCH;**9,94**; 21-OCT-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. EN ; Queue transmission if an IVM patient's insurance status changes.
  1. ; Input: DFN -- Pointer to the patient in file #2
  1. ;
  1. N EVENTS
  1. S EVENTS("IVM")=1
  1. ;
  1. I '$G(DFN) G ENQ
  1. ;
  1. ; - quit if invoked by the IVM insurance upload process
  1. I $G(IVMINSUP) G ENQ
  1. ;
  1. ; - quit if the patient is not Cat C or Cat A
  1. S IVMMT=$$LST^DGMTU(DFN)
  1. I $P(IVMMT,"^",4)'="A",$P(IVMMT,"^",4)'="C" G ENQ
  1. ;
  1. ; - find the latest IVM case record, if it exists
  1. S (IVMDA,IVMDT,X)=0
  1. F S X=$O(^IVM(301.5,"APT",DFN,X)) Q:'X S IVMDT=X
  1. I IVMDT S IVMDA=+$O(^IVM(301.5,"APT",DFN,IVMDT,0))
  1. S IVMNEW='IVMDA
  1. ;
  1. ; - determine changes in insurance status
  1. S IVMINSP=$$PRIOR(IVMDA)
  1. S IVMINSA=$$INSUR^IBBAPI(DFN)
  1. ;
  1. ; - queue transmission if status has changed
  1. I IVMDA,(IVMINSP&'IVMINSA)!('IVMINSP&IVMINSA=1) I $$SETSTAT^IVMPLOG(IVMDA,.EVENTS)
  1. ;
  1. ; - queue transmission if Cat C pt w/o a case record has no insurance
  1. I 'IVMDA,'IVMINSA,$P(IVMMT,"^",4)="C" S IVMDT=$$LYR^DGMTSCU1(+$P(IVMMT,"^",2)) I $$LOG^IVMPLOG(DFN,IVMDT,.EVENTS)
  1. ;
  1. ENQ K IVMDA,IVMDT,IVMINSA,IVMINSP,IVMMT,IVMNEW,X
  1. Q
  1. ;
  1. ;
  1. PRIOR(DA) ; Find insurance status from last transmission
  1. ; Input: DA -- Pointer to the case record in file #301.5
  1. ; Output: 0 -- No active insurance at last transmission
  1. ; (or could not identify last transmission)
  1. ; 1 -- Had active insurance at last transmission
  1. ;
  1. N X,Y S (X,Y)=0
  1. I $G(DA) F S Y=$O(^IVM(301.6,"B",DA,Y)) Q:'Y S X=Y
  1. Q $S(X:+$P($G(^IVM(301.6,X,1)),"^",2),1:0)