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

IVMLSU2.m

Go to the documentation of this file.
  1. IVMLSU2 ;ALB/MLI/KCL - IVM SSA/SSN UPLOAD OR PURGE ENTRIES ; 07-JAN-94
  1. ;;Version 2.0 ; INCOME VERIFICATION MATCH ;; 21-OCT-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ; This routine contains the code to execute the mneumonics on the
  1. ; list manager option. The line tag equals the mneumonic (and is
  1. ; followed by a line mneumonic_Q which is the kill line for the
  1. ; tag).
  1. ;
  1. ;
  1. PU ; - (Action) Purge entries from list if inappropriate for uploading
  1. ;
  1. ; Input - ^TMP("IVMLST",$J,"IDX",#,#)=pt name_pt ssn_dfn_sp ien_date of death_da(1)_da
  1. ; VALMY(n)=array of selections
  1. ;
  1. S IVMOUT=0,IVMWHERE="PU"
  1. ;
  1. ; - generic selector used within a list manager action call
  1. D EN^VALM2($G(XQORNOD(0)),"S")
  1. Q:'$D(VALMY)
  1. S IVMENT=0 F S IVMENT=$O(VALMY(IVMENT)) Q:'IVMENT!IVMOUT D
  1. .S IVMND=$G(^TMP("IVMLST",$J,"IDX",IVMENT,IVMENT)) I IVMND']"" Q
  1. .S IVMNM=$P(IVMND,"^",1),IVMSSN=$P(IVMND,"^",2)
  1. .S IVMI=$P(IVMND,"^",6),IVMJ=$P(IVMND,"^",7)
  1. .W !,"Purge for patient: ",IVMNM
  1. .;
  1. .; - alert user if date of death
  1. .I $P(IVMND,"^",5)]"" D DOD
  1. .;
  1. .D RUSURE^IVMLSU3 I 'IVMSURE Q
  1. .W !,"Update SSN's for ",IVMNM
  1. .D DELENT^IVMLSU3
  1. .W " ...deleted.",!
  1. .S DIR(0)="E",DIR("A")="Press RETURN to continue" D ^DIR K DIR
  1. PUQ D QUIT
  1. Q
  1. ;
  1. ;
  1. UP ; - (Action) Upload data for patient
  1. ;
  1. ; Input - ^TMP("IVMLST",$J,"IDX",#,#)=pt name_pt ssn_dfn_sp ien_date of death_da(1)_da
  1. ; VALMY(n)=array of selections
  1. ;
  1. ;
  1. S IVMOUT=0,IVMWHERE="UP"
  1. ;
  1. ; - generic selector used within a list manager action call
  1. D EN^VALM2($G(XQORNOD(0)),"S")
  1. Q:'$D(VALMY)
  1. S IVMENT=0 F S IVMENT=$O(VALMY(IVMENT)) Q:'IVMENT!IVMOUT D
  1. .S IVMND=$G(^TMP("IVMLST",$J,"IDX",IVMENT,IVMENT)) I IVMND']"" Q
  1. .S IVMNM=$P(IVMND,"^",1),IVMSSN=$P(IVMND,"^",2)
  1. .S IVMI=$P(IVMND,"^",6),IVMJ=$P(IVMND,"^",7)
  1. .; - get data node
  1. .S IVMDND=^TMP("IVMUP",$J,IVMNM,IVMSSN,IVMI,IVMJ)
  1. .S DFN=$P(IVMDND,"^",1),IVMSIEN=$P(IVMDND,"^",2),IVMLINE=$P(IVMDND,"^",4,99)
  1. .S IVMVSSN=$P(IVMLINE,"^",3),IVMSSSN=$P(IVMLINE,"^",6)
  1. .S IVMUP=$S(IVMVSSN&IVMSSSN:"B",IVMVSSN:"V",1:"S")
  1. .W !,"Update for patient: ",IVMNM
  1. .;
  1. .; - alert user if date of death
  1. .I $P(IVMND,"^",5)]"" D DOD
  1. .;
  1. .I IVMUP="B" D BOTH I IVMOUT Q
  1. .;
  1. .D RUSURE^IVMLSU3 I IVMOUT!'IVMSURE Q
  1. .D SSNUP^IVMLSU3
  1. UPQ D QUIT
  1. Q
  1. ;
  1. ;
  1. QUIT ; - Kill variables used from all protocols
  1. ;
  1. ; - reset array for display
  1. D INIT^IVMLSU1
  1. ;
  1. S VALMBCK=$S(IVMOUT'=2:"R",1:"Q") ; redisplay or quit if timeout
  1. K DFN,IVMDND,IVMENT,IVMI,IVMJ,IVMLINE,IVMND,IVMNM,IVMOUT
  1. K IVMSSN,IVMSSSN,IVMSURE,IVMUP,IVMVSSN,IVMWHERE
  1. Q
  1. ;
  1. ;
  1. BOTH ; - Upload both ssn's?
  1. ;
  1. ; Input - None
  1. ; Output - IVMUP as V for vet, S for spouse, B for both
  1. ; IVMOUT = 1 for '^', 2 for time-out, 0 otherwise
  1. ;
  1. N X,Y
  1. S DIR("A")="Update the SSN for the 'V'eteran, 'S'pouse, or 'B'oth?",DIR(0)="SB^V:VETERAN;S:SPOUSE;B:BOTH"
  1. S DIR("?",1)="Answer 'V' to upload veteran SSN only, 'S' to upload spouse SSN only",DIR("?")="or 'B' to upload the SSN for both the veteran and the spouse"
  1. S DIR("B")="BOTH" ; default both
  1. D ^DIR
  1. S IVMOUT=$S($D(DTOUT):2,$D(DUOUT):1,$D(DIROUT):1,1:0)
  1. S IVMUP=$G(Y) I IVMUP="B" S IVMUP="VS"
  1. K DIR,DIROUT,DTOUT,DUOUT
  1. Q
  1. ;
  1. ;
  1. DOD ; - Alert user of date of death reported in DHCP or from IVM Center
  1. ;
  1. W !,*7,"'Date of Death' reported for this patient "
  1. W $S($E($P(IVMND,"^",5))="I":"by the IVM Center",$E($P(IVMND,"^",5))="D":"in DHCP")_" as "_$$DAT2^IVMUFNC4($E($P(IVMND,"^",5),2,99))_".",!
  1. Q