source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMVSIT.m@ 1552

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

revised back to 6/30/08 version

File size: 3.0 KB
Line 
1PXRMVSIT ; SLC/PKR - Visit related info for reminders. ;07/06/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;
4 ;======================================================
5GETDATA(DA,FIEVT,SVALUE) ;Return data for a specific Visit file entry.
6 ;DBIA #2028 for Visit file.
7 N HTEMP,TEMP
8 S TEMP=^AUPNVSIT(DA,0)
9 S FIEVT("VISIT")=DA
10 S FIEVT("DATE VISIT CREATED")=$P(TEMP,U,2)
11 S FIEVT("DFN")=$P(TEMP,U,5)
12 S FIEVT("LOC. OF ENCOUNTER")=$P(TEMP,U,6)
13 S FIEVT("SERVICE CATEGORY")=$P(TEMP,U,7)
14 I $G(SVALUE) S FIEVT("VALUE")=$P(TEMP,U,7)
15 S FIEVT("HOSPITAL LOCATION")=$P(TEMP,U,22)
16 ;DBIA #10040, #2804
17 I $G(FIEVT("HOSPITAL LOCATION"))="" S HTEMP=""
18 E S HTEMP=^SC(FIEVT("HOSPITAL LOCATION"),0)
19 S FIEVT("HLOC")=$P(HTEMP,U,1)
20 S FIEVT("DSS ID")=$P(TEMP,U,8)
21 I FIEVT("DSS ID")="" S FIEVT("DSS ID")=$P(HTEMP,U,7)
22 ;DBIA #557
23 I FIEVT("DSS ID")'="" S FIEVT("STOP CODE")=$P(^DIC(40.7,FIEVT("DSS ID"),0),U,2)
24 S FIEVT("OUTSIDE LOCATION")=$G(^AUPNVSIT(DA,21))
25 S FIEVT("COMMENTS")=$G(^AUPNVSIT(DA,811))
26 ;DBIA #4850
27 S FIEVT("STATUS")=$$STATUS^SDPCE(DA)
28 Q
29 ;
30 ;======================================================
31GAPSTAT(VIEN) ;Return the status of the appointment associated with the
32 ;visit.
33 ;DBIA #4850
34 Q $$STATUS^SDPCE(VIEN)
35 ;
36 ;======================================================
37HENC(VIEN,INDENT,NLINES,TEXT) ;Display location and comment for historical
38 ;encounters associated with the V files.
39 N COMMENT,HLOC,LOCATION,OLOC,NIN,TEXTIN,VDATA
40 D GETDATA(VIEN,.VDATA) I VDATA("SERVICE CATEGORY")'="E" Q
41 S NIN=0
42 S LOCATION=VDATA("LOC. OF ENCOUNTER")
43 I LOCATION'="" D
44 . S LOCATION=$$GET1^DIQ(4,LOCATION,.01)_" "_$$GET1^DIQ(4,LOCATION,99)
45 . S NIN=NIN+1,TEXTIN(NIN)="Location of Encounter: "_LOCATION_"\\"
46 S HLOC=VDATA("HOSPITAL LOCATION")
47 I HLOC'="" D
48 . S HLOC=$$GET1^DIQ(44,HLOC,.01)
49 . S NIN=NIN+1,TEXTIN(NIN)="Hospital Location: "_HLOC_"\\"
50 S OLOC=VDATA("OUTSIDE LOCATION")
51 I OLOC'="" D
52 . S NIN=NIN+1,TEXTIN(NIN)="Outside Location: "_OLOC_"\\"
53 S COMMENT=VDATA("COMMENT")
54 I COMMENT'="" D
55 . S NIN=NIN+1,TEXTIN(NIN)="Comment: "_COMMENT
56 I NIN>0 D
57 . N JND,NOUT,TEXTOUT
58 . S NLINES=NLINES+1
59 . S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Historical Encounter Information:"
60 . D FORMAT^PXRMTEXT(INDENT+2,PXRMRM,NIN,.TEXTIN,.NOUT,.TEXTOUT)
61 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
62 Q
63 ;
64 ;======================================================
65ISHIST(VIEN) ;Return true if the encounter was historical.
66 ;DBIA #2028
67 I $P($G(^AUPNVSIT(VIEN,0)),U,7)="E" Q 1
68 Q 0
69 ;
70 ;======================================================
71VAPSTAT(VIEN) ;Return true if the appointment associated with
72 ;the visit has a valid appointment status.
73 ;Return false if the status is one of the following:
74 ;CANCELLED BY CLINIC
75 ;CANCELLED BY CLINIC & AUTO RE-BOOK
76 ;CANCELLED BY PATIENT
77 ;CANCELLED BY PATIENT & AUTO-REBOOK
78 ;DELETED
79 ;NO ACTION TAKEN
80 ;NO-SHOW
81 ;NO-SHOW & AUTO RE-BOOK
82 N STATUS,VALID
83 ;DBIA #4850
84 S STATUS=$P($$STATUS^SDPCE(VIEN),U,2)
85 S VALID=$S(STATUS["CANCELLED":0,STATUS["DELETED":0,STATUS["NO ACTION":0,STATUS["NO-SHOW":0,1:1)
86 Q VALID
87 ;
Note: See TracBrowser for help on using the repository browser.