source: FOIAVistA/trunk/r/HEALTH_SUMMARY-GMTS/GMTSGEC.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1GMTSGEC ; SLC/AGP - Ad Hoc Summary Driver ; 07/11/2007
2 ;;2.7;Health Summary;**63,39,87**;Oct 20, 1995;Build 23
3 ;
4 ; DBIA 1268 ^AUTTHF(
5 ;
6EN(X) ;
7 I $P($G(^GMT(142.1,+$G(CMP),0)),U,4)="GECH" Q "I (($P(^(0),U,10)=""C"")&(+$P(^(0),U,11)'=1))&($E($P($G(^(0)),U,9),1,3)=""GEC"")"
8 Q "I $P(^(0),U,11)'=1"
9 ;
10REPORT ;
11 N CNT
12 D CKP^GMTSUP Q:$D(GMTSQIT)
13 S CNT=0 F S CNT=$O(^TMP("GMTSGEC",$J,CNT)) Q:CNT="" D
14 . D CKP^GMTSUP Q:$D(GMTSQIT)
15 . W !,$G(^TMP("GMTSGEC",$J,CNT))
16 Q
17 ;
18REPHEAD ;
19 N STR
20 S STR="Total Number of Completed Referrals in date range: "_CNT1
21 S ^TMP("GMTSGEC",$J,2)=STR
22 Q
23 ;
24PRINT ;
25 N ACNT,ACNT1,BDT,CNT,CNT1,EDT,EDT1,GMTSGECH,INCOMP,OCCCNT,VALUE
26 N EHF,EVDT,HF,HFCAT,VDT
27 K ^TMP("PXRMGEC",$J,"HS")
28 K ^TMP("GMTSGEC",$J)
29 I $G(GMTSNDM)<1 S OCCCNT=1
30 E S OCCCNT=GMTSNDM
31 D E^PXRMGECV("HS",1,$G(GMTSBEG),$G(GMTSEND),"S",$G(DFN))
32 S (BDT,CNT,EDT,VALUE)="",CNT1=0,ACNT=2
33 F S CNT=$O(^TMP("PXRMGEC",$J,"HS",CNT),-1) Q:CNT=""!($G(CNT1)=OCCCNT) D
34 .I VALUE'=CNT S VALUE=CNT,CNT1=CNT1+1,INCOMP=0
35 .F S BDT=$O(^TMP("PXRMGEC",$J,"HS",CNT,DFN,BDT)) Q:BDT="" D
36 ..F S EDT=$O(^TMP("PXRMGEC",$J,"HS",CNT,DFN,BDT,EDT)) Q:EDT="" D
37 ...S EDT1=EDT I EDT="0000000" S EDT1=DT,INCOMP=1
38 ...S ACNT=ACNT+1,^TMP("GMTSGEC",$J,ACNT)="",ACNT=ACNT+1
39 ...S STR=$$LJ^XLFSTR(" ",3),STR=STR_"Referral Number: "_CNT1
40 ...S ^TMP("GMTSGEC",$J,ACNT)=STR,ACNT=ACNT+1,STR=$$LJ^XLFSTR(" ",5)
41 ...S STR=STR_$$LJ^XLFSTR("START DATE",30),STR=STR_"END DATE"
42 ...S ACNT=ACNT+1,^TMP("GMTSGEC",$J,ACNT)=STR,ACNT=ACNT+1
43 ...S STR=$$LJ^XLFSTR(" ",5),STR=STR_$$LJ^XLFSTR($$FMTE^XLFDT(BDT),30)
44 ...I INCOMP=0 S STR=STR_$$FMTE^XLFDT(EDT)
45 ...I INCOMP=1 S STR=STR_"Incomplete Referral"
46 ...S ^TMP("GMTSGEC",$J,ACNT)=STR,ACNT=ACNT+1
47 ...S ^TMP("GMTSGEC",$J,ACNT)=" ",ACNT=ACNT+1,STR=$$LJ^XLFSTR(" ",10)
48 ...S ^TMP("GMTSGEC",$J,ACNT)=STR_"Category",ACNT=ACNT+1
49 ...S STR=$$LJ^XLFSTR(" ",15),STR=STR_$$LJ^XLFSTR("Health Factor",40)
50 ...S STR=STR_"Visit Date",^TMP("GMTSGEC",$J,ACNT)=STR,ACNT=ACNT+1
51 ...S ^TMP("GMTSGEC",$J,ACNT)=" ",ACNT=ACNT+1,HFCAT=""
52 ...F S HFCAT=$O(^TMP("PXRMGEC",$J,"HS",CNT,DFN,BDT,EDT,HFCAT)) Q:HFCAT="" D
53 ....S STR=$$LJ^XLFSTR(" ",10)
54 ....S ^TMP("GMTSGEC",$J,ACNT)=STR_HFCAT,ACNT=ACNT+1,VDT=""
55 ....F S VDT=$O(^TMP("PXRMGEC",$J,"HS",CNT,DFN,BDT,EDT,HFCAT,VDT)) Q:VDT="" D
56 .....S EVDT=$$FMTE^XLFDT(VDT),HF=""
57 .....F S HF=$O(^TMP("PXRMGEC",$J,"HS",CNT,DFN,BDT,EDT,HFCAT,VDT,HF)) Q:HF="" D
58 ......S EHF=$$GET1^DIQ(9999999.64,$P($G(^AUPNVHF(HF,0)),U),.01)
59 ......S STR=$$LJ^XLFSTR(" ",15)
60 ......S STR=STR_$$LJ^XLFSTR(EHF,40)
61 ......S STR=STR_$$LJ^XLFSTR(EVDT,25)
62 ......S ^TMP("GMTSGEC",$J,ACNT)=STR,ACNT=ACNT+1
63 D REPHEAD
64 D REPORT
65 K ^TMP("GMTSGEC",$J)
66 K ^TMP("PXRMGEC",$J,"HS")
67 Q
Note: See TracBrowser for help on using the repository browser.