PXCADXP2 ;ISL/dee & LEA/Chylton - Validates & Translates data from the PCE Device Interface into a call to V POV & update Problem List ; 9/12/01 12:16pm
;;1.0;PCE PATIENT CARE ENCOUNTER;**115**;Aug 12, 1996
Q
;
PART2 ;
;Problem Active
S PXCAITEM=$P(PXCADXPL,U,6)
I '(PXCAITEM="A"!(PXCAITEM="I")!(PXCAITEM="")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,6)="Problem Active flag bad^"_PXCAITEM
;
;Problem Onset Date
S PXCAITEM=$P(PXCADXPL,U,7)
I PXCAITEM]"",PXCAITEM>DT!(PXCAITEM<1800000)!($P(+PXCAITEM,".")'=PXCAITEM)!(PXCAITEM>+$P($P(PXCA("ENCOUNTER"),"^"),".")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,7)="Problem Onset Date is bad^"_PXCAITEM
;
;Problem Resolved Date
S PXCAITEM=$P(PXCADXPL,U,8)
I PXCAITEM]"",PXCAITEM>DT!(PXCAITEM<1800000)!($P(+PXCAITEM,".")'=PXCAITEM)!(PXCAITEM>+$P($P(PXCA("ENCOUNTER"),"^"),".")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,8)="Problem Resolved Date is bad^"_PXCAITEM
;
;SC Condition
S PXCAITEM=$P(PXCADXPL,U,9)
I '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM="")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,9)="SC flag bad^"_PXCAITEM
;
;AO Condition
S PXCAITEM=$P(PXCADXPL,U,10)
I '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM="")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,10)="AO flag bad^"_PXCAITEM
;
;IR Condition
S PXCAITEM=$P(PXCADXPL,U,11)
I '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM="")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,11)="IR flag bad^"_PXCAITEM
;
;EC Condition
S PXCAITEM=$P(PXCADXPL,U,12)
I '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM="")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,12)="EC flag bad^"_PXCAITEM
;
;PX*1*115 - MST Condition
S PXCAITEM=$P(PXCADXPL,U,15)
I '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM="")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,15)="MST flag bad^"_PXCAITEM
;
;PX*1*115 - HNC Condition
S PXCAITEM=$P(PXCADXPL,U,16)
I '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM="")) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,16)="HNC flag bad^"_PXCAITEM
;
;Narrative: Required for DX and for new Problem
S PXCAITEM=$P(PXCADXPL,"^",13),PXCAITM2=$L(PXCAITEM)
I PXCAITEM]"" D
. I PXCAITM2<2!(PXCAITM2>80) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)="Provider's Narrative must be 2-80 Characters^"_PXCAITEM
. E D
.. S PXCAITM3=+$$PROVNARR^PXAPI(PXCAITEM,9000010.07,$G(PXCACLEX))
.. I PXCAITM3'>0 S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)="Could not get pointer to Provider's NARRATIVE^"_PXCAITEM
.. E S $P(PXCADXPL,"^",13)=PXCAITM3
E D
.I PXCADIAG S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)="Provider's Narrative is required for DIAGNOSIS "
.I PXCAPROB,($P(PXCADXPL,"^",4)="") S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)=$P($G(PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)),"^",1)_"Provider's Narrative is required for a new PROBLEM"
;
;Narrative Category
S PXCAITEM=$P(PXCADXPL,"^",14),PXCAITM2=$L(PXCAITEM)
I PXCAITEM]"" D
. I PXCAITM2<2!(PXCAITM2>80) S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,14)="Provider's NARRATIVE Category must be 2-80 Characters^"_PXCAITEM
. E D
.. S PXCAITM3=+$$PROVNARR^PXAPI(PXCAITEM,9000010.07)
.. I PXCAITM3'>0 S PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,14)="Could not get pointer to Provider's NARRATIVE Category^"_PXCAITEM
.. E S $P(PXCADXPL,"^",14)=PXCAITM3
;
Q
;
PXCADXP2 ;ISL/dee & LEA/Chylton - Validates & Translates data from the PCE Device Interface into a call to V POV & update Problem List ; 9/12/01 12:16pm
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**115**;Aug 12, 1996
+2 QUIT
+3 ;
PART2 ;
+1 ;Problem Active
+2 SET PXCAITEM=$PIECE(PXCADXPL,U,6)
+3 IF '(PXCAITEM="A"!(PXCAITEM="I")!(PXCAITEM=""))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,6)="Problem Active flag bad^"_PXCAITEM
+4 ;
+5 ;Problem Onset Date
+6 SET PXCAITEM=$PIECE(PXCADXPL,U,7)
+7 IF PXCAITEM]""
IF PXCAITEM>DT!(PXCAITEM<1800000)!($PIECE(+PXCAITEM,".")'=PXCAITEM)!(PXCAITEM>+$PIECE($PIECE(PXCA("ENCOUNTER"),"^"),"."))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,7)="Problem Onset Date is bad^"_PXCAITEM
+8 ;
+9 ;Problem Resolved Date
+10 SET PXCAITEM=$PIECE(PXCADXPL,U,8)
+11 IF PXCAITEM]""
IF PXCAITEM>DT!(PXCAITEM<1800000)!($PIECE(+PXCAITEM,".")'=PXCAITEM)!(PXCAITEM>+$PIECE($PIECE(PXCA("ENCOUNTER"),"^"),"."))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,8)="Problem Resolved Date is bad^"_PXCAITEM
+12 ;
+13 ;SC Condition
+14 SET PXCAITEM=$PIECE(PXCADXPL,U,9)
+15 IF '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM=""))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,9)="SC flag bad^"_PXCAITEM
+16 ;
+17 ;AO Condition
+18 SET PXCAITEM=$PIECE(PXCADXPL,U,10)
+19 IF '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM=""))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,10)="AO flag bad^"_PXCAITEM
+20 ;
+21 ;IR Condition
+22 SET PXCAITEM=$PIECE(PXCADXPL,U,11)
+23 IF '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM=""))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,11)="IR flag bad^"_PXCAITEM
+24 ;
+25 ;EC Condition
+26 SET PXCAITEM=$PIECE(PXCADXPL,U,12)
+27 IF '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM=""))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,12)="EC flag bad^"_PXCAITEM
+28 ;
+29 ;PX*1*115 - MST Condition
+30 SET PXCAITEM=$PIECE(PXCADXPL,U,15)
+31 IF '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM=""))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,15)="MST flag bad^"_PXCAITEM
+32 ;
+33 ;PX*1*115 - HNC Condition
+34 SET PXCAITEM=$PIECE(PXCADXPL,U,16)
+35 IF '(PXCAITEM=1!(PXCAITEM=0)!(PXCAITEM=""))
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,16)="HNC flag bad^"_PXCAITEM
+36 ;
+37 ;Narrative: Required for DX and for new Problem
+38 SET PXCAITEM=$PIECE(PXCADXPL,"^",13)
SET PXCAITM2=$LENGTH(PXCAITEM)
+39 IF PXCAITEM]""
Begin DoDot:1
+40 IF PXCAITM2<2!(PXCAITM2>80)
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)="Provider's Narrative must be 2-80 Characters^"_PXCAITEM
+41 IF '$TEST
Begin DoDot:2
+42 SET PXCAITM3=+$$PROVNARR^PXAPI(PXCAITEM,9000010.07,$GET(PXCACLEX))
+43 IF PXCAITM3'>0
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)="Could not get pointer to Provider's NARRATIVE^"_PXCAITEM
+44 IF '$TEST
SET $PIECE(PXCADXPL,"^",13)=PXCAITM3
End DoDot:2
End DoDot:1
+45 IF '$TEST
Begin DoDot:1
+46 IF PXCADIAG
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)="Provider's Narrative is required for DIAGNOSIS "
+47 IF PXCAPROB
IF ($PIECE(PXCADXPL,"^",4)="")
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)=$PIECE($GET(PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,13)),"^",1)_"Provider's Narrative is required for a new PROBLEM"
End DoDot:1
+48 ;
+49 ;Narrative Category
+50 SET PXCAITEM=$PIECE(PXCADXPL,"^",14)
SET PXCAITM2=$LENGTH(PXCAITEM)
+51 IF PXCAITEM]""
Begin DoDot:1
+52 IF PXCAITM2<2!(PXCAITM2>80)
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,14)="Provider's NARRATIVE Category must be 2-80 Characters^"_PXCAITEM
+53 IF '$TEST
Begin DoDot:2
+54 SET PXCAITM3=+$$PROVNARR^PXAPI(PXCAITEM,9000010.07)
+55 IF PXCAITM3'>0
SET PXCA("ERROR","DIAGNOSIS/PROBLEM",PXCAPRV,PXCAINDX,14)="Could not get pointer to Provider's NARRATIVE Category^"_PXCAITEM
+56 IF '$TEST
SET $PIECE(PXCADXPL,"^",14)=PXCAITM3
End DoDot:2
End DoDot:1
+57 ;
+58 QUIT
+59 ;