PXAIPOVV ;ISL/JVS,PKR - VALIDATE DIAGNOSIS ;02/04/2021
;;1.0;PCE PATIENT CARE ENCOUNTER;**121,194,199,211**;Aug 12, 1996;Build 454
;
;Reference to ICDEX supported by ICR #5747.
;
ERRSET ;Set the rest of the error data.
S STOP=1
S PXAERRF("POV")=1
S PXADI("DIALOG")=8390001.001
S PXAERR(7)="DX/PL"
Q
;
PRIM(VISITIEN,PXADATA,PXAERRF) ;Make sure there is only one primary diagnosis.
N DIAG,IND,NPDIAG,NPDN,PDLISTN,PRIM
S IND=0
F S IND=+$O(@PXADATA@("DX/PL",IND)) Q:IND=0 D
. S DIAG=$G(@PXADATA@("DX/PL",IND,"DIAGNOSIS"))
. I DIAG="" Q
. S PRIM=$G(@PXADATA@("DX/PL",IND,"PRIMARY"))
.;Check for a change to the existing primary diagnosis.
. I $D(PDLISTE(DIAG)) D
.. I +$G(@PXADATA@("DX/PL",IND,"DELETE")) K PDLISTE(DIAG) Q
.. I (PRIM=0)!(PRIM="S") K PDLISTE(DIAG)
.;Check for adding a new primary diagnosis.
. I (PRIM=1)!(PRIM="P") S PDLISTN(DIAG)=""
. I +$G(@PXADATA@("DX/PL",IND,"DELETE")) K PDLISTN(DIAG) Q
;
S DIAG="",NPDN=0
F S DIAG=$O(PDLISTN(DIAG)) Q:DIAG="" S NPDN=NPDN+1,NPDIAG(NPDN)=DIAG
;
I NPDN>1 D Q
. S PXAERR(9)="DIAGNOSIS"
. S PXAERR(12)=NPDN_" diagnoses have been designated as primary, there can only be one."
. S PXAERR(12)=PXAERR(12)_" They are: "
. F IND=1:1:NPDN S PXAERR(12)=PXAERR(12)_$S(IND=1:" ",1:",")_NPDIAG(IND)
. D ERRSET
Q
;
VAL ;Validate the input data.
I $G(PXAA("DIAGNOSIS"))="" D Q
. S PXAERR(9)="DIAGNOSIS"
. S PXAERR(12)="The ICD diagnosis is missing."
. D ERRSET
;
;Save the code or the pointer.
S PXAERR(11)=$G(PXAA("DIAGNOSIS"))
;
N CODE,CODEIEN,CODESYS,EVENTDT,FMT,ICDDATA,SERVCAT,TEMP
S TEMP=^AUPNVSIT(PXAVISIT,0)
S SERVCAT=$P(TEMP,U,7)
;For historical encounters use the Date the Visit was created.
S EVENTDT=$S(SERVCAT="E":$P(TEMP,U,2),$G(PXAA("EVENT D/T"))'="":PXAA("EVENT D/T"),1:$P(TEMP,U,1))
S FMT=$S(PXAA("DIAGNOSIS")?1.N:"I",1:"E")
I FMT="E" S CODE=PXAA("DIAGNOSIS"),CODEIEN=$P($$CODEN^ICDEX(CODE,80),"~",1)
I FMT="I" S CODEIEN=PXAA("DIAGNOSIS"),CODE=$$CODEC^ICDEX(80,CODEIEN)
I CODEIEN'>0 D Q
. S PXAERR(9)="DIAGNOSIS"
. S PXAERR(11)=PXAA("DIAGNOSIS")
. S PXAERR(12)=PXAERR(11)_" is not a valid code or pointer."
. D ERRSET
;
;If a code was passed store the pointer.
I FMT="E" S PXAA("DIAGNOSIS")=CODEIEN
;
;If this is a deletion no further validation is required.
I $G(PXAA("DELETE"))=1 Q
;
;Make sure the code is active.
S CODESYS=$$CSI^ICDEX(80,CODEIEN)
I '$$ISCACT^PXLEX(CODESYS,CODE,EVENTDT) D
. S PXAERR(9)="DIAGNOSIS"
. S PXAERR(11)=PXAA("DIAGNOSIS")
. S PXAERR(12)=PXAERR(11)_" is not an active ICD code."
. D ERRSET
;
;If Primary is input validate it.
;* N PRIM
;* S PRIM=$G(PXAA("PRIMARY"))
;* S PXAA("PRIMARY")=$S(PRIM=1:"P",PRIM=0:"S",1:PRIM)
;* I $G(PXAA("PRIMARY"))'="",'$$SET^PXAIVAL(9000010.07,"PRIMARY",.12,PXAA("PRIMARY"),.PXAERR) D Q
;* . S PXAERR(9)="PRIMARY"
;* . S PXAERR(11)=PXAA("PRIMARY")
;* . D ERRSET
;
;If ORD/RES is input validate it.
;* I $G(PXAA("ORD/RES"))'="",'$$SET^PXAIVAL(9000010.07,"ORD/RES",.17,PXAA("ORD/RES"),.PXAERR) D Q
;* . S PXAERR(9)="ORD/RES"
;* . S PXAERR(11)=PXAA("ORD/RES")
;* . D ERRSET
;
;If Lexicon Term is input validate it.
;* I $G(PXAA("LEXICON TERM"))'="",'$D(^LEX(757.01,PXAA("LEXICON TERM"),0)) D Q
;* . S PXAERR(9)="LEXICON TERM"
;* . S PXAERR(11)=PXAA("LEXICON TERM")
;* . S PXAERR(12)=PXAA("LEXICON TERM")_" is not a valid point to the Clinical Expression file #757.01."
;* . D ERRSET
;
;If Narrative is input validate it.
;* I $G(PXAA("NARRATIVE"))'="",'$$TEXT^PXAIVAL("PROVIDER NARRATIVE",PXAA("NARRATIVE"),2,245,.PXAERR) D Q
;* . D ERRSET
;*Control characters are not allowed.
;*I '$$VPNARR^PXPNARR(PXAA("NARRATIVE")) D Q
;*. S PXAERR(9)="PROVIDER NARRATIVE"
;*. S PXAERR(11)=PXAA("NARRATIVE")
;*. S PXAERR(12)="Control characters are not allowed."
;*. D ERRSET
;
;Provider Narrative is required so if it is not input create one from
;the code description.
I $G(PXAA("NARRATIVE"))="" S PXAA("NARRATIVE")=$$DXNARR^PXUTL1(CODEIEN,EVENTDT)
;
;If Provider Narrative Category is input validate it.
;* I $G(PXAA("CATEGORY"))'="",'$$TEXT^PXAIVAL("PROVIDER NARRATIVE CATEGORY",PXAA("CATEGORY"),2,245,.PXAERR) D Q
;* . D ERRSET
;*Control characters are not allowed.
;*I '$$VPNARR^PXPNARR(PXAA("PROVIDER NARRATIVE CATEGORY")) D Q
;*. S PXAERR(9)="PROVIDER NARRATIVE CATEGORY"
;*. S PXAERR(11)=PXAA("CATEGORY")
;*. S PXAERR(12)="Control characters are not allowed."
;*. 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 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 input verify it.
;* I $G(PXAA("COMMENT"))'="",'$$TEXT^PXAIVAL("COMMENT",PXAA("COMMENT"),1,245,.PXAERR) D Q
;* . D ERRSET
;
;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
;* I $G(STOP)=1 Q
;
;If PL IEN is input validate it.
;* I $G(PXAA("PL IEN"))'="",'$D(^AUPNPROB(PXAA("PL IEN"),0)) D Q
;* . S PXAERR(9)="PL IEN"
;* . S PXAERR(11)=PXAA("PL IEN")
;* . S PXAERR(12)=PXAA("PL IEN")_" is not a valid point to the Problem file #9000011."
;* . D ERRSET
;
;There is nothing to verify for PL ADD.
;
;If PL ACTIVE is input validate it.
;* I $G(PXAA("PL ACTIVE"))'="",PXAA("PL ACTIVE")'="A",PXAA("PL ACTIVE")'="I" D Q
;* . S PXAERR(9)="PL ACTIVE"
;* . S PXAERR(11)=PXAA("PL ACTIVE")
;* . S PXAERR(12)=PXAA("PL ACTIVE")_" is not a valid value for PL ACTIVE, A or I are allowed."
;* . D ERRSET
;
;If PL Onset Date is input verify it.
;* I $G(PXAA("PL ONSET DATE"))'="",'$$DATETIME^PXAIVAL("PL ONSET DATE",PXAA("PL ONSET DATE"),"",.PXAERR) D Q
;* . S PXAERR(9)="PL ONSET DATE"
;* . S PXAERR(11)=PXAA("PL ONSET DATE")
;* . D ERRSET
;
;If PL Resolved Date is input verify it.
;* I $G(PXAA("PL RESOLVED DATE"))'="",'$$DATETIME^PXAIVAL("PL RESOLVED DATE",PXAA("PL RESOLVED DATE"),"",.PXAERR) D Q
;* . S PXAERR(9)="PL RESOLVED DATE"
;* . S PXAERR(11)=PXAA("PL RESOLVED DATE")
;* . D ERRSET
;
;If PL SC is input verify it.
;* I $G(PXAA("PL SC"))'="",'$$SET^PXAIVAL(9000010.07,"PL SC",80001,PXAA("PL SC"),.PXAERR) D Q
;* . S PXAERR(9)="PL SC"
;* . S PXAERR(11)=PXAA("PL SC")
;* . D ERRSET
;
;If PL AO is input verify it.
;* I $G(PXAA("PL AO"))'="",'$$SET^PXAIVAL(9000010.07,"PL AO",80002,PXAA("PL AO"),.PXAERR) D Q
;* . S PXAERR(9)="PL AO"
;* . S PXAERR(11)=PXAA("PL AO")
;* . D ERRSET
;
;If PL IR is input verify it.
;* I $G(PXAA("PL IR"))'="",'$$SET^PXAIVAL(9000010.07,"PL IR",80003,PXAA("PL IR"),.PXAERR) D Q
;* . S PXAERR(9)="PL IR"
;* . S PXAERR(11)=PXAA("PL IR")
;* . D ERRSET
;
;If PL EC is input verify it.
;* I $G(PXAA("PL EC"))'="",'$$SET^PXAIVAL(9000010.07,"PL EC",80004,PXAA("PL EC"),.PXAERR) D Q
;* . S PXAERR(9)="PL EC"
;* . S PXAERR(11)=PXAA("PL EC")
;* . D ERRSET
;
;If PL MST is input verify it.
;* I $G(PXAA("PL MST"))'="",'$$SET^PXAIVAL(9000010.07,"PL MST",80005,PXAA("PL MST"),.PXAERR) D Q
;* . S PXAERR(9)="PL MST"
;* . S PXAERR(11)=PXAA("PL MST")
;* . D ERRSET
;
;If PL HNC is input verify it.
;* I $G(PXAA("PL HNC"))'="",'$$SET^PXAIVAL(9000010.07,"PL HNC",80006,PXAA("PL HNC"),.PXAERR) D Q
;* . S PXAERR(9)="PL HNC"
;* . S PXAERR(11)=PXAA("PL HNC")
;* . D ERRSET
;
;If PL CV is input verify it.
;* I $G(PXAA("PL CV"))'="",'$$SET^PXAIVAL(9000010.07,"PL CV",80007,PXAA("PL CV"),.PXAERR) D Q
;* . S PXAERR(9)="PL CV"
;* . S PXAERR(11)=PXAA("PL CV")
;* . D ERRSET
;
;If PL SHAD is input verify it.
;* I $G(PXAA("PL SHAD"))'="",'$$SET^PXAIVAL(9000010.07,"PL SHAD",80008,PXAA("PL SHAD"),.PXAERR) D Q
;* . S PXAERR(9)="PL SHAD"
;* . S PXAERR(11)=PXAA("PL SHAD")
;* . D ERRSET
Q
;
VAL04 ;Setup error array for missing or invalid Provider Narrative.
S PXAERR(9)="PROVIDER NARRATIVE"
S PXAERR(11)=$G(PXAA("NARRATIVE"))
S PXAERR(12)="We are unable to retrieve a provider narrative from the PROVIDER NARRATIVE file #9999999.27"
D ERRSET
Q
;
VAL802 ;Setup error array for missing or invalid Provider Narrative Category.
;Provider Narrative Category is not required, so make this a warning.
S PXAERR(9)="PROVIDER NARRATIVE CATEGORY"
S PXAERR(11)=$G(PXAA("CATEGORY"))
S PXAERR(12)="We are unable to retrieve a provider narrative category from the PROVIDER NARRATIVE file #9999999.27"
S PXADI("DIALOG")=8390001.002
S PXAERR(7)="DX/PL"
S PXAERRW("POV")=1
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXAIPOVV 9244 printed Oct 16, 2024@18:26:40 Page 2
PXAIPOVV ;ISL/JVS,PKR - VALIDATE DIAGNOSIS ;02/04/2021
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**121,194,199,211**;Aug 12, 1996;Build 454
+2 ;
+3 ;Reference to ICDEX supported by ICR #5747.
+4 ;
ERRSET ;Set the rest of the error data.
+1 SET STOP=1
+2 SET PXAERRF("POV")=1
+3 SET PXADI("DIALOG")=8390001.001
+4 SET PXAERR(7)="DX/PL"
+5 QUIT
+6 ;
PRIM(VISITIEN,PXADATA,PXAERRF) ;Make sure there is only one primary diagnosis.
+1 NEW DIAG,IND,NPDIAG,NPDN,PDLISTN,PRIM
+2 SET IND=0
+3 FOR
SET IND=+$ORDER(@PXADATA@("DX/PL",IND))
if IND=0
QUIT
Begin DoDot:1
+4 SET DIAG=$GET(@PXADATA@("DX/PL",IND,"DIAGNOSIS"))
+5 IF DIAG=""
QUIT
+6 SET PRIM=$GET(@PXADATA@("DX/PL",IND,"PRIMARY"))
+7 ;Check for a change to the existing primary diagnosis.
+8 IF $DATA(PDLISTE(DIAG))
Begin DoDot:2
+9 IF +$GET(@PXADATA@("DX/PL",IND,"DELETE"))
KILL PDLISTE(DIAG)
QUIT
+10 IF (PRIM=0)!(PRIM="S")
KILL PDLISTE(DIAG)
End DoDot:2
+11 ;Check for adding a new primary diagnosis.
+12 IF (PRIM=1)!(PRIM="P")
SET PDLISTN(DIAG)=""
+13 IF +$GET(@PXADATA@("DX/PL",IND,"DELETE"))
KILL PDLISTN(DIAG)
QUIT
End DoDot:1
+14 ;
+15 SET DIAG=""
SET NPDN=0
+16 FOR
SET DIAG=$ORDER(PDLISTN(DIAG))
if DIAG=""
QUIT
SET NPDN=NPDN+1
SET NPDIAG(NPDN)=DIAG
+17 ;
+18 IF NPDN>1
Begin DoDot:1
+19 SET PXAERR(9)="DIAGNOSIS"
+20 SET PXAERR(12)=NPDN_" diagnoses have been designated as primary, there can only be one."
+21 SET PXAERR(12)=PXAERR(12)_" They are: "
+22 FOR IND=1:1:NPDN
SET PXAERR(12)=PXAERR(12)_$SELECT(IND=1:" ",1:",")_NPDIAG(IND)
+23 DO ERRSET
End DoDot:1
QUIT
+24 QUIT
+25 ;
VAL ;Validate the input data.
+1 IF $GET(PXAA("DIAGNOSIS"))=""
Begin DoDot:1
+2 SET PXAERR(9)="DIAGNOSIS"
+3 SET PXAERR(12)="The ICD diagnosis is missing."
+4 DO ERRSET
End DoDot:1
QUIT
+5 ;
+6 ;Save the code or the pointer.
+7 SET PXAERR(11)=$GET(PXAA("DIAGNOSIS"))
+8 ;
+9 NEW CODE,CODEIEN,CODESYS,EVENTDT,FMT,ICDDATA,SERVCAT,TEMP
+10 SET TEMP=^AUPNVSIT(PXAVISIT,0)
+11 SET SERVCAT=$PIECE(TEMP,U,7)
+12 ;For historical encounters use the Date the Visit was created.
+13 SET EVENTDT=$SELECT(SERVCAT="E":$PIECE(TEMP,U,2),$GET(PXAA("EVENT D/T"))'="":PXAA("EVENT D/T"),1:$PIECE(TEMP,U,1))
+14 SET FMT=$SELECT(PXAA("DIAGNOSIS")?1.N:"I",1:"E")
+15 IF FMT="E"
SET CODE=PXAA("DIAGNOSIS")
SET CODEIEN=$PIECE($$CODEN^ICDEX(CODE,80),"~",1)
+16 IF FMT="I"
SET CODEIEN=PXAA("DIAGNOSIS")
SET CODE=$$CODEC^ICDEX(80,CODEIEN)
+17 IF CODEIEN'>0
Begin DoDot:1
+18 SET PXAERR(9)="DIAGNOSIS"
+19 SET PXAERR(11)=PXAA("DIAGNOSIS")
+20 SET PXAERR(12)=PXAERR(11)_" is not a valid code or pointer."
+21 DO ERRSET
End DoDot:1
QUIT
+22 ;
+23 ;If a code was passed store the pointer.
+24 IF FMT="E"
SET PXAA("DIAGNOSIS")=CODEIEN
+25 ;
+26 ;If this is a deletion no further validation is required.
+27 IF $GET(PXAA("DELETE"))=1
QUIT
+28 ;
+29 ;Make sure the code is active.
+30 SET CODESYS=$$CSI^ICDEX(80,CODEIEN)
+31 IF '$$ISCACT^PXLEX(CODESYS,CODE,EVENTDT)
Begin DoDot:1
+32 SET PXAERR(9)="DIAGNOSIS"
+33 SET PXAERR(11)=PXAA("DIAGNOSIS")
+34 SET PXAERR(12)=PXAERR(11)_" is not an active ICD code."
+35 DO ERRSET
End DoDot:1
+36 ;
+37 ;If Primary is input validate it.
+38 ;* N PRIM
+39 ;* S PRIM=$G(PXAA("PRIMARY"))
+40 ;* S PXAA("PRIMARY")=$S(PRIM=1:"P",PRIM=0:"S",1:PRIM)
+41 ;* I $G(PXAA("PRIMARY"))'="",'$$SET^PXAIVAL(9000010.07,"PRIMARY",.12,PXAA("PRIMARY"),.PXAERR) D Q
+42 ;* . S PXAERR(9)="PRIMARY"
+43 ;* . S PXAERR(11)=PXAA("PRIMARY")
+44 ;* . D ERRSET
+45 ;
+46 ;If ORD/RES is input validate it.
+47 ;* I $G(PXAA("ORD/RES"))'="",'$$SET^PXAIVAL(9000010.07,"ORD/RES",.17,PXAA("ORD/RES"),.PXAERR) D Q
+48 ;* . S PXAERR(9)="ORD/RES"
+49 ;* . S PXAERR(11)=PXAA("ORD/RES")
+50 ;* . D ERRSET
+51 ;
+52 ;If Lexicon Term is input validate it.
+53 ;* I $G(PXAA("LEXICON TERM"))'="",'$D(^LEX(757.01,PXAA("LEXICON TERM"),0)) D Q
+54 ;* . S PXAERR(9)="LEXICON TERM"
+55 ;* . S PXAERR(11)=PXAA("LEXICON TERM")
+56 ;* . S PXAERR(12)=PXAA("LEXICON TERM")_" is not a valid point to the Clinical Expression file #757.01."
+57 ;* . D ERRSET
+58 ;
+59 ;If Narrative is input validate it.
+60 ;* I $G(PXAA("NARRATIVE"))'="",'$$TEXT^PXAIVAL("PROVIDER NARRATIVE",PXAA("NARRATIVE"),2,245,.PXAERR) D Q
+61 ;* . D ERRSET
+62 ;*Control characters are not allowed.
+63 ;*I '$$VPNARR^PXPNARR(PXAA("NARRATIVE")) D Q
+64 ;*. S PXAERR(9)="PROVIDER NARRATIVE"
+65 ;*. S PXAERR(11)=PXAA("NARRATIVE")
+66 ;*. S PXAERR(12)="Control characters are not allowed."
+67 ;*. D ERRSET
+68 ;
+69 ;Provider Narrative is required so if it is not input create one from
+70 ;the code description.
+71 IF $GET(PXAA("NARRATIVE"))=""
SET PXAA("NARRATIVE")=$$DXNARR^PXUTL1(CODEIEN,EVENTDT)
+72 ;
+73 ;If Provider Narrative Category is input validate it.
+74 ;* I $G(PXAA("CATEGORY"))'="",'$$TEXT^PXAIVAL("PROVIDER NARRATIVE CATEGORY",PXAA("CATEGORY"),2,245,.PXAERR) D Q
+75 ;* . D ERRSET
+76 ;*Control characters are not allowed.
+77 ;*I '$$VPNARR^PXPNARR(PXAA("PROVIDER NARRATIVE CATEGORY")) D Q
+78 ;*. S PXAERR(9)="PROVIDER NARRATIVE CATEGORY"
+79 ;*. S PXAERR(11)=PXAA("CATEGORY")
+80 ;*. S PXAERR(12)="Control characters are not allowed."
+81 ;*. D ERRSET
+82 ;
+83 ;If an Ordering Provider is passed verify it is valid.
+84 ;* I $G(PXAA("ORD PROVIDER"))'="",'$$PRV^PXAIVAL(PXAA("ORD PROVIDER"),"ORD",.PXAA,.PXAERR,PXAVISIT) D Q
+85 ;* . D ERRSET
+86 ;
+87 ;If an Encounter Provider is passed verify it is valid.
+88 ;* I $G(PXAA("ENC PROVIDER"))'="",'$$PRV^PXAIVAL(PXAA("ENC PROVIDER"),"ENC",.PXAA,.PXAERR,PXAVISIT) D Q
+89 ;* . D ERRSET
+90 ;
+91 ;If Event D/T is input verify it is a valid FileMan date and not in
+92 ;the future.
+93 ;* I $G(PXAA("EVENT D/T"))'="",'$$EVENTDT^PXAIVAL(PXAA("EVENT D/T"),"T",.PXAERR) D Q
+94 ;* . D ERRSET
+95 ;
+96 ;If a Comment is input verify it.
+97 ;* I $G(PXAA("COMMENT"))'="",'$$TEXT^PXAIVAL("COMMENT",PXAA("COMMENT"),1,245,.PXAERR) D Q
+98 ;* . D ERRSET
+99 ;
+100 ;If PKG is input verify it.
+101 ;* I $G(PXAA("PKG"))'="" D
+102 ;* . N PKG
+103 ;* . S PKG=$$VPKG^PXAIVAL(PXAA("PKG"),.PXAERR)
+104 ;* . I PKG=0 S PXAERR(9)="PKG" D ERRSET Q
+105 ;* . S PXAA("PKG")=PKG
+106 ;* I $G(STOP)=1 Q
+107 ;
+108 ;If SOURCE is input verify it.
+109 ;* I $G(PXAA("SOURCE"))'="" D
+110 ;* . N SRC
+111 ;* . S SRC=$$VSOURCE^PXAIVAL(PXAA("SOURCE"),.PXAERR)
+112 ;* . I SRC=0 S PXAERR(9)="SOURCE" D ERRSET Q
+113 ;* . S PXAA("SOURCE")=SRC
+114 ;* I $G(STOP)=1 Q
+115 ;
+116 ;If PL IEN is input validate it.
+117 ;* I $G(PXAA("PL IEN"))'="",'$D(^AUPNPROB(PXAA("PL IEN"),0)) D Q
+118 ;* . S PXAERR(9)="PL IEN"
+119 ;* . S PXAERR(11)=PXAA("PL IEN")
+120 ;* . S PXAERR(12)=PXAA("PL IEN")_" is not a valid point to the Problem file #9000011."
+121 ;* . D ERRSET
+122 ;
+123 ;There is nothing to verify for PL ADD.
+124 ;
+125 ;If PL ACTIVE is input validate it.
+126 ;* I $G(PXAA("PL ACTIVE"))'="",PXAA("PL ACTIVE")'="A",PXAA("PL ACTIVE")'="I" D Q
+127 ;* . S PXAERR(9)="PL ACTIVE"
+128 ;* . S PXAERR(11)=PXAA("PL ACTIVE")
+129 ;* . S PXAERR(12)=PXAA("PL ACTIVE")_" is not a valid value for PL ACTIVE, A or I are allowed."
+130 ;* . D ERRSET
+131 ;
+132 ;If PL Onset Date is input verify it.
+133 ;* I $G(PXAA("PL ONSET DATE"))'="",'$$DATETIME^PXAIVAL("PL ONSET DATE",PXAA("PL ONSET DATE"),"",.PXAERR) D Q
+134 ;* . S PXAERR(9)="PL ONSET DATE"
+135 ;* . S PXAERR(11)=PXAA("PL ONSET DATE")
+136 ;* . D ERRSET
+137 ;
+138 ;If PL Resolved Date is input verify it.
+139 ;* I $G(PXAA("PL RESOLVED DATE"))'="",'$$DATETIME^PXAIVAL("PL RESOLVED DATE",PXAA("PL RESOLVED DATE"),"",.PXAERR) D Q
+140 ;* . S PXAERR(9)="PL RESOLVED DATE"
+141 ;* . S PXAERR(11)=PXAA("PL RESOLVED DATE")
+142 ;* . D ERRSET
+143 ;
+144 ;If PL SC is input verify it.
+145 ;* I $G(PXAA("PL SC"))'="",'$$SET^PXAIVAL(9000010.07,"PL SC",80001,PXAA("PL SC"),.PXAERR) D Q
+146 ;* . S PXAERR(9)="PL SC"
+147 ;* . S PXAERR(11)=PXAA("PL SC")
+148 ;* . D ERRSET
+149 ;
+150 ;If PL AO is input verify it.
+151 ;* I $G(PXAA("PL AO"))'="",'$$SET^PXAIVAL(9000010.07,"PL AO",80002,PXAA("PL AO"),.PXAERR) D Q
+152 ;* . S PXAERR(9)="PL AO"
+153 ;* . S PXAERR(11)=PXAA("PL AO")
+154 ;* . D ERRSET
+155 ;
+156 ;If PL IR is input verify it.
+157 ;* I $G(PXAA("PL IR"))'="",'$$SET^PXAIVAL(9000010.07,"PL IR",80003,PXAA("PL IR"),.PXAERR) D Q
+158 ;* . S PXAERR(9)="PL IR"
+159 ;* . S PXAERR(11)=PXAA("PL IR")
+160 ;* . D ERRSET
+161 ;
+162 ;If PL EC is input verify it.
+163 ;* I $G(PXAA("PL EC"))'="",'$$SET^PXAIVAL(9000010.07,"PL EC",80004,PXAA("PL EC"),.PXAERR) D Q
+164 ;* . S PXAERR(9)="PL EC"
+165 ;* . S PXAERR(11)=PXAA("PL EC")
+166 ;* . D ERRSET
+167 ;
+168 ;If PL MST is input verify it.
+169 ;* I $G(PXAA("PL MST"))'="",'$$SET^PXAIVAL(9000010.07,"PL MST",80005,PXAA("PL MST"),.PXAERR) D Q
+170 ;* . S PXAERR(9)="PL MST"
+171 ;* . S PXAERR(11)=PXAA("PL MST")
+172 ;* . D ERRSET
+173 ;
+174 ;If PL HNC is input verify it.
+175 ;* I $G(PXAA("PL HNC"))'="",'$$SET^PXAIVAL(9000010.07,"PL HNC",80006,PXAA("PL HNC"),.PXAERR) D Q
+176 ;* . S PXAERR(9)="PL HNC"
+177 ;* . S PXAERR(11)=PXAA("PL HNC")
+178 ;* . D ERRSET
+179 ;
+180 ;If PL CV is input verify it.
+181 ;* I $G(PXAA("PL CV"))'="",'$$SET^PXAIVAL(9000010.07,"PL CV",80007,PXAA("PL CV"),.PXAERR) D Q
+182 ;* . S PXAERR(9)="PL CV"
+183 ;* . S PXAERR(11)=PXAA("PL CV")
+184 ;* . D ERRSET
+185 ;
+186 ;If PL SHAD is input verify it.
+187 ;* I $G(PXAA("PL SHAD"))'="",'$$SET^PXAIVAL(9000010.07,"PL SHAD",80008,PXAA("PL SHAD"),.PXAERR) D Q
+188 ;* . S PXAERR(9)="PL SHAD"
+189 ;* . S PXAERR(11)=PXAA("PL SHAD")
+190 ;* . D ERRSET
+191 QUIT
+192 ;
VAL04 ;Setup error array for missing or invalid Provider Narrative.
+1 SET PXAERR(9)="PROVIDER NARRATIVE"
+2 SET PXAERR(11)=$GET(PXAA("NARRATIVE"))
+3 SET PXAERR(12)="We are unable to retrieve a provider narrative from the PROVIDER NARRATIVE file #9999999.27"
+4 DO ERRSET
+5 QUIT
+6 ;
VAL802 ;Setup error array for missing or invalid Provider Narrative Category.
+1 ;Provider Narrative Category is not required, so make this a warning.
+2 SET PXAERR(9)="PROVIDER NARRATIVE CATEGORY"
+3 SET PXAERR(11)=$GET(PXAA("CATEGORY"))
+4 SET PXAERR(12)="We are unable to retrieve a provider narrative category from the PROVIDER NARRATIVE file #9999999.27"
+5 SET PXADI("DIALOG")=8390001.002
+6 SET PXAERR(7)="DX/PL"
+7 SET PXAERRW("POV")=1
+8 QUIT
+9 ;