Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PXAIIMM

PXAIIMM.m

Go to the documentation of this file.
PXAIIMM ;ISL/PKR - Set the IMMUNIZATION nodes. ;02/04/16  09:21
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**45,124,209,210,215**;Aug 12, 1996;Build 10
 ;
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
 . I IND?1(1"VIS",1"REMARKS") D  Q
 . . M PXAA(IND)=@PXADATA@("IMMUNIZATION",PXAK,IND)
 . 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,AFTER13,AFTER16,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)
 ;
 ;--Add new fields for VIMM 2.0 - PX*1*209/210/215
 S $P(AFTER12,U,2)=$G(PXAA("ORD PROVIDER"))
 S $P(AFTER12,U,7)=$G(PXAA("LOT NUM"))
 S $P(AFTER12,U,20)=$G(PXAA("WARNING ACK"))
 S $P(AFTER13,U)=$G(PXAA("INFO SOURCE"))
 S $P(AFTER13,U,2)=$G(PXAA("ADMIN ROUTE"))
 S $P(AFTER13,U,3)=$G(PXAA("ANATOMIC LOC"))
 S $P(AFTER13,U,4)=$G(PXAA("DIAGNOSIS"))
 S $P(AFTER13,U,12)=$G(PXAA("DOSE"))
 S $P(AFTER13,U,13)=$G(PXAA("DOSE UNITS"))
 S $P(AFTER16,U,1)=$G(PXAA("OVERRIDE REASON"))
 ;
 S ^TMP("PXK",$J,"IMM",PXAK,0,"AFTER")=AFTER0
 S ^TMP("PXK",$J,"IMM",PXAK,12,"AFTER")=AFTER12
 S ^TMP("PXK",$J,"IMM",PXAK,13,"AFTER")=AFTER13
 S ^TMP("PXK",$J,"IMM",PXAK,16,"AFTER")=AFTER16
 S ^TMP("PXK",$J,"IMM",PXAK,811,"AFTER")=AFTER811
 S ^TMP("PXK",$J,"IMM",PXAK,812,"AFTER")=AFTER812
 ;
 ; Add multiple data to PXK AFTER - PX*1*210
 N FLD,SEQ,SUB
 ;
 F FLD="VIS","REMARKS" D
 . ;
 . S SUB=$S(FLD="VIS":2,1:11)
 . ;
 . ; Delete multiple
 . I $G(PXAA(FLD))="@" D  Q
 . . S ^TMP("PXK",$J,"IMM",PXAK,SUB,0,"AFTER")="@"
 . ;
 . S SEQ=0
 . F  S SEQ=$O(PXAA(FLD,SEQ)) Q:'SEQ  D
 . . S ^TMP("PXK",$J,"IMM",PXAK,SUB,SEQ,"AFTER")=$G(PXAA(FLD,SEQ,0))
 ;
 ; Add DIAGNOSIS 2 thru 8 to OTHER DIAGNOSIS multiple
 N DIAGNUM,DIAGSTR
 ;
 S SEQ=0
 ;
 F DIAGNUM=2:1:8 D
 . S DIAGSTR="DIAGNOSIS "_DIAGNUM
 . I $G(PXAA(DIAGSTR))'="" D
 . . S SEQ=SEQ+1
 . . S ^TMP("PXK",$J,"IMM",PXAK,3,SEQ,"AFTER")=PXAA(DIAGSTR)
 ;
SETVARB ;Set the before variables.
 N BEFOR0,BEFOR12,BEFOR13,BEFOR16,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 BEFOR13=$G(^AUPNVIMM(IENB,13))
 . S BEFOR16=$G(^AUPNVIMM(IENB,16))
 . S BEFOR811=$G(^AUPNVIMM(IENB,811))
 . S BEFOR812=$G(^AUPNVIMM(IENB,812))
 E  S (BEFOR0,BEFOR11,BEFOR12,BEFOR13,BEFOR16,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,13,"BEFORE")=BEFOR13
 S ^TMP("PXK",$J,"IMM",PXAK,16,"BEFORE")=BEFOR16
 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
 ;
 ; Add multiple data to PXK BEFORE
 I $G(IENB) D
 . N IENSUB,SUB
 . F SUB=2,3,11 D
 . . S IENSUB=0
 . . F  S IENSUB=$O(^AUPNVIMM(IENB,SUB,IENSUB)) Q:'IENSUB  D
 . . . S ^TMP("PXK",$J,"IMM",PXAK,SUB,IENSUB,"BEFORE")=$G(^AUPNVIMM(IENB,SUB,IENSUB,0))
 ;
 Q