PXAIPL ;ISL/JVS - PROBLEM LIST ;10/05/2020
;;1.0;PCE PATIENT CARE ENCOUNTER;**69,124,168,199,211**;Aug 12, 1996;Build 454
;
;
Q
PL ;--ENTRY POINT TO EDIT PROBLEMS
;
;
Q:'$L($T(^GMPLUTL))
;
N PXARRAY,RESULT
DECIDE ;--DECIDE IF A PROBLEM
I $G(PXAA("PL ADD"))=1 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
;PX*1.0*124
;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
;I $G(PXAA("PL MST"))]"" G SET
;I $G(PXAA("PL HNC"))]"" G SET
;I $G(PXAA("PL CV"))]"" G SET
;I $G(PXAA("PL SHAD"))]"" 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("DX_DATE_OF_INTEREST")=$$CSDATE^PXDXUTL(PXAVISIT)
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)
S PXARRAY("MST")=$P(AFTER800,"^",5)
S PXARRAY("HNC")=$P(AFTER800,"^",6)
S PXARRAY("CV")=$P(AFTER800,"^",7)
S PXARRAY("SHAD")=$P(AFTER800,"^",8)
;---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("PL")=1
.S PXADI("DIALOG")=8390001.004
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXAIPL 2034 printed Sep 02, 2024@19:11:14 Page 2
PXAIPL ;ISL/JVS - PROBLEM LIST ;10/05/2020
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**69,124,168,199,211**;Aug 12, 1996;Build 454
+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"))=1
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 ;PX*1.0*124
+7 ;I $G(PXAA("PL SC"))]"" G SET
+8 ;I $G(PXAA("PL AO"))]"" G SET
+9 ;I $G(PXAA("PL IR"))]"" G SET
+10 ;I $G(PXAA("PL EC"))]"" G SET
+11 ;I $G(PXAA("PL MST"))]"" G SET
+12 ;I $G(PXAA("PL HNC"))]"" G SET
+13 ;I $G(PXAA("PL CV"))]"" G SET
+14 ;I $G(PXAA("PL SHAD"))]"" G SET
+15 QUIT
+16 ;
+17 ;
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("DX_DATE_OF_INTEREST")=$$CSDATE^PXDXUTL(PXAVISIT)
+7 SET PXARRAY("LEXICON")=$GET(PXAA("LEXICON TERM"))
+8 SET PXARRAY("STATUS")=$GET(PXAA("PL ACTIVE"))
+9 SET PXARRAY("ONSET")=$GET(PXAA("PL ONSET DATE"))
+10 IF '$GET(PXAA("PL IEN"))
SET PXARRAY("RECORDED")=$GET(PXAA("EVENT D/T"))
+11 SET PXARRAY("RESOLVED")=$GET(PXAA("PL RESOLVED DATE"))
+12 SET PXARRAY("COMMENT")=$GET(PXAA("COMMENT"))
+13 IF $GET(PXARRAY("COMMENT"))="@"
SET PXARRAY("COMMENT")=""
+14 ;--LOCATION
+15 SET PXARRAY("LOCATION")=$PIECE($GET(^AUPNVSIT(PXAVISIT,0)),"^",22)
+16 ;--SERVICE CONNECTEDNESS
+17 SET PXARRAY("SC")=$PIECE(AFTER800,"^",1)
+18 SET PXARRAY("AO")=$PIECE(AFTER800,"^",2)
+19 SET PXARRAY("IR")=$PIECE(AFTER800,"^",3)
+20 SET PXARRAY("EC")=$PIECE(AFTER800,"^",4)
+21 SET PXARRAY("MST")=$PIECE(AFTER800,"^",5)
+22 SET PXARRAY("HNC")=$PIECE(AFTER800,"^",6)
+23 SET PXARRAY("CV")=$PIECE(AFTER800,"^",7)
+24 SET PXARRAY("SHAD")=$PIECE(AFTER800,"^",8)
+25 ;---MISC
+26 SET PXARRAY("PROBLEM")=$GET(PXAA("PL IEN"))
+27 ;
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("PL")=1
+7 SET PXADI("DIALOG")=8390001.004
End DoDot:1
+8 QUIT