SDESGETTIUDOC ;ALB/RRM - VISTA SCHEDULING GET TIU DOCUMENT BY CONTEXT RPC; Oct 07, 2022@15:02
;;5.3;Scheduling;**827**;Aug 13, 1993;Build 10
;;Per VHA Directive 6402, this routine should not be modified
;
;External References
;-------------------
; Reference to $$CONTEXT^TIUSRVLO is supported by IA #2865
; Reference to GETS^DIQ is supported by IA #2056
; Reference to $$FIND1^DIC is supported by IA #2051
; Reference to ENCODE^XLFJSON is supported by IA #6682
; Reference to Direct Global Read access to is supported by IA #2937
; TIU DOCUMENT File #8925
; Reference to Direct Global Read access to is supported by IA #5897
; TIU DOCUMENT File #8925.1
; Reference to ^VA(200 is supported by IA #10060
;
Q ;No Direct Call
;
; The parameter list for this RPC must be kept in sync.
; If you need to add or remove a parameter, ensure that the Remote Procedure File #8994 definition is also updated.
TIUDOCBYCONTEXT(JSONRETURN,CLASS,CONTEXT,DFN,BEGINDATE,ENDDATE,PERSON,OCCLIM,SEQUENCE,SHOWADD,INCUND,SHOW,TIUIEN,EAS) ; ep: SDES GET TIU DOC BY CONTEXT RPC
; Input:
; CLASS [Required] - Pointer to TIU DOCUMENT DEFINITION #8925.1
; (e.g. 3 for PROGRESS NOTES, 244 for DISCHARGE SUMMARIES)
; CONTEXT [Required] - 1=All Signed (by PT),
; 2="Unsigned (by PT&(AUTHOR!TRANSCRIBER))
; 3="Uncosigned (by PT&EXPECTED COSIGNER
; 4="Signed notes (by PT&selected author)
; 5="Signed notes (by PT&date range)
; DFN [Required] - Pointer to Patient File#2
; BEGINDATE [Optional] - The beginning date/time in ISO 8601 Time Format to start for the search.
; ENDDATE [Optional] - The ending date/time in ISO 8601 Time Format to start for the search.
; PERSON [Optional] - Pointer to file 200 (The program will use the default DUZ if not passed)
; OCCLIM [Optional] - The number of documents/records to the return array
; SEQUENCE [Optional] - "A"=ascending (Regular date/time)
; "D"=descending (Reverse date/time) (dflt)
; SHOWADD [Optional] - Boolean: Include addenda in the return array, when their parent documents are identified by the search
; INCUND [Optional] - Boolean: Include Undictated and Untranscribed documents along with Unsigned documents, when the CONTEXT is 2.
; SHOW [Optional] - Boolean: Return "0^SHOW MORE" in return
; array when additional notes available for
; context of 1 or 5 when occurrence limit
; prevents all notes from displaying
; TIUIEN [Optional] - Starting TIU IEN for additional return
; when "SHOW MORE" was received in previous
; return array (LATE date/time will be set
; to Reference date of this TIU document)
; EAS [Optional] - The Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
;
; Output:
; Successful Return:
; JSONRETURN = Returns the TIU DOCUMENT data in JSON formatted string.
; Otherwise, JSON Errors will be returned for any invalid/missing parameters.
;
N TMPTIU,RETURN,ERRORS
D INITVAR
D VALIDATECLASS(.ERRORS,CLASS)
D VALIDATECONTEXT(.ERRORS,CONTEXT)
D VALIDATEDFN(.ERRORS,DFN)
D VALBEGENDDATE(.ERRORS,BEGINDATE,ENDDATE)
D VALIDATEPERSON(.ERRORS,PERSON)
D VALIDATEOCCLIM(.ERRORS,OCCLIM)
D VALIDATESEQ(.ERRORS,SEQUENCE)
D VALIDATESHOWADD(.ERRORS,SHOWADD)
D VALIDATEINCUND(.ERRORS,INCUND)
D VALIDATESHOW(.ERRORS,SHOW)
D VALIDATETIUIEN(.ERRORS,TIUIEN)
D VALIDATEEAS^SDESINPUTVALUTL(.ERRORS,EAS)
I $D(ERRORS) M RETURN=ERRORS D BUILDJSON^SDESBUILDJSON(.JSONRETURN,.RETURN) Q
D CONTEXT^TIUSRVLO(.TMPTIU,CLASS,CONTEXT,DFN,BEGINDATE,ENDDATE,PERSON,OCCLIM,SEQUENCE,SHOWADD,INCUND,SHOW,TIUIEN)
D BUILDDATA(.TMPTIU,.RETURN,DFN)
D BUILDJSON^SDESBUILDJSON(.JSONRETURN,.RETURN)
Q
;
BUILDDATA(TMPTIU,RETURN,DFN) ;
N RECNT,CLINICIEN,TIUDATA,ERR,EPBEGDATETIME,EPENDDATETIME
K RETURN
S RECNT=0 F S RECNT=$O(@TMPTIU@(RECNT)) Q:RECNT="" D
. S TIUIEN=$P(@TMPTIU@(RECNT),"^")
. S RETURN("TIUDocument",RECNT,"DocumentIEN")=TIUIEN
. S RETURN("TIUDocument",RECNT,"DocumentPrintName")=$P(@TMPTIU@(RECNT),"^",2)
. S RETURN("TIUDocument",RECNT,"NoteDateTime")=$$FMTISO^SDAMUTDT($P(@TMPTIU@(RECNT),"^",3))
. S RETURN("TIUDocument",RECNT,"PatientName")=$$GET1^DIQ(2,DFN,.01,"E")
. S RETURN("TIUDocument",RECNT,"PatientDFN")=$G(DFN)
. S RETURN("TIUDocument",RECNT,"Last4SSN")=$$LAST4SSN^SDESINPUTVALUTL($G(DFN))
. S RETURN("TIUDocument",RECNT,"Author")=$P($P(@TMPTIU@(RECNT),"^",5),";",3)
. S RETURN("TIUDocument",RECNT,"AuthorDUZ")=$P($P(@TMPTIU@(RECNT),"^",5),";")
. S RETURN("TIUDocument",RECNT,"SignatureBlockName")=$P($P(@TMPTIU@(RECNT),"^",5),";",2)
. S RETURN("TIUDocument",RECNT,"HospitalLocation")=$P(@TMPTIU@(RECNT),"^",6)
. S RETURN("TIUDocument",RECNT,"Status")=$P(@TMPTIU@(RECNT),"^",7)
. S RETURN("TIUDocument",RECNT,"RequestingPackageVariablePointer")=$P(@TMPTIU@(RECNT),"^",10)
. S RETURN("TIUDocument",RECNT,"ImageCount")=$P(@TMPTIU@(RECNT),"^",11)
. S RETURN("TIUDocument",RECNT,"Subject")=$P(@TMPTIU@(RECNT),"^",12)
. S RETURN("TIUDocument",RECNT,"HasChildren")=$P(@TMPTIU@(RECNT),"^",13)
. S RETURN("TIUDocument",RECNT,"IENOfParentDocument")=$P(@TMPTIU@(RECNT),"^",14)
. ;
. S CLINICIEN=$$FIND1^DIC(44,"","X",$P(@TMPTIU@(RECNT),"^",6),"B")
. S RETURN("TIUDocument",RECNT,"HospitalLocationIEN")=CLINICIEN
. S EPBEGDATETIME=$$CVTTOFM^SDAMUTDT($TR($P($P(@TMPTIU@(RECNT),"^",8),":",2)," ",""))
. S EPENDDATETIME=$$CVTTOFM^SDAMUTDT($TR($P($P(@TMPTIU@(RECNT),"^",9),":",2)," ",""))
. S RETURN("TIUDocument",RECNT,"EpisodeBeginDateTime")=$S(EPBEGDATETIME<1:"",1:$$FMTISO^SDAMUTDT(EPBEGDATETIME,$G(CLINICIEN)))
. S RETURN("TIUDocument",RECNT,"EpisodeEndDateTime")=$S(EPENDDATETIME<1:"",1:$$FMTISO^SDAMUTDT(EPENDDATETIME,$G(CLINICIEN)))
. S RETURN("TIUDocument",RECNT,"TypeOfLocation")=$P($P(@TMPTIU@(RECNT),"^",8),":",1)
. ;
. K TIUDATA,ERR
. D GETS^DIQ(8925,TIUIEN_",","1205;1206;1207;1211","IE","TIUDATA","ERR")
. S RETURN("TIUDocument",RECNT,"VisitLocationName")=$G(TIUDATA(8925,TIUIEN_",",1211,"E"))
. S RETURN("TIUDocument",RECNT,"VisitLocationIEN")=$G(TIUDATA(8925,TIUIEN_",",1211,"I"))
;If no record found, set the object equals to null
I $O(RETURN("TIUDocument",""))="" S RETURN("TIUDocument",1)=""
Q
;
VALIDATECLASS(ERRORS,CLASS) ;
N ERR,SDTIUCLASSIEN
I $G(CLASS)="" D ERRLOG^SDESJSON(.ERRORS,329) Q
S SDTIUCLASSIEN=$$FIND1^DIC(8925.1,"","","`"_$G(CLASS),"","","ERR")
I +SDTIUCLASSIEN<1 D ERRLOG^SDESJSON(.ERRORS,328)
Q
;
VALIDATECONTEXT(ERRORS,CONTEXT) ;
I $G(CONTEXT)="" D ERRLOG^SDESJSON(.ERRORS,330) Q
I $G(CONTEXT)'="",(+CONTEXT<1!(+CONTEXT>5)) D ERRLOG^SDESJSON(.ERRORS,331) Q
Q
;
VALIDATEDFN(ERRORS,DFN) ;
D VALIDATEDFN^SDESINPUTVALUTL(.ERRORS,DFN)
Q
;
VALBEGENDDATE(ERRORS,BEGINDATE,ENDDATE) ;
I BEGINDATE'="" D
. S BEGINDATE=$$ISOTFM^SDAMUTDT(BEGINDATE)
. I BEGINDATE=-1 S BEGINDATE=""
;
I ENDDATE'="" D
. S ENDDATE=$$ISOTFM^SDAMUTDT(ENDDATE)
. I ENDDATE=-1 S ENDDATE=""
;
I $G(BEGINDATE)'=-1,$G(ENDDATE)'=-1,BEGINDATE>ENDDATE D ERRLOG^SDESJSON(.ERRORS,29)
Q
;
VALIDATEPERSON(ERRORS,PERSON) ;
I PERSON'="",'$D(^VA(200,DUZ,0)) S PERSON=""
Q
;
VALIDATEOCCLIM(ERRORS,OCCLIM) ;
I +$G(OCCLIM)'>0 S OCCLIM=""
Q
;
VALIDATESEQ(ERRORS,SEQUENCE) ;
I $G(SEQUENCE)'="",(SEQUENCE'="A"!(SEQUENCE'="D")) S SEQUENCE=""
Q
;
VALIDATESHOWADD(ERRORS,SHOWADD) ;
I ($G(SHOWADD)'="")&(SHOWADD'?1N!(SHOWADD>1)) S SHOWADD=""
Q
;
VALIDATEINCUND(ERRORS,INCUND) ;
I ($G(INCUND)'="")&(INCUND'?1N!(INCUND>1)) S INCUND=""
Q
;
VALIDATESHOW(ERRORS,SHOW) ;
I ($G(SHOW)'="")&(SHOW'?1N!(SHOW>1)) S SHOW=""
Q
;
VALIDATETIUIEN(ERRORS,TIUEN) ;
I $G(TIUIEN)'="",'$D(^TIU(8925,+TIUIEN,0)) S TIUIEN=""
Q
;
INITVAR ;Initialize input parameter variables
S CLASS=$G(CLASS)
S CONTEXT=$G(CONTEXT)
S DFN=$G(DFN)
S BEGINDATE=$G(BEGINDATE)
S ENDDATE=$G(ENDDATE)
S DUZ=$G(DUZ)
S PERSON=$G(PERSON)
S OCCLIM=$G(OCCLIM)
S SEQUENCE=$G(SEQUENCE)
S SHOWADD=$G(SHOWADD)
S INCUND=$G(INCUND)
S SHOW=$G(SHOW)
S TIUIEN=$G(TIUIEN)
S EAS=$G(EAS)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESGETTIUDOC 8528 printed Oct 16, 2024@18:57:35 Page 2
SDESGETTIUDOC ;ALB/RRM - VISTA SCHEDULING GET TIU DOCUMENT BY CONTEXT RPC; Oct 07, 2022@15:02
+1 ;;5.3;Scheduling;**827**;Aug 13, 1993;Build 10
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 ;External References
+5 ;-------------------
+6 ; Reference to $$CONTEXT^TIUSRVLO is supported by IA #2865
+7 ; Reference to GETS^DIQ is supported by IA #2056
+8 ; Reference to $$FIND1^DIC is supported by IA #2051
+9 ; Reference to ENCODE^XLFJSON is supported by IA #6682
+10 ; Reference to Direct Global Read access to is supported by IA #2937
+11 ; TIU DOCUMENT File #8925
+12 ; Reference to Direct Global Read access to is supported by IA #5897
+13 ; TIU DOCUMENT File #8925.1
+14 ; Reference to ^VA(200 is supported by IA #10060
+15 ;
+16 ;No Direct Call
QUIT
+17 ;
+18 ; The parameter list for this RPC must be kept in sync.
+19 ; If you need to add or remove a parameter, ensure that the Remote Procedure File #8994 definition is also updated.
TIUDOCBYCONTEXT(JSONRETURN,CLASS,CONTEXT,DFN,BEGINDATE,ENDDATE,PERSON,OCCLIM,SEQUENCE,SHOWADD,INCUND,SHOW,TIUIEN,EAS) ; ep: SDES GET TIU DOC BY CONTEXT RPC
+1 ; Input:
+2 ; CLASS [Required] - Pointer to TIU DOCUMENT DEFINITION #8925.1
+3 ; (e.g. 3 for PROGRESS NOTES, 244 for DISCHARGE SUMMARIES)
+4 ; CONTEXT [Required] - 1=All Signed (by PT),
+5 ; 2="Unsigned (by PT&(AUTHOR!TRANSCRIBER))
+6 ; 3="Uncosigned (by PT&EXPECTED COSIGNER
+7 ; 4="Signed notes (by PT&selected author)
+8 ; 5="Signed notes (by PT&date range)
+9 ; DFN [Required] - Pointer to Patient File#2
+10 ; BEGINDATE [Optional] - The beginning date/time in ISO 8601 Time Format to start for the search.
+11 ; ENDDATE [Optional] - The ending date/time in ISO 8601 Time Format to start for the search.
+12 ; PERSON [Optional] - Pointer to file 200 (The program will use the default DUZ if not passed)
+13 ; OCCLIM [Optional] - The number of documents/records to the return array
+14 ; SEQUENCE [Optional] - "A"=ascending (Regular date/time)
+15 ; "D"=descending (Reverse date/time) (dflt)
+16 ; SHOWADD [Optional] - Boolean: Include addenda in the return array, when their parent documents are identified by the search
+17 ; INCUND [Optional] - Boolean: Include Undictated and Untranscribed documents along with Unsigned documents, when the CONTEXT is 2.
+18 ; SHOW [Optional] - Boolean: Return "0^SHOW MORE" in return
+19 ; array when additional notes available for
+20 ; context of 1 or 5 when occurrence limit
+21 ; prevents all notes from displaying
+22 ; TIUIEN [Optional] - Starting TIU IEN for additional return
+23 ; when "SHOW MORE" was received in previous
+24 ; return array (LATE date/time will be set
+25 ; to Reference date of this TIU document)
+26 ; EAS [Optional] - The Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
+27 ;
+28 ; Output:
+29 ; Successful Return:
+30 ; JSONRETURN = Returns the TIU DOCUMENT data in JSON formatted string.
+31 ; Otherwise, JSON Errors will be returned for any invalid/missing parameters.
+32 ;
+33 NEW TMPTIU,RETURN,ERRORS
+34 DO INITVAR
+35 DO VALIDATECLASS(.ERRORS,CLASS)
+36 DO VALIDATECONTEXT(.ERRORS,CONTEXT)
+37 DO VALIDATEDFN(.ERRORS,DFN)
+38 DO VALBEGENDDATE(.ERRORS,BEGINDATE,ENDDATE)
+39 DO VALIDATEPERSON(.ERRORS,PERSON)
+40 DO VALIDATEOCCLIM(.ERRORS,OCCLIM)
+41 DO VALIDATESEQ(.ERRORS,SEQUENCE)
+42 DO VALIDATESHOWADD(.ERRORS,SHOWADD)
+43 DO VALIDATEINCUND(.ERRORS,INCUND)
+44 DO VALIDATESHOW(.ERRORS,SHOW)
+45 DO VALIDATETIUIEN(.ERRORS,TIUIEN)
+46 DO VALIDATEEAS^SDESINPUTVALUTL(.ERRORS,EAS)
+47 IF $DATA(ERRORS)
MERGE RETURN=ERRORS
DO BUILDJSON^SDESBUILDJSON(.JSONRETURN,.RETURN)
QUIT
+48 DO CONTEXT^TIUSRVLO(.TMPTIU,CLASS,CONTEXT,DFN,BEGINDATE,ENDDATE,PERSON,OCCLIM,SEQUENCE,SHOWADD,INCUND,SHOW,TIUIEN)
+49 DO BUILDDATA(.TMPTIU,.RETURN,DFN)
+50 DO BUILDJSON^SDESBUILDJSON(.JSONRETURN,.RETURN)
+51 QUIT
+52 ;
BUILDDATA(TMPTIU,RETURN,DFN) ;
+1 NEW RECNT,CLINICIEN,TIUDATA,ERR,EPBEGDATETIME,EPENDDATETIME
+2 KILL RETURN
+3 SET RECNT=0
FOR
SET RECNT=$ORDER(@TMPTIU@(RECNT))
if RECNT=""
QUIT
Begin DoDot:1
+4 SET TIUIEN=$PIECE(@TMPTIU@(RECNT),"^")
+5 SET RETURN("TIUDocument",RECNT,"DocumentIEN")=TIUIEN
+6 SET RETURN("TIUDocument",RECNT,"DocumentPrintName")=$PIECE(@TMPTIU@(RECNT),"^",2)
+7 SET RETURN("TIUDocument",RECNT,"NoteDateTime")=$$FMTISO^SDAMUTDT($PIECE(@TMPTIU@(RECNT),"^",3))
+8 SET RETURN("TIUDocument",RECNT,"PatientName")=$$GET1^DIQ(2,DFN,.01,"E")
+9 SET RETURN("TIUDocument",RECNT,"PatientDFN")=$GET(DFN)
+10 SET RETURN("TIUDocument",RECNT,"Last4SSN")=$$LAST4SSN^SDESINPUTVALUTL($GET(DFN))
+11 SET RETURN("TIUDocument",RECNT,"Author")=$PIECE($PIECE(@TMPTIU@(RECNT),"^",5),";",3)
+12 SET RETURN("TIUDocument",RECNT,"AuthorDUZ")=$PIECE($PIECE(@TMPTIU@(RECNT),"^",5),";")
+13 SET RETURN("TIUDocument",RECNT,"SignatureBlockName")=$PIECE($PIECE(@TMPTIU@(RECNT),"^",5),";",2)
+14 SET RETURN("TIUDocument",RECNT,"HospitalLocation")=$PIECE(@TMPTIU@(RECNT),"^",6)
+15 SET RETURN("TIUDocument",RECNT,"Status")=$PIECE(@TMPTIU@(RECNT),"^",7)
+16 SET RETURN("TIUDocument",RECNT,"RequestingPackageVariablePointer")=$PIECE(@TMPTIU@(RECNT),"^",10)
+17 SET RETURN("TIUDocument",RECNT,"ImageCount")=$PIECE(@TMPTIU@(RECNT),"^",11)
+18 SET RETURN("TIUDocument",RECNT,"Subject")=$PIECE(@TMPTIU@(RECNT),"^",12)
+19 SET RETURN("TIUDocument",RECNT,"HasChildren")=$PIECE(@TMPTIU@(RECNT),"^",13)
+20 SET RETURN("TIUDocument",RECNT,"IENOfParentDocument")=$PIECE(@TMPTIU@(RECNT),"^",14)
+21 ;
+22 SET CLINICIEN=$$FIND1^DIC(44,"","X",$PIECE(@TMPTIU@(RECNT),"^",6),"B")
+23 SET RETURN("TIUDocument",RECNT,"HospitalLocationIEN")=CLINICIEN
+24 SET EPBEGDATETIME=$$CVTTOFM^SDAMUTDT($TRANSLATE($PIECE($PIECE(@TMPTIU@(RECNT),"^",8),":",2)," ",""))
+25 SET EPENDDATETIME=$$CVTTOFM^SDAMUTDT($TRANSLATE($PIECE($PIECE(@TMPTIU@(RECNT),"^",9),":",2)," ",""))
+26 SET RETURN("TIUDocument",RECNT,"EpisodeBeginDateTime")=$SELECT(EPBEGDATETIME<1:"",1:$$FMTISO^SDAMUTDT(EPBEGDATETIME,$GET(CLINICIEN)))
+27 SET RETURN("TIUDocument",RECNT,"EpisodeEndDateTime")=$SELECT(EPENDDATETIME<1:"",1:$$FMTISO^SDAMUTDT(EPENDDATETIME,$GET(CLINICIEN)))
+28 SET RETURN("TIUDocument",RECNT,"TypeOfLocation")=$PIECE($PIECE(@TMPTIU@(RECNT),"^",8),":",1)
+29 ;
+30 KILL TIUDATA,ERR
+31 DO GETS^DIQ(8925,TIUIEN_",","1205;1206;1207;1211","IE","TIUDATA","ERR")
+32 SET RETURN("TIUDocument",RECNT,"VisitLocationName")=$GET(TIUDATA(8925,TIUIEN_",",1211,"E"))
+33 SET RETURN("TIUDocument",RECNT,"VisitLocationIEN")=$GET(TIUDATA(8925,TIUIEN_",",1211,"I"))
End DoDot:1
+34 ;If no record found, set the object equals to null
+35 IF $ORDER(RETURN("TIUDocument",""))=""
SET RETURN("TIUDocument",1)=""
+36 QUIT
+37 ;
VALIDATECLASS(ERRORS,CLASS) ;
+1 NEW ERR,SDTIUCLASSIEN
+2 IF $GET(CLASS)=""
DO ERRLOG^SDESJSON(.ERRORS,329)
QUIT
+3 SET SDTIUCLASSIEN=$$FIND1^DIC(8925.1,"","","`"_$GET(CLASS),"","","ERR")
+4 IF +SDTIUCLASSIEN<1
DO ERRLOG^SDESJSON(.ERRORS,328)
+5 QUIT
+6 ;
VALIDATECONTEXT(ERRORS,CONTEXT) ;
+1 IF $GET(CONTEXT)=""
DO ERRLOG^SDESJSON(.ERRORS,330)
QUIT
+2 IF $GET(CONTEXT)'=""
IF (+CONTEXT<1!(+CONTEXT>5))
DO ERRLOG^SDESJSON(.ERRORS,331)
QUIT
+3 QUIT
+4 ;
VALIDATEDFN(ERRORS,DFN) ;
+1 DO VALIDATEDFN^SDESINPUTVALUTL(.ERRORS,DFN)
+2 QUIT
+3 ;
VALBEGENDDATE(ERRORS,BEGINDATE,ENDDATE) ;
+1 IF BEGINDATE'=""
Begin DoDot:1
+2 SET BEGINDATE=$$ISOTFM^SDAMUTDT(BEGINDATE)
+3 IF BEGINDATE=-1
SET BEGINDATE=""
End DoDot:1
+4 ;
+5 IF ENDDATE'=""
Begin DoDot:1
+6 SET ENDDATE=$$ISOTFM^SDAMUTDT(ENDDATE)
+7 IF ENDDATE=-1
SET ENDDATE=""
End DoDot:1
+8 ;
+9 IF $GET(BEGINDATE)'=-1
IF $GET(ENDDATE)'=-1
IF BEGINDATE>ENDDATE
DO ERRLOG^SDESJSON(.ERRORS,29)
+10 QUIT
+11 ;
VALIDATEPERSON(ERRORS,PERSON) ;
+1 IF PERSON'=""
IF '$DATA(^VA(200,DUZ,0))
SET PERSON=""
+2 QUIT
+3 ;
VALIDATEOCCLIM(ERRORS,OCCLIM) ;
+1 IF +$GET(OCCLIM)'>0
SET OCCLIM=""
+2 QUIT
+3 ;
VALIDATESEQ(ERRORS,SEQUENCE) ;
+1 IF $GET(SEQUENCE)'=""
IF (SEQUENCE'="A"!(SEQUENCE'="D"))
SET SEQUENCE=""
+2 QUIT
+3 ;
VALIDATESHOWADD(ERRORS,SHOWADD) ;
+1 IF ($GET(SHOWADD)'="")&(SHOWADD'?1N!(SHOWADD>1))
SET SHOWADD=""
+2 QUIT
+3 ;
VALIDATEINCUND(ERRORS,INCUND) ;
+1 IF ($GET(INCUND)'="")&(INCUND'?1N!(INCUND>1))
SET INCUND=""
+2 QUIT
+3 ;
VALIDATESHOW(ERRORS,SHOW) ;
+1 IF ($GET(SHOW)'="")&(SHOW'?1N!(SHOW>1))
SET SHOW=""
+2 QUIT
+3 ;
VALIDATETIUIEN(ERRORS,TIUEN) ;
+1 IF $GET(TIUIEN)'=""
IF '$DATA(^TIU(8925,+TIUIEN,0))
SET TIUIEN=""
+2 QUIT
+3 ;
INITVAR ;Initialize input parameter variables
+1 SET CLASS=$GET(CLASS)
+2 SET CONTEXT=$GET(CONTEXT)
+3 SET DFN=$GET(DFN)
+4 SET BEGINDATE=$GET(BEGINDATE)
+5 SET ENDDATE=$GET(ENDDATE)
+6 SET DUZ=$GET(DUZ)
+7 SET PERSON=$GET(PERSON)
+8 SET OCCLIM=$GET(OCCLIM)
+9 SET SEQUENCE=$GET(SEQUENCE)
+10 SET SHOWADD=$GET(SHOWADD)
+11 SET INCUND=$GET(INCUND)
+12 SET SHOW=$GET(SHOW)
+13 SET TIUIEN=$GET(TIUIEN)
+14 SET EAS=$GET(EAS)
+15 QUIT
+16 ;