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

SDESGETPATINQUIR.m

Go to the documentation of this file.
  1. SDESGETPATINQUIR ;ALB/BLB,JAS - SDES GET PATIENT INQUIRY ;Apr 18, 2024
  1. ;;5.3;Scheduling;**842,877**;Aug 13, 1993;Build 14
  1. ;;Per VHA Directive 6402, this routine should not be modified
  1. Q
  1. ;
  1. GETINQUIRY(JSONRETURN,DFN) ;
  1. N ERRORS,RETURN,DETAILS,TMPRETURN,ORDA,ORDAS
  1. I '$$VALIDATEDFN(.ERRORS,$G(DFN)) M RETURN=ERRORS D BUILDJSON(.JSONRETURN,.RETURN) Q
  1. ;
  1. K ^TMP("ORDATA",$J)
  1. D PTINQ^ORWPT(.TMPRETURN,DFN)
  1. ; Remove all but Last Four of SSN
  1. S ORDA=0
  1. F S ORDA=$O(^TMP("ORDATA",$J,ORDA)) Q:'ORDA I $D(^TMP("ORDATA",$J,ORDA)) D
  1. . S ORDAS=0
  1. . F S ORDAS=$O(^TMP("ORDATA",$J,ORDA,ORDAS)) Q:'ORDAS I $L(^TMP("ORDATA",$J,ORDA,ORDAS)) D
  1. . . N ORLINE S ORLINE=^TMP("ORDATA",$J,ORDA,ORDAS)
  1. . . I ORLINE?.E3N1"-"2N1"-"4N.E D
  1. . . . S ^TMP("ORDATA",$J,ORDA,ORDAS)=$E(ORLINE,1,$L($P(ORLINE,"-"))-3)_$P(ORLINE,"-",3)
  1. ;
  1. M DETAILS("PatientInquiryDetails")=^TMP("ORDATA",$J)
  1. ;
  1. I '$D(DETAILS) S DETAILS("PatientInquiryDetails",1)=""
  1. M RETURN=DETAILS D BUILDJSON(.JSONRETURN,.RETURN)
  1. Q
  1. ;
  1. VALIDATEDFN(ERRORS,DFN) ;
  1. I DFN="" D ERRLOG^SDESJSON(.ERRORS,1) Q 0
  1. I DFN'="",'$D(^DPT(DFN,0)) D ERRLOG^SDESJSON(.ERRORS,2) Q 0
  1. Q 1
  1. ;
  1. BUILDJSON(JSONRETURN,RETURN) ;
  1. N JSONERR
  1. D ENCODE^XLFJSON("RETURN","JSONRETURN","JSONERR")
  1. Q
  1. ;