PXAIPEDV ;ISL/PKR - VALIDATE PATIENT EDUCATION DATA ;03/17/2022
;;1.0;PCE PATIENT CARE ENCOUNTER;**211,217**;Aug 12, 1996;Build 134
;
ERRSET ;Set the rest of the error data.
S STOP=1
S PXAERRF("PED")=1
S PXADI("DIALOG")=8390001.001
S PXAERR(7)="PATIENT EDUCATION"
Q
;
VAL ;Validate the input data.
I $G(PXAA("TOPIC"))="" D Q
. S PXAERR(9)="Education Topic"
. S PXAERR(12)="The Education Topic is missing."
. D ERRSET
;
;If this is a deletion no further verification is required.
I $G(PXAA("DELETE"))=1 Q
;
;Check that it is a valid pointer.
I '$D(^AUTTEDT(PXAA("TOPIC"))) D Q
. S PXAERR(9)="Education Topic"
. S PXAERR(11)=PXAA("TOPIC")
. S PXAERR(12)="The Education Topic pointer is not valid."
. D ERRSET
;
N TEMP S TEMP=$G(^AUTTEDT(PXAA("TOPIC"),0))
;Check that the .01 is not null.
I $P(TEMP,U,1)="" D Q
. S PXAERR(9)="EDUCATION TOPIC"
. S PXAERR(11)=PXAA("TOPIC")
. S PXAERR(12)="The Education Topic does not have a .01."
. D ERRSET
;
;Check that it is active.
;* I $P(TEMP,U,3)=1 D Q
;* . S PXAERR(9)="INACTIVE"
;* . S PXAERR(11)=PXAA("TOPIC")
;* . S PXAERR(12)="The Education Topic is inactive."
;* . D ERRSET
;
;If a Level Of Understanding is being input validate it.
;* I $G(PXAA("UNDERSTANDING"))'="",'$$SET^PXAIVAL(9000010.16,"LEVEL OF UNDERSTANDING",.06,PXAA("UNDERSTANDING"),.PXAERR) D Q
;* . D ERRSET
;
;If Event D/T is input verify it is a valid FileMan date and not in
;the future.
;* I $G(PXAA("EVENT D/T"))'="",'$$EVENTDT^PXAIVAL(PXAA("EVENT D/T"),"T",.PXAERR) D Q
;* . D ERRSET
;
;If a Comment is passed verify it.
;* I $G(PXAA("COMMENT"))'="",'$$TEXT^PXAIVAL("COMMENT",PXAA("COMMENT"),1,245,.PXAERR) D Q
;* . D ERRSET
;
;If an Ordering Provider is passed verify it is valid.
;* I $G(PXAA("ORD PROVIDER"))'="",'$$PRV^PXAIVAL(PXAA("ORD PROVIDER"),"ORD",.PXAA,.PXAERR,PXAVISIT) D Q
;* . D ERRSET
;
;If an Encounter Provider is passed verify it is valid.
;* I $G(PXAA("ENC PROVIDER"))'="",'$$PRV^PXAIVAL(PXAA("ENC PROVIDER"),"ENC",.PXAA,.PXAERR,PXAVISIT) D Q
;* . D ERRSET
;
;If a measurement is being input verify that it is in the allowed
;range.
I $D(PXAA("MAGNITUDE")) D
. I '$$MAG^PXAIVAL(PXAA("MAGNITUDE"),$G(^AUTTEDT(PXAA("TOPIC"),220)),.PXAERR) D ERRSET Q
. S PXAA("MAGNITUDE")=$$MAGFORMAT^PXMEASUREMENT(PXAA("MAGNITUDE"))
;
;If PKG is input verify it.
;* I $G(PXAA("PKG"))'="" D
;* . N PKG
;* . S PKG=$$VPKG^PXAIVAL(PXAA("PKG"),.PXAERR)
;* . I PKG=0 S PXAERR(9)="PKG" D ERRSET Q
;* . S PXAA("PKG")=PKG
;* I $G(STOP)=1 Q
;
;If SOURCE is input verify it.
;* I $G(PXAA("SOURCE"))'="" D
;* . N SRC
;* . S SRC=$$VSOURCE^PXAIVAL(PXAA("SOURCE"),.PXAERR)
;* . I SRC=0 S PXAERR(9)="SOURCE" D ERRSET Q
;* . S PXAA("SOURCE")=SRC
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXAIPEDV 2822 printed Nov 22, 2024@17:35:56 Page 2
PXAIPEDV ;ISL/PKR - VALIDATE PATIENT EDUCATION DATA ;03/17/2022
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**211,217**;Aug 12, 1996;Build 134
+2 ;
ERRSET ;Set the rest of the error data.
+1 SET STOP=1
+2 SET PXAERRF("PED")=1
+3 SET PXADI("DIALOG")=8390001.001
+4 SET PXAERR(7)="PATIENT EDUCATION"
+5 QUIT
+6 ;
VAL ;Validate the input data.
+1 IF $GET(PXAA("TOPIC"))=""
Begin DoDot:1
+2 SET PXAERR(9)="Education Topic"
+3 SET PXAERR(12)="The Education Topic is missing."
+4 DO ERRSET
End DoDot:1
QUIT
+5 ;
+6 ;If this is a deletion no further verification is required.
+7 IF $GET(PXAA("DELETE"))=1
QUIT
+8 ;
+9 ;Check that it is a valid pointer.
+10 IF '$DATA(^AUTTEDT(PXAA("TOPIC")))
Begin DoDot:1
+11 SET PXAERR(9)="Education Topic"
+12 SET PXAERR(11)=PXAA("TOPIC")
+13 SET PXAERR(12)="The Education Topic pointer is not valid."
+14 DO ERRSET
End DoDot:1
QUIT
+15 ;
+16 NEW TEMP
SET TEMP=$GET(^AUTTEDT(PXAA("TOPIC"),0))
+17 ;Check that the .01 is not null.
+18 IF $PIECE(TEMP,U,1)=""
Begin DoDot:1
+19 SET PXAERR(9)="EDUCATION TOPIC"
+20 SET PXAERR(11)=PXAA("TOPIC")
+21 SET PXAERR(12)="The Education Topic does not have a .01."
+22 DO ERRSET
End DoDot:1
QUIT
+23 ;
+24 ;Check that it is active.
+25 ;* I $P(TEMP,U,3)=1 D Q
+26 ;* . S PXAERR(9)="INACTIVE"
+27 ;* . S PXAERR(11)=PXAA("TOPIC")
+28 ;* . S PXAERR(12)="The Education Topic is inactive."
+29 ;* . D ERRSET
+30 ;
+31 ;If a Level Of Understanding is being input validate it.
+32 ;* I $G(PXAA("UNDERSTANDING"))'="",'$$SET^PXAIVAL(9000010.16,"LEVEL OF UNDERSTANDING",.06,PXAA("UNDERSTANDING"),.PXAERR) D Q
+33 ;* . D ERRSET
+34 ;
+35 ;If Event D/T is input verify it is a valid FileMan date and not in
+36 ;the future.
+37 ;* I $G(PXAA("EVENT D/T"))'="",'$$EVENTDT^PXAIVAL(PXAA("EVENT D/T"),"T",.PXAERR) D Q
+38 ;* . D ERRSET
+39 ;
+40 ;If a Comment is passed verify it.
+41 ;* I $G(PXAA("COMMENT"))'="",'$$TEXT^PXAIVAL("COMMENT",PXAA("COMMENT"),1,245,.PXAERR) D Q
+42 ;* . D ERRSET
+43 ;
+44 ;If an Ordering Provider is passed verify it is valid.
+45 ;* I $G(PXAA("ORD PROVIDER"))'="",'$$PRV^PXAIVAL(PXAA("ORD PROVIDER"),"ORD",.PXAA,.PXAERR,PXAVISIT) D Q
+46 ;* . D ERRSET
+47 ;
+48 ;If an Encounter Provider is passed verify it is valid.
+49 ;* I $G(PXAA("ENC PROVIDER"))'="",'$$PRV^PXAIVAL(PXAA("ENC PROVIDER"),"ENC",.PXAA,.PXAERR,PXAVISIT) D Q
+50 ;* . D ERRSET
+51 ;
+52 ;If a measurement is being input verify that it is in the allowed
+53 ;range.
+54 IF $DATA(PXAA("MAGNITUDE"))
Begin DoDot:1
+55 IF '$$MAG^PXAIVAL(PXAA("MAGNITUDE"),$GET(^AUTTEDT(PXAA("TOPIC"),220)),.PXAERR)
DO ERRSET
QUIT
+56 SET PXAA("MAGNITUDE")=$$MAGFORMAT^PXMEASUREMENT(PXAA("MAGNITUDE"))
End DoDot:1
+57 ;
+58 ;If PKG is input verify it.
+59 ;* I $G(PXAA("PKG"))'="" D
+60 ;* . N PKG
+61 ;* . S PKG=$$VPKG^PXAIVAL(PXAA("PKG"),.PXAERR)
+62 ;* . I PKG=0 S PXAERR(9)="PKG" D ERRSET Q
+63 ;* . S PXAA("PKG")=PKG
+64 ;* I $G(STOP)=1 Q
+65 ;
+66 ;If SOURCE is input verify it.
+67 ;* I $G(PXAA("SOURCE"))'="" D
+68 ;* . N SRC
+69 ;* . S SRC=$$VSOURCE^PXAIVAL(PXAA("SOURCE"),.PXAERR)
+70 ;* . I SRC=0 S PXAERR(9)="SOURCE" D ERRSET Q
+71 ;* . S PXAA("SOURCE")=SRC
+72 QUIT
+73 ;