ORQQPXRM ; SLC/PJH - Functions for reminder data ;12/04/2007
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,116,173,187,190,215,243**;Dec 17, 1997;Build 242
;
;ORQQPXRM DIALOG ACTIVE
ACTIVE(ORY,ORLIST) D ACTIVE^PXRMRPCC(.ORY,.ORLIST) Q ; DBIA 3080
;
;ORQQPXRM REMINDER EVALUATION
ALIST(ORY,ORPT,ORLIST) D ALIST^PXRMRPCA(.ORY,.ORPT,.ORLIST) Q ; DBIA 3078
;
;ORQQPXRM REMINDERS APPLICABLE
APPL(ORY,ORPT,ORLOC) D EVALCOVR^ORQQPX(.ORY,ORPT,ORLOC) Q
;D APPL^PXRMRPCA(.ORY,ORPT,ORLOC) Q ; DBIA 3078
;
;ORQQPXRM REMINDER CATEGORIES
CATEGORY(ORY,ORPT,ORLOC) ;
D CATEGORY^PXRMRPCA(.ORY,ORPT,ORLOC) Q ; DBIA 3078
;
;ORQQPXRM REMINDER DIALOG
DIALOG(ORY,ORREM,DFN) ;
; DBIA 3080
N DIEN
D DIALOG^PXRMRPCC(.ORY,ORREM,DFN)
;I $G(DFN)'="" D DIALOG^PXRMRPCC(.ORY,ORREM,DFN)
;I $G(DFN)="" D DIALOG^PXRMRPCC(.ORY,ORREM)
I $P($G(ORY(1)),U)=-1 Q
S DIEN=$G(^PXD(811.9,ORREM,51))
S ORY(0)=0_U_+$P($G(^PXRMD(801.41,DIEN,0)),U,17)
Q
;
;ORQQPXRM EDUCATION SUBTOPICS
EDS(ORY,OREDU) D EDS^PXRMRPCB(.ORY,OREDU) Q ; DBIA 3079
;
;ORQQPXRM EDUCATION SUMMARY
EDL(ORY,OREM) D EDL^PXRMRPCB(.ORY,OREM) Q ; DBIA 3079
;
;ORQQPXRM EDUCATION TOPIC
EDU(ORY,OREDU) D EDU^PXRMRPCB(.ORY,OREDU) Q ; DBIA 3079
;
;ORQQPXRM PROGRESS NOTE HEADER
HDR(ORY,ORLOC) D HDR^PXRMRPCC(.ORY,ORLOC) Q ; DBIA 3080
;
;ORQQPXRM REMINDERS UNEVALUATED
LIST(ORY,ORPT,ORLOC) D GETLIST^ORQQPX(.ORY,ORLOC) Q
;D LIST^PXRMRPCA(.ORY,ORPT,ORLOC) Q ; DBIA 3078
;
;ORQQPXRM MENTAL HEALTH
MH(ORY,OTEST) ;
D MH^PXRMRPCC(.ORY,OTEST) ; DBIA 3080
S ORY(0)=0
I $$PATCH^XPDUTL("YS*5.01*85") S ORY(0)=1
Q
;
MHDLL(ORY,DFN,INPUTS) ;
N CNT,CNT1,ORRESULT,ORSCORES,TEXT
F TEXT="RESULTS","SCORES" D
.S CNT=0,CNT1=0
.F S CNT=$O(INPUTS(TEXT,CNT)) Q:CNT="" D
..S CNT1=CNT1+1
..I TEXT="RESULTS" S ORRESULT(CNT1)=$G(INPUTS(TEXT,CNT))
..I TEXT="SCORES" S ORSCORES(CNT1)=$G(INPUTS(TEXT,CNT))
D MHDLL^PXRMDRSG(.ORY,.ORRESULT,.ORSCORES,DFN)
Q
;
MHDLLDMS(ORY) ;
;Returns a one if CPRS should used the MH dll. Returns a 0 if CPRS
;should not used the MH dll.
S ORY=1
I '$$PATCH^XPDUTL("YS*5.01*85") S ORY=0 Q
I '$$PATCH^XPDUTL("PXRM*2.0*6") S ORY=0 Q
I $$GET^XPAR("SYS","OR USE MH DLL")<1 S ORY=0 Q
Q
;
;ORQQPXRM MENTAL HEALTH RESULTS
MHR(ORY,RESULT,ORES) ;
; DBIA 3080
D MHR^PXRMRPCC(.ORY,RESULT,.ORES)
Q
;
;ORQQPXRM MENTAL HEALTH SAVE
MHS(ORY,ORES) D MHS^PXRMRPCC(.ORY,.ORES) Q ; DBIA 3080
;
MHV(ORY,DFN,NAME,ANS) ;
N ORDATA,ORES,X
S ORY(0)=0
I '$$PATCH^XPDUTL("YS*5.01*85") S ORY(0)=2 Q
I '$L(ANS) Q
S ORES("DFN")=DFN,ORES("CODE")=NAME
F X=1:1:$L(ANS) I $E(ANS,X)'="X" D
.;I $E(ANS,X)="T" S $E(ANS,X)=1
.;I $E(ANS,X)="F" S $E(ANS,X)=2
.S ORES(X)=X_U_$E(ANS,X)
D CHECKCR^YTQPXRM4(.ORDATA,.ORES)
I $G(ORDATA(2))="OK" S ORY(0)=1 Q
S ORY(1)=$P($G(ORDATA(2)),U,2)
Q
;
;ORQQPXRM MST UPDATE
MST(ORY,ORPT,ORDATE,ORSTAT,ORPROV,ORFTYP,ORFIEN,ORRES) ;
D MST^PXRMRPCC(.ORY,ORPT,ORDATE,ORSTAT,ORPROV,ORFTYP,ORFIEN,ORRES) Q
;
;ORQQPXRM WOMEN HEALTH RESULT
WH(ORY,ORRESULT) ;
D WH^PXRMRPCC(.ORY,.ORRESULT) Q
;
WHLETTER(ORY,ORIEN) ;
D LETTER^WVRPCNO1(.ORY,ORIEN) Q
;
WHREPORT(ORY,ORIEN) ;
D RESULTS^WVALERTF(.ORY,ORIEN) Q
;
;ORQQPXRM DIALOG PROMPTS
PROMPT(ORY,ORDLG,ORDCUR,ORFTYP) ;
D PROMPT^PXRMRPCC(.ORY,ORDLG,ORDCUR,ORFTYP) Q ; DBIA 3080
;
;ORQQPXRM REMINDER DETAIL
REMDET(ORY,ORPT,ORIEN) D REMDET^PXRMRPCA(.ORY,ORPT,ORIEN) Q ; DBIA 3078
;
;ORQQPXRM REMINDER INQUIRY
RES(ORY,ORREM) D RES^PXRMRPCC(.ORY,ORREM) Q ; DBIA 3080
;
;ORQQPXRM REMINDER WEB
WEB(ORY,ORREM) D WEB^PXRMRPCA(.ORY,ORREM) Q ; DBIA 3078
;
;PXRM REMINDER DIALOG (TIU)
TDIALOG(ORY,ORDLG,DFN) ;
D DIALOG^PXRMRPCD(.ORY,ORDLG,DFN)
I $P($G(ORY(1)),U)=-1 Q
S ORY(0)=0_U_+$P($G(^PXRMD(801.41,ORDLG,0)),U,17)
Q
;
ACT(REM) ;ORQQPX SEARCH ITEMS - XPAR value screen for active reminders
;Treat a null value as inactive
I 'REM Q 0
;Treat a non-existen entry as inactive
I $G(^PXD(811.9,REM,0))="" Q 0
;Check IF inactive flag is set
I ($T(INACTIVE^PXRM)'=""),$$INACTIVE^PXRM(REM) Q 0 ; DBIA 2182
;Otherwise active
Q 1
;
REMVER(ORLIST) ;
S ORLIST=$$VERSION^XPDUTL("PXRM")
Q
;
GEC(ORRESULT,IEN,DFN,VISIT,NOTEIEN) ;
D API^PXRMGECU(.ORRESULT,IEN,DFN,VISIT,1,NOTEIEN)
Q
;
GECF(RESULT,DFN,FIN) ;
D FINISHED^PXRMGECU(DFN,FIN)
Q
;
GECP(RESULT,DFN) ;
S RESULT=$$STATUS^PXRMGECU(DFN)
Q
;
ORQQPXRM ; SLC/PJH - Functions for reminder data ;12/04/2007
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,116,173,187,190,215,243**;Dec 17, 1997;Build 242
+2 ;
+3 ;ORQQPXRM DIALOG ACTIVE
ACTIVE(ORY,ORLIST) ; DBIA 3080
DO ACTIVE^PXRMRPCC(.ORY,.ORLIST)
QUIT
+1 ;
+2 ;ORQQPXRM REMINDER EVALUATION
ALIST(ORY,ORPT,ORLIST) ; DBIA 3078
DO ALIST^PXRMRPCA(.ORY,.ORPT,.ORLIST)
QUIT
+1 ;
+2 ;ORQQPXRM REMINDERS APPLICABLE
APPL(ORY,ORPT,ORLOC) DO EVALCOVR^ORQQPX(.ORY,ORPT,ORLOC)
QUIT
+1 ;D APPL^PXRMRPCA(.ORY,ORPT,ORLOC) Q ; DBIA 3078
+2 ;
+3 ;ORQQPXRM REMINDER CATEGORIES
CATEGORY(ORY,ORPT,ORLOC) ;
+1 ; DBIA 3078
DO CATEGORY^PXRMRPCA(.ORY,ORPT,ORLOC)
QUIT
+2 ;
+3 ;ORQQPXRM REMINDER DIALOG
DIALOG(ORY,ORREM,DFN) ;
+1 ; DBIA 3080
+2 NEW DIEN
+3 DO DIALOG^PXRMRPCC(.ORY,ORREM,DFN)
+4 ;I $G(DFN)'="" D DIALOG^PXRMRPCC(.ORY,ORREM,DFN)
+5 ;I $G(DFN)="" D DIALOG^PXRMRPCC(.ORY,ORREM)
+6 IF $PIECE($GET(ORY(1)),U)=-1
QUIT
+7 SET DIEN=$GET(^PXD(811.9,ORREM,51))
+8 SET ORY(0)=0_U_+$PIECE($GET(^PXRMD(801.41,DIEN,0)),U,17)
+9 QUIT
+10 ;
+11 ;ORQQPXRM EDUCATION SUBTOPICS
EDS(ORY,OREDU) ; DBIA 3079
DO EDS^PXRMRPCB(.ORY,OREDU)
QUIT
+1 ;
+2 ;ORQQPXRM EDUCATION SUMMARY
EDL(ORY,OREM) ; DBIA 3079
DO EDL^PXRMRPCB(.ORY,OREM)
QUIT
+1 ;
+2 ;ORQQPXRM EDUCATION TOPIC
EDU(ORY,OREDU) ; DBIA 3079
DO EDU^PXRMRPCB(.ORY,OREDU)
QUIT
+1 ;
+2 ;ORQQPXRM PROGRESS NOTE HEADER
HDR(ORY,ORLOC) ; DBIA 3080
DO HDR^PXRMRPCC(.ORY,ORLOC)
QUIT
+1 ;
+2 ;ORQQPXRM REMINDERS UNEVALUATED
LIST(ORY,ORPT,ORLOC) DO GETLIST^ORQQPX(.ORY,ORLOC)
QUIT
+1 ;D LIST^PXRMRPCA(.ORY,ORPT,ORLOC) Q ; DBIA 3078
+2 ;
+3 ;ORQQPXRM MENTAL HEALTH
MH(ORY,OTEST) ;
+1 ; DBIA 3080
DO MH^PXRMRPCC(.ORY,OTEST)
+2 SET ORY(0)=0
+3 IF $$PATCH^XPDUTL("YS*5.01*85")
SET ORY(0)=1
+4 QUIT
+5 ;
MHDLL(ORY,DFN,INPUTS) ;
+1 NEW CNT,CNT1,ORRESULT,ORSCORES,TEXT
+2 FOR TEXT="RESULTS","SCORES"
Begin DoDot:1
+3 SET CNT=0
SET CNT1=0
+4 FOR
SET CNT=$ORDER(INPUTS(TEXT,CNT))
IF CNT=""
QUIT
Begin DoDot:2
+5 SET CNT1=CNT1+1
+6 IF TEXT="RESULTS"
SET ORRESULT(CNT1)=$GET(INPUTS(TEXT,CNT))
+7 IF TEXT="SCORES"
SET ORSCORES(CNT1)=$GET(INPUTS(TEXT,CNT))
End DoDot:2
End DoDot:1
+8 DO MHDLL^PXRMDRSG(.ORY,.ORRESULT,.ORSCORES,DFN)
+9 QUIT
+10 ;
MHDLLDMS(ORY) ;
+1 ;Returns a one if CPRS should used the MH dll. Returns a 0 if CPRS
+2 ;should not used the MH dll.
+3 SET ORY=1
+4 IF '$$PATCH^XPDUTL("YS*5.01*85")
SET ORY=0
QUIT
+5 IF '$$PATCH^XPDUTL("PXRM*2.0*6")
SET ORY=0
QUIT
+6 IF $$GET^XPAR("SYS","OR USE MH DLL")<1
SET ORY=0
QUIT
+7 QUIT
+8 ;
+9 ;ORQQPXRM MENTAL HEALTH RESULTS
MHR(ORY,RESULT,ORES) ;
+1 ; DBIA 3080
+2 DO MHR^PXRMRPCC(.ORY,RESULT,.ORES)
+3 QUIT
+4 ;
+5 ;ORQQPXRM MENTAL HEALTH SAVE
MHS(ORY,ORES) ; DBIA 3080
DO MHS^PXRMRPCC(.ORY,.ORES)
QUIT
+1 ;
MHV(ORY,DFN,NAME,ANS) ;
+1 NEW ORDATA,ORES,X
+2 SET ORY(0)=0
+3 IF '$$PATCH^XPDUTL("YS*5.01*85")
SET ORY(0)=2
QUIT
+4 IF '$LENGTH(ANS)
QUIT
+5 SET ORES("DFN")=DFN
SET ORES("CODE")=NAME
+6 FOR X=1:1:$LENGTH(ANS)
IF $EXTRACT(ANS,X)'="X"
Begin DoDot:1
+7 ;I $E(ANS,X)="T" S $E(ANS,X)=1
+8 ;I $E(ANS,X)="F" S $E(ANS,X)=2
+9 SET ORES(X)=X_U_$EXTRACT(ANS,X)
End DoDot:1
+10 DO CHECKCR^YTQPXRM4(.ORDATA,.ORES)
+11 IF $GET(ORDATA(2))="OK"
SET ORY(0)=1
QUIT
+12 SET ORY(1)=$PIECE($GET(ORDATA(2)),U,2)
+13 QUIT
+14 ;
+15 ;ORQQPXRM MST UPDATE
MST(ORY,ORPT,ORDATE,ORSTAT,ORPROV,ORFTYP,ORFIEN,ORRES) ;
+1 DO MST^PXRMRPCC(.ORY,ORPT,ORDATE,ORSTAT,ORPROV,ORFTYP,ORFIEN,ORRES)
QUIT
+2 ;
+3 ;ORQQPXRM WOMEN HEALTH RESULT
WH(ORY,ORRESULT) ;
+1 DO WH^PXRMRPCC(.ORY,.ORRESULT)
QUIT
+2 ;
WHLETTER(ORY,ORIEN) ;
+1 DO LETTER^WVRPCNO1(.ORY,ORIEN)
QUIT
+2 ;
WHREPORT(ORY,ORIEN) ;
+1 DO RESULTS^WVALERTF(.ORY,ORIEN)
QUIT
+2 ;
+3 ;ORQQPXRM DIALOG PROMPTS
PROMPT(ORY,ORDLG,ORDCUR,ORFTYP) ;
+1 ; DBIA 3080
DO PROMPT^PXRMRPCC(.ORY,ORDLG,ORDCUR,ORFTYP)
QUIT
+2 ;
+3 ;ORQQPXRM REMINDER DETAIL
REMDET(ORY,ORPT,ORIEN) ; DBIA 3078
DO REMDET^PXRMRPCA(.ORY,ORPT,ORIEN)
QUIT
+1 ;
+2 ;ORQQPXRM REMINDER INQUIRY
RES(ORY,ORREM) ; DBIA 3080
DO RES^PXRMRPCC(.ORY,ORREM)
QUIT
+1 ;
+2 ;ORQQPXRM REMINDER WEB
WEB(ORY,ORREM) ; DBIA 3078
DO WEB^PXRMRPCA(.ORY,ORREM)
QUIT
+1 ;
+2 ;PXRM REMINDER DIALOG (TIU)
TDIALOG(ORY,ORDLG,DFN) ;
+1 DO DIALOG^PXRMRPCD(.ORY,ORDLG,DFN)
+2 IF $PIECE($GET(ORY(1)),U)=-1
QUIT
+3 SET ORY(0)=0_U_+$PIECE($GET(^PXRMD(801.41,ORDLG,0)),U,17)
+4 QUIT
+5 ;
ACT(REM) ;ORQQPX SEARCH ITEMS - XPAR value screen for active reminders
+1 ;Treat a null value as inactive
+2 IF 'REM
QUIT 0
+3 ;Treat a non-existen entry as inactive
+4 IF $GET(^PXD(811.9,REM,0))=""
QUIT 0
+5 ;Check IF inactive flag is set
+6 ; DBIA 2182
IF ($TEXT(INACTIVE^PXRM)'="")
IF $$INACTIVE^PXRM(REM)
QUIT 0
+7 ;Otherwise active
+8 QUIT 1
+9 ;
REMVER(ORLIST) ;
+1 SET ORLIST=$$VERSION^XPDUTL("PXRM")
+2 QUIT
+3 ;
GEC(ORRESULT,IEN,DFN,VISIT,NOTEIEN) ;
+1 DO API^PXRMGECU(.ORRESULT,IEN,DFN,VISIT,1,NOTEIEN)
+2 QUIT
+3 ;
GECF(RESULT,DFN,FIN) ;
+1 DO FINISHED^PXRMGECU(DFN,FIN)
+2 QUIT
+3 ;
GECP(RESULT,DFN) ;
+1 SET RESULT=$$STATUS^PXRMGECU(DFN)
+2 QUIT
+3 ;