PXCAPED ;ISL/dee - Validates & Translates data from the PCE Device Interface into PCE's PXK format for Patient Ed ;3/14/97
;;1.0;PCE PATIENT CARE ENCOUNTER;**27**;Aug 12, 1996
Q
; Variables
; PXCAPED Copy of a PATIENT ED node of the PXCA array
; PXCAPRV Pointer to the provider (200)
; PXCANUMB Count of the number if PEDs
; PXCAINDX Count of the number of PATIENT ED for one provider
; PXCAPNAR Pointer to the provider narrative (9999999.27)
;
PED(PXCAPED,PXCANUMB,PXCAPRV,PXCAERRS) ;
S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,"IEN")=""
S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,0,"BEFORE")=""
S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,0,"AFTER")=$P(PXCAPED,"^",1)_"^"_PXCAPAT_"^"_PXCAVSIT_"^^^"_$P(PXCAPED,"^",2)
S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,12,"BEFORE")=""
S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,12,"AFTER")="^^^"_$S(PXCAPRV>0:PXCAPRV,1:"")
S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,812,"BEFORE")=""
S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,812,"AFTER")="^"_PXCAPKG_"^"_PXCASOR
Q
;
PATED(PXCA,PXCABULD,PXCAERRS) ;Validation routine for PED
Q:'$D(PXCA("PATIENT ED"))
N PXCAPED,PXCAPRV,PXCANUMB,PXCAINDX
N PXCAITEM
S PXCAPRV=""
S PXCANUMB=0
F S PXCAPRV=$O(PXCA("PATIENT ED",PXCAPRV)) Q:PXCAPRV']"" D
. I PXCAPRV>0 D
.. I '$$ACTIVPRV^PXAPI(PXCAPRV,PXCADT) S PXCA("ERROR","PATIENT ED",PXCAPRV,0,0)="Provider is not active or valid^"_PXCAPRV
.. E I PXCABULD!PXCAERRS D ANOTHPRV^PXCAPRV(PXCAPRV)
. S PXCAINDX=""
. F S PXCAINDX=$O(PXCA("PATIENT ED",PXCAPRV,PXCAINDX)) Q:PXCAINDX']"" D
.. S PXCAPED=$G(PXCA("PATIENT ED",PXCAPRV,PXCAINDX))
.. S PXCANUMB=PXCANUMB+1
.. I PXCAPED="" S PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,0)="PATIENT ED data missing" Q
.. S PXCAITEM=+$P(PXCAPED,U,1)
.. I $G(^AUTTEDT(PXCAITEM,0))="" S PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,1)="PATIENT ED type not in file 9999999.09^"_PXCAITEM
.. S PXCAITEM=$P(PXCAPED,U,2) I '((PXCAITEM=(PXCAITEM\1)&(PXCAITEM>0)&(PXCAITEM<6))!(PXCAITEM="")) S PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,2)="PATIENT ED level of understanding must be an integer form 1 to 5^"_PXCAITEM
.. I PXCABULD&'$D(PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX))!PXCAERRS D PED(PXCAPED,.PXCANUMB,PXCAPRV,PXCAERRS)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXCAPED 2210 printed Dec 13, 2024@02:27:33 Page 2
PXCAPED ;ISL/dee - Validates & Translates data from the PCE Device Interface into PCE's PXK format for Patient Ed ;3/14/97
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**27**;Aug 12, 1996
+2 QUIT
+3 ; Variables
+4 ; PXCAPED Copy of a PATIENT ED node of the PXCA array
+5 ; PXCAPRV Pointer to the provider (200)
+6 ; PXCANUMB Count of the number if PEDs
+7 ; PXCAINDX Count of the number of PATIENT ED for one provider
+8 ; PXCAPNAR Pointer to the provider narrative (9999999.27)
+9 ;
PED(PXCAPED,PXCANUMB,PXCAPRV,PXCAERRS) ;
+1 SET ^TMP(PXCAGLB,$JOB,"PED",PXCANUMB,"IEN")=""
+2 SET ^TMP(PXCAGLB,$JOB,"PED",PXCANUMB,0,"BEFORE")=""
+3 SET ^TMP(PXCAGLB,$JOB,"PED",PXCANUMB,0,"AFTER")=$PIECE(PXCAPED,"^",1)_"^"_PXCAPAT_"^"_PXCAVSIT_"^^^"_$PIECE(PXCAPED,"^",2)
+4 SET ^TMP(PXCAGLB,$JOB,"PED",PXCANUMB,12,"BEFORE")=""
+5 SET ^TMP(PXCAGLB,$JOB,"PED",PXCANUMB,12,"AFTER")="^^^"_$SELECT(PXCAPRV>0:PXCAPRV,1:"")
+6 SET ^TMP(PXCAGLB,$JOB,"PED",PXCANUMB,812,"BEFORE")=""
+7 SET ^TMP(PXCAGLB,$JOB,"PED",PXCANUMB,812,"AFTER")="^"_PXCAPKG_"^"_PXCASOR
+8 QUIT
+9 ;
PATED(PXCA,PXCABULD,PXCAERRS) ;Validation routine for PED
+1 if '$DATA(PXCA("PATIENT ED"))
QUIT
+2 NEW PXCAPED,PXCAPRV,PXCANUMB,PXCAINDX
+3 NEW PXCAITEM
+4 SET PXCAPRV=""
+5 SET PXCANUMB=0
+6 FOR
SET PXCAPRV=$ORDER(PXCA("PATIENT ED",PXCAPRV))
if PXCAPRV']""
QUIT
Begin DoDot:1
+7 IF PXCAPRV>0
Begin DoDot:2
+8 IF '$$ACTIVPRV^PXAPI(PXCAPRV,PXCADT)
SET PXCA("ERROR","PATIENT ED",PXCAPRV,0,0)="Provider is not active or valid^"_PXCAPRV
+9 IF '$TEST
IF PXCABULD!PXCAERRS
DO ANOTHPRV^PXCAPRV(PXCAPRV)
End DoDot:2
+10 SET PXCAINDX=""
+11 FOR
SET PXCAINDX=$ORDER(PXCA("PATIENT ED",PXCAPRV,PXCAINDX))
if PXCAINDX']""
QUIT
Begin DoDot:2
+12 SET PXCAPED=$GET(PXCA("PATIENT ED",PXCAPRV,PXCAINDX))
+13 SET PXCANUMB=PXCANUMB+1
+14 IF PXCAPED=""
SET PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,0)="PATIENT ED data missing"
QUIT
+15 SET PXCAITEM=+$PIECE(PXCAPED,U,1)
+16 IF $GET(^AUTTEDT(PXCAITEM,0))=""
SET PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,1)="PATIENT ED type not in file 9999999.09^"_PXCAITEM
+17 SET PXCAITEM=$PIECE(PXCAPED,U,2)
IF '((PXCAITEM=(PXCAITEM\1)&(PXCAITEM>0)&(PXCAITEM<6))!(PXCAITEM=""))
SET PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,2)="PATIENT ED level of understanding must be an integer form 1 to 5^"_PXCAITEM
+18 IF PXCABULD&'$DATA(PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX))!PXCAERRS
DO PED(PXCAPED,.PXCANUMB,PXCAPRV,PXCAERRS)
End DoDot:2
End DoDot:1
+19 QUIT
+20 ;