source: FOIAVistA/trunk/r/FEE_BASIS-FB/FBNHAMIE.m@ 905

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1FBNHAMIE ;AISC/CMR-CNH Admission/Discharge Output ;4/28/93 11:04
2 ;;3.5;FEE BASIS;;JAN 30, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 D DATE^FBAAUTL Q:FBPOP
5 S VAR="BEGDATE^ENDDATE",VAL=BEGDATE_"^"_ENDDATE,PGM="START^FBNHAMIE" D ZIS^FBAAUTL G END:FBPOP
6START S FBHD="=",$P(FBHD,"=",80)="=",FBUL="-",$P(FBUL,"-",29)="-",FBAAOUT=0 U IO W:$E(IOST,1,2)["C-" @IOF D HED
7 F FBDT=BEGDATE-.001:0 S FBDT=$O(^FBAACNH("B",FBDT)) Q:'FBDT!(FBDT>(ENDDATE+.9999))!(FBAAOUT) F FBIEN=0:0 S FBIEN=$O(^FBAACNH("B",FBDT,FBIEN)) Q:'FBIEN!(FBAAOUT) S FB(0)=$G(^FBAACNH(+FBIEN,0)) I FB(0)]"" D
8 .S (FBTP,FB("TP"))="",FBTYPE=$S($P(FB(0),"^",3)="A":"ADMISSION",$P(FB(0),"^",3)="D":"DISCHARGE",1:0) Q:FBTYPE=0 D Q:FBAAOUT
9 ..I $E(FBTYPE)="A" S FBTP=$P(FB(0),"^",6),FB("TP")=$S(FBTP=4:"ALL OTHER",FBTP=3:"FROM ASIH <15 DAYS",FBTP=1:"AFTER RE-HOSPITALIZATION >15 DAYS",FBTP=2:"TRANSFER FROM OTHER CNH",1:"")
10 ..I $E(FBTYPE)="D" S FBTP=$P(FB(0),"^",8),FB("TP")=$S(FBTP=1:"REGULAR",FBTP=2:"DEATH",FBTP=3:"TRANSFER FROM OTHER CNH",FBTP=4:"ASIH",FBTP=5:"DEATH WHILE ASIH",FBTP=6:"REGULAR - PRIVATE PAY",1:"")
11 ..S DFN=$P(FB(0),"^",2) Q:'$G(DFN) S FBNAME=$$NAME^FBCHREQ2(DFN),FBID=$$SSN^FBAAUTL(DFN),FTP=+$P(FB(0),"^",9)
12 ..S FBVEN=$G(^FBAAV(FTP,0)),FBVNAME=$P(FBVEN,"^"),FBVID=$P(FBVEN,"^",2),FBVSTR=$P(FBVEN,"^",3),FBVCITY=$P(FBVEN,"^",4),FBVST=$P($G(^DIC(5,+$P(FBVEN,"^",5),0)),"^"),FBVZIP=$P(FBVEN,"^",6)
13 ..S FBPHONE=$P($G(^FBAAV(FTP,1)),U),FBPHONE=$S(FBPHONE="":"Not entered",1:FBPHONE)
14 ..D ELIG^VADPT,PRINT
15END ;
16 K BEGDATE,ENDDATE,FBDT,FBAAOUT,FBIEN,FB,DFN,FBPHONE,FBNAME,FBID,FBPSA,FTP,FBVEN,FBVNAME,FBVID,FBVSTR,FBVCITY,FBVST,FBVZIP,FBHD,FBTYPE,FBUL,VAEL,VAERR,FBTP
17 D CLOSE^FBAAUTL Q
18PRINT ;
19 I $E(IOST,1,2)["C-",$Y+8>IOSL S DIR(0)="E" D ^DIR K DIR I 'Y S FBAAOUT=1 Q
20 I $Y+8>IOSL W @IOF D HED
21 W !!,FBNAME,?32,FBID,?48,$P(VAEL(1),"^",2),!?3,FBTYPE," DATE: ",$$DATX^FBAAUTL(FBDT),?36,FBTYPE," TYPE: ",$E(FB("TP"),1,28)
22 I $G(FTP) W !?10,FBVNAME,?42,FBVID,!?10,FBVSTR,!?10,FBVCITY," ",FBVST," ",FBVZIP,!?10,"Phone #: ",FBPHONE
23 Q
24HED ;
25 W !?22,"CNH ADMISSIONS AND DISCHARGES",!?24,$$DATX^FBAAUTL(BEGDATE)," THROUGH ",$$DATX^FBAAUTL(ENDDATE),!?22,FBUL,!
26 Q
Note: See TracBrowser for help on using the repository browser.