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

SDESGETCONDETAIL.m

Go to the documentation of this file.
SDESGETCONDETAIL ;ALB/BLB - SDES GET CONSULT DETAILS ;Jan 17, 2023
 ;;5.3;Scheduling;**842**;Aug 13, 1993;Build 17
 ;;Per VHA Directive 6402, this routine should not be modified
 Q
 ;
GETDETAILS(JSONRETURN,CONSULTIEN) ;
 N ERRORS,RETURN,CONSULTDETAILS,TMPRETURN,DETAILS
 I '$$VALIDATECONSULT(.ERRORS,$G(CONSULTIEN)) M RETURN=ERRORS D BUILDJSON(.JSONRETURN,.RETURN) Q
 ;
 K ^TMP("GMRCR",$J,"DT")
 D DETAIL^ORQQCN(.TMPRETURN,CONSULTIEN)
 M DETAILS("ConsultDetails")=^TMP("GMRCR",$J)
 ;
 D CLEANRETURN(.DETAILS,.CONSULTDETAILS)
 ;
 I '$D(CONSULTDETAILS) S CONSULTDETAILS("ConsultDetails",1)=""
 M RETURN=CONSULTDETAILS D BUILDJSON(.JSONRETURN,.RETURN)
 Q
 ;
CLEANRETURN(DETAILS,CONSULTDETAILS) ;
 N NUM
 S NUM=0
 F  S NUM=$O(DETAILS("ConsultDetails","DT",NUM)) Q:'NUM  D
 .S CONSULTDETAILS("ConsultDetails","DT",NUM)=$G(DETAILS("ConsultDetails","DT",NUM,0))
 Q
 ;
VALIDATECONSULT(ERRORS,CONSULTIEN) ;
 I CONSULTIEN="" D ERRLOG^SDESJSON(.ERRORS,5) Q 0
 I CONSULTIEN'="",'$D(^GMR(123,CONSULTIEN,0)) D ERRLOG^SDESJSON(.ERRORS,6) Q 0
 Q 1
 ;
BUILDJSON(JSONRETURN,RETURN) ;
 D ENCODE^XLFJSON("RETURN","JSONRETURN")
 Q
 ;