PXAIIMM ;ISL/PKR - Set the IMMUNIZATION nodes. ;12/18/97
;;1.0;PCE PATIENT CARE ENCOUNTER;**45**;Aug 12, 1996
;
IMM ;Main entry point.
;
K PXAERR
S PXAERR(8)=PXAK
S PXAERR(7)="IMMUNIZATION"
;
N IND,PXAA
S IND=""
F S IND=$O(@PXADATA@("IMMUNIZATION",PXAK,IND)) Q:IND="" D
. S PXAA(IND)=@PXADATA@("IMMUNIZATION",PXAK,IND)
;
;Validate the data.
N STOP
D VAL^PXAIIMMV
I $G(STOP) Q
;
SETVARA ;Set the after visit variables.
N AFTER0,AFTER12,AFTER811,AFTER812
S $P(AFTER0,U,1)=$G(PXAA("IMMUN"))
I $G(PXAA("DELETE")) S $P(AFTER0,U,1)="@"
S $P(AFTER0,U,2)=$G(PATIENT)
S $P(AFTER0,U,3)=$G(PXAVISIT)
S $P(AFTER0,U,4)=$G(PXAA("SERIES"))
S $P(AFTER0,U,6)=$G(PXAA("REACTION"))
S $P(AFTER0,U,7)=$G(PXAA("CONTRAINDICATED"))
S $P(AFTER12,U,1)=$G(PXAA("EVENT D/T"))
S $P(AFTER12,U,4)=$G(PXAA("ENC PROVIDER"))
S $P(AFTER811,U,1)=$G(PXAA("COMMENT"))
;
;--PACKAGE AND SOURCE
S $P(AFTER812,"^",2)=$G(PXAPKG)
S $P(AFTER812,"^",3)=$G(PXASOURC)
;
S ^TMP("PXK",$J,"IMM",PXAK,0,"AFTER")=AFTER0
S ^TMP("PXK",$J,"IMM",PXAK,12,"AFTER")=AFTER12
S ^TMP("PXK",$J,"IMM",PXAK,811,"AFTER")=AFTER811
S ^TMP("PXK",$J,"IMM",PXAK,812,"AFTER")=AFTER812
;
SETVARB ;Set the before variables.
N BEFOR0,BEFOR12,BEFOR811,BEFOR812
N IENB,PXAAX,PXBCNT,PXBKY,PXBSKY,PXBSAM
D IMM^PXBGIMM(PXAVISIT)
;
S IENB=""
I PXBCNT>0 D
. S PXAAX("IMMUN")=$P($G(^AUTTIMM(PXAA("IMMUN"),0)),U,1)
. S IENB=$O(PXBKY(PXAAX("IMMUN"),IENB))
I $G(IENB) D
. S BEFOR0=$G(^AUPNVIMM(IENB,0))
. S BEFOR12=$G(^AUPNVIMM(IENB,12))
. S BEFOR811=$G(^AUPNVIMM(IENB,811))
. S BEFOR812=$G(^AUPNVIMM(IENB,812))
E S (BEFOR0,BEFOR11,BEFOR12,BEFOR811,BEFOR812)=""
;
S ^TMP("PXK",$J,"IMM",PXAK,0,"BEFORE")=BEFOR0
S ^TMP("PXK",$J,"IMM",PXAK,12,"BEFORE")=BEFOR12
S ^TMP("PXK",$J,"IMM",PXAK,811,"BEFORE")=BEFOR811
S ^TMP("PXK",$J,"IMM",PXAK,812,"BEFORE")=BEFOR812
S ^TMP("PXK",$J,"IMM",PXAK,"IEN")=IENB
;
Q
PXAIIMM ;ISL/PKR - Set the IMMUNIZATION nodes. ;12/18/97
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**45**;Aug 12, 1996
+2 ;
IMM ;Main entry point.
+1 ;
+2 KILL PXAERR
+3 SET PXAERR(8)=PXAK
+4 SET PXAERR(7)="IMMUNIZATION"
+5 ;
+6 NEW IND,PXAA
+7 SET IND=""
+8 FOR
SET IND=$ORDER(@PXADATA@("IMMUNIZATION",PXAK,IND))
IF IND=""
QUIT
Begin DoDot:1
+9 SET PXAA(IND)=@PXADATA@("IMMUNIZATION",PXAK,IND)
End DoDot:1
+10 ;
+11 ;Validate the data.
+12 NEW STOP
+13 DO VAL^PXAIIMMV
+14 IF $GET(STOP)
QUIT
+15 ;
SETVARA ;Set the after visit variables.
+1 NEW AFTER0,AFTER12,AFTER811,AFTER812
+2 SET $PIECE(AFTER0,U,1)=$GET(PXAA("IMMUN"))
+3 IF $GET(PXAA("DELETE"))
SET $PIECE(AFTER0,U,1)="@"
+4 SET $PIECE(AFTER0,U,2)=$GET(PATIENT)
+5 SET $PIECE(AFTER0,U,3)=$GET(PXAVISIT)
+6 SET $PIECE(AFTER0,U,4)=$GET(PXAA("SERIES"))
+7 SET $PIECE(AFTER0,U,6)=$GET(PXAA("REACTION"))
+8 SET $PIECE(AFTER0,U,7)=$GET(PXAA("CONTRAINDICATED"))
+9 SET $PIECE(AFTER12,U,1)=$GET(PXAA("EVENT D/T"))
+10 SET $PIECE(AFTER12,U,4)=$GET(PXAA("ENC PROVIDER"))
+11 SET $PIECE(AFTER811,U,1)=$GET(PXAA("COMMENT"))
+12 ;
+13 ;--PACKAGE AND SOURCE
+14 SET $PIECE(AFTER812,"^",2)=$GET(PXAPKG)
+15 SET $PIECE(AFTER812,"^",3)=$GET(PXASOURC)
+16 ;
+17 SET ^TMP("PXK",$JOB,"IMM",PXAK,0,"AFTER")=AFTER0
+18 SET ^TMP("PXK",$JOB,"IMM",PXAK,12,"AFTER")=AFTER12
+19 SET ^TMP("PXK",$JOB,"IMM",PXAK,811,"AFTER")=AFTER811
+20 SET ^TMP("PXK",$JOB,"IMM",PXAK,812,"AFTER")=AFTER812
+21 ;
SETVARB ;Set the before variables.
+1 NEW BEFOR0,BEFOR12,BEFOR811,BEFOR812
+2 NEW IENB,PXAAX,PXBCNT,PXBKY,PXBSKY,PXBSAM
+3 DO IMM^PXBGIMM(PXAVISIT)
+4 ;
+5 SET IENB=""
+6 IF PXBCNT>0
Begin DoDot:1
+7 SET PXAAX("IMMUN")=$PIECE($GET(^AUTTIMM(PXAA("IMMUN"),0)),U,1)
+8 SET IENB=$ORDER(PXBKY(PXAAX("IMMUN"),IENB))
End DoDot:1
+9 IF $GET(IENB)
Begin DoDot:1
+10 SET BEFOR0=$GET(^AUPNVIMM(IENB,0))
+11 SET BEFOR12=$GET(^AUPNVIMM(IENB,12))
+12 SET BEFOR811=$GET(^AUPNVIMM(IENB,811))
+13 SET BEFOR812=$GET(^AUPNVIMM(IENB,812))
End DoDot:1
+14 IF '$TEST
SET (BEFOR0,BEFOR11,BEFOR12,BEFOR811,BEFOR812)=""
+15 ;
+16 SET ^TMP("PXK",$JOB,"IMM",PXAK,0,"BEFORE")=BEFOR0
+17 SET ^TMP("PXK",$JOB,"IMM",PXAK,12,"BEFORE")=BEFOR12
+18 SET ^TMP("PXK",$JOB,"IMM",PXAK,811,"BEFORE")=BEFOR811
+19 SET ^TMP("PXK",$JOB,"IMM",PXAK,812,"BEFORE")=BEFOR812
+20 SET ^TMP("PXK",$JOB,"IMM",PXAK,"IEN")=IENB
+21 ;
+22 QUIT