source: FOIAVistA/trunk/r/CONSULT_REQUEST_TRACKING-GMRC-GMRS-GMRT/GMRCGUIS.m@ 1123

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1GMRCGUIS ;ALB/TDP - update Consult Status ;4/26/2006
2 ;;3.0;CONSULT/REQUEST TRACKING;**52**;DEC 27, 1997
3 ;
4 ;Called by SDCNSLT for Scheduling Consult Appointment Linkage
5STATUS(GMRCO,GMRCSTS,GMRCA,GMRCORNP,GMRCAD,GMRCADUZ,GMRCMT) ;Change status/last action/add comment consult API
6 ; Input variables:
7 ;GMRCO - The internal file number of the consult from File 123
8 ;GMRCSTS - Status of the consult
9 ;GMRCA - Last Action to be added to the consult
10 ;GMRCORNP - Name of the person who actually 'Received' the consult
11 ;GMRCAD - Actual date time that consult was received into the service.
12 ;GMRCADUZ - array of alert recipients as chosen by user (by reference)
13 ; ARRAY(DUZ)=""
14 ;GMRCMT - array of comments if entered (by reference)
15 ; ARRAY(1)="FIRST LINE OF COMMENT"
16 ; ARRAY(2)="SECOND LINE OF COMMENT"
17 ;
18 ;Output:
19 ;GMRCERR - Error Condition Code: 0 = NO error, 1=error
20 ;GMRCERMS - Error message or null
21 ; returned as GMRCERR^GMRCERMS
22 ;
23 N DFN,GMRCNOW,GMRCERR,GMRCERMS
24 S GMRCERR=0,GMRCERMS="",GMRCNOW=$$NOW^XLFDT,GMRCMT=0
25 I 'GMRCSTS!('GMRCA) D Q GMRCERR_"^"_GMRCERMS
26 . S GMRCERR="1",GMRCERMS="Status/last action update is missing or wrong."
27 . D EXIT^GMRCGUIA
28 S:$G(GMRCAD)="" GMRCAD=GMRCNOW
29 S:'$G(GMRCDUZ) GMRCDUZ=DUZ
30 S DFN=$P($G(^GMR(123,GMRCO,0)),"^",2) I DFN="" D Q GMRCERR_"^"_GMRCERMS
31 . S GMRCERR="1",GMRCERMS="Not A Valid Consult - File Not Found."
32 . D EXIT^GMRCGUIA
33 D STATUS^GMRCP I $D(GMRCQUT) D EXIT^GMRCGUIA Q GMRCERR_"^"_GMRCERMS
34 I '$O(GMRCMT(0)) D AUDIT^GMRCP
35 I $O(GMRCMT(0)) D
36 . S DA=$$SETDA^GMRCGUIB
37 . S GMRCMT(0)=DA,GMRCMT=1
38 . D SETCOM^GMRCGUIB(.GMRCMT,GMRCDUZ)
39 D EN^GMRCHL7(DFN,GMRCO,"","","SC",GMRCORNP,"",.GMRCMT,"",GMRCAD)
40 D ;send alerts
41 . N TXT
42 . S TXT="Comment Added to Consult "_$$ORTX^GMRCAU(GMRCO)
43 . I $P(^GMR(123,+GMRCO,0),U,14) S GMRCADUZ($P(^(0),U,14))=""
44 . D MSG^GMRCP(DFN,TXT,GMRCO,63,.GMRCADUZ,0)
45 D EXIT^GMRCGUIA
46 Q GMRCERR_"^"_GMRCERMS
Note: See TracBrowser for help on using the repository browser.