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

IVMLDEM4.m

Go to the documentation of this file.
  1. IVMLDEM4 ;ALB/KCL,PJR,LBD - IVM DEMOGRAPHIC UPLOAD/DELETE FIELDS ; 3/27/12 4:05pm
  1. ;;2.0;INCOME VERIFICATION MATCH;**5,10,56,102,152**; 21-OCT-94;Build 4
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;
  1. UF ; - (action) select uploadable demographic fields for filing
  1. ;
  1. ; Input: IVMWHERE -- as where the action is coming from
  1. ;
  1. ; -- If action from UPLOADABLE list:
  1. ; array of uploadable fields as
  1. ; ^TMP("IVMUPLOAD",$J,"IDX",CTR,CTR)=dfn^da(2)^da(1)^da^ivm field value^pointer to file (#1)^dhcp field number^dhcp field name
  1. ;
  1. ;
  1. ; - generic seletor used within list manager action
  1. N VALMY,IVMDOD S IVMDOD=0
  1. D EN^VALM2($G(XQORNOD(0)))
  1. Q:'$D(VALMY)
  1. ;
  1. N IVMPKDOD D CHECKS,CHECKDOD
  1. ;
  1. S IVMENT4=0 F S IVMENT4=$O(VALMY(IVMENT4)) Q:'IVMENT4 D
  1. .;
  1. .S IVMINDEX=$G(^TMP("IVMUPLOAD",$J,"IDX",IVMENT4,IVMENT4)) I IVMINDEX']"" Q
  1. .;
  1. .; - check to see if selection is an address field
  1. .S IVMADDR=$$ADDR^IVMLDEM6(+IVMINDEX,$P(IVMINDEX,"^",2),$P(IVMINDEX,"^",3),$P(IVMINDEX,"^",4),IVMPPICK)
  1. .;
  1. .Q:IVMADDR
  1. .;
  1. .; - check to see if selection is a Date of Death field
  1. .I IVMPKDOD S IVMDOD=$$DOD^IVMLDEMD(+IVMINDEX,$P(IVMINDEX,"^",2),$P(IVMINDEX,"^",3),$P(IVMINDEX,"^",4))
  1. .;
  1. .Q:IVMDOD
  1. .;
  1. .; - ask user if they are sure they want to update field
  1. .D RUSURE^IVMLDEMU($P(IVMINDEX,"^",8),"update") I IVMOUT!'IVMSURE Q
  1. .;
  1. .W !,"Updating "_$P(IVMINDEX,"^",8)_" field... "
  1. .;
  1. .; - upload value received from IVM into DHCP field
  1. .D UPLOAD^IVMLDEMU(DFN,$P(IVMINDEX,"^",6),$P(IVMINDEX,"^",7),$P(IVMINDEX,"^",5))
  1. .;
  1. .; - remove entry from file (#301.5)
  1. .D DELENT^IVMLDEMU($P(IVMINDEX,"^",2),$P(IVMINDEX,"^",3),$P(IVMINDEX,"^",4)) W "completed."
  1. .;
  1. ;
  1. ; - hold display before building list
  1. D PAUSE^VALM1
  1. ;
  1. ; - init the list and re-display to the user
  1. D INIT^IVMLDEM2
  1. ;
  1. DEQ ; clean-up variables
  1. D QACTION
  1. Q
  1. ;
  1. ;
  1. DF ; - (action) select uploadable/non-uploadable demographic fields for deletion
  1. ;
  1. ; Input: IVMWHERE -- as where the action is coming from
  1. ;
  1. ; -- If action from UPLOADABLE list:
  1. ; array of uploadable fields as
  1. ; ^TMP("IVMUPLOAD",$J,"IDX",CTR,CTR)=dfn^da(2)^da(1)^da^ivm field value^pointer to file (#1)^dhcp field number^dhcp field name
  1. ;
  1. ; OR
  1. ;
  1. ; -- If action from NON-UPLOADABLE list:
  1. ; array of non-uploadable fields as
  1. ; ^TMP("IVMNONUP",$J,"IDX",CTR,CTR)=dfn^da(2)^da(1)^da^ivm field value^pointer to file (#1)^dhcp field number^dhcp field name
  1. ;
  1. ;
  1. ; Output: None
  1. ;
  1. ; - generic seletor used within list manager action
  1. N VALMY
  1. D EN^VALM2($G(XQORNOD(0)))
  1. Q:'$D(VALMY)
  1. ;
  1. ; - determine array depending on variable IVMWHERE
  1. S IVMARRAY=$S(IVMWHERE="UP":"IVMUPLOAD",1:"IVMNONUP")
  1. ;
  1. N IVMPKDOD D CHECKS,CHECKDOD
  1. ;
  1. S IVMENT4=0 F S IVMENT4=$O(VALMY(IVMENT4)) Q:'IVMENT4 D
  1. .;
  1. .I IVMWHERE="NON" D DF^IVMLDEM8 Q ; non-uploadable fields
  1. .;
  1. .; - get selected entry for uploadable fields
  1. .S IVMINDEX=$G(^TMP(IVMARRAY,$J,"IDX",IVMENT4,IVMENT4)) Q:IVMINDEX']""
  1. .;
  1. .; - check to see if selection is an address field
  1. .S IVMADDR=$$ADDR^IVMLDEM7(+IVMINDEX,$P(IVMINDEX,"^",2),$P(IVMINDEX,"^",3),$P(IVMINDEX,"^",4),IVMPPICK)
  1. .;
  1. .Q:IVMADDR
  1. .;
  1. .; - ask user if they are sure they want to delete field
  1. .D RUSURE^IVMLDEMU($P(IVMINDEX,"^",8),"delete") I IVMOUT!'IVMSURE Q
  1. .;
  1. .W !,"Deleting "_$P(IVMINDEX,"^",8)_" field from the list... "
  1. .;
  1. .;if Date of Death is Deleted, send bulletin
  1. .I IVMPKDOD D BULLETIN S IVMPKDOD=0
  1. .;- remove entry from file (#301.5)
  1. .D DELENT^IVMLDEMU($P(IVMINDEX,"^",2),$P(IVMINDEX,"^",3),$P(IVMINDEX,"^",4)) W "completed."
  1. ;
  1. ; - hold display before re-building list
  1. D PAUSE^VALM1
  1. ;
  1. ; - init the list and re-display to the user
  1. D @$S(IVMWHERE="UP":"INIT^IVMLDEM2",1:"INIT^IVMLDEM3")
  1. ;
  1. DFQ ; clean-up variables
  1. D QACTION
  1. Q
  1. ;
  1. ;
  1. CHECKS ; check if residence phone number selected
  1. ; check if another address field selected
  1. ; IVMPPICK=0 phone or an address field not selected
  1. ; 1 address field(s) selected
  1. ; 2 phone selected
  1. ; 3 both address field(s) and phone selected
  1. ;
  1. N IVMPPIC1,IVMPPIC2
  1. S (IVMPPICK,IVMPPIC2)=0
  1. Q:IVMWHERE'="UP"
  1. S IVMENT4=0 F S IVMENT4=$O(VALMY(IVMENT4)) Q:'IVMENT4 D
  1. .I $G(^TMP("IVMUPLOAD",$J,"IDX",IVMENT4,IVMENT4))["PHONE NUMBER [RESIDENCE]" S IVMPPICK=2 Q
  1. .I $G(^TMP("IVMUPLOAD",$J,"IDX",IVMENT4,IVMENT4))["RESIDENCE NUMBER CHANGE" S IVMPPICK=2 Q
  1. .S IVMINDEX=$G(^TMP("IVMUPLOAD",$J,"IDX",IVMENT4,IVMENT4)) I IVMINDEX']"" Q
  1. .S IVMPPIC1=+$G(^IVM(301.5,+$P(IVMINDEX,"^",2),"IN",+$P(IVMINDEX,"^",3),"DEM",+$P(IVMINDEX,"^",4),0)) Q:'IVMPPIC1
  1. .S:$D(^IVM(301.92,"AD",+IVMPPIC1)) IVMPPIC2=1
  1. .Q
  1. S IVMPPICK=IVMPPICK+IVMPPIC2
  1. Q
  1. ;
  1. CHECKDOD ; check if date of death was selected
  1. ; IVMPKDOD=0 date of death not selected
  1. ; 1 date of death selected
  1. ;
  1. N IVMPPIC1,IVMPPIC2,CKST
  1. S (IVMPKDOD,IVMPPIC2)=0
  1. Q:IVMWHERE'="UP"
  1. S IVMENT4=0 F S IVMENT4=$O(VALMY(IVMENT4)) Q:'IVMENT4 D
  1. .S CKST=$G(^TMP("IVMUPLOAD",$J,"IDX",IVMENT4,IVMENT4))
  1. .I CKST["DATE OF DEATH"!(CKST["SOURCE OF NOTIFICATION")!(CKST["DATE OF DEATH LAST UPDATED") S IVMPKDOD=1 Q
  1. Q
  1. BULLETIN ; Non-Acceptance of Date of Death Data Bulletin
  1. N DGBULL,DGLINE,DGMGRP,DGNAME,DIFROM,VA,VAERR,XMTEXT,XMSUB,XMDUZ
  1. S DGMGRP=$O(^XMB(3.8,"B","DGEN ELIGIBILITY ALERT",""))
  1. Q:'DGMGRP
  1. D XMY^DGMTUTL(DGMGRP,0,1)
  1. S DGNAME=$P($G(^DPT(DFN,0)),"^"),DGSSN=$P($G(^DPT(DFN,0)),"^",9)
  1. S XMTEXT="DGBULL("
  1. S XMSUB="NON-ACCEPTANCE OF DATE OF DEATH DATA"
  1. S DGLINE=0
  1. D LINE^DGEN("Patient: "_DGNAME,.DGLINE)
  1. D LINE^DGEN("SSN: "_DGSSN,.DGLINE)
  1. D LINE^DGEN("",.DGLINE)
  1. D LINE^DGEN("This Veteran's Enrollment Record contains a Date of Death,",.DGLINE)
  1. D LINE^DGEN("however, you did not upload this information into VistA.",.DGLINE)
  1. D LINE^DGEN("Contact the HEC by phone or by fax with the reason for",.DGLINE)
  1. D LINE^DGEN("non-acceptance. The HEC will delete erroneous Date of Death",.DGLINE)
  1. D LINE^DGEN("information and update the veteran's enrollment record.",.DGLINE)
  1. D ^XMD
  1. Q
  1. QACTION ; - kill variables used from all protocols
  1. S VALMBCK="R"
  1. K IVMADDR,IVMARRAY,IVMENT4,IVMINDEX,IVMOUT,IVMPPICK,IVMSURE
  1. Q