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

VBECA1A.m

Go to the documentation of this file.
  1. VBECA1A ;HIOFO/REL - Verify Patient ; 7/5/01 6:50am
  1. ;;2.0;VBEC;;Jun 05, 2015;Build 4
  1. ;
  1. ; Note: This routine supports data exchange with an FDA registered
  1. ; medical device. As such, it may not be changed in any way without
  1. ; prior written approval from the medical device manufacturer.
  1. ;
  1. ; Integration Agreements:
  1. ; Reference to ^DIC supported by IA #10006
  1. ; Reference to $$LRDFN^LR7OR1 supported by IA #2503
  1. ;
  1. QUIT
  1. ;
  1. PAT ; Verify Patient
  1. N NUM,ERR,X,Y,DIC,ROOT K VBECERR S NUM=0
  1. I $G(PATID)="" S ERR=1 D ERR
  1. I $G(PATNAM)="" S ERR=2 D ERR
  1. I $G(PATDOB)="" S ERR=3 D ERR
  1. S:$G(PARENT)="" PARENT=2 I PARENT'=2&(PARENT'=67) S ERR=7 D ERR G DONE
  1. G:$G(PATID)="" DONE
  1. S DIC=PARENT,DIC(0)="XMZN",X=PATID D ^DIC
  1. ; ^ ADDED "N" TO DIC(0)
  1. ; TO ALLOW NUMERIC LOOKUP. RLM
  1. I Y<1 S ERR=4 D ERR G DONE
  1. S IFN=+Y,FILEROOT=$S(PARENT=2:"DPT(",PARENT=67:"LRT(67,",1:"")
  1. S LRDFN=$$LRDFN^LR7OR1(IFN,FILEROOT)
  1. I $G(PATNAM)'="",PATNAM'=$P(Y(0),"^",1) S ERR=5 D ERR
  1. I $G(PATDOB)'="",PATDOB'=$P(Y(0),"^",3) S ERR=6 D ERR
  1. DONE S:NUM LRDFN="" Q
  1. ;
  1. ERR ; Set Error
  1. I '$D(VBECERR(0)) S VBECERR(0)=$G(PATID)_"^"_$G(PATNAM)_"^"_$G(PATDOB)_"^"_$G(PARENT)
  1. S NUM=NUM+1,VBECERR(NUM)=ERR_"^"_$P($T(ERRTX+ERR),";;",2)
  1. Q
  1. ERRTX ;; Error Text
  1. ;;No Patient ID supplied
  1. ;;No Patient Name supplied
  1. ;;No Patient Date of Birth supplied
  1. ;;No patient record found to match the PATID supplied
  1. ;;Patient Name (PATNAM) supplied does not match the patient ID (PATID) record
  1. ;;Patient Date of Birth (PATDOB) does not match the patient ID (PATID) record
  1. ;;Unsupported Parent File (PARENT) supplied