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

IVMPLOG2.m

Go to the documentation of this file.
  1. IVMPLOG2 ;ALB/CJM - API for IVM PATIENT file; 4-SEP-97
  1. ;;2.0;INCOME VERIFICATION MATCH;**9,17**; 21-OCT-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;
  1. CLOSE(IEN,REASON,SOURCE) ;
  1. ;Description: Sets the value of the STOP FLAG field to 1 for a
  1. ;particular record in the IVM PATIENT file, as well as setting related
  1. ;fields. This has the effect of stopping updates to a particular
  1. ;IVM PATIENT record for some types of events, but not for enrollment
  1. ;events.
  1. ;
  1. ;Input:
  1. ; IEN - internal entry number of a record in the IVM PATIENT file.
  1. ; REASON - ien of record in the IVM CASE CLOSURE REASON file (#301.93)
  1. ; SOURCE - set of codes, 1= IVM CENTER (HEC), 2 = DHCP (local site)
  1. ;
  1. ;Output:
  1. ; Function Value - 1 on success, 0 on failure.
  1. ;
  1. N DATA,ERROR
  1. I $G(REASON)'="",'$$TESTVAL^DGENDBS(301.5,1.01,REASON) Q 0
  1. I $G(SOURCE)'="",'$$TESTVAL^DGENDBS(301.5,1.02,SOURCE) Q 0
  1. Q:'$$LOCK^IVMPLOG($G(IEN)) 0
  1. S DATA(.04)=1
  1. S DATA(1.01)=$G(REASON)
  1. S DATA(1.02)=$G(SOURCE)
  1. S DATA(1.03)=$$NOW^XLFDT
  1. S ERROR=$$UPD^DGENDBS(301.5,IEN,.DATA)
  1. D UNLOCK^IVMPLOG(IEN)
  1. Q ERROR
  1. ;
  1. DELETE(IEN) ;
  1. ;Description: Used to delete a record in the IVM PATIENT file.
  1. ;
  1. ;Input:
  1. ; IEN - the internal entry number for a record in the IVM PATIENT file
  1. ;Output:
  1. ; Function Value - 1 on success, 0 on failure
  1. ;
  1. Q:'$G(IEN) 1
  1. ;
  1. Q:'$$LOCK^IVMPLOG(IEN) 0
  1. ;
  1. N DIK,DA
  1. S DIK="^IVM(301.5,"
  1. S DA=IEN
  1. D ^DIK
  1. D UNLOCK^IVMPLOG(IEN)
  1. Q 1
  1. ;
  1. ADDFUTR(MTIEN) ;
  1. ;Adds a future test to the IVM Patient file. MTIEN is the ien
  1. ;of the future test in the Annual Means Test file
  1. ;
  1. Q:'$G(MTIEN)
  1. ;
  1. N NODE,DFN,DATE,IVMPAT,DATA,YEAR,TYPE
  1. S NODE=$G(^DGMT(408.31,MTIEN,0))
  1. S DATE=+NODE
  1. Q:'DATE
  1. S YEAR=($E(DATE,1,3)-1)
  1. S DFN=$P(NODE,"^",2)
  1. Q:('DFN)
  1. S TYPE=$P(NODE,"^",19)
  1. I TYPE'=1,TYPE'=2 Q
  1. S IVMPAT=$$LOG^IVMPLOG(DFN,YEAR)
  1. Q:'IVMPAT
  1. S:(TYPE=1) DATA(.06)=MTIEN
  1. S:(TYPE=2) DATA(.07)=MTIEN
  1. I $$UPD^DGENDBS(301.5,IVMPAT,.DATA)
  1. Q