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

PXCEICR.m

Go to the documentation of this file.
  1. PXCEICR ;BHM/ADM - EDIT/DISPLAY CONTRAINDICATION/REFUSAL ;05/20/2022
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**215,217**;Aug 12, 1996;Build 134
  1. ;
  1. Q
  1. ;
  1. ;Line with the line label "FORMAT"
  1. ;;Long name~File Number~Node Subscripts~Allow Duplicate entries (1=yes, 0=no)~File global name
  1. ; 1 2 3 4 5
  1. ;
  1. ;Following lines:
  1. ;;Node~Piece~,Field Number~Edit Label~Display Label~Display Routine~Edit Routine~Help Text for DIR("?")~Set of PXCEKEYS that can Edit~D if Detail Display Only~
  1. ; 1 ~ 2 ~ 3 ~ 4 ~ 5 ~ 6 ~ 7 ~ 8 ~ 9 ~ 10
  1. ;The Display & Edit routines are for special cases.
  1. ; (The .01 field cannot have a special edit.)
  1. ;
  1. FORMAT ;;Imm Contraindication/Refusal Event~9000010.707~0,12,801,811,812~1~^AUPNVICR
  1. ;;0~1~.01~Contraindication/Refusal: ~Contra/Refusal Event: ~~~~~B
  1. ;;0~4~.04~Immunization: ~Immunization: ~~EIMM^PXCEICR~~~D
  1. ;;12~5~1205~Refused all immunizations in this group?: ~Refused all immunizations in this group?: ~~REFGRP^PXCEICR~~~B
  1. ;;12~1~1201~Event Date and Time: ~Event Date and Time: ~~~~~D
  1. ;;12~4~1204~Encounter Provider: ~Encounter Provider: ~~EPROV12^PXCEPRV~~~D
  1. ;;0~5~.05~Warn Until Date: ~Warn Until Date: ~~WARNDT^PXCEICR~~~D
  1. ;;0~6~.06~Date/Time Recorded: ~Date/Time Recorded: ~~~~~D
  1. ;;811~1~81101~Comments: ~Comments: ~~~~~D
  1. ;;
  1. ;
  1. ;********************************
  1. ;Display text for the .01 field
  1. ;(Must have is called by ASK^PXCEVFI2 and DEL^PXCEVFI2.)
  1. DISPLY01(PXCEICR,PXCEDT) ;
  1. N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. S PXCEINT=$P(PXCEICR,"^",1)
  1. S PXCEEXT=$$EXTERNAL^DILFD(9000010.707,.01,"",PXCEINT,"PXCEDILF")
  1. Q $S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. ;
  1. EIMM ; Edit Immunization
  1. N DA,DIR,DTOUT,DUOUT,X,Y
  1. I $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))'="" D
  1. . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
  1. . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
  1. . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. S DIR(0)="PA^9999999.14:QEM"
  1. S DIR("S")="I $$IMMCRSEL^PXVUTIL($P($G(PXCEAFTR(0)),U,1),Y)"
  1. S DIR("A")=$P(PXCETEXT,"~",4)
  1. S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
  1. D ^DIR
  1. I X="@" S Y="@"
  1. E I $D(DTOUT)!$D(DUOUT) S PXCEEND=1
  1. S $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^")
  1. Q
  1. ;
  1. WARNDT ;
  1. N DA,DIR,DTOUT,DUOUT,X,Y
  1. ;
  1. I $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))'="" D
  1. . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
  1. . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
  1. . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. S DIR(0)=PXCEFILE_","_$P(PXCETEXT,"~",3)_"A"
  1. S DIR("A")=$P(PXCETEXT,"~",4)
  1. I $G(DIR("B"))="",'$G(PXCEFIEN) D
  1. . N PXICR,PXFILE,PXIEN,PXLOC,PXRSLT,PXDEF
  1. . S PXICR=$P($G(PXCEAFTR(0)),U,1)
  1. . S PXFILE=+$P(PXICR,"(",2)
  1. . I 'PXFILE Q
  1. . S PXIEN=+PXICR
  1. . I 'PXIEN Q
  1. . I $G(PXCEVIEN) S PXLOC=$P($G(^AUPNVSIT(PXCEVIEN,0)),U,22)
  1. . D GETICR^PXVRPC5(.PXRSLT,PXFILE,"R:"_PXIEN,"",$G(PXLOC))
  1. . S PXDEF=$P($G(PXRSLT(1)),U,$S(PXFILE=920.5:5,1:8))
  1. . I PXDEF>0 S DIR("B")=$$FMTE^XLFDT(PXDEF)
  1. S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
  1. D ^DIR
  1. I X="@" S Y="@"
  1. E I $D(DTOUT)!$D(DUOUT) S PXCEEND=1
  1. S $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^")
  1. Q
  1. ;
  1. REFGRP ; Refused Vaccine Group
  1. N DA,DIR,DTOUT,DUOUT,X,Y
  1. ;
  1. I $P($G(PXCEAFTR(0)),U,1)'[920.5 Q
  1. ;
  1. I $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))'="" D
  1. . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
  1. . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
  1. . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. S DIR(0)=PXCEFILE_","_$P(PXCETEXT,"~",3)_"A"
  1. S DIR("A")=$P(PXCETEXT,"~",4)
  1. I $G(DIR("B"))="",'$G(PXCEFIEN) S DIR("B")="YES"
  1. S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
  1. D ^DIR
  1. I X="@" S Y="@"
  1. E I $D(DTOUT)!$D(DUOUT) S PXCEEND=1
  1. S $P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))=$P(Y,"^")
  1. Q
  1. ;
  1. CONTRA ;
  1. Q:'$G(PXCEPAT)!'+$G(PXD)
  1. N PXCNT,PXD1,PXEXT,PXIEN,PXRESULT,PXVJFLG,PXWUD
  1. S (PXVACK,PXCNT)=0,PXD1=+PXD,PXJUST=""
  1. D PATICR^PXAPIIM(.PXRESULT,PXCEPAT,PXD1)
  1. I '$O(PXRESULT(0)) Q
  1. S PXIEN=0 F S PXIEN=$O(PXRESULT(PXIEN)) Q:'PXIEN D CHK
  1. I PXCNT S PXCONTRA=1 D
  1. . I $P($G(PXCEAFTR("12")),"^",20) D JUST I PXVJFLG S PXVACK=1 Q
  1. . K DIR S DIR("A",1)=""
  1. . S DIR("A")="Acknowledge warning and proceed with administration",DIR(0)="Y",DIR("B")="NO"
  1. . S DIR("?",1)="Enter YES to acknowledge a warning of contraindication/refusal events"
  1. . S DIR("?")="associated with this immunization and to proceed with administration." D ^DIR K DIR
  1. . I $D(DTOUT)!$D(DUOUT)!'Y Q
  1. . I Y D JUST I PXVJFLG S PXVACK=1 Q
  1. Q
  1. CHK ;
  1. S PXWUD=$P(PXRESULT(PXIEN),"^",4) I $G(PXWUD),$G(PXWUD)<DT Q
  1. S PXCNT=PXCNT+1 I PXCNT=1 D WARN
  1. S PXEXT=$P($P(PXRESULT(PXIEN),"^",2),"|",2)
  1. I $G(PXWUD) S Y=PXWUD D DD^%DT S PXEXT=PXEXT_" (Until "_Y_")"
  1. D EN^DDIOL(PXEXT,,"!,?4")
  1. N PXC S PXC=$G(PXRESULT(PXIEN,"COMMENTS")) I $L(PXC) S PXC="COMMENT: "_PXC D EN^DDIOL(PXC,,"!,?6")
  1. Q
  1. WARN ;
  1. N PXX S PXX=$C(7)_"WARNING!" D EN^DDIOL(PXX,,"!!")
  1. D EN^DDIOL("Contraindication/refusal event(s) associated with this immunization:",,"!,?2")
  1. Q
  1. JUST ; enter comment concerning override of warning
  1. S PXVJFLG=0
  1. K DIR I $D(PXCEAFTR("16")) S DIR("B")=$P(PXCEAFTR("16"),"^")
  1. S DIR("A")="Warning Override Justification",DIR(0)="9000010.11,1601" D ^DIR K DIR
  1. I $D(DTOUT)!$D(DUOUT) S:Y="^" PXJUST="@" Q
  1. I Y="" D EN^DDIOL("Override justification entry is required to proceed with administration.",,"!,?2") G JUST
  1. S PXJUST=Y,PXVJFLG=1
  1. Q