source: WorldVistAEHR/trunk/r/ICR_IMMUNOLOGY_CASE_REGISTRY-IMR/IMRARVNO.m@ 1608

Last change on this file since 1608 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1IMRARVNO ;HCIOFO-FAI/PATIENTS WITH NO ARV ;07/20/00 10:49
2 ;;2.1;IMMUNOLOGY CASE REGISTRY;**5**;Feb 09, 1998
3ENTRY S (IMRPAT,IMRSCT,REIM)=1,IMRI=0,IMRPG=0,IMREXC="B" K ^TMP($J),IMRLR,IMROUT,IMRPTF,IMRRX,IMRRXN,IMRSCH,IMRST,IMRSUF
4 F IMRI=0:0 S IMRI=$O(^IMR(158,IMRI)) Q:IMRI'>0 S X=+^(IMRI,0),IMRCAT=$P(^(0),U,42) D ^IMRXOR S (DFN,IMRDFN)=X I $D(^DPT(DFN,0)) D ADD
5 D HEDR S I="",(CTNOARV,K,N)=0,IMRUT=0
6 D PRBR
7 Q
8PRBR ;by arv use
9 I '$D(^TMP($J)) W !!?5,"***NO PATIENTS FOUND IN THIS DATE RANGE***"
10 S TY="" F S TY=$O(^TMP($J,TY)),MC="" Q:TY="" F S MC=$O(^TMP($J,TY,MC)),RM="" Q:MC="" F S RM=$O(^TMP($J,TY,MC,RM)),PD="" Q:RM="" F S PD=$O(^TMP($J,TY,MC,RM,PD)) Q:PD="" D PR2
11 Q
12PR2 S IMRPCT=$P($G(^TMP($J,TY,MC,RM,PD)),U,3) Q:IMRPCT'=4
13 S CTNOARV=CTNOARV+1,K=K+1,N=N+1 W:IMRC4=1 !,$J(N,5),?7,RM,?33,$P($G(^TMP($J,TY,MC,RM,PD)),U,2),?48,$P($G(^TMP($J,TY,MC,RM,PD)),U,3),?53,$P($G(^TMP($J,TY,MC,RM,PD)),U,4),?65,MC
14 Q
15ADD ;
16 D 2^VADPT
17 D PERCHK^IMRLCAT1 S DFN=IMRDFN Q:'IMRCHK ;if date range check when patient was seen. quit if not seen in date range.
18 Q:$G(IMRHNBEG)="" Q:$G(IMRHNEND)=""
19 S IMRDOD=$P($G(^IMR(158,IMRI,5)),U,19) ;get IMR DATE OF DEATH
20 S IMRDOD=$S(+VADM(6)>0:+VADM(6),IMRDOD>0:IMRDOD,1:"")
21 I $E(IMREXC)="A",IMRDOD>0,+IMRDOD<IMRHNBEG Q ;quit if date range, alive selected and date of death is before start date
22 I IMREXC="D",IMRDOD>0,IMRDOD<IMRHNBEG Q ;quit if date range, deceased selected and date of death before start date
23 I IMREXC="D",IMRDOD>0,IMRDOD>IMRHNEND Q ;quit if date range, deceased selected and date of death after end date
24 I IMREXC="D",IMRDOD'>0 Q ;quit if date range, deceased selected and no date of death
25 I IMREXC="A",IMRDOD>0 Q ;quit if no date range, alive selected and patient is dead
26 I IMREXC="D",IMRDOD'>0 Q ;quit if no date range, deceased selected and patient is not dead
27 I IMREXC="B",IMRDOD>0,IMRDOD<IMRHNBEG Q ;quit if date range, both selected and date of death before start date
28 I IMREXC="B",IMRDOD>0,IMRDOD>IMRHNEND Q ;quit if date range, both selected and date of death after end date
29 I IMRDOD>0 S IMRDOD=$E(IMRDOD,4,5)_"/"_$E(IMRDOD,6,7)_"/"_$E(IMRDOD,2,3)_$S(+VADM(6)>0:"",1:" (ICR)") ;indicate where DOD came from; MAS or ICR
30 D ^IMRARVRL
31 D ARVUSE
32 K IMRLR,IMROUT,IMRPTF,IMRRX,IMRRXN,IMRSCH,IMRST,IMRSUF
33 Q
34ARVUSE S:IMRBL="NOARV" ^TMP($J,"NOARV",IMRBL,(VADM(1)),DFN)=VADM(1)_U_$P(VADM(2),U)_U_IMRCAT_U_IMRDOD
35 Q
36HEDR ; report header
37 W:IMRC4=1 !!,?10,"===================================================",!!,?20,"Unique Category 4 Patients NOT on ARVs",!!,?7,"NAME",?36,"SSN",?47,"CAT",?53,"DECEASED",?65,"REIM LEVEL",!
38 Q
Note: See TracBrowser for help on using the repository browser.