ECMUTL1 ;ALB/ESD - Utilities for Multiple Dates/Mult Procs ;20 AUG 1997 13:56
;;2.0; EVENT CAPTURE ;**5,10,15,13,17,23,41,42,50,54,76**;8 May 96;Build 6
;
;
ASKPAT(ECPAT) ; Ask patient
;
; Input: ECPAT = patient DFN and name (passed by reference)
;
; Output: 1 = successful
; -1 = unsuccessful (timed out or uparrowed)
; -2 = unsuccessful (returned out)
;
N DIC,DUOUT,DTOUT,Y,YY,ECDUP,ECI,ECUP
SEL ;
S (ECDUP,ECI)=0
S DIC="^DPT(",DIC(0)="QEAMZ"
S DIC("A")="Select Patient: "
D ^DIC
I Y=-1!($D(DUOUT))!($D(DTOUT)) G ASKPATQ
;
;- Create ECPLST local array to track duplicate names
I $O(^TMP("ECPLST",$J,0)) D
. F S ECI=$O(^TMP("ECPLST",$J,ECI)) Q:'ECI D
.. I +$G(^TMP("ECPLST",$J,ECI))=+Y D
... S ECDUP=1
... W !!,"Patient already selected. Please select another patient.",!
I ECDUP G SEL
I 'ECDUP D I $G(ECUP)="^" G SEL
. S ECPAT=+Y_"^"_$P(Y,"^",2)
. S YY=Y,DFN=+Y,ECUP="" D 2^VADPT S Y=YY I +VADM(6) D I ECUP="^" Q
.. ;NOIS MWV-0603-21781: line below changed by VMP.
.. W !!,"WARNING "_"[PATIENT DIED ON "_$P(VADM(6),U,2)_"] ",!!
.. R "Press Return to Continue or ^ to Deselect: ",ECUP:DTIME
. S ^TMP("ECPLST",$J,($S('$O(^TMP("ECPLST",$J,0)):1,1:$O(^TMP("ECPLST",$J,""),-1)+1)))=+Y_"^"_$P(Y,"^",2)
ASKPATQ Q $S((Y=-1)&($D(DUOUT)!$D(DTOUT)):-1,(Y=-1)&('$D(DUOUT))&('$D(DTOUT)):-2,1:1)
;
;
ASKORD() ; Ask ordering section
;
; Input: None
;
; Output: Ordering Section ien if successful
; 0 if not successful
;
N DIR,DIRUT,Y,ECORD
S ECORD=0
S DIR(0)="721,11",DIR("A")="Ordering Section"
D ^DIR
I Y=""!($D(DIRUT)) G ASKORDQ
S ECORD=+Y
ASKORDQ Q +ECORD
;
;
PCEDAT(ECUNIT,ECSCR,ECPCE) ;get needed PCE data
;
; input
; ECUNIT = ien of DSS unit in file #724 (required)
; ECSCR = ien of event code screen in file #720.3 (required);
; but may be null value
; ECPCE = array, passed by reference (required)
;
; output
; ECPCE("CLIN") = associated clinic ien in file #44^clinic name
; ECPCE("DX") = ien in file #80^icd code
; ECPCE("DXS",) = array of multiple secondary diagnosis, where
; = ecpce("dxs",n)=v n=dx code and v=dx ien
; ECPCE("AO") = agent orange indicator
; ECPCE("IR") = ionizing radiation indicator
; ECPCE("ENV") = environmental contaminants indicator/south west asia
; ECPCE("SC") = service connected indicator (Y/N)
; ECPCE("MST") = military sexual trauma indicator (Y/N)
; ECPCE("HNC") = head/neck cancer indicator (Y/N)
; ECPCE("CV") = combat veteran indicator (Y/N)
; ECPCE("SHAD") = P112/SHAD Shipboard Hazard and Defense) (Y/N)
;
; returns
; ECOUT = if normal user input, then "0"
; if user times-out, then "1"
; if user up-arrows out, then "2"
;
N SEND,ECOUT,EC4,EC4N,ECPCL,ECPCID,ECPCRD
S ECOUT=0
S ECSCR=+$G(ECSCR)
S SEND=$P(^ECD(+ECUNIT,0),"^",14)
I SEND="" S SEND="N"
S ECPCE("CLIN")="",ECPCE("DX")="",ECPCE("AO")="",ECPCE("IR")=""
S ECPCE("ENV")="",ECPCE("SC")="",ECPCE("MST")="",ECPCE("HNC")=""
S ECPCE("CV")="",ECPCE("SHAD")=""
K ECPCE("DXS")
I "AO"[SEND D
.;- Don't write message if Send to PCE = "O" and patient is an inpatient
.I SEND="A"!(SEND="O"&(ECPCE("I/O")="O")) D
..W !!,?5,"Please Note: The following prompt(s) cannot be by-passed with"
..W !,?5,"<cr>, since the data is sent to PCE for workload reporting."
..W !,?5,"If data cannot be provided, respond with ""^"". This will"
..W !,?5,"remove the current patient from the selected patient list.",!
.D CLINIC I $G(ECOUT) D MSGCLN Q
.D ASKDX I $G(ECOUT) D MSGDX Q
.D VISIT I $G(ECOUT) D CLMSG Q
I ECSCR,(ECPCE("CLIN")=""),('$G(ECOUT)) D
.Q:'$D(^ECJ(ECSCR))
.I ECUNIT'=$P($P(^ECJ(ECSCR,0),"^",1),"-",2) Q
.S EC4=$P($G(^ECJ(ECSCR,"PRO")),"^",4) I +EC4 D
..S EC4N=$P($G(^SC(+EC4,0)),"^",1)
..D CLIN(EC4,.ECPCL)
..S:ECPCL ECPCE("CLIN")=EC4_"^"_EC4N
..S:'ECPCL ECPCE("CLIN")=""
Q ECOUT
;
ASKDX ;ask dx
N ECDX,ECDXN,DTOUT,DUOUT,DIRUT,DIR,Y,EC4,ECDXS
S (ECDX,ECDXN)="",EC4=$P(ECPCE("CLIN"),U)
D PDX^ECUTL2 I ECOUT Q
S ECPCE("DX")=ECDX_"^"_ECDXN
D SDX^ECUTL2 I ECOUT Q
M ECPCE("DXS")=ECDXS
Q
;
CLINIC ;get associated clinic
N ECDATA,EC4,EC4N,ECID,ECPCL,DTOUT,DUOUT,DIRUT,DIR,Y
Q:SEND="O"&(ECPCE("I/O")'="O")
F D Q:$G(ECOUT) Q:$G(ECPCL)
.K DA,DIR,DIRUT,DTOUT,DUOUT
.S (EC4,ECPCL)=0,EC4N=""
.S DIR(0)="721,26",DIR("A")="Associated Clinic",DIR("?")="An active clinic is required. Enter an active clinic or an ^ to exit"
.D ^DIR
.S:$D(DTOUT) ECOUT=1 S:$D(DUOUT) ECOUT=2
.Q:$G(ECOUT)
.I 'Y W !!?5,"You must enter an active clinic now.",! Q
.I Y S EC4=+Y,ECDATA=$G(^SC(+EC4,0)),ECID=$P(ECDATA,"^",7),EC4N=$P(ECDATA,"^",1)
.I $G(EC4) D CLIN(EC4,.ECPCL) I 'ECPCL D
..W !!,?5,"The clinic you selected is inactive."
..W !,?5,"Workload data cannot be sent to PCE for Event"
..W !,?5,"Capture procedures without an active clinic."
.I 'ECPCL W !!?5,"You must enter an active clinic now.",!
Q:'$G(ECPCL)
S ECPCE("CLIN")=EC4_"^"_EC4N
Q
;
;
VISIT ;ask visit info
N ECFLG,ECCLFLDS,ECCLVAR,ECX,ECAO,ECIR,ECMST,ECSC,ECZEC,ECHNC,ECCV,ECMDT
N ECY,ECMD,ECDT,ECSHAD
Q:ECPCE("I/O")="I"
S (ECAO,ECIR,ECSC,ECZEC,ECX,ECMST,ECHNC,ECCV,ECSHAD)="",ECY=0
F S ECY=$O(^TMP("ECMPIDX",$J,ECY)) Q:'ECY S ECMD=^(ECY) I $P(ECMD,U,2) D
.S ECMDT($P(ECMD,U,2))=""
S ECDT=$O(ECMDT(0)) ;use earliest date to evaluate classifications
;
;- Ask classification questions applicable to patient and file in #721
I $$ASKCLASS^ECUTL1(+$G(ECPAT),.ECCLFLDS,.ECOUT,SEND,ECPCE("I/O")),($O(ECCLFLDS(""))]"") D SETCLASS^ECUTL1(.ECCLFLDS)
Q:+$G(ECOUT)
;
;- Store classification variables into ECPCE array
F ECCLVAR="ECAO","ECIR","ECZEC","ECSC","ECMST","ECHNC","ECCV","ECSHAD" I @($G(ECCLVAR))]"" S ECPCE($S($E(ECCLVAR,3,$L(ECCLVAR))'="ZEC":$E(ECCLVAR,3,$L(ECCLVAR)),1:"ENV"))=@ECCLVAR
Q
;
;
CLIN(EC4,ECPCL) ;check for active associated clinic
N ECPCID,ECPCRD
D CLIN^ECPCEU
Q
;
;
MSGDX ;if ecout & essential data missing, display msg
Q:SEND="N" Q:SEND="O"&(ECPCE("I/O")'="O")
I ECPCE("DX")="" D Q
.W !!,?5,"Please note that data cannot be sent to PCE"
.W !,?5,"for workload reporting without an ICD-9 code.",!
.D MSG1
Q
;
MSGCLN ;if ecout & essential data missing, display msg
Q:SEND="N" Q:SEND="O"&(ECPCE("I/O")'="O")
I ECPCE("CLIN")="" D Q
.W !!,?5,"Please note that data cannot be sent to PCE for workload"
.W !,?5,"reporting without an active associated clinic.",!
.D MSG1
Q
;
CLMSG ; Display classification questions error message
Q:SEND="N" Q:ECPCE("I/O")'="O"
W !!,?5,"Please note that data cannot be sent to PCE for workload reporting"
W !,?5,"unless the classification questions are answered.",!
D MSG1
Q
;
;
MSG1 ;Error message display
N DIR,Y
S DIR(0)="E",DIR("A")="Press RETURN to continue"
D ^DIR
W !
Q
;
;
INOUT(ECPTIEN,ECARRY) ; Determine inpatient/outpatient status
;
N ECOUT
S ECOUT=0
S ECARRY=$G(ECARRY)
S ECPTIEN=+$G(ECPTIEN)
;
; - If ECARRY not defined, use ^TMP("ECMPIDX",$J)
S:(ECARRY="") ECARRY="^TMP(""ECMPIDX"",$J)"
;
S ECPCE("I/O")=$$INOUTPT^ECUTL0(ECPTIEN,+$P(@ECARRY@(+$O(@ECARRY@(""),-1)),"^",2))
I ECPCE("I/O")="" D INOUTERR^ECUTL0
Q $S(+$G(ECOUT)=0:1,1:0)
;
;
ASKELIG(ECDSS,ECIO,ECPTIEN) ; Determine patient eligibility
;
; Input:
; ECDSS - DSS Unit IEN
; ECIO - Inpatient or Outpatient
; ECPTIEN - DFN of Patient file (#2)
;
; Output:
; ECPCE("ELIG") - containing patient eligibility
;
N VAEL
S ECDSS=+$G(ECDSS)
S ECIO=$G(ECIO)
S ECPTIEN=+$G(ECPTIEN)
;
;- Get elig if Send to PCE="A" or Send to PCE="O" and outpatient
I $$CHKDSS^ECUTL0(+$G(ECDSS),ECIO) D
. ;
. ;- If dual elig, ask user to select otherwise use primary elig
. I $$MULTELG^ECUTL0(+$G(ECPTIEN)) S ECPCE("ELIG")=+$$ELGLST^ECUTL0
. E S ECPCE("ELIG")=+$G(VAEL(1))
Q
;
REMOVE(ECPAT) ; Remove patient from selected patient list because required data missing
N DFN,ECI
S DFN=+ECPAT,ECI=0
F S ECI=$O(^TMP("ECPLST",$J,ECI)) Q:'ECI D
.I +$G(^TMP("ECPLST",$J,ECI))=DFN D
..K ^TMP("ECPLST",$J,ECI),^TMP("ECMPTIDX",$J,ECI),^TMP("ECPAT",$J,DFN)
..W !?5,"Patient deselected because required data missing.",!
..D MSG1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECMUTL1 8396 printed Dec 13, 2024@01:57:47 Page 2
ECMUTL1 ;ALB/ESD - Utilities for Multiple Dates/Mult Procs ;20 AUG 1997 13:56
+1 ;;2.0; EVENT CAPTURE ;**5,10,15,13,17,23,41,42,50,54,76**;8 May 96;Build 6
+2 ;
+3 ;
ASKPAT(ECPAT) ; Ask patient
+1 ;
+2 ; Input: ECPAT = patient DFN and name (passed by reference)
+3 ;
+4 ; Output: 1 = successful
+5 ; -1 = unsuccessful (timed out or uparrowed)
+6 ; -2 = unsuccessful (returned out)
+7 ;
+8 NEW DIC,DUOUT,DTOUT,Y,YY,ECDUP,ECI,ECUP
SEL ;
+1 SET (ECDUP,ECI)=0
+2 SET DIC="^DPT("
SET DIC(0)="QEAMZ"
+3 SET DIC("A")="Select Patient: "
+4 DO ^DIC
+5 IF Y=-1!($DATA(DUOUT))!($DATA(DTOUT))
GOTO ASKPATQ
+6 ;
+7 ;- Create ECPLST local array to track duplicate names
+8 IF $ORDER(^TMP("ECPLST",$JOB,0))
Begin DoDot:1
+9 FOR
SET ECI=$ORDER(^TMP("ECPLST",$JOB,ECI))
if 'ECI
QUIT
Begin DoDot:2
+10 IF +$GET(^TMP("ECPLST",$JOB,ECI))=+Y
Begin DoDot:3
+11 SET ECDUP=1
+12 WRITE !!,"Patient already selected. Please select another patient.",!
End DoDot:3
End DoDot:2
End DoDot:1
+13 IF ECDUP
GOTO SEL
+14 IF 'ECDUP
Begin DoDot:1
+15 SET ECPAT=+Y_"^"_$PIECE(Y,"^",2)
+16 SET YY=Y
SET DFN=+Y
SET ECUP=""
DO 2^VADPT
SET Y=YY
IF +VADM(6)
Begin DoDot:2
+17 ;NOIS MWV-0603-21781: line below changed by VMP.
+18 WRITE !!,"WARNING "_"[PATIENT DIED ON "_$PIECE(VADM(6),U,2)_"] ",!!
+19 READ "Press Return to Continue or ^ to Deselect: ",ECUP:DTIME
End DoDot:2
IF ECUP="^"
QUIT
+20 SET ^TMP("ECPLST",$JOB,($SELECT('$ORDER(^TMP("ECPLST",$JOB,0)):1,1:$ORDER(^TMP("ECPLST",$JOB,""),-1)+1)))=+Y_"^"_$PIECE(Y,"^",2)
End DoDot:1
IF $GET(ECUP)="^"
GOTO SEL
ASKPATQ QUIT $SELECT((Y=-1)&($DATA(DUOUT)!$DATA(DTOUT)):-1,(Y=-1)&('$DATA(DUOUT))&('$DATA(DTOUT)):-2,1:1)
+1 ;
+2 ;
ASKORD() ; Ask ordering section
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output: Ordering Section ien if successful
+5 ; 0 if not successful
+6 ;
+7 NEW DIR,DIRUT,Y,ECORD
+8 SET ECORD=0
+9 SET DIR(0)="721,11"
SET DIR("A")="Ordering Section"
+10 DO ^DIR
+11 IF Y=""!($DATA(DIRUT))
GOTO ASKORDQ
+12 SET ECORD=+Y
ASKORDQ QUIT +ECORD
+1 ;
+2 ;
PCEDAT(ECUNIT,ECSCR,ECPCE) ;get needed PCE data
+1 ;
+2 ; input
+3 ; ECUNIT = ien of DSS unit in file #724 (required)
+4 ; ECSCR = ien of event code screen in file #720.3 (required);
+5 ; but may be null value
+6 ; ECPCE = array, passed by reference (required)
+7 ;
+8 ; output
+9 ; ECPCE("CLIN") = associated clinic ien in file #44^clinic name
+10 ; ECPCE("DX") = ien in file #80^icd code
+11 ; ECPCE("DXS",) = array of multiple secondary diagnosis, where
+12 ; = ecpce("dxs",n)=v n=dx code and v=dx ien
+13 ; ECPCE("AO") = agent orange indicator
+14 ; ECPCE("IR") = ionizing radiation indicator
+15 ; ECPCE("ENV") = environmental contaminants indicator/south west asia
+16 ; ECPCE("SC") = service connected indicator (Y/N)
+17 ; ECPCE("MST") = military sexual trauma indicator (Y/N)
+18 ; ECPCE("HNC") = head/neck cancer indicator (Y/N)
+19 ; ECPCE("CV") = combat veteran indicator (Y/N)
+20 ; ECPCE("SHAD") = P112/SHAD Shipboard Hazard and Defense) (Y/N)
+21 ;
+22 ; returns
+23 ; ECOUT = if normal user input, then "0"
+24 ; if user times-out, then "1"
+25 ; if user up-arrows out, then "2"
+26 ;
+27 NEW SEND,ECOUT,EC4,EC4N,ECPCL,ECPCID,ECPCRD
+28 SET ECOUT=0
+29 SET ECSCR=+$GET(ECSCR)
+30 SET SEND=$PIECE(^ECD(+ECUNIT,0),"^",14)
+31 IF SEND=""
SET SEND="N"
+32 SET ECPCE("CLIN")=""
SET ECPCE("DX")=""
SET ECPCE("AO")=""
SET ECPCE("IR")=""
+33 SET ECPCE("ENV")=""
SET ECPCE("SC")=""
SET ECPCE("MST")=""
SET ECPCE("HNC")=""
+34 SET ECPCE("CV")=""
SET ECPCE("SHAD")=""
+35 KILL ECPCE("DXS")
+36 IF "AO"[SEND
Begin DoDot:1
+37 ;- Don't write message if Send to PCE = "O" and patient is an inpatient
+38 IF SEND="A"!(SEND="O"&(ECPCE("I/O")="O"))
Begin DoDot:2
+39 WRITE !!,?5,"Please Note: The following prompt(s) cannot be by-passed with"
+40 WRITE !,?5,"<cr>, since the data is sent to PCE for workload reporting."
+41 WRITE !,?5,"If data cannot be provided, respond with ""^"". This will"
+42 WRITE !,?5,"remove the current patient from the selected patient list.",!
End DoDot:2
+43 DO CLINIC
IF $GET(ECOUT)
DO MSGCLN
QUIT
+44 DO ASKDX
IF $GET(ECOUT)
DO MSGDX
QUIT
+45 DO VISIT
IF $GET(ECOUT)
DO CLMSG
QUIT
End DoDot:1
+46 IF ECSCR
IF (ECPCE("CLIN")="")
IF ('$GET(ECOUT))
Begin DoDot:1
+47 if '$DATA(^ECJ(ECSCR))
QUIT
+48 IF ECUNIT'=$PIECE($PIECE(^ECJ(ECSCR,0),"^",1),"-",2)
QUIT
+49 SET EC4=$PIECE($GET(^ECJ(ECSCR,"PRO")),"^",4)
IF +EC4
Begin DoDot:2
+50 SET EC4N=$PIECE($GET(^SC(+EC4,0)),"^",1)
+51 DO CLIN(EC4,.ECPCL)
+52 if ECPCL
SET ECPCE("CLIN")=EC4_"^"_EC4N
+53 if 'ECPCL
SET ECPCE("CLIN")=""
End DoDot:2
End DoDot:1
+54 QUIT ECOUT
+55 ;
ASKDX ;ask dx
+1 NEW ECDX,ECDXN,DTOUT,DUOUT,DIRUT,DIR,Y,EC4,ECDXS
+2 SET (ECDX,ECDXN)=""
SET EC4=$PIECE(ECPCE("CLIN"),U)
+3 DO PDX^ECUTL2
IF ECOUT
QUIT
+4 SET ECPCE("DX")=ECDX_"^"_ECDXN
+5 DO SDX^ECUTL2
IF ECOUT
QUIT
+6 MERGE ECPCE("DXS")=ECDXS
+7 QUIT
+8 ;
CLINIC ;get associated clinic
+1 NEW ECDATA,EC4,EC4N,ECID,ECPCL,DTOUT,DUOUT,DIRUT,DIR,Y
+2 if SEND="O"&(ECPCE("I/O")'="O")
QUIT
+3 FOR
Begin DoDot:1
+4 KILL DA,DIR,DIRUT,DTOUT,DUOUT
+5 SET (EC4,ECPCL)=0
SET EC4N=""
+6 SET DIR(0)="721,26"
SET DIR("A")="Associated Clinic"
SET DIR("?")="An active clinic is required. Enter an active clinic or an ^ to exit"
+7 DO ^DIR
+8 if $DATA(DTOUT)
SET ECOUT=1
if $DATA(DUOUT)
SET ECOUT=2
+9 if $GET(ECOUT)
QUIT
+10 IF 'Y
WRITE !!?5,"You must enter an active clinic now.",!
QUIT
+11 IF Y
SET EC4=+Y
SET ECDATA=$GET(^SC(+EC4,0))
SET ECID=$PIECE(ECDATA,"^",7)
SET EC4N=$PIECE(ECDATA,"^",1)
+12 IF $GET(EC4)
DO CLIN(EC4,.ECPCL)
IF 'ECPCL
Begin DoDot:2
+13 WRITE !!,?5,"The clinic you selected is inactive."
+14 WRITE !,?5,"Workload data cannot be sent to PCE for Event"
+15 WRITE !,?5,"Capture procedures without an active clinic."
End DoDot:2
+16 IF 'ECPCL
WRITE !!?5,"You must enter an active clinic now.",!
End DoDot:1
if $GET(ECOUT)
QUIT
if $GET(ECPCL)
QUIT
+17 if '$GET(ECPCL)
QUIT
+18 SET ECPCE("CLIN")=EC4_"^"_EC4N
+19 QUIT
+20 ;
+21 ;
VISIT ;ask visit info
+1 NEW ECFLG,ECCLFLDS,ECCLVAR,ECX,ECAO,ECIR,ECMST,ECSC,ECZEC,ECHNC,ECCV,ECMDT
+2 NEW ECY,ECMD,ECDT,ECSHAD
+3 if ECPCE("I/O")="I"
QUIT
+4 SET (ECAO,ECIR,ECSC,ECZEC,ECX,ECMST,ECHNC,ECCV,ECSHAD)=""
SET ECY=0
+5 FOR
SET ECY=$ORDER(^TMP("ECMPIDX",$JOB,ECY))
if 'ECY
QUIT
SET ECMD=^(ECY)
IF $PIECE(ECMD,U,2)
Begin DoDot:1
+6 SET ECMDT($PIECE(ECMD,U,2))=""
End DoDot:1
+7 ;use earliest date to evaluate classifications
SET ECDT=$ORDER(ECMDT(0))
+8 ;
+9 ;- Ask classification questions applicable to patient and file in #721
+10 IF $$ASKCLASS^ECUTL1(+$GET(ECPAT),.ECCLFLDS,.ECOUT,SEND,ECPCE("I/O"))
IF ($ORDER(ECCLFLDS(""))]"")
DO SETCLASS^ECUTL1(.ECCLFLDS)
+11 if +$GET(ECOUT)
QUIT
+12 ;
+13 ;- Store classification variables into ECPCE array
+14 FOR ECCLVAR="ECAO","ECIR","ECZEC","ECSC","ECMST","ECHNC","ECCV","ECSHAD"
IF @($GET(ECCLVAR))]""
SET ECPCE($SELECT($EXTRACT(ECCLVAR,3,$LENGTH(ECCLVAR))'="ZEC":$EXTRACT(ECCLVAR,3,$LENGTH(ECCLVAR)),1:"ENV"))=@ECCLVAR
+15 QUIT
+16 ;
+17 ;
CLIN(EC4,ECPCL) ;check for active associated clinic
+1 NEW ECPCID,ECPCRD
+2 DO CLIN^ECPCEU
+3 QUIT
+4 ;
+5 ;
MSGDX ;if ecout & essential data missing, display msg
+1 if SEND="N"
QUIT
if SEND="O"&(ECPCE("I/O")'="O")
QUIT
+2 IF ECPCE("DX")=""
Begin DoDot:1
+3 WRITE !!,?5,"Please note that data cannot be sent to PCE"
+4 WRITE !,?5,"for workload reporting without an ICD-9 code.",!
+5 DO MSG1
End DoDot:1
QUIT
+6 QUIT
+7 ;
MSGCLN ;if ecout & essential data missing, display msg
+1 if SEND="N"
QUIT
if SEND="O"&(ECPCE("I/O")'="O")
QUIT
+2 IF ECPCE("CLIN")=""
Begin DoDot:1
+3 WRITE !!,?5,"Please note that data cannot be sent to PCE for workload"
+4 WRITE !,?5,"reporting without an active associated clinic.",!
+5 DO MSG1
End DoDot:1
QUIT
+6 QUIT
+7 ;
CLMSG ; Display classification questions error message
+1 if SEND="N"
QUIT
if ECPCE("I/O")'="O"
QUIT
+2 WRITE !!,?5,"Please note that data cannot be sent to PCE for workload reporting"
+3 WRITE !,?5,"unless the classification questions are answered.",!
+4 DO MSG1
+5 QUIT
+6 ;
+7 ;
MSG1 ;Error message display
+1 NEW DIR,Y
+2 SET DIR(0)="E"
SET DIR("A")="Press RETURN to continue"
+3 DO ^DIR
+4 WRITE !
+5 QUIT
+6 ;
+7 ;
INOUT(ECPTIEN,ECARRY) ; Determine inpatient/outpatient status
+1 ;
+2 NEW ECOUT
+3 SET ECOUT=0
+4 SET ECARRY=$GET(ECARRY)
+5 SET ECPTIEN=+$GET(ECPTIEN)
+6 ;
+7 ; - If ECARRY not defined, use ^TMP("ECMPIDX",$J)
+8 if (ECARRY="")
SET ECARRY="^TMP(""ECMPIDX"",$J)"
+9 ;
+10 SET ECPCE("I/O")=$$INOUTPT^ECUTL0(ECPTIEN,+$PIECE(@ECARRY@(+$ORDER(@ECARRY@(""),-1)),"^",2))
+11 IF ECPCE("I/O")=""
DO INOUTERR^ECUTL0
+12 QUIT $SELECT(+$GET(ECOUT)=0:1,1:0)
+13 ;
+14 ;
ASKELIG(ECDSS,ECIO,ECPTIEN) ; Determine patient eligibility
+1 ;
+2 ; Input:
+3 ; ECDSS - DSS Unit IEN
+4 ; ECIO - Inpatient or Outpatient
+5 ; ECPTIEN - DFN of Patient file (#2)
+6 ;
+7 ; Output:
+8 ; ECPCE("ELIG") - containing patient eligibility
+9 ;
+10 NEW VAEL
+11 SET ECDSS=+$GET(ECDSS)
+12 SET ECIO=$GET(ECIO)
+13 SET ECPTIEN=+$GET(ECPTIEN)
+14 ;
+15 ;- Get elig if Send to PCE="A" or Send to PCE="O" and outpatient
+16 IF $$CHKDSS^ECUTL0(+$GET(ECDSS),ECIO)
Begin DoDot:1
+17 ;
+18 ;- If dual elig, ask user to select otherwise use primary elig
+19 IF $$MULTELG^ECUTL0(+$GET(ECPTIEN))
SET ECPCE("ELIG")=+$$ELGLST^ECUTL0
+20 IF '$TEST
SET ECPCE("ELIG")=+$GET(VAEL(1))
End DoDot:1
+21 QUIT
+22 ;
REMOVE(ECPAT) ; Remove patient from selected patient list because required data missing
+1 NEW DFN,ECI
+2 SET DFN=+ECPAT
SET ECI=0
+3 FOR
SET ECI=$ORDER(^TMP("ECPLST",$JOB,ECI))
if 'ECI
QUIT
Begin DoDot:1
+4 IF +$GET(^TMP("ECPLST",$JOB,ECI))=DFN
Begin DoDot:2
+5 KILL ^TMP("ECPLST",$JOB,ECI),^TMP("ECMPTIDX",$JOB,ECI),^TMP("ECPAT",$JOB,DFN)
+6 WRITE !?5,"Patient deselected because required data missing.",!
+7 DO MSG1
End DoDot:2
End DoDot:1
+8 QUIT