PXAIPL ;ISL/JVS - PROBLEM LIST ;6/5/96 16:57
;;1.0;PCE PATIENT CARE ENCOUNTER;**69**;Aug 12, 1996
;
;
Q
PL ;--ENTRY POINT TO EDIT PROBLEMS
;
;
Q:'$L($T(^GMPLUTL))
;
N PXARRAY,RESULT
DECIDE ;--DECIDE IF A PROBLEM
I $G(PXAA("PL ADD"))>0 G SET
I $G(PXAA("PL IEN"))>0 G SET
I $G(PXAA("PL ACTIVE"))]"" G SET
I $G(PXAA("PL ONSET DATE"))>0 G SET
I $G(PXAA("PL RESOLVED DATE"))>0 G SET
I $G(PXAA("PL SC"))]"" G SET
I $G(PXAA("PL AO"))]"" G SET
I $G(PXAA("PL IR"))]"" G SET
I $G(PXAA("PL EC"))]"" G SET
Q
;
;
SET ;--REQUIRED
S PXARRAY("PATIENT")=$G(PATIENT)
S PXARRAY("NARRATIVE")=$G(PXAA("NARRATIVE"))
S PXARRAY("PROVIDER")=$G(PXAA("ENC PROVIDER"))
;--OPTIONAL
S PXARRAY("DIAGNOSIS")=$G(PXAA("DIAGNOSIS"))
S PXARRAY("LEXICON")=$G(PXAA("LEXICON TERM"))
S PXARRAY("STATUS")=$G(PXAA("PL ACTIVE"))
S PXARRAY("ONSET")=$G(PXAA("PL ONSET DATE"))
I '$G(PXAA("PL IEN")) S PXARRAY("RECORDED")=$G(PXAA("EVENT D/T"))
S PXARRAY("RESOLVED")=$G(PXAA("PL RESOLVED DATE"))
S PXARRAY("COMMENT")=$G(PXAA("COMMENT"))
I $G(PXARRAY("COMMENT"))="@" S PXARRAY("COMMENT")=""
;--LOCATION
S PXARRAY("LOCATION")=$P($G(^AUPNVSIT(PXAVISIT,0)),"^",22)
;--SERVICE CONNECTEDNESS
S PXARRAY("SC")=$P(AFTER800,"^",1)
S PXARRAY("AO")=$P(AFTER800,"^",2)
S PXARRAY("IR")=$P(AFTER800,"^",3)
S PXARRAY("EC")=$P(AFTER800,"^",4)
;---MISC
S PXARRAY("PROBLEM")=$G(PXAA("PL IEN"))
;
;
;
RUN ;
D UPDATE^GMPLUTL(.PXARRAY,.RESULT)
I RESULT(0)="" S $P(AFTER0,"^",16)=RESULT
;--**SET ERROR INTO DIALOG
I RESULT(0)]"" D
.S PXAERR("PL1")=$G(RESULT(0))
.S PXAERRF=1
.S PXADI("DIALOG")=8390001.004
Q
PXAIPL ;ISL/JVS - PROBLEM LIST ;6/5/96 16:57
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**69**;Aug 12, 1996
+2 ;
+3 ;
+4 QUIT
PL ;--ENTRY POINT TO EDIT PROBLEMS
+1 ;
+2 ;
+3 IF '$LENGTH($TEXT(^GMPLUTL))
QUIT
+4 ;
+5 NEW PXARRAY,RESULT
DECIDE ;--DECIDE IF A PROBLEM
+1 IF $GET(PXAA("PL ADD"))>0
GOTO SET
+2 IF $GET(PXAA("PL IEN"))>0
GOTO SET
+3 IF $GET(PXAA("PL ACTIVE"))]""
GOTO SET
+4 IF $GET(PXAA("PL ONSET DATE"))>0
GOTO SET
+5 IF $GET(PXAA("PL RESOLVED DATE"))>0
GOTO SET
+6 IF $GET(PXAA("PL SC"))]""
GOTO SET
+7 IF $GET(PXAA("PL AO"))]""
GOTO SET
+8 IF $GET(PXAA("PL IR"))]""
GOTO SET
+9 IF $GET(PXAA("PL EC"))]""
GOTO SET
+10 QUIT
+11 ;
+12 ;
SET ;--REQUIRED
+1 SET PXARRAY("PATIENT")=$GET(PATIENT)
+2 SET PXARRAY("NARRATIVE")=$GET(PXAA("NARRATIVE"))
+3 SET PXARRAY("PROVIDER")=$GET(PXAA("ENC PROVIDER"))
+4 ;--OPTIONAL
+5 SET PXARRAY("DIAGNOSIS")=$GET(PXAA("DIAGNOSIS"))
+6 SET PXARRAY("LEXICON")=$GET(PXAA("LEXICON TERM"))
+7 SET PXARRAY("STATUS")=$GET(PXAA("PL ACTIVE"))
+8 SET PXARRAY("ONSET")=$GET(PXAA("PL ONSET DATE"))
+9 IF '$GET(PXAA("PL IEN"))
SET PXARRAY("RECORDED")=$GET(PXAA("EVENT D/T"))
+10 SET PXARRAY("RESOLVED")=$GET(PXAA("PL RESOLVED DATE"))
+11 SET PXARRAY("COMMENT")=$GET(PXAA("COMMENT"))
+12 IF $GET(PXARRAY("COMMENT"))="@"
SET PXARRAY("COMMENT")=""
+13 ;--LOCATION
+14 SET PXARRAY("LOCATION")=$PIECE($GET(^AUPNVSIT(PXAVISIT,0)),"^",22)
+15 ;--SERVICE CONNECTEDNESS
+16 SET PXARRAY("SC")=$PIECE(AFTER800,"^",1)
+17 SET PXARRAY("AO")=$PIECE(AFTER800,"^",2)
+18 SET PXARRAY("IR")=$PIECE(AFTER800,"^",3)
+19 SET PXARRAY("EC")=$PIECE(AFTER800,"^",4)
+20 ;---MISC
+21 SET PXARRAY("PROBLEM")=$GET(PXAA("PL IEN"))
+22 ;
+23 ;
+24 ;
RUN ;
+1 DO UPDATE^GMPLUTL(.PXARRAY,.RESULT)
+2 IF RESULT(0)=""
SET $PIECE(AFTER0,"^",16)=RESULT
+3 ;--**SET ERROR INTO DIALOG
+4 IF RESULT(0)]""
Begin DoDot:1
+5 SET PXAERR("PL1")=$GET(RESULT(0))
+6 SET PXAERRF=1
+7 SET PXADI("DIALOG")=8390001.004
End DoDot:1
+8 QUIT