source: WorldVistAEHR/trunk/r/AUTOMATED_MED_INFO_EXCHANGE-DVBA-DVBC/DVBAB67.m@ 1710

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

initial load of WorldVistAEHR

File size: 2.8 KB
RevLine 
[613]1DVBAB67 ;ALB/KLB - CAPRI PENDING REPORT - PART 2 (called by DVBAB57) ;09/09/00
2 ;;2.7;AMIE;**35,90**;Apr 10, 1995
3 ;
4DCHGDT S DCHGDT="",DCHPTR=$P(^DGPM(XJ,0),U,17),XADMDT=$P(^(0),U,1) I DCHPTR]"",$D(^DGPM(+DCHPTR,0)) S DCHGDT=$P(^DGPM(+DCHPTR,0),U,1)
5 K DCHPTR
6 Q
7 ;
8PRINT S DOCTYPE=$S($D(^DVB(396,DA,2)):$P(^(2),U,10),1:""),DFN=$P(^DVB(396,DA,0),U,1),ADMDT=$P(^(0),U,4),RDATE=$P(^(1),U,1)
9 S XI=$G(^DPT(DFN,0)),PNAM=$P(XI,U,1),SSN=$P(XI,U,9) Q:PNAM=""!'SSN
10 S CNUM=$P($G(^DPT(DFN,.31)),U,3) S:CNUM="" CNUM="UNKNOWN"
11 I RO="Y" S CFLOC=$$STATION^DVBAUTL1(DFN),CFLOC=$S(CFLOC>0:CFLOC,1:9999) Q:CFLOC'=RONUM&(CFLOC'=0)&(CFLOC'=376)
12 K ^TMP("DVBA","ADMIT",$J)
13 F XI=0:0 S XI=$O(^DGPM("APTT1",DFN,XI)) Q:XI="" F XJ=0:0 S XJ=$O(^DGPM("APTT1",DFN,XI,XJ)) Q:XJ="" D DCHGDT S ^TMP("DVBA","ADMIT",$J,XADMDT,DFN)=XI_U_DCHGDT
14 S:SELDIV="Y" ^TMP("CAPRI",MSGCNT)="Division: "_ADIV_"^",MSGCNT=MSGCNT+1,^TMP("CAPRI",MSGCNT)="^",MSGCNT=MSGCNT+1
15 S:SELDIV="N" ^TMP("CAPRI",MSGCNT)="Original Division: "_ADIV_"^",MSGCNT=MSGCNT+1,^TMP("CAPRI",MSGCNT)="^",MSGCNT=MSGCNT+1
16 S ^TMP("CAPRI",MSGCNT)=PNAM_"^",MSGCNT=MSGCNT+1,^TMP("CAPRI",MSGCNT)="SSN: "_SSN_"^",MSGCNT=MSGCNT+1,^TMP("CAPRI",MSGCNT)="Claim no: "_CNUM_"^",MSGCNT=MSGCNT+1
17 S ^TMP("CAPRI",MSGCNT)=$S(DOCTYPE="L":" Activity date: ",1:"Admission date: ")_$$FMTE^XLFDT(ADMDT,"5DZ")_"^",MSGCNT=MSGCNT+1,^TMP("CAPRI",MSGCNT)="Request date: "_$$FMTE^XLFDT(RDATE,"5DZ")_"^"
18 S DCHGDT=""
19 I $D(^TMP("DVBA","ADMIT",$J,+ADMDT,DFN)) S:DOCTYPE="A" DCHGDT=$P(^TMP("DVBA","ADMIT",$J,+ADMDT,DFN),U,2)
20 D ELAPSED
21 I DCHGDT]""_"^" S Y=DCHGDT X ^DD("DD") S ^TMP("CAPRI",MSGCNT)="",MSGCNT=MSGCNT+1,^TMP("CAPRI",MSGCNT)="** Discharged: "_Y_"^",MSGCNT=MSGCNT+1
22 S ^TMP("CAPRI",MSGCNT)="Elapsed days: "_EDAYS_"^",MSGCNT=MSGCNT+1,^TMP("CAPRI",MSGCNT)="Items Pending:"_"^",MSGCNT=MSGCNT+1
23ITEMS F Q=9,11,13,15,17,19,21,23,26,28 I $P(^DVB(396,DA,0),U,Q)="P" D PRINT1 Q:DVBAQUIT=1
24 S Q=7 I $P(^DVB(396,DA,1),U,Q)="P" D PRINT1 Q:DVBAQUIT=1
25 S:$D(^DVB(396,DA,2)) ^TMP("CAPRI",MSGCNT)="Requested by: "_$S($P(^DVB(396,DA,2),U,8)]"":$P(^(2),U,8),1:" (Not specified) ")_" AT "_$S($P(^(2),U,7)]"":$P(^(2),U,7),1:" (Not specified) ")_"^",MSGCNT=MSGCNT+1
26 S $P(^TMP("CAPRI",MSGCNT),"-")="-^",MSGCNT=MSGCNT+1
27 S ^TMP("CAPRI",MSGCNT)="^",MSGCNT=MSGCNT+1
28 Q
29 ;
30PRINT1 S:$D(^DVB(396,DA,6)) GDIVPTR=$P(^DVB(396,DA,6),"^",Q)
31 S:'$D(^DVB(396,DA,6)) GDIVPTR=$P(^DVB(396,DA,2),"^",9)
32 S:+GDIVPTR>0 GDIVNAM=$P(^DG(40.8,GDIVPTR,0),"^",1)
33 S:+GDIVPTR'>0 GDIVNAM=""
34 S NODTA=1 I QQ S MC=$T(@Q),MD=$P(MC,";;",2) S GDIV=" ("_$E(GDIVNAM,1,(9+(23-$L(MC))))_")" S ^TMP("CAPRI",MSGCNT)=" "_MD_GDIV_"^",MSGCNT=MSGCNT+1 S QQ='QQ Q
35 I 'QQ S MC=$T(@Q),MD=$P(MC,";;",2) S GDIV=" ("_$E(GDIVNAM,1,(9+(23-$L(MC))))_")" S ^TMP("CAPRI",MSGCNT)=" "_MD_GDIV_"^",MSGCNT=MSGCNT+1 S QQ='QQ I $Y>22 Q:DVBAQUIT=1
36 Q
37 ;
38ELAPSED K EDAYS S X1=DT,X=RDATE D ^XUWORKDY
39 S EDAYS=X
40 Q
41 ;
Note: See TracBrowser for help on using the repository browser.