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

IVMPTRN1.m

Go to the documentation of this file.
  1. IVMPTRN1 ;ALB/MLI - Clock routine for testing only ; 04-MAY-93
  1. ;;2.0;INCOME VERIFICATION MATCH;**9**; 21-OCT-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;
  1. START ; start clock remove after v1
  1. D NOW^%DTC S IVMBEG=%
  1. K %
  1. Q
  1. ;
  1. ;
  1. STOP ; stop clock, mail bulletin remove after v1
  1. N X,Y ; from DTC call
  1. I '$G(IVMGTOT) G STOPQ
  1. D NOW^%DTC S IVMEND=%
  1. S IVMTEXT(1)="The IVM bulk transmission has completed successfully.",IVMTEXT(2)=" "
  1. S IVMTEXT(3)="Start Time: "_IVMBEG
  1. S IVMTEXT(4)="End Time: "_IVMEND
  1. S IVMTEXT(5)="Number of Transmissions: "_IVMGTOT
  1. X ^%ZOSF("UCI")
  1. S XMTEXT="IVMTEXT(",XMSUB="IVM BULK TRANSMISSION HAS COMPLETED"
  1. S XMDUZ=.5,XMY(DUZ)=""
  1. D ^XMD
  1. STOPQ K IVMGBEG,IVMEND,IVMGTOT
  1. K XMTEXT,IVMTEXT,XMSUB,XMDUZ,XMY
  1. Q
  1. ;
  1. ;
  1. DELMT ; send delete mt transaction if pt no longer meets IVM criteria
  1. ;
  1. ; Input - DFN
  1. ; IVMMTDT - date of means test
  1. ;
  1. N I,IVMIY,X
  1. S IVMIY=$$LYR^DGMTSCU1(IVMMTDT)
  1. F I=1:1:5,8:1:14 S $P(X,HLFS,I)=HLQ
  1. S ^TMP("HLS",$J,HLSDT,IVMCT)="ZMT"_HLFS_X
  1. D CLOSE(IVMIY,DFN,2,3) ; set flag to stop future transmissions
  1. Q
  1. ;
  1. ;
  1. CLOSE(IVMIY,DFN,IVMCS,IVMCR) ; Close IVM case record for a patient
  1. ; Input: DFN -- Pointer to the patient in file #2
  1. ; IVMIY -- Income year of the closed case
  1. ; IVMCS -- Closure source [1=IVM | 2=DHCP]
  1. ; IVMCR -- Pointer to the closure reason in file #301.93
  1. ;
  1. N DA,DIE,DR,X,Y,EVENTS,STATUS
  1. I '$G(IVMIY)!'$G(DFN)!'$G(IVMCS)!'$G(IVMCR) G CLOSEQ
  1. S IVMDELMT=1 ; flag indicates deletion
  1. S DA=$O(^IVM(301.5,"APT",+DFN,+IVMIY,0))
  1. I $G(^IVM(301.5,+DA,0))']"" G CLOSEQ
  1. ;
  1. ;don't want closing a case to stop transmission of an enrollment event
  1. S STATUS=1
  1. I ($$STATUS^IVMPLOG(+DA,.EVENTS)=0),EVENTS("ENROLL")=1 S STATUS=0
  1. ;
  1. D NOW^%DTC S DR=".03////"_STATUS_";.04////1;1.01////"_IVMCR_";1.02////"_IVMCS_";1.03////"_%
  1. S DIE="^IVM(301.5," D ^DIE
  1. CLOSEQ Q
  1. ;
  1. ;
  1. PSEUDO ; strip P from pseudo SSNs before transmitting to IVM
  1. ;
  1. N X
  1. S X=IVMPID_$G(IVMPID(1))
  1. S $P(X,HLFS,20)=$E($P(X,HLFS,20),1,9) ; remove P
  1. K IVMPID S IVMPID=$E(X,1,245)
  1. I $L(X)>245 S IVMPID(1)=$E(X,246,999)
  1. Q