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

SDESPATCOMMTS.m

Go to the documentation of this file.
SDESPATCOMMTS ;ALB/ANU - VISTA SCHEDULING RPC SDES GET PATIENT COMMENTS ;JUN 08, 2023
 ;;5.3;Scheduling;**846**;Aug 13, 1993;Build 12
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 ;External References
 ;-------------------
 ; Reference to $$GETS^DIQ,$$GETS1^DIQ in ICR #2056
 ;
 Q
 ;
PATCMTGET(JSONRETURN,APPTIEN,EAS) ;return entries from the SDEC APPOINTMENT FILE(409.84)
 ;INPUT:
 ;  APPT IEN
 ;RETURN:
 ;  List of Patient Comments
 ;
 N ISIENVALID,ISEASVALID,RETURN,ERRORS,HASFIELDS,RETURN,ELGFIELDSARRARY
 ;
 S ISIENVALID=$$VALIDATEIEN(.ERRORS,$G(APPTIEN))
 S ISEASVALID=$$VALIDATEEAS(.ERRORS,$G(EAS))
 I $D(ERRORS) M RETURN=ERRORS D BUILDJSON^SDESBUILDJSON(.JSONRETURN,.RETURN) Q
 ;
 I '$D(ERRORS) S HASFIELDS=$$PATCMT(.ELGFIELDSARRAY,$G(APPTIEN))
 I HASFIELDS M RETURN=ELGFIELDSARRAY
 ;
 D BUILDJSON^SDESBUILDJSON(.JSONRETURN,.RETURN)
 D CLEANUP
 Q
 ;
VALIDATEIEN(ERRORS,IEN) ;
 I '$G(IEN) D ERRLOG^SDESJSON(.ERRORS,14) Q 0
 I '$D(^SDEC(409.84,IEN,0)) D ERRLOG^SDESJSON(.ERRORS,15) Q 0
 Q 1
 ;
VALIDATEEAS(ERRORS,EAS) ;
 I $L(EAS) S EAS=$$EASVALIDATE^SDESUTIL($G(EAS))
 I $P($G(EAS),U)=-1 D ERRLOG^SDESJSON(.ERRORS,142) Q 0
 Q 1
 ;
PATCMT(ELGARRAY,IEN) ; return entries from the SDEC CANCELLATION COMMENT file (#409.88)
 ;
 N HASDATA
 ; patient comments
 D GETPATCOMMENTS^SDESAPPTDATA(.ELGARRAY,IEN)
 S ELGARRAY=""
 S HASDATA=($D(ELGARRAY)>1)
 Q HASDATA
 ;
CLEANUP ;
 K ISTYPEVALID,ERRORS
 K RETURN,HASFIELDS,ELGFIELDSARRAY,ELGRETURN
 Q
 ;