PXMEASCF ;SLC/PKR Utilities for checking and fixing measurements. ;06/08/2022
;;1.0;PCE PATIENT CARE ENCOUNTER;**217**;Aug 12, 1996;Build 134
;Check the definition files for measurements that are not completely defined.
;For measurements that are completely defined, check the corresponding V-file
;for entries that have a MAGNITUDE, but are missing the UCUM CODE. When any of
;these are found, set the UCUM CODE to that found in the definition.
;
;===============================
ASKYN(DEFAULT,TEXT) ;Ask a YES/NO question.
N DIR,X,Y
K DIROUT,DIRUT,DTOUT,DUOUT
S DIR(0)="YA"
S DIR("A")=TEXT
S DIR("B")=DEFAULT
S DIR("?")="Enter Y or N."
W !
D ^DIR
I $D(DTOUT)!$D(DUOUT) S Y=0
Q Y
;
;===============================
CFEDU ;Check/fix Education Topics factors that have measurements defined.
N ALLDEF,ANS,IEN,IND,MAX,MAXDEC,MEASLIST,MIN,NAME,NL,PCAPTION,TEXT,TMP220,UCUMCODE,UCUMDISPLAY
W !,"Checking Education Topics for complete measurement setup."
S NAME=""
F S NAME=$O(^AUTTEDT("B",NAME)) Q:NAME="" D
. S IEN=$O(^AUTTEDT("B",NAME,""))
. S TMP220=$G(^AUTTEDT(IEN,220))
. I TMP220="" Q
. S MIN=$P(TMP220,U,1),MAX=$P(TMP220,U,2)
. S MAXDEC=$P(TMP220,U,3),UCUMCODE=$P(TMP220,U,4)
. S PCAPTION=$P(TMP220,U,5),UCUMDISPLAY=$P(TMP220,U,6)
. I (MIN=""),(MAX=""),(MAXDEC=""),(UCUMCODE=""),(PCAPTION=""),(UCUMDISPLAY="") Q
.;If any of the measurement fields are defined, they all
.;must be.
. K TEXT
. S ALLDEF=1
. S TEXT(1)=""
. S TEXT(2)="Education Topic: "_NAME
. S NL=2
. I MIN="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MINIMUM VALUE is not defined."
. I MAX="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MAXIMUM VALUE is not defined."
. I MAXDEC="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MAXIMUM DECIMALS is not defined."
. I UCUMCODE="" S ALLDEF=0,NL=NL+1,TEXT(NL)="UCUM CODE is not defined."
. I PCAPTION="" S ALLDEF=0,NL=NL+1,TEXT(NL)="PROMPT CAPTION is not defined."
. I UCUMDISPLAY="" S ALLDEF=0,NL=NL+1,TEXT(NL)="UCUM DISPLAY is not defined."
. I ALLDEF=1 S MEASLIST(NAME)=IEN_U_UCUMCODE Q
. F IND=1:1:NL W !,TEXT(IND)
I $D(MEASLIST) D
. S ANS=$$ASKYN("Y","Search for and repair V PATIENT ED entries missing the UCUM CODE? ")
. I ANS=1 D CFVPATED(.MEASLIST)
Q
;
;===============================
CFEXAM ;Check/fix Exams that have measurements defined.
N ALLDEF,ANS,IEN,IND,MAX,MAXDEC,MEASLIST,MIN,NAME,NL,PCAPTION,TEXT,TMP220,UCUMCODE,UCUMDISPLAY
W !,"Checking Exams for complete measurement setup."
S NAME=""
F S NAME=$O(^AUTTEXAM("B",NAME)) Q:NAME="" D
. S IEN=$O(^AUTTEXAM("B",NAME,""))
. S TMP220=$G(^AUTTEXAM(IEN,220))
. I TMP220="" Q
. S MIN=$P(TMP220,U,1),MAX=$P(TMP220,U,2)
. S MAXDEC=$P(TMP220,U,3),UCUMCODE=$P(TMP220,U,4)
. S PCAPTION=$P(TMP220,U,5),UCUMDISPLAY=$P(TMP220,U,6)
. I (MIN=""),(MAX=""),(MAXDEC=""),(UCUMCODE=""),(PCAPTION=""),(UCUMDISPLAY="") Q
.;If any of the measurement fields are defined, they all
.;must be.
. K TEXT
. S ALLDEF=1
. S TEXT(1)=""
. S TEXT(2)="Exam: "_NAME
. S NL=2
. I MIN="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MINIMUM VALUE is not defined."
. I MAX="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MAXIMUM VALUE is not defined."
. I MAXDEC="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MAXIMUM DECIMALS is not defined."
. I UCUMCODE="" S ALLDEF=0,NL=NL+1,TEXT(NL)="UCUM CODE is not defined."
. I PCAPTION="" S ALLDEF=0,NL=NL+1,TEXT(NL)="PROMPT CAPTION is not defined."
. I UCUMDISPLAY="" S ALLDEF=0,NL=NL+1,TEXT(NL)="UCUM DISPLAY is not defined."
. I ALLDEF=1 S MEASLIST(NAME)=IEN_U_UCUMCODE Q
. F IND=1:1:NL W !,TEXT(IND)
I $D(MEASLIST) D
. S ANS=$$ASKYN("Y","Search for and repair V EXAM entries missing the UCUM CODE? ")
. I ANS=1 D CFVEXAM(.MEASLIST)
Q
;
;===============================
CFHF ;Check/fix health factors that have measurements defined.
N ALLDEF,ANS,IEN,IND,MAX,MAXDEC,MEASLIST,MIN,NAME,NL,PCAPTION,TEXT,TMP220,UCUMCODE,UCUMDISPLAY
W !,"Checking Health Factors for complete measurement setup."
S NAME=""
F S NAME=$O(^AUTTHF("B",NAME)) Q:NAME="" D
. S IEN=$O(^AUTTHF("B",NAME,""))
. S TMP220=$G(^AUTTHF(IEN,220))
. I TMP220="" Q
. S MIN=$P(TMP220,U,1),MAX=$P(TMP220,U,2)
. S MAXDEC=$P(TMP220,U,3),UCUMCODE=$P(TMP220,U,4)
. S PCAPTION=$P(TMP220,U,5),UCUMDISPLAY=$P(TMP220,U,6)
. I (MIN=""),(MAX=""),(MAXDEC=""),(UCUMCODE=""),(PCAPTION=""),(UCUMDISPLAY="") Q
.;If any of the measurement fields are defined, they all
.;must be.
. K TEXT
. S ALLDEF=1
. S TEXT(1)=""
. S TEXT(2)="Health Factor: "_NAME
. S NL=2
. I MIN="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MINIMUM VALUE is not defined."
. I MAX="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MAXIMUM VALUE is not defined."
. I MAXDEC="" S ALLDEF=0,NL=NL+1,TEXT(NL)="MAXIMUM DECIMALS is not defined."
. I UCUMCODE="" S ALLDEF=0,NL=NL+1,TEXT(NL)="UCUM CODE is not defined."
. I PCAPTION="" S ALLDEF=0,NL=NL+1,TEXT(NL)="PROMPT CAPTION is not defined."
. I UCUMDISPLAY="" S ALLDEF=0,NL=NL+1,TEXT(NL)="UCUM DISPLAY is not defined."
. I ALLDEF=1 S MEASLIST(NAME)=IEN_U_UCUMCODE Q
. F IND=1:1:NL W !,TEXT(IND)
I $D(MEASLIST) D
. S ANS=$$ASKYN("Y","Search for and repair V HEALTH FACTORS entries missing the UCUM CODE? ")
. I ANS=1 D CFVHF(.MEASLIST)
Q
;
;===============================
CFVEXAM(MEASLIST) ; Check V Exam.
N EXAMIEN,IND,MAGNITUDE,NAME,NSET,TEMP220,TEXT,UCUMCODE,UCUMIEN,VEXAMIEN
S TEXT(1)="Checking V Exam for missing UCUM CODES."
S NAME="",NL=1
F S NAME=$O(MEASLIST(NAME)) Q:NAME="" D
. S NSET=0
. S EXAMIEN=$P(MEASLIST(NAME),U,1)
. S UCUMCODE=$P(MEASLIST(NAME),U,2)
. S VEXAMIEN=""
. F S VEXAMIEN=$O(^AUPNVXAM("B",EXAMIEN,VEXAMIEN)) Q:VEXAMIEN="" D
.. S TEMP220=$G(^AUPNVXAM(VEXAMIEN,220))
.. S MAGNITUDE=$P(TEMP220,U,1)
.. I MAGNITUDE="" Q
.. S UCUMIEN=$P(TEMP220,U,2)
.. I UCUMIEN="" S NSET=NSET+1,$P(^AUPNVXAM(VEXAMIEN,220),U,2)=UCUMCODE
. I NSET>0 D
.. S NL=NL+1,TEXT(NL)=""
.. S NL=NL+1,TEXT(NL)="For the Exam: "_NAME
.. S NL=NL+1,TEXT(NL)="The UCUM CODE was set for "_NSET_" V Exam entries."
I NL=1 S NL=NL+1,TEXT(NL)="No missing UCUM CODEs were found."
F IND=1:1:NL W !,TEXT(IND)
Q
;
;===============================
CFVHF(MEASLIST) ; Check V Health Factors.
N HFIEN,IND,MAGNITUDE,NAME,NSET,TEMP220,TEXT,UCUMCODE,UCUMIEN,VHFIEN
S TEXT(1)="Checking V Health Factors for missing UCUM CODES."
S NAME="",NL=1
F S NAME=$O(MEASLIST(NAME)) Q:NAME="" D
. S NSET=0
. S HFIEN=$P(MEASLIST(NAME),U,1)
. S UCUMCODE=$P(MEASLIST(NAME),U,2)
. S VHFIEN=""
. F S VHFIEN=$O(^AUPNVHF("B",HFIEN,VHFIEN)) Q:VHFIEN="" D
.. S TEMP220=$G(^AUPNVHF(VHFIEN,220))
.. S MAGNITUDE=$P(TEMP220,U,1)
.. I MAGNITUDE="" Q
.. S UCUMIEN=$P(TEMP220,U,2)
.. I UCUMIEN="" S NSET=NSET+1,$P(^AUPNVHF(VHFIEN,220),U,2)=UCUMCODE
. I NSET>0 D
.. S NL=NL+1,TEXT(NL)=""
.. S NL=NL+1,TEXT(NL)="For the Health Factor: "_NAME
.. S NL=NL+1,TEXT(NL)="The UCUM CODE was set for "_NSET_" V Health Factor entries."
I NL=1 S NL=NL+1,TEXT(NL)="No missing UCUM CODEs were found."
F IND=1:1:NL W !,TEXT(IND)
Q
;
;===============================
CFVPATED(MEASLIST) ; Check V Patient Ed.
N EDUIEN,IND,MAGNITUDE,NAME,NSET,TEMP220,TEXT,UCUMCODE,UCUMIEN,VPATEDIEN
S TEXT(1)="Checking V Health Factors for missing UCUM CODES."
S NAME="",NL=1
F S NAME=$O(MEASLIST(NAME)) Q:NAME="" D
. S NSET=0
. S EDUIEN=$P(MEASLIST(NAME),U,1)
. S UCUMCODE=$P(MEASLIST(NAME),U,2)
. S VPATEDIEN=""
. F S VPATEDIEN=$O(^AUPNVPED("B",EDUIEN,VPATEDIEN)) Q:VPATEDIEN="" D
.. S TEMP220=$G(^AUPNVPED(VPATEDIEN,220))
.. S MAGNITUDE=$P(TEMP220,U,1)
.. I MAGNITUDE="" Q
.. S UCUMIEN=$P(TEMP220,U,2)
.. I UCUMIEN="" S NSET=NSET+1,$P(^AUPNVPED(VPATEDIEN,220),U,2)=UCUMCODE
. I NSET>0 D
.. S NL=NL+1,TEXT(NL)=""
.. S NL=NL+1,TEXT(NL)="For the Education Topic: "_NAME
.. S NL=NL+1,TEXT(NL)="The UCUM CODE was set for "_NSET_" V Patient Ed entries."
I NL=1 S NL=NL+1,TEXT(NL)="No missing UCUM CODEs were found."
F IND=1:1:NL W !,TEXT(IND)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXMEASCF 7971 printed Dec 13, 2024@02:29:42 Page 2
PXMEASCF ;SLC/PKR Utilities for checking and fixing measurements. ;06/08/2022
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**217**;Aug 12, 1996;Build 134
+2 ;Check the definition files for measurements that are not completely defined.
+3 ;For measurements that are completely defined, check the corresponding V-file
+4 ;for entries that have a MAGNITUDE, but are missing the UCUM CODE. When any of
+5 ;these are found, set the UCUM CODE to that found in the definition.
+6 ;
+7 ;===============================
ASKYN(DEFAULT,TEXT) ;Ask a YES/NO question.
+1 NEW DIR,X,Y
+2 KILL DIROUT,DIRUT,DTOUT,DUOUT
+3 SET DIR(0)="YA"
+4 SET DIR("A")=TEXT
+5 SET DIR("B")=DEFAULT
+6 SET DIR("?")="Enter Y or N."
+7 WRITE !
+8 DO ^DIR
+9 IF $DATA(DTOUT)!$DATA(DUOUT)
SET Y=0
+10 QUIT Y
+11 ;
+12 ;===============================
CFEDU ;Check/fix Education Topics factors that have measurements defined.
+1 NEW ALLDEF,ANS,IEN,IND,MAX,MAXDEC,MEASLIST,MIN,NAME,NL,PCAPTION,TEXT,TMP220,UCUMCODE,UCUMDISPLAY
+2 WRITE !,"Checking Education Topics for complete measurement setup."
+3 SET NAME=""
+4 FOR
SET NAME=$ORDER(^AUTTEDT("B",NAME))
if NAME=""
QUIT
Begin DoDot:1
+5 SET IEN=$ORDER(^AUTTEDT("B",NAME,""))
+6 SET TMP220=$GET(^AUTTEDT(IEN,220))
+7 IF TMP220=""
QUIT
+8 SET MIN=$PIECE(TMP220,U,1)
SET MAX=$PIECE(TMP220,U,2)
+9 SET MAXDEC=$PIECE(TMP220,U,3)
SET UCUMCODE=$PIECE(TMP220,U,4)
+10 SET PCAPTION=$PIECE(TMP220,U,5)
SET UCUMDISPLAY=$PIECE(TMP220,U,6)
+11 IF (MIN="")
IF (MAX="")
IF (MAXDEC="")
IF (UCUMCODE="")
IF (PCAPTION="")
IF (UCUMDISPLAY="")
QUIT
+12 ;If any of the measurement fields are defined, they all
+13 ;must be.
+14 KILL TEXT
+15 SET ALLDEF=1
+16 SET TEXT(1)=""
+17 SET TEXT(2)="Education Topic: "_NAME
+18 SET NL=2
+19 IF MIN=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MINIMUM VALUE is not defined."
+20 IF MAX=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MAXIMUM VALUE is not defined."
+21 IF MAXDEC=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MAXIMUM DECIMALS is not defined."
+22 IF UCUMCODE=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="UCUM CODE is not defined."
+23 IF PCAPTION=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="PROMPT CAPTION is not defined."
+24 IF UCUMDISPLAY=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="UCUM DISPLAY is not defined."
+25 IF ALLDEF=1
SET MEASLIST(NAME)=IEN_U_UCUMCODE
QUIT
+26 FOR IND=1:1:NL
WRITE !,TEXT(IND)
End DoDot:1
+27 IF $DATA(MEASLIST)
Begin DoDot:1
+28 SET ANS=$$ASKYN("Y","Search for and repair V PATIENT ED entries missing the UCUM CODE? ")
+29 IF ANS=1
DO CFVPATED(.MEASLIST)
End DoDot:1
+30 QUIT
+31 ;
+32 ;===============================
CFEXAM ;Check/fix Exams that have measurements defined.
+1 NEW ALLDEF,ANS,IEN,IND,MAX,MAXDEC,MEASLIST,MIN,NAME,NL,PCAPTION,TEXT,TMP220,UCUMCODE,UCUMDISPLAY
+2 WRITE !,"Checking Exams for complete measurement setup."
+3 SET NAME=""
+4 FOR
SET NAME=$ORDER(^AUTTEXAM("B",NAME))
if NAME=""
QUIT
Begin DoDot:1
+5 SET IEN=$ORDER(^AUTTEXAM("B",NAME,""))
+6 SET TMP220=$GET(^AUTTEXAM(IEN,220))
+7 IF TMP220=""
QUIT
+8 SET MIN=$PIECE(TMP220,U,1)
SET MAX=$PIECE(TMP220,U,2)
+9 SET MAXDEC=$PIECE(TMP220,U,3)
SET UCUMCODE=$PIECE(TMP220,U,4)
+10 SET PCAPTION=$PIECE(TMP220,U,5)
SET UCUMDISPLAY=$PIECE(TMP220,U,6)
+11 IF (MIN="")
IF (MAX="")
IF (MAXDEC="")
IF (UCUMCODE="")
IF (PCAPTION="")
IF (UCUMDISPLAY="")
QUIT
+12 ;If any of the measurement fields are defined, they all
+13 ;must be.
+14 KILL TEXT
+15 SET ALLDEF=1
+16 SET TEXT(1)=""
+17 SET TEXT(2)="Exam: "_NAME
+18 SET NL=2
+19 IF MIN=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MINIMUM VALUE is not defined."
+20 IF MAX=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MAXIMUM VALUE is not defined."
+21 IF MAXDEC=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MAXIMUM DECIMALS is not defined."
+22 IF UCUMCODE=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="UCUM CODE is not defined."
+23 IF PCAPTION=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="PROMPT CAPTION is not defined."
+24 IF UCUMDISPLAY=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="UCUM DISPLAY is not defined."
+25 IF ALLDEF=1
SET MEASLIST(NAME)=IEN_U_UCUMCODE
QUIT
+26 FOR IND=1:1:NL
WRITE !,TEXT(IND)
End DoDot:1
+27 IF $DATA(MEASLIST)
Begin DoDot:1
+28 SET ANS=$$ASKYN("Y","Search for and repair V EXAM entries missing the UCUM CODE? ")
+29 IF ANS=1
DO CFVEXAM(.MEASLIST)
End DoDot:1
+30 QUIT
+31 ;
+32 ;===============================
CFHF ;Check/fix health factors that have measurements defined.
+1 NEW ALLDEF,ANS,IEN,IND,MAX,MAXDEC,MEASLIST,MIN,NAME,NL,PCAPTION,TEXT,TMP220,UCUMCODE,UCUMDISPLAY
+2 WRITE !,"Checking Health Factors for complete measurement setup."
+3 SET NAME=""
+4 FOR
SET NAME=$ORDER(^AUTTHF("B",NAME))
if NAME=""
QUIT
Begin DoDot:1
+5 SET IEN=$ORDER(^AUTTHF("B",NAME,""))
+6 SET TMP220=$GET(^AUTTHF(IEN,220))
+7 IF TMP220=""
QUIT
+8 SET MIN=$PIECE(TMP220,U,1)
SET MAX=$PIECE(TMP220,U,2)
+9 SET MAXDEC=$PIECE(TMP220,U,3)
SET UCUMCODE=$PIECE(TMP220,U,4)
+10 SET PCAPTION=$PIECE(TMP220,U,5)
SET UCUMDISPLAY=$PIECE(TMP220,U,6)
+11 IF (MIN="")
IF (MAX="")
IF (MAXDEC="")
IF (UCUMCODE="")
IF (PCAPTION="")
IF (UCUMDISPLAY="")
QUIT
+12 ;If any of the measurement fields are defined, they all
+13 ;must be.
+14 KILL TEXT
+15 SET ALLDEF=1
+16 SET TEXT(1)=""
+17 SET TEXT(2)="Health Factor: "_NAME
+18 SET NL=2
+19 IF MIN=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MINIMUM VALUE is not defined."
+20 IF MAX=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MAXIMUM VALUE is not defined."
+21 IF MAXDEC=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="MAXIMUM DECIMALS is not defined."
+22 IF UCUMCODE=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="UCUM CODE is not defined."
+23 IF PCAPTION=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="PROMPT CAPTION is not defined."
+24 IF UCUMDISPLAY=""
SET ALLDEF=0
SET NL=NL+1
SET TEXT(NL)="UCUM DISPLAY is not defined."
+25 IF ALLDEF=1
SET MEASLIST(NAME)=IEN_U_UCUMCODE
QUIT
+26 FOR IND=1:1:NL
WRITE !,TEXT(IND)
End DoDot:1
+27 IF $DATA(MEASLIST)
Begin DoDot:1
+28 SET ANS=$$ASKYN("Y","Search for and repair V HEALTH FACTORS entries missing the UCUM CODE? ")
+29 IF ANS=1
DO CFVHF(.MEASLIST)
End DoDot:1
+30 QUIT
+31 ;
+32 ;===============================
CFVEXAM(MEASLIST) ; Check V Exam.
+1 NEW EXAMIEN,IND,MAGNITUDE,NAME,NSET,TEMP220,TEXT,UCUMCODE,UCUMIEN,VEXAMIEN
+2 SET TEXT(1)="Checking V Exam for missing UCUM CODES."
+3 SET NAME=""
SET NL=1
+4 FOR
SET NAME=$ORDER(MEASLIST(NAME))
if NAME=""
QUIT
Begin DoDot:1
+5 SET NSET=0
+6 SET EXAMIEN=$PIECE(MEASLIST(NAME),U,1)
+7 SET UCUMCODE=$PIECE(MEASLIST(NAME),U,2)
+8 SET VEXAMIEN=""
+9 FOR
SET VEXAMIEN=$ORDER(^AUPNVXAM("B",EXAMIEN,VEXAMIEN))
if VEXAMIEN=""
QUIT
Begin DoDot:2
+10 SET TEMP220=$GET(^AUPNVXAM(VEXAMIEN,220))
+11 SET MAGNITUDE=$PIECE(TEMP220,U,1)
+12 IF MAGNITUDE=""
QUIT
+13 SET UCUMIEN=$PIECE(TEMP220,U,2)
+14 IF UCUMIEN=""
SET NSET=NSET+1
SET $PIECE(^AUPNVXAM(VEXAMIEN,220),U,2)=UCUMCODE
End DoDot:2
+15 IF NSET>0
Begin DoDot:2
+16 SET NL=NL+1
SET TEXT(NL)=""
+17 SET NL=NL+1
SET TEXT(NL)="For the Exam: "_NAME
+18 SET NL=NL+1
SET TEXT(NL)="The UCUM CODE was set for "_NSET_" V Exam entries."
End DoDot:2
End DoDot:1
+19 IF NL=1
SET NL=NL+1
SET TEXT(NL)="No missing UCUM CODEs were found."
+20 FOR IND=1:1:NL
WRITE !,TEXT(IND)
+21 QUIT
+22 ;
+23 ;===============================
CFVHF(MEASLIST) ; Check V Health Factors.
+1 NEW HFIEN,IND,MAGNITUDE,NAME,NSET,TEMP220,TEXT,UCUMCODE,UCUMIEN,VHFIEN
+2 SET TEXT(1)="Checking V Health Factors for missing UCUM CODES."
+3 SET NAME=""
SET NL=1
+4 FOR
SET NAME=$ORDER(MEASLIST(NAME))
if NAME=""
QUIT
Begin DoDot:1
+5 SET NSET=0
+6 SET HFIEN=$PIECE(MEASLIST(NAME),U,1)
+7 SET UCUMCODE=$PIECE(MEASLIST(NAME),U,2)
+8 SET VHFIEN=""
+9 FOR
SET VHFIEN=$ORDER(^AUPNVHF("B",HFIEN,VHFIEN))
if VHFIEN=""
QUIT
Begin DoDot:2
+10 SET TEMP220=$GET(^AUPNVHF(VHFIEN,220))
+11 SET MAGNITUDE=$PIECE(TEMP220,U,1)
+12 IF MAGNITUDE=""
QUIT
+13 SET UCUMIEN=$PIECE(TEMP220,U,2)
+14 IF UCUMIEN=""
SET NSET=NSET+1
SET $PIECE(^AUPNVHF(VHFIEN,220),U,2)=UCUMCODE
End DoDot:2
+15 IF NSET>0
Begin DoDot:2
+16 SET NL=NL+1
SET TEXT(NL)=""
+17 SET NL=NL+1
SET TEXT(NL)="For the Health Factor: "_NAME
+18 SET NL=NL+1
SET TEXT(NL)="The UCUM CODE was set for "_NSET_" V Health Factor entries."
End DoDot:2
End DoDot:1
+19 IF NL=1
SET NL=NL+1
SET TEXT(NL)="No missing UCUM CODEs were found."
+20 FOR IND=1:1:NL
WRITE !,TEXT(IND)
+21 QUIT
+22 ;
+23 ;===============================
CFVPATED(MEASLIST) ; Check V Patient Ed.
+1 NEW EDUIEN,IND,MAGNITUDE,NAME,NSET,TEMP220,TEXT,UCUMCODE,UCUMIEN,VPATEDIEN
+2 SET TEXT(1)="Checking V Health Factors for missing UCUM CODES."
+3 SET NAME=""
SET NL=1
+4 FOR
SET NAME=$ORDER(MEASLIST(NAME))
if NAME=""
QUIT
Begin DoDot:1
+5 SET NSET=0
+6 SET EDUIEN=$PIECE(MEASLIST(NAME),U,1)
+7 SET UCUMCODE=$PIECE(MEASLIST(NAME),U,2)
+8 SET VPATEDIEN=""
+9 FOR
SET VPATEDIEN=$ORDER(^AUPNVPED("B",EDUIEN,VPATEDIEN))
if VPATEDIEN=""
QUIT
Begin DoDot:2
+10 SET TEMP220=$GET(^AUPNVPED(VPATEDIEN,220))
+11 SET MAGNITUDE=$PIECE(TEMP220,U,1)
+12 IF MAGNITUDE=""
QUIT
+13 SET UCUMIEN=$PIECE(TEMP220,U,2)
+14 IF UCUMIEN=""
SET NSET=NSET+1
SET $PIECE(^AUPNVPED(VPATEDIEN,220),U,2)=UCUMCODE
End DoDot:2
+15 IF NSET>0
Begin DoDot:2
+16 SET NL=NL+1
SET TEXT(NL)=""
+17 SET NL=NL+1
SET TEXT(NL)="For the Education Topic: "_NAME
+18 SET NL=NL+1
SET TEXT(NL)="The UCUM CODE was set for "_NSET_" V Patient Ed entries."
End DoDot:2
End DoDot:1
+19 IF NL=1
SET NL=NL+1
SET TEXT(NL)="No missing UCUM CODEs were found."
+20 FOR IND=1:1:NL
WRITE !,TEXT(IND)
+21 QUIT
+22 ;