APCDUTL ; IHS/CMI/LAB - DATA ENTRY UTILITIES ;
;;2.0;IHS PCC SUITE;**2,7,10,20**;MAY 14, 2009;Build 25
;
;
NR ;EP - called from APCD NRS (ADD) input template
NEW A,B,C,D
D EN^DDIOL("Nutritional Risk Screening Factors",,"!!")
D EN^DDIOL("","","!")
I $P(^AUPNVNTS(DA,0),U,4) D EN^DDIOL("- Age 70+",,"!?5")
I $P(^AUPNVNTS(DA,0),U,5) D EN^DDIOL("- Nutrition Support",,"!?5")
I $P(^AUPNVNTS(DA,0),U,6) D EN^DDIOL("- High Risk Weight Issue",,"!?5")
I $P(^AUPNVNTS(DA,0),U,7) D EN^DDIOL("- High Risk Diagnosis",,"!?5")
I $P(^AUPNVNTS(DA,0),U,8) D EN^DDIOL("- Poor Appetite",,"!?5")
I $P(^AUPNVNTS(DA,0),U,9) D EN^DDIOL("- Difficulty Chewing",,"!?5")
I $P(^AUPNVNTS(DA,0),U,10) D EN^DDIOL("- Food Allergies/Intolerances",,"!?5")
I $P(^AUPNVNTS(DA,0),U,11) D EN^DDIOL("- Recent Vomiting or Diarrhea",,"!?5")
I $P(^AUPNVNTS(DA,0),U,12) S B=$P(^AUPNVNTS(DA,0),U,13)
I $P(^AUPNVNTS(DA,0),U,12) D EN^DDIOL("- Other: "_B,,"!?5")
D EN^DDIOL("","","!!")
Q
MSRSCR ;EP - called from pcc input templates to check age/sex
I $P(^AUTTMSR(APCDTX,0),U,5)]"",$P(^DPT(APCDPAT,0),U,2)'=$P(^AUTTMSR(APCDTX,0),U,5) D S APCDTQ=1 Q
.W !,"That measurement can only be entered for ",$$VAL^XBDIQ1(9999999.07,APCDTX,.05)," patients.",!
I $P(^AUTTMSR(APCDTX,0),U,6),$$AGE^AUPNPAT(APCDPAT,$S($G(APCDDATE):APCDDATE,1:DT))<$P(^AUTTMSR(APCDTX,0),U,6) D S APCDTQ=1 Q
.W !,"That measurement can only be entered for patients over the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.06)," and under ",!,"the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.07),".",!
I $P(^AUTTMSR(APCDTX,0),U,7),$$AGE^AUPNPAT(APCDPAT,$S($G(APCDDATE):APCDDATE,1:DT))>$P(^AUTTMSR(APCDTX,0),U,7) D S APCDTQ=1 Q
.W !,"That measurement can only be entered for patients over the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.06)," and under ",!,"the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.07),".",!
Q
;
GETMEAS(PATDFN,VSTDATE) ;EP - GET MEASUREMENT TYPE AND APPLY SCREEN FOR HMSR AND MEAS MNEMONICS
S APCDLOOK=""
D EN^XBNEW("GETMEAS1^APCDUTL","APCDLOOK;PATDFN;VSTDATE")
Q
GETMEAS1 ;
;GET MEASUREMENT TYPE WITH READER CALL
NEW APCDTX,APCDDATE,APCDPAT,APCDTQ
S APCDPAT=PATDFN
S APCDDATE=VSTDATE
K DIC
S DIC="^AUTTMSR(",DIC("A")="Enter MEASUREMENT Type: ",DIC(0)="AEMQ",DIC("S")="I $P(^(0),U)'[""BMI""" D ^DIC
I Y=-1 Q
NEW APCDTX
S APCDTX=+Y
D MSRSCR
I $G(APCDTQ) G GETMEAS1
S APCDLOOK=$P(^AUTTMSR(APCDTX,0),U,1)
Q
IF() ;EP - get infant feeding value
S APCDTIF=""
D EN^XBNEW("IF1^APCDUTL","APCDTIF")
Q APCDTIF
;
IF1 ;EP - CALLED FROM XBNEW
S APCDTIF=""
S DIR(0)="S^1:EXCLUSIVE BREASTFEEDING;2:MOSTLY BREASTFEEDING;4:MOSTLY FORMULA;5:FORMULA ONLY",DIR("A")="Select V INFANT FEEDING CHOICES:" KILL DA D ^DIR KILL DIR
I $D(DIRUT) Q
I 'Y Q
S APCDTIF=Y
Q
APCDUTL ; IHS/CMI/LAB - DATA ENTRY UTILITIES ;
+1 ;;2.0;IHS PCC SUITE;**2,7,10,20**;MAY 14, 2009;Build 25
+2 ;
+3 ;
NR ;EP - called from APCD NRS (ADD) input template
+1 NEW A,B,C,D
+2 DO EN^DDIOL("Nutritional Risk Screening Factors",,"!!")
+3 DO EN^DDIOL("","","!")
+4 IF $PIECE(^AUPNVNTS(DA,0),U,4)
DO EN^DDIOL("- Age 70+",,"!?5")
+5 IF $PIECE(^AUPNVNTS(DA,0),U,5)
DO EN^DDIOL("- Nutrition Support",,"!?5")
+6 IF $PIECE(^AUPNVNTS(DA,0),U,6)
DO EN^DDIOL("- High Risk Weight Issue",,"!?5")
+7 IF $PIECE(^AUPNVNTS(DA,0),U,7)
DO EN^DDIOL("- High Risk Diagnosis",,"!?5")
+8 IF $PIECE(^AUPNVNTS(DA,0),U,8)
DO EN^DDIOL("- Poor Appetite",,"!?5")
+9 IF $PIECE(^AUPNVNTS(DA,0),U,9)
DO EN^DDIOL("- Difficulty Chewing",,"!?5")
+10 IF $PIECE(^AUPNVNTS(DA,0),U,10)
DO EN^DDIOL("- Food Allergies/Intolerances",,"!?5")
+11 IF $PIECE(^AUPNVNTS(DA,0),U,11)
DO EN^DDIOL("- Recent Vomiting or Diarrhea",,"!?5")
+12 IF $PIECE(^AUPNVNTS(DA,0),U,12)
SET B=$PIECE(^AUPNVNTS(DA,0),U,13)
+13 IF $PIECE(^AUPNVNTS(DA,0),U,12)
DO EN^DDIOL("- Other: "_B,,"!?5")
+14 DO EN^DDIOL("","","!!")
+15 QUIT
MSRSCR ;EP - called from pcc input templates to check age/sex
+1 IF $PIECE(^AUTTMSR(APCDTX,0),U,5)]""
IF $PIECE(^DPT(APCDPAT,0),U,2)'=$PIECE(^AUTTMSR(APCDTX,0),U,5)
Begin DoDot:1
+2 WRITE !,"That measurement can only be entered for ",$$VAL^XBDIQ1(9999999.07,APCDTX,.05)," patients.",!
End DoDot:1
SET APCDTQ=1
QUIT
+3 IF $PIECE(^AUTTMSR(APCDTX,0),U,6)
IF $$AGE^AUPNPAT(APCDPAT,$SELECT($GET(APCDDATE):APCDDATE,1:DT))<$PIECE(^AUTTMSR(APCDTX,0),U,6)
Begin DoDot:1
+4 WRITE !,"That measurement can only be entered for patients over the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.06)," and under ",!,"the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.07),".",!
End DoDot:1
SET APCDTQ=1
QUIT
+5 IF $PIECE(^AUTTMSR(APCDTX,0),U,7)
IF $$AGE^AUPNPAT(APCDPAT,$SELECT($GET(APCDDATE):APCDDATE,1:DT))>$PIECE(^AUTTMSR(APCDTX,0),U,7)
Begin DoDot:1
+6 WRITE !,"That measurement can only be entered for patients over the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.06)," and under ",!,"the age of ",$$VAL^XBDIQ1(9999999.07,APCDTX,.07),".",!
End DoDot:1
SET APCDTQ=1
QUIT
+7 QUIT
+8 ;
GETMEAS(PATDFN,VSTDATE) ;EP - GET MEASUREMENT TYPE AND APPLY SCREEN FOR HMSR AND MEAS MNEMONICS
+1 SET APCDLOOK=""
+2 DO EN^XBNEW("GETMEAS1^APCDUTL","APCDLOOK;PATDFN;VSTDATE")
+3 QUIT
GETMEAS1 ;
+1 ;GET MEASUREMENT TYPE WITH READER CALL
+2 NEW APCDTX,APCDDATE,APCDPAT,APCDTQ
+3 SET APCDPAT=PATDFN
+4 SET APCDDATE=VSTDATE
+5 KILL DIC
+6 SET DIC="^AUTTMSR("
SET DIC("A")="Enter MEASUREMENT Type: "
SET DIC(0)="AEMQ"
SET DIC("S")="I $P(^(0),U)'[""BMI"""
DO ^DIC
+7 IF Y=-1
QUIT
+8 NEW APCDTX
+9 SET APCDTX=+Y
+10 DO MSRSCR
+11 IF $GET(APCDTQ)
GOTO GETMEAS1
+12 SET APCDLOOK=$PIECE(^AUTTMSR(APCDTX,0),U,1)
+13 QUIT
IF() ;EP - get infant feeding value
+1 SET APCDTIF=""
+2 DO EN^XBNEW("IF1^APCDUTL","APCDTIF")
+3 QUIT APCDTIF
+4 ;
IF1 ;EP - CALLED FROM XBNEW
+1 SET APCDTIF=""
+2 SET DIR(0)="S^1:EXCLUSIVE BREASTFEEDING;2:MOSTLY BREASTFEEDING;4:MOSTLY FORMULA;5:FORMULA ONLY"
SET DIR("A")="Select V INFANT FEEDING CHOICES:"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
QUIT
+4 IF 'Y
QUIT
+5 SET APCDTIF=Y
+6 QUIT