SDEC36 ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
;
Q
;
;COLLECT WAITLIST FOR GIVEN RESOURCE - RPC
WAITLIST(SDECY,SDECRES) ;COLLECT WAITLIST DATA
;WAITLIST(SDECY,SDECRES) external parameter tag in SDEC
; .SDECY = returned pointer to list of waitlist data
; SDECRES = resource code - pointer to ^SDEC(409.831 (SDEC RESOURCE)
; called by SDEC WAITLIST remote procedure
;RETURN:
;Returns a Global Array in which each array entry contains wait list data separated by ^:
; 1. HOSPITAL_LOC_IEN
; 2. WAIT_LIST_IEN
; 3. PATIENT_IEN
; 4. PATIENT_NAME
; 5. HOME_PHONE
; 6. WORK_PHONE
; 7. CHART
; 8. DATE_ADDED
; 9. REASON
;10. PRIORITY
;11. PROVIDER
;12. RECALL_DATE
;13. COMMENT
N SDECI,SDECNOD,SDECRESN,SDECSC,SDECTMP,BSDWL,SDECWLD,SDECWLN,CI,WL
S SDECI=0
K ^TMP("SDEC",$J)
S SDECY="^TMP(""SDEC"","_$J_")"
S ^TMP("SDEC",$J,0)="T00020ERRORID"_$C(30)
; 1 2 3 4 5
S SDECTMP="I00020HOSPITAL_LOC_IEN^I00020WAIT_LIST_IEN^I00020PATIENT_IEN^T00030PATIENT_NAME^T00030HOME_PHONE^"
; 6 7 8 9 10 11
S SDECTMP=SDECTMP_"T00020WORK_PHONE^T00030CHART^D00020DATE_ADDED^T00030REASON^T00020PRIORITY^I00020PROVIDER^"
; 12 13
S SDECTMP=SDECTMP_"D00020RECALL_DATE^T00250COMMENT"_$C(30)
S ^TMP("SDEC",$J,0)=SDECTMP_$C(31)
Q ;TODO - this is looking at ^BSDWL - needs to be changed to look at ^SDWL
;
ERROR ;
D ERR("VISTA Error")
Q
;
ERR(SDECERR) ;Error processing
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=SDECERR_$C(30,31)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDEC36 1756 printed Dec 13, 2024@02:50:31 Page 2
SDEC36 ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
+1 ;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
+2 ;
+3 QUIT
+4 ;
+5 ;COLLECT WAITLIST FOR GIVEN RESOURCE - RPC
WAITLIST(SDECY,SDECRES) ;COLLECT WAITLIST DATA
+1 ;WAITLIST(SDECY,SDECRES) external parameter tag in SDEC
+2 ; .SDECY = returned pointer to list of waitlist data
+3 ; SDECRES = resource code - pointer to ^SDEC(409.831 (SDEC RESOURCE)
+4 ; called by SDEC WAITLIST remote procedure
+5 ;RETURN:
+6 ;Returns a Global Array in which each array entry contains wait list data separated by ^:
+7 ; 1. HOSPITAL_LOC_IEN
+8 ; 2. WAIT_LIST_IEN
+9 ; 3. PATIENT_IEN
+10 ; 4. PATIENT_NAME
+11 ; 5. HOME_PHONE
+12 ; 6. WORK_PHONE
+13 ; 7. CHART
+14 ; 8. DATE_ADDED
+15 ; 9. REASON
+16 ;10. PRIORITY
+17 ;11. PROVIDER
+18 ;12. RECALL_DATE
+19 ;13. COMMENT
+20 NEW SDECI,SDECNOD,SDECRESN,SDECSC,SDECTMP,BSDWL,SDECWLD,SDECWLN,CI,WL
+21 SET SDECI=0
+22 KILL ^TMP("SDEC",$JOB)
+23 SET SDECY="^TMP(""SDEC"","_$JOB_")"
+24 SET ^TMP("SDEC",$JOB,0)="T00020ERRORID"_$CHAR(30)
+25 ; 1 2 3 4 5
+26 SET SDECTMP="I00020HOSPITAL_LOC_IEN^I00020WAIT_LIST_IEN^I00020PATIENT_IEN^T00030PATIENT_NAME^T00030HOME_PHONE^"
+27 ; 6 7 8 9 10 11
+28 SET SDECTMP=SDECTMP_"T00020WORK_PHONE^T00030CHART^D00020DATE_ADDED^T00030REASON^T00020PRIORITY^I00020PROVIDER^"
+29 ; 12 13
+30 SET SDECTMP=SDECTMP_"D00020RECALL_DATE^T00250COMMENT"_$CHAR(30)
+31 SET ^TMP("SDEC",$JOB,0)=SDECTMP_$CHAR(31)
+32 ;TODO - this is looking at ^BSDWL - needs to be changed to look at ^SDWL
QUIT
+33 ;
ERROR ;
+1 DO ERR("VISTA Error")
+2 QUIT
+3 ;
ERR(SDECERR) ;Error processing
+1 SET SDECI=SDECI+1
+2 SET ^TMP("SDEC",$JOB,SDECI)=SDECERR_$CHAR(30,31)
+3 QUIT