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

IVMLDEM.m

Go to the documentation of this file.
  1. IVMLDEM ;ALB/KCL - IVM DEMOGRAPHIC UPLOAD PATIENT DISPLAY ; 11-APR-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. ;
  1. EN ; - main entry point
  1. N IVMENT
  1. D BUILD
  1. I IVMCTR=0 G EXIT ; if no patients with demographic info - quit
  1. D EN^VALM("IVM DEMOGRAPHIC")
  1. Q
  1. ;
  1. ;
  1. BUILD ; - build an array of IVM patients with demographic data for uploading
  1. K ^TMP("IVMDUPL",$J)
  1. W !,"Building patient list for display..."
  1. S IVMCTR=0
  1. ;
  1. ; - get patients with demographic fields from ASEG x-ref
  1. S IVMI=0 F S IVMI=$O(^IVM(301.5,"ASEG","PID",IVMI)) Q:'IVMI D
  1. .S IVMJ=0 F S IVMJ=$O(^IVM(301.5,"ASEG","PID",IVMI,IVMJ)) Q:'IVMJ D
  1. ..S IVMCTR=IVMCTR+1 W:'(IVMCTR#15) "."
  1. ..;
  1. ..; - grab node from file #301.5
  1. ..S IVM0NODE=$G(^IVM(301.5,IVMI,0)) I IVM0NODE']"" Q
  1. ..;
  1. ..; - get DFN and grab node from file #2
  1. ..S DFN=+IVM0NODE,IVM0DPT=$G(^DPT(+DFN,0)) I IVM0DPT']"" Q
  1. ..;
  1. ..; - patient name and ssn
  1. ..S IVMNAME=$P(IVM0DPT,"^"),IVMSSN=$P(IVM0DPT,"^",9),IVMSSN=$E(IVMSSN,1,3)_"-"_$E(IVMSSN,4,5)_"-"_$E(IVMSSN,6,9)
  1. ..;
  1. ..; - check for uploadable and non-uploadable fields
  1. ..S IVMUP=$S($$DEMO^IVMLDEM5(IVMI,IVMJ,1)=1:"YES",1:"NO")
  1. ..S IVMINFO=$S($$DEMO^IVMLDEM5(IVMI,IVMJ,0)=1:"YES",1:"NO")
  1. ..;
  1. ..; - build line for list manager display
  1. ..D BUILDLN
  1. ;
  1. I IVMCTR=0 W !!,"There is no IVM demographic information to be uploaded at this time.",!,*7
  1. ;
  1. BUILDQ ; - clean up variables
  1. K DFN,IVM0NODE,IVM0DPT,IVMCHK,IVMI,IVMINFO,IVMJ,IVMNAME,IVMSSN,IVMUP
  1. Q
  1. ;
  1. ;
  1. BUILDLN ; - build storage array with data for List Manager (called from BLD)
  1. ;
  1. S ^TMP("IVMDUPL",$J,IVMNAME,IVMI,IVMJ)=DFN_"^"_IVMNAME_"^"_IVMSSN_"^"_IVMUP_"^"_IVMINFO
  1. ;
  1. ; ^tmp("ivmdupl",$j,pat name, ivm ien, ivm sub ien)=dfn^patient name^patient ssn^demo uploadable^demo info only
  1. Q
  1. ;
  1. ;
  1. HDR ; - header code for list manager display
  1. S VALMHDR(1)="Patient Demographic Information" ; header line 1
  1. S VALMHDR(2)=" Uploadable Non-uploadable" ; header line 2
  1. Q
  1. ;
  1. ;
  1. INIT ; - init variables and list array
  1. K ^TMP("IVMLST",$J)
  1. S IVMBL="",$P(IVMBL," ",30)="",IVMCTR=0
  1. S IVMNAME="" F S IVMNAME=$O(^TMP("IVMDUPL",$J,IVMNAME)) Q:IVMNAME']"" S IVMI="" D
  1. .F S IVMI=$O(^TMP("IVMDUPL",$J,IVMNAME,IVMI)) Q:'IVMI S IVMJ="" D
  1. ..F S IVMJ=$O(^TMP("IVMDUPL",$J,IVMNAME,IVMI,IVMJ)) Q:'IVMJ D
  1. ...;
  1. ...; - IVMLN as the line for the list manager display
  1. ...S IVMLN=$G(^TMP("IVMDUPL",$J,IVMNAME,IVMI,IVMJ)) I IVMLN']"" Q
  1. ...;
  1. ...; - increment counter and write line
  1. ...S IVMCTR=IVMCTR+1 D WRLN(IVMLN,IVMCTR)
  1. ...;
  1. ...; - build index record to use for processing as
  1. ...; ^tmp("ivmlst",$j,"idx",ctr,ctr)=dfn^pat name^ien (#301.5) file^ien (#301.501) sub file
  1. ...S ^TMP("IVMLST",$J,"IDX",IVMCTR,IVMCTR)=$P(IVMLN,"^",1)_"^"_IVMNAME_"^"_IVMI_"^"_IVMJ
  1. ;
  1. ; - list manager variable as number of lines in the list
  1. S VALMCNT=IVMCTR
  1. ;
  1. INITQ ; - clean up variables
  1. K DFN,IVMBL,IVMCTR,IVMI,IVMJ,IVMLINE,IVMLN,IVMNAME,IVMNUM
  1. Q
  1. ;
  1. ;
  1. WRLN(IVMLINE,IVMNUM) ; - write line out for list manager display
  1. ;
  1. ; Input: IVMLINE -- as line for display
  1. ; dfn^pat name^pat ssn^uploadable (yes/no)^non-uploadable (yes/no)
  1. ; IVMNUM -- as the line number
  1. ; Output: None
  1. ;
  1. N IVMLN
  1. S IVMLN=$E($P(IVMLINE,"^",2)_IVMBL,1,30)_" "_$E($P(IVMLINE,"^",3)_IVMBL,1,15)_" "_$E($P(IVMLINE,"^",4)_IVMBL,1,13)_" "_$P(IVMLINE,"^",5)
  1. I $P(IVMLINE,"^",4)["YES" D CNTRL^VALM10(IVMNUM,55,3,IOINHI,IOINORM) ; highlight
  1. S @VALMAR@(IVMNUM,0)=$E(IVMNUM_" ",1,5)_IVMLN
  1. Q
  1. ;
  1. ;
  1. HELP ; - help code
  1. S X="?" D DISP^XQORM1 W !!
  1. Q
  1. ;
  1. ;
  1. EXIT ; - exit code
  1. K ^TMP("IVMLST",$J),^TMP("IVMDUPL",$J)
  1. Q