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

SDUPDATECONSPID.m

Go to the documentation of this file.
SDUPDATECONSPID ;ALB/BLB -  Feb 29, 2024 - Entry point for SD PID/CID UPDATE OR protocol - attached to GMRC EVSEND OR
 ;;5.3;Scheduling;**877,885**;Aug 13, 1993;Build 5
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 Q
 ;
UPDATECONSULTPID(CONSULT) ;
 N CONSULTIEN,PID,DFN,COUNT
 ;
 I $D(SDCONTEXT)!($L($G(CANBYCLINORPAT)))!($L($G(SDECTYP))) Q
 I $D(APPOINTMENT) Q
 I $G(SDDDT)!($D(APPTARRAY)) Q
 I $L($G(NOSHOW))!($L($G(SDECNS))) Q
 I $D(NOSHOW) Q
 ;
 S COUNT=0
 F  S COUNT=$O(CONSULT(COUNT)) Q:'COUNT  D
 .I $E($G(CONSULT(COUNT)),1,3)="ORC" D
 ..S CONSULTIEN=$P($P($P($G(CONSULT(COUNT)),U,2),"|",2),";")
 ..S PID=$$HL7TFM^XLFDT($P($G(CONSULT(COUNT)),U,6))
 .;
 .I $E($G(CONSULT(COUNT)),1,3)="PID" D
 ..S DFN=$P($G(CONSULT(COUNT)),"|",4)
 I '$G(CONSULTIEN)!('$G(DFN))!('$G(PID)) Q
 ;
 D UPDATECONSULTPID^SDES2APPTUTIL(CONSULTIEN,PID,DFN) ;
 Q
 ;