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

VPSRPC11.m

Go to the documentation of this file.
VPSRPC11  ;BPOIFO/EL,WOIFO/BT - Patient Demographic RPC - Appointment;9/4/14 13:07
 ;;1.0;VA POINT OF SERVICE (KIOSKS);**4**;Sep 4, 2014;Build 27
 ;;Per VHA Directive 2004-038, this routine should not be modified.
 ;
 ; External Reference DBIA#
 ; ------------------------
 ; #2056 - DIQ call               (Supported)
 ; #4433 - SDAMA301 call          (Supported)
 ; #10103 - XLFDT call            (Supported)
 ; #10104 - XLFSTR call           (Supported)
 QUIT
 ;
GETAPPT(VPSARR,DFN,DTRANGE) ;  Appointment Info
 ; OUTPUT
 ;   VPSARR   - passed in by reference; this is the output array to store patient demographics
 ; INPUT
 ;   DFN      - patient DFN (This value must be validated before calling this procedure)
 ;   DTRANGE  - FROMDATE:THROUGH DATE
 ;
 N TODAY S TODAY=$$DT^XLFDT()
 N VPSFR S VPSFR=$P(DTRANGE,":")
 N VPSTO S VPSTO=$P(DTRANGE,":",2)
 S:VPSFR="" VPSFR=TODAY
 S:VPSTO="" VPSTO=TODAY+20000
 ;
 ; -- Set filter
 N VPSSD
 S VPSSD(1)=VPSFR_":"_VPSTO
 S VPSSD(3)="R;I;NS;NSR;R;CP;CPR;CC;CCR;NT"
 S VPSSD(4)=DFN
 S VPSSD("FLDS")="1;2;3;10;16;19;20;21;22"
 ;
 ; -- get appointments
 K ^TMP($J,"SDAMA301",DFN)
 N VAL S VAL=$$SDAPI^SDAMA301(.VPSSD)
 I VAL'>0 D SET(.VPSARR,"E",DFN,"","NO APPOINTMENTS FOUND FOR PATIENT","APPOINTMENT NOT FOUND") QUIT
 ; 
 N VPSCL,VPSDT S (VPSCL,VPSDT)=""
 N EXIST S EXIST=0
 ;
 F  S VPSCL=$O(^TMP($J,"SDAMA301",DFN,VPSCL)) QUIT:VPSCL=""  D
 . S VPSDT=""
 . F  S VPSDT=$O(^TMP($J,"SDAMA301",DFN,VPSCL,VPSDT)) QUIT:VPSDT=""  D
 . . S VPSAPT=^TMP($J,"SDAMA301",DFN,VPSCL,VPSDT)
 . . S VPSIEN=DFN_";"_VPSCL_";"_VPSDT
 . . D STAPPT(.VPSARR,VPSAPT,VPSIEN)
 . . S EXIST=1
 ;
 K ^TMP($J,"SDAMA301",DFN)
 QUIT
 ;
STAPPT(VPSARR,VPSAPT,VPSIEN) ; Store appointments
 ; ------ Clinic Info ------------
 N VAL S VAL=$P(VPSAPT,U,2)
 N VPSCLN S VPSCLN=$P(VAL,";")
 N VPSCNAM S VPSCNAM=$P(VAL,";",2)
 ;
 ; -- APPT CLINIC IEN/NAME #2
 D SET(.VPSARR,2.98,VPSIEN,".01",VPSCLN)
 ;
 ; -- Hospital Location
 N VPSFL S VPSFL="44"
 D SET(.VPSARR,VPSFL,VPSIEN,".01",VPSCNAM)
 S VAL=$$GET1^DIQ(VPSFL,VPSCLN_",",10,"E")
 D SET(.VPSARR,VPSFL,VPSIEN,10,VAL) ; HOSPITAL PHYSICAL LOCATION
 ;
 ; ------ Appt Info ---------------
 S VPSFL="2.98"
 S VAL=$P(VPSAPT,U,1) D SET(.VPSARR,VPSFL,VPSIEN,".001",VAL,"APPOINTMENT DATE/TIME") ; APPT DATE/TIME #1
 S VAL=$P(VPSAPT,U,3) D SET(.VPSARR,VPSFL,VPSIEN,3,VAL) ; STATUS #3
 S VAL=$P($P(VPSAPT,U,22),";",3) D SET(.VPSARR,VPSFL,VPSIEN,100,VAL) ; CURRENT STATUS #22
 S VAL=$P($P(VPSAPT,U,10),";",2) D SET(.VPSARR,VPSFL,VPSIEN,9.5,VAL) ; APPT TYPE IEN/NAME #10
 S VAL=$P(VPSAPT,U,16) D SET(.VPSARR,VPSFL,VPSIEN,20,VAL) ; DATE APPT MADE #16
 S VAL=$P(VPSAPT,U,19) D SET(.VPSARR,VPSFL,VPSIEN,7,VAL) ; EKG DATE/TIME #19
 S VAL=$P(VPSAPT,U,20) D SET(.VPSARR,VPSFL,VPSIEN,6,VAL) ; X-RAY DATE/TIME #20
 S VAL=$P(VPSAPT,U,21) D SET(.VPSARR,VPSFL,VPSIEN,5,VAL) ; LAB DATE/TIME #21
 ;
 N VPSDFN,VPSDT,FLD S VPSDFN=$P(VPSIEN,";") S VPSDT=$P(VPSIEN,";",3)
 S VAL=$$GET1^DIQ(VPSFL,VPSDT_","_VPSDFN_",",14,"E") D SET(.VPSARR,VPSFL,VPSIEN,14,VAL) ; NO-SHOW/CANCELED BY #29
 S VAL=$$GET1^DIQ(VPSFL,VPSDT_","_VPSDFN_",",15,"I") D SET(.VPSARR,VPSFL,VPSIEN,15,VAL) ; NO-SHOW/CANCELED DATE/TM #25
 S VAL=$$GET1^DIQ(VPSFL,VPSDT_","_VPSDFN_",",16,"E") D SET(.VPSARR,VPSFL,VPSIEN,16,VAL) ; Cancellation Reason #32
 S VAL=$$GET1^DIQ(VPSFL,VPSDT_","_VPSDFN_",",17,"E") D SET(.VPSARR,VPSFL,VPSIEN,17,VAL) ; Cancellation Remarks
 QUIT
 ;
SET(VPSARR,VPSFL,VPSIEN,VPSFLD,VPSDA,VPSDS) ;Set line item to output array
 I VPSDA'="" D SET^VPSRPC1(.VPSARR,VPSFL,VPSIEN,VPSFLD,VPSDA,$G(VPSDS),1) ;Set line item to output array
 QUIT