source: FOIAVistA/tag/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGFFPLM.m@ 1312

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1DGFFPLM ; ALB/GAH - FUGITIVE FELON PROGRAM LM INQUIRY ; 10-10-2006
2 ;;5.3;Registration;**485,725**;Aug 13, 1993;Build 12
3EN ; -- main entry point for DGFFP PATIENT STATUS INQUIRY
4 N DFN,VALMCNT
5 ;
6 D SEL^DGFFPLM1(.DFN)
7 Q:DFN'>0
8 D EN^VALM("DGFFP PATIENT STATUS INQUIRY")
9 Q
10 ;
11HDR ; -- header code
12 N VA,X
13 ;
14 D PID^VADPT
15 S VALMHDR(1)=$E("Patient: "_$P($G(^DPT(DFN,0)),U),1,30)_" ("_VA("PID")_")"
16 S VALMHDR(2)=$S($D(^DPT("AXFFP",1,DFN)):"Fugitive Flag Set",1:"")
17 S VALMHDR(3)=$$LASTACT(DFN)
18 Q
19 ;
20INIT ; -- init variables and list array
21 N VALMBCK
22 D BLD
23 Q
24 ;
25BLD ; Build patient fugitive felon program screen
26 D CLEAN^VALM10
27 K ^TMP("DGFFPLM",$J)
28 ;
29 D HDR
30 D EN^DGFFPLM1(DFN,"DGFFPLM",1,.VALMCNT)
31 Q
32 ;
33HELP ; -- help code
34 S X="?" D DISP^XQORM1 W !!
35 Q
36 ;
37EXIT ; -- exit code
38 D CLEAN^VALM10
39 D CLEAR^VALM1
40 K ^TMP("DGFFPLM",$J)
41 Q
42 ;
43EXPND ; -- expand code
44 Q
45 ;
46LASTACT(DFN) ;
47 N DGCLNME,DGDT,ERRCODE,NEWDAT,OLDDAT,RSLT,SDARRAY,SDCOUNT
48 ;
49 S DGDT=$$NOW^XLFDT
50 S SDARRAY(4)=DFN
51 S SDARRAY(1)=";"_DGDT
52 S SDARRAY("FLDS")=1
53 S SDCOUNT=$$SDAPI^SDAMA301(.SDARRAY) ;Get all appointments for the patient
54 I SDCOUNT>0 D ;Get the last appointment date and client if records found
55 . S DGCLN="",DGDT=0
56 . F S DGCLN=$O(^TMP($J,"SDAMA301",DFN,DGCLN)) Q:DGCLN="" D
57 . . S NEWDAT=+$O(^TMP($J,"SDAMA301",DFN,DGCLN,""),-1)
58 . . I NEWDAT>DGDT S DGDT=NEWDAT,DGCLNME=DGCLN
59 . S RSLT="Last Appointment: "_$$FMTE^XLFDT(DGDT,"1P")_" Clinic: "_DGCLNME
60 I SDCOUNT<0 S ERRCODE=$O(^TMP($J,"SDAMA301","")) I ERRCODE'="" S RSLT="Last Appointment: "_$G(^TMP($J,"SDAMA301",ERRCODE))
61 K ^TMP($J,"SDAMA301")
62 Q $G(RSLT)
63 ;
64PAT ; Entry point for DGFFP CHANGE PATIENT PROTOCOL
65 ; Input - None
66 ; Output - DFN Patient IEN
67 ; VALMBCK R = Refresh screen
68 ;
69 N DGDFN
70 S VALMBCK=""
71 D FULL^VALM1
72 ;
73 ; Get new patient
74 D SEL^DGFFPLM1(.DGDFN)
75 ;
76 I DGDFN>0 D
77 . S DFN=DGDFN
78 . D BLD^DGFFPLM
79 S VALMBCK="R"
80 Q
Note: See TracBrowser for help on using the repository browser.