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

SDEC07PID.m

Go to the documentation of this file.
SDEC07PID ;ALB/BLB - VISTA SCHEDULING  ;Jul 15, 2021@10:40
 ;;5.3;Scheduling;**805**;Aug 13, 1993;Build 9
 ;;Per VHA Directive 6402, this routine should not be modified
CONSULTPID(SDAPTYP,DFN,PROVIEN,SAVESTRT,SDDDT,SDDFN,SDECNOTE,SDECRES) ;
 N SDRIEN1,CFDA,ERRMSG,NCIEN,CSFDA,CSIEN,CSSIEN,CONSPIDIEN
 S SDRIEN1=$P(SDAPTYP,"|",2)
 D REQSET^SDEC07A($P(SDAPTYP,"|",2),PROVIEN,"",1,"",SDECNOTE,SAVESTRT,SDECRES,SDDFN)   ;MGH added 3 parameters to this call
 ; File full consult pid history entry
 S CONSPIDIEN=$O(^SDEC(409.87,"B",SDRIEN1,0))
 I '$D(^SDEC(409.87,"B",SDRIEN1)) D
 .S CFDA(409.87,"+1,",.01)=SDRIEN1
 .S CFDA(409.87,"+1,",.02)=DFN
 .D UPDATE^DIE("","CFDA","NCIEN","ERRMSG") K CFDA
 .I $D(ERRMSG) Q
 .S CSFDA(409.871,"+1,"_NCIEN(1)_",",.01)=$$NOW^XLFDT
 .S CSFDA(409.871,"+1,"_NCIEN(1)_",",1)=SDDDT
 .S CSFDA(409.871,"+1,"_NCIEN(1)_",",2)=$$GET1^DIQ(200,DUZ,.01,"E")
 .D UPDATE^DIE("","CSFDA","CSIEN") K CSFDA
 .;File consult pid history subfile only
 I $D(^SDEC(409.87,"B",SDRIEN1)) D
 .I $$CONSPIDCHECK^SDEC07(SDRIEN1,SDDDT) D
 ..S CSFDA(409.871,"+1,"_CONSPIDIEN_",",.01)=$$NOW^XLFDT
 ..S CSFDA(409.871,"+1,"_CONSPIDIEN_",",1)=SDDDT
 ..S CSFDA(409.871,"+1,"_CONSPIDIEN_",",2)=$$GET1^DIQ(200,DUZ,.01,"E")
 ..D UPDATE^DIE("","CSFDA","CSSIEN","ERR") K CSFDA
 Q