AUPNVPLC ; cmi/anch/maw - LIST MANAGER API'S FOR FAMILY HISTORY AND API FOR REP FACTORS
;;2.0;IHS PCC SUITE;**,11**;MAY 14, 2009;Build 58
;
INPUT ;EP - called from input transform on Stage field
NEW A,T,C,H,L
S C=$P($G(^AUPNPROB(DA,0)),U)
S A=0 F S A=$O(^APCDPLCL(A)) Q:A'=+A!('$D(X)) D
.S T=$P(^APCDPLCL(A,0),U,2)
.Q:T=""
.Q:'$D(^ATXAX(T))
.Q:'$$ICD^ATXAPI(C,T,9) ;not in this taxonomy
.S L=$P(^APCDPLCL(A,0),U,3)
.S H=$P(^APCDPLCL(A,0),U,4)
.I X<L!(X>H) K X
.Q
Q
;
HELP ;EP - Executable help from stage field of V POV
NEW A,T,C,H,L,G
S G=0
S C=$P($G(^AUPNPROB(DA,0)),U)
S A=0 F S A=$O(^APCDPLCL(A)) Q:A'=+A!(G) D
.S T=$P(^APCDPLCL(A,0),U,2)
.Q:'$D(^ATXAX(T))
.Q:'$$ICD^ATXAPI(C,T,9) ;not in this taxonomy
.S G=1
.S H=0 F S H=$O(^APCDPLCL(A,12,H)) Q:H'=+H D
..D EN^DDIOL($G(^APCDPLCL(A,12,H,0)))
.Q
Q
;
;
;
ASKCL(C) ;EP - called from data entry input templates to determine whether CLASSIFICATION should be prompted for this icd diagnosis
;C is ien of the icd9 entry
I $G(C)="" Q 0
NEW A,T,H
S A=0,H=0 F S A=$O(^APCDPLCL(A)) Q:A'=+A!(H) D
.S T=$P(^APCDPLCL(A,0),U,2)
.Q:T=""
.Q:'$D(^ATXAX(T))
.Q:'$$ICD^ATXAPI(C,T,9) ;not in this taxonomy
.S H=1
.Q
Q H
;
OUT(IEN,VAL) ;EP called from output transform
I 'IEN Q VAL
I $G(VAL)="" Q ""
I '$D(^AUPNPROB(IEN,0)) Q VAL
NEW C,A,T,H,G,J
S C=$P(^AUPNPROB(IEN,0),U)
S A=0,H=0,G="" F S A=$O(^APCDPLCL(A)) Q:A'=+A!(G) D
.S T=$P(^APCDPLCL(A,0),U,2)
.Q:T=""
.Q:'$D(^ATXAX(T))
.Q:'$$ICD^ATXAPI(C,T,9) ;not in this taxonomy
.I $D(^APCDPLCL(A,11,"B",VAL)) D
..S J=$O(^APCDPLCL(A,11,"B",VAL,0))
..Q:'J
..Q:'$D(^APCDPLCL(A,11,J,0))
..S VAL=VAL_"-"_$P(^APCDPLCL(A,11,J,0),U,2),G=1
Q VAL
;
CAT(C) ;EP - called from health summary to get category for this icd code
;C is ien of the icd9 entry
I $G(C)="" Q 0
NEW A,T,H
S A=0,H="" F S A=$O(^APCDPLCL(A)) Q:A'=+A!(H]"") D
.S T=$P(^APCDPLCL(A,0),U,2)
.Q:T=""
.Q:'$D(^ATXAX(T))
.Q:'$$ICD^ATXAPI(C,T,9) ;not in this taxonomy
.S H=$P(^APCDPLCL(A,0),U,1)
.Q
Q H
;
AUPNVPLC ; cmi/anch/maw - LIST MANAGER API'S FOR FAMILY HISTORY AND API FOR REP FACTORS
+1 ;;2.0;IHS PCC SUITE;**,11**;MAY 14, 2009;Build 58
+2 ;
INPUT ;EP - called from input transform on Stage field
+1 NEW A,T,C,H,L
+2 SET C=$PIECE($GET(^AUPNPROB(DA,0)),U)
+3 SET A=0
FOR
SET A=$ORDER(^APCDPLCL(A))
IF A'=+A!('$DATA(X))
QUIT
Begin DoDot:1
+4 SET T=$PIECE(^APCDPLCL(A,0),U,2)
+5 IF T=""
QUIT
+6 IF '$DATA(^ATXAX(T))
QUIT
+7 ;not in this taxonomy
IF '$$ICD^ATXAPI(C,T,9)
QUIT
+8 SET L=$PIECE(^APCDPLCL(A,0),U,3)
+9 SET H=$PIECE(^APCDPLCL(A,0),U,4)
+10 IF X<L!(X>H)
KILL X
+11 QUIT
End DoDot:1
+12 QUIT
+13 ;
HELP ;EP - Executable help from stage field of V POV
+1 NEW A,T,C,H,L,G
+2 SET G=0
+3 SET C=$PIECE($GET(^AUPNPROB(DA,0)),U)
+4 SET A=0
FOR
SET A=$ORDER(^APCDPLCL(A))
IF A'=+A!(G)
QUIT
Begin DoDot:1
+5 SET T=$PIECE(^APCDPLCL(A,0),U,2)
+6 IF '$DATA(^ATXAX(T))
QUIT
+7 ;not in this taxonomy
IF '$$ICD^ATXAPI(C,T,9)
QUIT
+8 SET G=1
+9 SET H=0
FOR
SET H=$ORDER(^APCDPLCL(A,12,H))
IF H'=+H
QUIT
Begin DoDot:2
+10 DO EN^DDIOL($GET(^APCDPLCL(A,12,H,0)))
End DoDot:2
+11 QUIT
End DoDot:1
+12 QUIT
+13 ;
+14 ;
+15 ;
ASKCL(C) ;EP - called from data entry input templates to determine whether CLASSIFICATION should be prompted for this icd diagnosis
+1 ;C is ien of the icd9 entry
+2 IF $GET(C)=""
QUIT 0
+3 NEW A,T,H
+4 SET A=0
SET H=0
FOR
SET A=$ORDER(^APCDPLCL(A))
IF A'=+A!(H)
QUIT
Begin DoDot:1
+5 SET T=$PIECE(^APCDPLCL(A,0),U,2)
+6 IF T=""
QUIT
+7 IF '$DATA(^ATXAX(T))
QUIT
+8 ;not in this taxonomy
IF '$$ICD^ATXAPI(C,T,9)
QUIT
+9 SET H=1
+10 QUIT
End DoDot:1
+11 QUIT H
+12 ;
OUT(IEN,VAL) ;EP called from output transform
+1 IF 'IEN
QUIT VAL
+2 IF $GET(VAL)=""
QUIT ""
+3 IF '$DATA(^AUPNPROB(IEN,0))
QUIT VAL
+4 NEW C,A,T,H,G,J
+5 SET C=$PIECE(^AUPNPROB(IEN,0),U)
+6 SET A=0
SET H=0
SET G=""
FOR
SET A=$ORDER(^APCDPLCL(A))
IF A'=+A!(G)
QUIT
Begin DoDot:1
+7 SET T=$PIECE(^APCDPLCL(A,0),U,2)
+8 IF T=""
QUIT
+9 IF '$DATA(^ATXAX(T))
QUIT
+10 ;not in this taxonomy
IF '$$ICD^ATXAPI(C,T,9)
QUIT
+11 IF $DATA(^APCDPLCL(A,11,"B",VAL))
Begin DoDot:2
+12 SET J=$ORDER(^APCDPLCL(A,11,"B",VAL,0))
+13 IF 'J
QUIT
+14 IF '$DATA(^APCDPLCL(A,11,J,0))
QUIT
+15 SET VAL=VAL_"-"_$PIECE(^APCDPLCL(A,11,J,0),U,2)
SET G=1
End DoDot:2
End DoDot:1
+16 QUIT VAL
+17 ;
CAT(C) ;EP - called from health summary to get category for this icd code
+1 ;C is ien of the icd9 entry
+2 IF $GET(C)=""
QUIT 0
+3 NEW A,T,H
+4 SET A=0
SET H=""
FOR
SET A=$ORDER(^APCDPLCL(A))
IF A'=+A!(H]"")
QUIT
Begin DoDot:1
+5 SET T=$PIECE(^APCDPLCL(A,0),U,2)
+6 IF T=""
QUIT
+7 IF '$DATA(^ATXAX(T))
QUIT
+8 ;not in this taxonomy
IF '$$ICD^ATXAPI(C,T,9)
QUIT
+9 SET H=$PIECE(^APCDPLCL(A,0),U,1)
+10 QUIT
End DoDot:1
+11 QUIT H
+12 ;