SDEC38 ;ALB/SAT,WTC - VISTA SCHEDULING RPCS ;Feb 12, 2020@15:22
;;5.3;Scheduling;**627,694**;Aug 13, 1993;Build 61
;
; ICR
; ---
; 7030 - #2 (appointment record)
; 10035 - #2 (demographics)
; 10060 - #200
;
Q
;
APPTEVLG(SDECY,DFN) ;GET appointment data for given patient
;APPTEVLG(SDECY,DFN) external parameter tag is in SDEC
;INPUT:
; DFN = patient code - pointer to ^DPT(DFN)
;RETURN:
;Global Array with a single entry containing appointment data for the given patient:
; 1. PATIENT_IEN
; 2. PATIENT_NAME
; 3. CLINIC_IEN
; 4. WARD_IEN
; 5. APPT_TIME
; 6. APPT_NUMBER
; 7. APPT_MADE_TIME
; 8. APPT_MADE_USER
; 9. APPT_MADE_USER_NAME
; 10. ROUT_SLIP_DATE
; 11. CHECKIN_TIME
; 12. CHECKIN_USER
; 13. CHECKIN_USER_NAME
; 14. CHECKOUT_TIME
; 15. CHECKOUT_USER
; 16. CHECKOUT_USER_NAME
; 17. CHECKOUT_FILED_TIME
; 18. NO_SHO_CANCEL_TIME
; 19. NO_SHO_CANCEL_USER
; 20. NO_SHO_CANCEL_USER_NAME
; 21. CHECKED_OUT
; 22. REBOOK_DATE
; 23. CANCEL_REASON
; 24. CANCEL_REMARK
;
N AMN,AMT,AMU,APN,APT,SDECI,SDECTMP,CIN,CIT,CIU,COE,COF,CON,COT,COU,CRM,CRS
N DPTS,DPTSR,NSN,NST,NSU,PAT,PN,RBD,RSD,S,SC,SDCL,SDCLS,SDCLSC,SDW
S SDECI=0
K ^TMP("SDEC",$J)
S SDECY="^TMP(""SDEC"","_$J_")"
S ^TMP("SDEC",$J,0)="T00020ERRORID"_$C(30)
;check for valid Patient
I '+DFN D ERR^SDECERR("Invalid Patient ID.") Q
I '$D(^DPT(DFN,0)) D ERR^SDECERR("Invalid Patient ID.") Q
; data header
S SDECTMP="T00020PATIENT_IEN^T00020PATIENT_NAME^T00020CLINIC_IEN^T00020WARD_IEN^T00020APPT_TIME^T00020APPT_NUMBER"
S SDECTMP=SDECTMP_"^T00020APPT_MADE_TIME^T00020APPT_MADE_USER^T00020APPT_MADE_USER_NAME^T00020ROUT_SLIP_DATE"
S SDECTMP=SDECTMP_"^T00020CHECKIN_TIME^T00020CHECKIN_USER^T00020CHECKIN_USER_NAME"
S SDECTMP=SDECTMP_"^T00020CHECKOUT_TIME^T00020CHECKOUT_USER^T00020CHECKOUT_USER_NAME^T00020CHECKOUT_FILED_TIME"
S SDECTMP=SDECTMP_"^T00020NO_SHO_CANCEL_TIME^T00020NO_SHO_CANCEL_USER^T00020NO_SHO_CANCEL_USER_NAME^T00020CHECKED_OUT"
S SDECTMP=SDECTMP_"^T00020REBOOK_DATE^T00100CANCEL_REASON^T00100CANCEL_REMARK"_$C(30)
S ^TMP("SDEC",$J,0)=SDECTMP
S PN=$$GET1^DIQ(2,DFN_",",.01)
S APN=0
S SDCLS=""
S SDCLSC=""
;loop thru patient appointments
S S=0 F S S=$O(^DPT(DFN,"S",S)) Q:S'>0 D
. S DPTS=$G(^DPT(DFN,"S",S,0))
. S DPTSR=$G(^DPT(DFN,"S",S,"R"))
. S SDCL=$P(DPTS,U) ;get clinic
. S PAT="",SC=0 F S SC=$O(^SC(SDCL,"S",S,1,SC)) Q:SC'>0 D Q:PAT=DFN ;get appt record from clinic
. . S SDCLS=$G(^SC(SDCL,"S",S,1,SC,0))
. . S SDCLSC=$G(^SC(SDCL,"S",S,1,SC,"C"))
. . S PAT=$P(SDCLS,U)
. . I PAT=DFN Q
. S SDECTMP=DFN_U ;01 PATIENT_IEN
. S SDECTMP=SDECTMP_PN_U ;02 PATIENT_NAME
. S SDECTMP=SDECTMP_SDCL_U ;03 CLINIC_IEN
. S SDW=$S($D(^DPT(DFN,.1)):^(.1),1:"Outpatient") ;04 WARD_IEN
. S SDECTMP=SDECTMP_SDW_U
. ;
. ; Change date/time conversion so midnight is handled properly. wtc 694 4/24/18
. ;
. ;S APT=$TR($$FMTE^XLFDT(S),"@"," ") ;05 APPT_TIME
. S APT=$$FMTONET^SDECDATE(S,"Y") ; 05 APPT_TIME
. S SDECTMP=SDECTMP_APT_U
. S APN=APN+1 ;06 APPT_NUMBER
. S SDECTMP=SDECTMP_APN_U
. S AMT=$P(DPTS,U,19) ;07 APPT_MADE_TIME
. ;S:AMT'="" AMT=$TR($$FMTE^XLFDT(AMT),"@"," ")
. S:AMT'="" AMT=$$FMTONET^SDECDATE(AMT,"Y") ;
. S SDECTMP=SDECTMP_AMT_U
. S AMU=$P(DPTS,U,18) ;08 APPT_MADE_USER
. S SDECTMP=SDECTMP_AMU_U
. S AMN=$$GET1^DIQ(200,AMU_",",.01) ;09 APPT_MADE_USER_NAME
. S SDECTMP=SDECTMP_AMN_U
. S RSD=$P(DPTS,U,13) ;10 ROUT_SLIP_DATE
. ;S:RSD'="" RSD=$TR($$FMTE^XLFDT(RSD),"@"," ")
. S:RSD'="" RSD=$$FMTONET^SDECDATE(RSD,"Y") ;
. S SDECTMP=SDECTMP_RSD_U
. S CIT=$P(SDCLSC,U) ;11 CHECKIN_TIME
. ;S:CIT'="" CIT=$TR($$FMTE^XLFDT(CIT),"@"," ")
. S:CIT'="" CIT=$$FMTONET^SDECDATE(CIT,"Y") ;
. S SDECTMP=SDECTMP_CIT_U
. S CIU=$P(SDCLSC,U,2) ;12 CHECKIN_USER
. S SDECTMP=SDECTMP_CIU_U
. S CIN=$$GET1^DIQ(200,CIU_",",.01) ;13 CHECKIN_USER_NAME
. S SDECTMP=SDECTMP_CIN_U
. S COT=$P(SDCLSC,U,3) ;14 CHECKOUT_TIME
. ;S:COT'="" COT=$TR($$FMTE^XLFDT(COT),"@"," ")
. S:COT'="" COT=$$FMTONET^SDECDATE(COT,"Y") ;
. S SDECTMP=SDECTMP_COT_U
. S COU=$P(SDCLSC,U,4) ;15 CHECKOUT_USER
. S SDECTMP=SDECTMP_COU_U
. S CON=$$GET1^DIQ(200,COU_",",.01) ;16 CHECKOUT_USER_NAME
. S SDECTMP=SDECTMP_CON_U
. S COE=$P(SDCLSC,U,6) ;17 CHECKOUT_FILED_TIME
. ;S:COE'="" COE=$TR($$FMTE^XLFDT(COE),"@"," ")
. S:COE'="" COE=$$FMTONET^SDECDATE(COE,"Y") ;
. S SDECTMP=SDECTMP_COE_U
. S NST=$P(DPTS,U,14) ;18 NO_SHO_CANCEL_TIME
. ;S:NST'="" NST=$TR($$FMTE^XLFDT(NST),"@"," ")
. S:NST'="" NST=$$FMTONET^SDECDATE(NST,"Y") ;
. S SDECTMP=SDECTMP_NST_U
. S NSU=$P(DPTS,U,12) ;19 NO_SHO_CANCEL_USER
. S SDECTMP=SDECTMP_NSU_U
. S NSN=$$GET1^DIQ(200,NSU_",",.01) ;20 NO_SHO_CANCEL_USER_NAME
. S SDECTMP=SDECTMP_NSN_U
. S COF=$S($P(SDCLSC,U,3)'="":"YES",SDCLSC'="":"NO",1:"") ;21 CHECKED_OUT
. S SDECTMP=SDECTMP_COF_U
. S RBD=$P(DPTS,U,10) ;22 REBOOK_DATE
. ;S:RBD'="" RBD=$TR($$FMTE^XLFDT(RBD),"@"," ")
. S:RBD'="" RBD=$$FMTONET^SDECDATE(RBD,"Y") ;
. S SDECTMP=SDECTMP_RBD_U
. S SDECI=SDECI+1
. S ^TMP("SDEC",$J,SDECI)=SDECTMP
. S CRS=$P(DPTS,U,15) ;23 CANCEL_REASON
. S SDECI=SDECI+1
. S ^TMP("SDEC",$J,SDECI)=CRS_U
. S CRM=$P(DPTSR,U) ;24 CANCEL_REMARK
. S SDECI=SDECI+1
. S ^TMP("SDEC",$J,SDECI)=CRM
. S SDECI=SDECI+1
. S ^TMP("SDEC",$J,SDECI)=$C(30)
;
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=$C(31)
Q
;
NOSHOW(DFN,SDT,CIFN,PAT) ;Input: DFN=Patient IFN, SDT=Appointment D/T
; CIFN=Clinic IFN, PAT=Zero node of pat. appt., DA=Clinic appt. IFN
; Output: 1 or 0 for noshow yes/no
N NSQUERY,NS S NS=1,NSQUERY=$$STATUS^SDAM1(DFN,SDT,CIFN,PAT)
I $P(NSQUERY,";",3)["ACTION REQ" S NS=0
NOSHOWQ Q NS
;
;return boolean to represent that a clinic allows variable appointment length - RPC
VAL(SDECY,SDCL) ;return boolean to represent that a clinic allows variable appointment length - RPC
; SDEC CLINIC VAR APPT
N SDECI,VAL
S SDECI=0
K ^TMP("SDEC",$J)
S SDECY="^TMP(""SDEC"","_$J_")"
S ^TMP("SDEC",$J,0)="T00020ERRORID"_$C(30)
;check for valid clinic ID
I '+SDCL D ERR^SDECERR("Invalid Clinic ID.") Q
I '$D(^SC(SDCL,0)) D ERR^SDECERR("Invalid Clinic ID.") Q
; data header
; VAR_APPT_FLAG = flag 0=Clinic does not Allow Variable Appointment; 1=Clinic Allows Variable Appointment
S ^TMP("SDEC",$J,0)="I00020VAR_APPT_FLAG"_$C(30)
;get VARIABLE APPOINTMENT FLAG for clinic
S VAL=$$GET1^DIQ(44,SDCL_",",1913) ;Variable Appointment Length
S VAL=$S(VAL["YES":1,1:0)
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=VAL
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=$C(30)
S SDECI=SDECI+1
S ^TMP("SDEC",$J,SDECI)=$C(31)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDEC38 7259 printed Dec 13, 2024@02:50:33 Page 2
SDEC38 ;ALB/SAT,WTC - VISTA SCHEDULING RPCS ;Feb 12, 2020@15:22
+1 ;;5.3;Scheduling;**627,694**;Aug 13, 1993;Build 61
+2 ;
+3 ; ICR
+4 ; ---
+5 ; 7030 - #2 (appointment record)
+6 ; 10035 - #2 (demographics)
+7 ; 10060 - #200
+8 ;
+9 QUIT
+10 ;
APPTEVLG(SDECY,DFN) ;GET appointment data for given patient
+1 ;APPTEVLG(SDECY,DFN) external parameter tag is in SDEC
+2 ;INPUT:
+3 ; DFN = patient code - pointer to ^DPT(DFN)
+4 ;RETURN:
+5 ;Global Array with a single entry containing appointment data for the given patient:
+6 ; 1. PATIENT_IEN
+7 ; 2. PATIENT_NAME
+8 ; 3. CLINIC_IEN
+9 ; 4. WARD_IEN
+10 ; 5. APPT_TIME
+11 ; 6. APPT_NUMBER
+12 ; 7. APPT_MADE_TIME
+13 ; 8. APPT_MADE_USER
+14 ; 9. APPT_MADE_USER_NAME
+15 ; 10. ROUT_SLIP_DATE
+16 ; 11. CHECKIN_TIME
+17 ; 12. CHECKIN_USER
+18 ; 13. CHECKIN_USER_NAME
+19 ; 14. CHECKOUT_TIME
+20 ; 15. CHECKOUT_USER
+21 ; 16. CHECKOUT_USER_NAME
+22 ; 17. CHECKOUT_FILED_TIME
+23 ; 18. NO_SHO_CANCEL_TIME
+24 ; 19. NO_SHO_CANCEL_USER
+25 ; 20. NO_SHO_CANCEL_USER_NAME
+26 ; 21. CHECKED_OUT
+27 ; 22. REBOOK_DATE
+28 ; 23. CANCEL_REASON
+29 ; 24. CANCEL_REMARK
+30 ;
+31 NEW AMN,AMT,AMU,APN,APT,SDECI,SDECTMP,CIN,CIT,CIU,COE,COF,CON,COT,COU,CRM,CRS
+32 NEW DPTS,DPTSR,NSN,NST,NSU,PAT,PN,RBD,RSD,S,SC,SDCL,SDCLS,SDCLSC,SDW
+33 SET SDECI=0
+34 KILL ^TMP("SDEC",$JOB)
+35 SET SDECY="^TMP(""SDEC"","_$JOB_")"
+36 SET ^TMP("SDEC",$JOB,0)="T00020ERRORID"_$CHAR(30)
+37 ;check for valid Patient
+38 IF '+DFN
DO ERR^SDECERR("Invalid Patient ID.")
QUIT
+39 IF '$DATA(^DPT(DFN,0))
DO ERR^SDECERR("Invalid Patient ID.")
QUIT
+40 ; data header
+41 SET SDECTMP="T00020PATIENT_IEN^T00020PATIENT_NAME^T00020CLINIC_IEN^T00020WARD_IEN^T00020APPT_TIME^T00020APPT_NUMBER"
+42 SET SDECTMP=SDECTMP_"^T00020APPT_MADE_TIME^T00020APPT_MADE_USER^T00020APPT_MADE_USER_NAME^T00020ROUT_SLIP_DATE"
+43 SET SDECTMP=SDECTMP_"^T00020CHECKIN_TIME^T00020CHECKIN_USER^T00020CHECKIN_USER_NAME"
+44 SET SDECTMP=SDECTMP_"^T00020CHECKOUT_TIME^T00020CHECKOUT_USER^T00020CHECKOUT_USER_NAME^T00020CHECKOUT_FILED_TIME"
+45 SET SDECTMP=SDECTMP_"^T00020NO_SHO_CANCEL_TIME^T00020NO_SHO_CANCEL_USER^T00020NO_SHO_CANCEL_USER_NAME^T00020CHECKED_OUT"
+46 SET SDECTMP=SDECTMP_"^T00020REBOOK_DATE^T00100CANCEL_REASON^T00100CANCEL_REMARK"_$CHAR(30)
+47 SET ^TMP("SDEC",$JOB,0)=SDECTMP
+48 SET PN=$$GET1^DIQ(2,DFN_",",.01)
+49 SET APN=0
+50 SET SDCLS=""
+51 SET SDCLSC=""
+52 ;loop thru patient appointments
+53 SET S=0
FOR
SET S=$ORDER(^DPT(DFN,"S",S))
if S'>0
QUIT
Begin DoDot:1
+54 SET DPTS=$GET(^DPT(DFN,"S",S,0))
+55 SET DPTSR=$GET(^DPT(DFN,"S",S,"R"))
+56 ;get clinic
SET SDCL=$PIECE(DPTS,U)
+57 ;get appt record from clinic
SET PAT=""
SET SC=0
FOR
SET SC=$ORDER(^SC(SDCL,"S",S,1,SC))
if SC'>0
QUIT
Begin DoDot:2
+58 SET SDCLS=$GET(^SC(SDCL,"S",S,1,SC,0))
+59 SET SDCLSC=$GET(^SC(SDCL,"S",S,1,SC,"C"))
+60 SET PAT=$PIECE(SDCLS,U)
+61 IF PAT=DFN
QUIT
End DoDot:2
if PAT=DFN
QUIT
+62 ;01 PATIENT_IEN
SET SDECTMP=DFN_U
+63 ;02 PATIENT_NAME
SET SDECTMP=SDECTMP_PN_U
+64 ;03 CLINIC_IEN
SET SDECTMP=SDECTMP_SDCL_U
+65 ;04 WARD_IEN
SET SDW=$SELECT($DATA(^DPT(DFN,.1)):^(.1),1:"Outpatient")
+66 SET SDECTMP=SDECTMP_SDW_U
+67 ;
+68 ; Change date/time conversion so midnight is handled properly. wtc 694 4/24/18
+69 ;
+70 ;S APT=$TR($$FMTE^XLFDT(S),"@"," ") ;05 APPT_TIME
+71 ; 05 APPT_TIME
SET APT=$$FMTONET^SDECDATE(S,"Y")
+72 SET SDECTMP=SDECTMP_APT_U
+73 ;06 APPT_NUMBER
SET APN=APN+1
+74 SET SDECTMP=SDECTMP_APN_U
+75 ;07 APPT_MADE_TIME
SET AMT=$PIECE(DPTS,U,19)
+76 ;S:AMT'="" AMT=$TR($$FMTE^XLFDT(AMT),"@"," ")
+77 ;
if AMT'=""
SET AMT=$$FMTONET^SDECDATE(AMT,"Y")
+78 SET SDECTMP=SDECTMP_AMT_U
+79 ;08 APPT_MADE_USER
SET AMU=$PIECE(DPTS,U,18)
+80 SET SDECTMP=SDECTMP_AMU_U
+81 ;09 APPT_MADE_USER_NAME
SET AMN=$$GET1^DIQ(200,AMU_",",.01)
+82 SET SDECTMP=SDECTMP_AMN_U
+83 ;10 ROUT_SLIP_DATE
SET RSD=$PIECE(DPTS,U,13)
+84 ;S:RSD'="" RSD=$TR($$FMTE^XLFDT(RSD),"@"," ")
+85 ;
if RSD'=""
SET RSD=$$FMTONET^SDECDATE(RSD,"Y")
+86 SET SDECTMP=SDECTMP_RSD_U
+87 ;11 CHECKIN_TIME
SET CIT=$PIECE(SDCLSC,U)
+88 ;S:CIT'="" CIT=$TR($$FMTE^XLFDT(CIT),"@"," ")
+89 ;
if CIT'=""
SET CIT=$$FMTONET^SDECDATE(CIT,"Y")
+90 SET SDECTMP=SDECTMP_CIT_U
+91 ;12 CHECKIN_USER
SET CIU=$PIECE(SDCLSC,U,2)
+92 SET SDECTMP=SDECTMP_CIU_U
+93 ;13 CHECKIN_USER_NAME
SET CIN=$$GET1^DIQ(200,CIU_",",.01)
+94 SET SDECTMP=SDECTMP_CIN_U
+95 ;14 CHECKOUT_TIME
SET COT=$PIECE(SDCLSC,U,3)
+96 ;S:COT'="" COT=$TR($$FMTE^XLFDT(COT),"@"," ")
+97 ;
if COT'=""
SET COT=$$FMTONET^SDECDATE(COT,"Y")
+98 SET SDECTMP=SDECTMP_COT_U
+99 ;15 CHECKOUT_USER
SET COU=$PIECE(SDCLSC,U,4)
+100 SET SDECTMP=SDECTMP_COU_U
+101 ;16 CHECKOUT_USER_NAME
SET CON=$$GET1^DIQ(200,COU_",",.01)
+102 SET SDECTMP=SDECTMP_CON_U
+103 ;17 CHECKOUT_FILED_TIME
SET COE=$PIECE(SDCLSC,U,6)
+104 ;S:COE'="" COE=$TR($$FMTE^XLFDT(COE),"@"," ")
+105 ;
if COE'=""
SET COE=$$FMTONET^SDECDATE(COE,"Y")
+106 SET SDECTMP=SDECTMP_COE_U
+107 ;18 NO_SHO_CANCEL_TIME
SET NST=$PIECE(DPTS,U,14)
+108 ;S:NST'="" NST=$TR($$FMTE^XLFDT(NST),"@"," ")
+109 ;
if NST'=""
SET NST=$$FMTONET^SDECDATE(NST,"Y")
+110 SET SDECTMP=SDECTMP_NST_U
+111 ;19 NO_SHO_CANCEL_USER
SET NSU=$PIECE(DPTS,U,12)
+112 SET SDECTMP=SDECTMP_NSU_U
+113 ;20 NO_SHO_CANCEL_USER_NAME
SET NSN=$$GET1^DIQ(200,NSU_",",.01)
+114 SET SDECTMP=SDECTMP_NSN_U
+115 ;21 CHECKED_OUT
SET COF=$SELECT($PIECE(SDCLSC,U,3)'="":"YES",SDCLSC'="":"NO",1:"")
+116 SET SDECTMP=SDECTMP_COF_U
+117 ;22 REBOOK_DATE
SET RBD=$PIECE(DPTS,U,10)
+118 ;S:RBD'="" RBD=$TR($$FMTE^XLFDT(RBD),"@"," ")
+119 ;
if RBD'=""
SET RBD=$$FMTONET^SDECDATE(RBD,"Y")
+120 SET SDECTMP=SDECTMP_RBD_U
+121 SET SDECI=SDECI+1
+122 SET ^TMP("SDEC",$JOB,SDECI)=SDECTMP
+123 ;23 CANCEL_REASON
SET CRS=$PIECE(DPTS,U,15)
+124 SET SDECI=SDECI+1
+125 SET ^TMP("SDEC",$JOB,SDECI)=CRS_U
+126 ;24 CANCEL_REMARK
SET CRM=$PIECE(DPTSR,U)
+127 SET SDECI=SDECI+1
+128 SET ^TMP("SDEC",$JOB,SDECI)=CRM
+129 SET SDECI=SDECI+1
+130 SET ^TMP("SDEC",$JOB,SDECI)=$CHAR(30)
End DoDot:1
+131 ;
+132 SET SDECI=SDECI+1
+133 SET ^TMP("SDEC",$JOB,SDECI)=$CHAR(31)
+134 QUIT
+135 ;
NOSHOW(DFN,SDT,CIFN,PAT) ;Input: DFN=Patient IFN, SDT=Appointment D/T
+1 ; CIFN=Clinic IFN, PAT=Zero node of pat. appt., DA=Clinic appt. IFN
+2 ; Output: 1 or 0 for noshow yes/no
+3 NEW NSQUERY,NS
SET NS=1
SET NSQUERY=$$STATUS^SDAM1(DFN,SDT,CIFN,PAT)
+4 IF $PIECE(NSQUERY,";",3)["ACTION REQ"
SET NS=0
NOSHOWQ QUIT NS
+1 ;
+2 ;return boolean to represent that a clinic allows variable appointment length - RPC
VAL(SDECY,SDCL) ;return boolean to represent that a clinic allows variable appointment length - RPC
+1 ; SDEC CLINIC VAR APPT
+2 NEW SDECI,VAL
+3 SET SDECI=0
+4 KILL ^TMP("SDEC",$JOB)
+5 SET SDECY="^TMP(""SDEC"","_$JOB_")"
+6 SET ^TMP("SDEC",$JOB,0)="T00020ERRORID"_$CHAR(30)
+7 ;check for valid clinic ID
+8 IF '+SDCL
DO ERR^SDECERR("Invalid Clinic ID.")
QUIT
+9 IF '$DATA(^SC(SDCL,0))
DO ERR^SDECERR("Invalid Clinic ID.")
QUIT
+10 ; data header
+11 ; VAR_APPT_FLAG = flag 0=Clinic does not Allow Variable Appointment; 1=Clinic Allows Variable Appointment
+12 SET ^TMP("SDEC",$JOB,0)="I00020VAR_APPT_FLAG"_$CHAR(30)
+13 ;get VARIABLE APPOINTMENT FLAG for clinic
+14 ;Variable Appointment Length
SET VAL=$$GET1^DIQ(44,SDCL_",",1913)
+15 SET VAL=$SELECT(VAL["YES":1,1:0)
+16 SET SDECI=SDECI+1
+17 SET ^TMP("SDEC",$JOB,SDECI)=VAL
+18 SET SDECI=SDECI+1
+19 SET ^TMP("SDEC",$JOB,SDECI)=$CHAR(30)
+20 SET SDECI=SDECI+1
+21 SET ^TMP("SDEC",$JOB,SDECI)=$CHAR(31)
+22 QUIT