Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRCGUIS

GMRCGUIS.m

Go to the documentation of this file.
  1. GMRCGUIS ;ALB/TDP - update Consult Status ;4/26/2006
  1. ;;3.0;CONSULT/REQUEST TRACKING;**52,46**;DEC 27, 1997;Build 23
  1. ;
  1. ;Called by SDCNSLT for Scheduling Consult Appointment Linkage
  1. STATUS(GMRCO,GMRCSTS,GMRCA,GMRCORNP,GMRCAD,GMRCADUZ,GMRCMT) ;Change status/last action/add comment consult API
  1. ; Input variables:
  1. ;GMRCO - The internal file number of the consult from File 123
  1. ;GMRCSTS - Status of the consult
  1. ;GMRCA - Last Action to be added to the consult
  1. ;GMRCORNP - Name of the person who actually 'Received' the consult
  1. ;GMRCAD - Actual date time that consult was received into the service.
  1. ;GMRCADUZ - array of alert recipients as chosen by user (by reference)
  1. ; ARRAY(DUZ)=""
  1. ;GMRCMT - array of comments if entered (by reference)
  1. ; ARRAY(1)="FIRST LINE OF COMMENT"
  1. ; ARRAY(2)="SECOND LINE OF COMMENT"
  1. ;
  1. ;Output:
  1. ;GMRCERR - Error Condition Code: 0 = NO error, 1=error
  1. ;GMRCERMS - Error message or null
  1. ; returned as GMRCERR^GMRCERMS
  1. ;
  1. N DFN,GMRCNOW,GMRCERR,GMRCERMS
  1. S GMRCERR=0,GMRCERMS="",GMRCNOW=$$NOW^XLFDT,GMRCMT=0
  1. I 'GMRCSTS!('GMRCA) D Q GMRCERR_"^"_GMRCERMS
  1. . S GMRCERR="1",GMRCERMS="Status/last action update is missing or wrong."
  1. . D EXIT^GMRCGUIA
  1. S:$G(GMRCAD)="" GMRCAD=GMRCNOW
  1. S:'$G(GMRCDUZ) GMRCDUZ=DUZ
  1. S DFN=$P($G(^GMR(123,GMRCO,0)),"^",2) I DFN="" D Q GMRCERR_"^"_GMRCERMS
  1. . S GMRCERR="1",GMRCERMS="Not A Valid Consult - File Not Found."
  1. . D EXIT^GMRCGUIA
  1. D STATUS^GMRCP I $D(GMRCQUT) D EXIT^GMRCGUIA Q GMRCERR_"^"_GMRCERMS
  1. I '$O(GMRCMT(0)) D AUDIT^GMRCP
  1. I $O(GMRCMT(0)) D
  1. . S DA=$$SETDA^GMRCGUIB
  1. . S GMRCMT(0)=DA,GMRCMT=1
  1. . D SETCOM^GMRCGUIB(.GMRCMT,GMRCDUZ)
  1. D EN^GMRCHL7(DFN,GMRCO,"","","SC",GMRCORNP,"",.GMRCMT,"",GMRCAD)
  1. D ;send alerts
  1. . N TXT
  1. . S TXT="Comment Added to Consult "_$$ORTX^GMRCAU(GMRCO)
  1. . I $P(^GMR(123,+GMRCO,0),U,14),$P(^GMR(123,+GMRCO,0),U,14)'=DUZ S GMRCADUZ($P(^(0),U,14))=""
  1. . D MSG^GMRCP(DFN,TXT,GMRCO,63,.GMRCADUZ,0)
  1. D EXIT^GMRCGUIA
  1. Q GMRCERR_"^"_GMRCERMS