AMQQDFN ;IHS/CMI/THL - CHECK TO SEE IF ANY ^AUTT FILE DFNS HAVE CHANGED ;
;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
;-----
EN ; ENTRY POINT
N %,A,B,C,I,X,Y,Z,DFN,%Z
S U="^"
;PATCH XXX
D IMM^AMQQMGR9
D MSR^AMQQMGR9
;D EXAM^AMQQMGR9
I '$D(AMQQXX) W !,"Qman is now waking up "
F X=0:0 S X=$O(^AMQQ(5,X)) Q:'X S Y=^(X,0),Z=$P(Y,U,12) I Z'="" W:'$D(AMQQXX) "." D G1
D IEN^AMQQMGR9
Q
;
G1 S (%,B)=$P(Y,U,5)
S %=$G(^AMQQ(1,%,2))
I %="" Q
I %["AUPNVXAM" S %=$P(%,";",2) G G11
S A="AUPNV"_$P(Z,";")_";",%=+$P(%,A,2)
G11 S %Z=$P(Z,";",2)
S Z="^AUTT"_$P(Z,";")_"(""C"","""_$P(Z,";",2)_""","""")"
S Z=$O(@Z)
I Z,Z=% Q
I 'Z Q
S DFN=%
D RESET
Q
;
RESET ;
S $P(^AMQQ(1,B,0),U,11)=Z
I Z S $P(^(0),U,15)=Z
S A=^AMQQ(1,B,1)
I A'["IMM" S C=" I $D(^(AMQP(0)," S %=$P(A,C,2),%="))"_$P(%,"))",2,999),%=Z_%,A=$P(A,C)_C_%,^AMQQ(1,B,1)=A
F I=1,2 D
.S A=^AMQQ(1,B,I)
.S C=$P(^AMQQ(5,X,0),U,12)
.S C=$P(C,";")
.S:C="EXAM" C="XAM"
.S C="AUPNV"_C_";"
.S %=$P(A,C,2)
.S %=Z_";"_$P(%,";",2,999)
.S A=$P(A,C)_C_%
.S ^AMQQ(1,B,I)=A
I A["IMM",'$D(^AUTTIMM(101,0)) D IMM
Q
;
IMM ; Check compound immunization links to see if need to change a dfn
N %A,%B,%C,%D,%E,%F,%I,%LINK
F %I=1:1 S %A=$P($T(IMMUN+%I),";;",2) Q:%A="" D
.S %C=$P(%A,U) F I=1:1 S %D=$P(%C,":",I) Q:%D="" I %D=%Z S %LINK=$P(%A,U,2) D Q
..F I=1,2 S A=^AMQQ(1,%LINK,I),C="AUPNVIMM;",%=$P(A,C,2),%C=$P(%,";") D S %=%C_";"_$P(%,";",2,999),A=$P(A,C)_C_%,^AMQQ(1,%LINK,I)=A
...F %E=1:1 S %F=$P(%C,":",%E) Q:%F="" I %F=DFN S $P(%C,":",%E)=Z
Q
;
IMMUN ; Table of Compound Immunizations - IHS CODE:IHS CODE^QMAN LINK ENTRY ;
;;02:03:04:34:42^180
;;02:04^186
;;03:04:34:42^185
;;15:17^199
;;14:17:18^198
;;35:37:38:39^306
;;11:17:18^197
AMQQDFN ;IHS/CMI/THL - CHECK TO SEE IF ANY ^AUTT FILE DFNS HAVE CHANGED ;
+1 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
+2 ;-----
EN ; ENTRY POINT
+1 NEW %,A,B,C,I,X,Y,Z,DFN,%Z
+2 SET U="^"
+3 ;PATCH XXX
+4 DO IMM^AMQQMGR9
+5 DO MSR^AMQQMGR9
+6 ;D EXAM^AMQQMGR9
+7 IF '$DATA(AMQQXX)
WRITE !,"Qman is now waking up "
+8 FOR X=0:0
SET X=$ORDER(^AMQQ(5,X))
IF 'X
QUIT
SET Y=^(X,0)
SET Z=$PIECE(Y,U,12)
IF Z'=""
IF '$DATA(AMQQXX)
WRITE "."
DO G1
+9 DO IEN^AMQQMGR9
+10 QUIT
+11 ;
G1 SET (%,B)=$PIECE(Y,U,5)
+1 SET %=$GET(^AMQQ(1,%,2))
+2 IF %=""
QUIT
+3 IF %["AUPNVXAM"
SET %=$PIECE(%,";",2)
GOTO G11
+4 SET A="AUPNV"_$PIECE(Z,";")_";"
SET %=+$PIECE(%,A,2)
G11 SET %Z=$PIECE(Z,";",2)
+1 SET Z="^AUTT"_$PIECE(Z,";")_"(""C"","""_$PIECE(Z,";",2)_""","""")"
+2 SET Z=$ORDER(@Z)
+3 IF Z
IF Z=%
QUIT
+4 IF 'Z
QUIT
+5 SET DFN=%
+6 DO RESET
+7 QUIT
+8 ;
RESET ;
+1 SET $PIECE(^AMQQ(1,B,0),U,11)=Z
+2 IF Z
SET $PIECE(^(0),U,15)=Z
+3 SET A=^AMQQ(1,B,1)
+4 IF A'["IMM"
SET C=" I $D(^(AMQP(0),"
SET %=$PIECE(A,C,2)
SET %="))"_$PIECE(%,"))",2,999)
SET %=Z_%
SET A=$PIECE(A,C)_C_%
SET ^AMQQ(1,B,1)=A
+5 FOR I=1,2
Begin DoDot:1
+6 SET A=^AMQQ(1,B,I)
+7 SET C=$PIECE(^AMQQ(5,X,0),U,12)
+8 SET C=$PIECE(C,";")
+9 IF C="EXAM"
SET C="XAM"
+10 SET C="AUPNV"_C_";"
+11 SET %=$PIECE(A,C,2)
+12 SET %=Z_";"_$PIECE(%,";",2,999)
+13 SET A=$PIECE(A,C)_C_%
+14 SET ^AMQQ(1,B,I)=A
End DoDot:1
+15 IF A["IMM"
IF '$DATA(^AUTTIMM(101,0))
DO IMM
+16 QUIT
+17 ;
IMM ; Check compound immunization links to see if need to change a dfn
+1 NEW %A,%B,%C,%D,%E,%F,%I,%LINK
+2 FOR %I=1:1
SET %A=$PIECE($TEXT(IMMUN+%I),";;",2)
IF %A=""
QUIT
Begin DoDot:1
+3 SET %C=$PIECE(%A,U)
FOR I=1:1
SET %D=$PIECE(%C,":",I)
IF %D=""
QUIT
IF %D=%Z
SET %LINK=$PIECE(%A,U,2)
Begin DoDot:2
+4 FOR I=1,2
SET A=^AMQQ(1,%LINK,I)
SET C="AUPNVIMM;"
SET %=$PIECE(A,C,2)
SET %C=$PIECE(%,";")
Begin DoDot:3
+5 FOR %E=1:1
SET %F=$PIECE(%C,":",%E)
IF %F=""
QUIT
IF %F=DFN
SET $PIECE(%C,":",%E)=Z
End DoDot:3
SET %=%C_";"_$PIECE(%,";",2,999)
SET A=$PIECE(A,C)_C_%
SET ^AMQQ(1,%LINK,I)=A
End DoDot:2
QUIT
End DoDot:1
+6 QUIT
+7 ;
IMMUN ; Table of Compound Immunizations - IHS CODE:IHS CODE^QMAN LINK ENTRY ;
+1 ;;02:03:04:34:42^180
+2 ;;02:04^186
+3 ;;03:04:34:42^185
+4 ;;15:17^199
+5 ;;14:17:18^198
+6 ;;35:37:38:39^306
+7 ;;11:17:18^197