SDECPT ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
;
Q
;
PTINQ(SDECY,DFN) ; Return output from ORWPT PTINQ in DataTable format
;PTINQ(SDECY,DFN) external parameter tag is in SDEC
;Return detailed patient information for display in GUI form
;INPUT:
; DFN - (required) Patient ID - pointer to the PATIENT file 2
;RETURN:
; DataTable with one column: PATIENT_INFO
;
N II,SDECI,SDECARR
S SDECY=$NA(^TMP("SDEC",$J))
K @SDECY
S SDECI=0
S @SDECY@(SDECI)="T00250PATIENT_INFO"_$C(30)
S DFN=$G(DFN)
I DFN="" D ERR1^SDECERR(-1,"Patient ID required.",SDECI,SDECY)
I '$D(DFN) D ERR1^SDECERR(-1,"Invalid patient ID "_DFN_".",SDECI,SDECY)
D PTINQ^ORWPT(.SDECARR,DFN)
F II=1:1:$O(@SDECARR@(""),-1) D
. S SDECI=SDECI+1
. S @SDECY@(SDECI)=@SDECARR@(II)_$C(30)
S SDECI=SDECI+1
S @SDECY@(SDECI)=$C(31)
K @SDECARR
Q
;
FACLIST ; Return list of remote facilities for patient
;FACLIST(SDECY,DFN)
;INPUT:
; DFN - (required) Patient ID - pointer to the PATIENT file 2
;RETURN:
; DataTable with one column: PATIENT_INFO
;
N II,SDECI,SDECARR
S SDECY=$NA(^TMP("SDECPT",$J))
K @SDECY
S SDECI=0
S @SDECY@(SDECI)="T00030R1^T00030R2^T00030R3^T00030R4^T00030R5"_$C(30)
D FACLIST^ORWCIRN(.SDECARR,DFN)
S II="" F S II=$O(SDECARR(II)) Q:II="" D
. S SDECI=SDECI+1
. S @SDECY@(SDECI)=@SDECARR@(II)_$C(30)
S SDECI=SDECI+1
S @SDECY@(SDECI)=$C(31)
K @SDECARR
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDECPT 1486 printed Dec 13, 2024@02:52:24 Page 2
SDECPT ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
+1 ;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
+2 ;
+3 QUIT
+4 ;
PTINQ(SDECY,DFN) ; Return output from ORWPT PTINQ in DataTable format
+1 ;PTINQ(SDECY,DFN) external parameter tag is in SDEC
+2 ;Return detailed patient information for display in GUI form
+3 ;INPUT:
+4 ; DFN - (required) Patient ID - pointer to the PATIENT file 2
+5 ;RETURN:
+6 ; DataTable with one column: PATIENT_INFO
+7 ;
+8 NEW II,SDECI,SDECARR
+9 SET SDECY=$NAME(^TMP("SDEC",$JOB))
+10 KILL @SDECY
+11 SET SDECI=0
+12 SET @SDECY@(SDECI)="T00250PATIENT_INFO"_$CHAR(30)
+13 SET DFN=$GET(DFN)
+14 IF DFN=""
DO ERR1^SDECERR(-1,"Patient ID required.",SDECI,SDECY)
+15 IF '$DATA(DFN)
DO ERR1^SDECERR(-1,"Invalid patient ID "_DFN_".",SDECI,SDECY)
+16 DO PTINQ^ORWPT(.SDECARR,DFN)
+17 FOR II=1:1:$ORDER(@SDECARR@(""),-1)
Begin DoDot:1
+18 SET SDECI=SDECI+1
+19 SET @SDECY@(SDECI)=@SDECARR@(II)_$CHAR(30)
End DoDot:1
+20 SET SDECI=SDECI+1
+21 SET @SDECY@(SDECI)=$CHAR(31)
+22 KILL @SDECARR
+23 QUIT
+24 ;
FACLIST ; Return list of remote facilities for patient
+1 ;FACLIST(SDECY,DFN)
+2 ;INPUT:
+3 ; DFN - (required) Patient ID - pointer to the PATIENT file 2
+4 ;RETURN:
+5 ; DataTable with one column: PATIENT_INFO
+6 ;
+7 NEW II,SDECI,SDECARR
+8 SET SDECY=$NAME(^TMP("SDECPT",$JOB))
+9 KILL @SDECY
+10 SET SDECI=0
+11 SET @SDECY@(SDECI)="T00030R1^T00030R2^T00030R3^T00030R4^T00030R5"_$CHAR(30)
+12 DO FACLIST^ORWCIRN(.SDECARR,DFN)
+13 SET II=""
FOR
SET II=$ORDER(SDECARR(II))
if II=""
QUIT
Begin DoDot:1
+14 SET SDECI=SDECI+1
+15 SET @SDECY@(SDECI)=@SDECARR@(II)_$CHAR(30)
End DoDot:1
+16 SET SDECI=SDECI+1
+17 SET @SDECY@(SDECI)=$CHAR(31)
+18 KILL @SDECARR
+19 QUIT