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

PXCECCLS.m

Go to the documentation of this file.
  1. PXCECCLS ;WASH/BDB,PKR - UPDATE ENCOUNTER SC/EI FROM DX SC/EI ;03/06/2023
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**124,174,168,211,234**;Feb 12, 2004;Build 6
  1. Q
  1. ;
  1. VST(PXVIEN) ;
  1. ; PXVIEN Pointer to the Visit (#9000010)
  1. ;
  1. ;Loop over the V POV Service Connected and Environmental Indicator
  1. ;(SC/EI) fields and auto-populate the encounter level SC/EI based
  1. ;on the following rules:
  1. ;
  1. ;If the SC/EI for at least one ICD diagnosis is "Yes", the
  1. ;Encounter Level SC/EI will automatically be set to "Yes"
  1. ;regardless if the Encounter Level SC (or EI) was previously
  1. ;populated ("Yes", "No" or Null). Note: This presumes that a
  1. ;single ICD diagnosis with SC/EI determination of "Yes" makes the
  1. ;Encounter SC/EI determination "Yes".
  1. ;
  1. ;If the SC/EI for all ICD diagnosis are "No" the Encounter Level
  1. ;SC/EI will automatically be set to "No" regardless if the
  1. ;Encounter Level SC/EI was previously populated ("Yes", "No" or
  1. ;Null). Note: This presumes that an Encounter SC/EI cannot be
  1. ;"Yes" if all ICD diagnosis have an SC/EI determination of "No".
  1. ;
  1. ;If at least one ICD diagnosis is missing SC/EI determination and
  1. ;none of the other ICD diagnosis SC/EI determination is "Yes" do
  1. ;not change the SC/EI determination of the Encounter level. Note:
  1. ;This presumes that if one or more ICD diagnosis do not have an
  1. ;SC/EI determination then no inference can be made upon the
  1. ;Encounter Level SC determination. In addition if another package
  1. ;populates SC/EI directly do not overwrite that value in the case
  1. ;of incomplete data. In other words do not set the Encounter Level
  1. ;to Null.
  1. ;
  1. ;VARIABLE LIST TO AUTO POPULATE THE ENCOUNTER LEVEL SC/EI
  1. ;For each SC/EI in the PXSCEINW string:
  1. ; = 1 SC/EI Classification determined by the DX's is found to be "Yes"
  1. ; = 0 SC/EI Classification determined by the DX's is found to be "NO"
  1. ; =-1 SC/EI cannot be determined by the DX's =""
  1. ;
  1. ;Do not ask the SC/EI questions Edit flag for SC: SCEF, AO: AOEF,
  1. ;IR: IREF, EC:ECEF, MST: MSTEF , HNC: HNCEF , CV: CVEF,
  1. ;SHAD:SHADEF Used in Visit File Filing - See example below:
  1. ; VSIT("SCEF")=1 SC/EI
  1. ; Classification determined by the DX's - do not ask SC/EI
  1. ; VSIT("SCEF")=0
  1. ; SC/EI Classification undetermined by the DX's - ask SC/EI etc.
  1. ;
  1. ;====================
  1. ;If the Visit is missing the patient quit.
  1. I $P($G(^AUPNVSIT(PXVIEN,0)),U,5)="" Q
  1. N VSIT
  1. S VSIT("IEN")=PXVIEN
  1. S (VSIT("SCEF"),VSIT("AOEF"),VSIT("IREF"),VSIT("ECEF"))=0
  1. S (VSIT("MSTEF"),VSIT("HNCEF"),VSIT("CVEF"),VSIT("SHADEF"))=0
  1. I '$D(^AUPNVPOV("AD",PXVIEN)) D UPD^VSIT Q
  1. ;Initialize the SC/EI variables. The variables ending in A0 will be
  1. ;true if all if all the diagnosis entries are 0 for that variable.
  1. N AO,CV,EC,HNC,IR,MST,SC,SHAD,VSITA0
  1. N AOA0,CVA0,ECA0,HNCA0,IRA0,MSTA0,SCA0,SHADA0
  1. N PXPOV,PXPOV800
  1. S (AO,CV,EC,HNC,IR,MST,SC,SHAD)=""
  1. S (AOA0,CVA0,ECA0,HNCA0,IRA0,MSTA0,SCA0,SHADA0)=1
  1. ;Loop over all V POV entries for the Visit.
  1. S PXPOV=0
  1. F S PXPOV=+$O(^AUPNVPOV("AD",PXVIEN,PXPOV)) Q:PXPOV=0 D
  1. . S PXPOV800=$G(^AUPNVPOV(PXPOV,800))
  1. . I SC'=1 S SC=$P(PXPOV800,U,1) I SC'=0 S SCA0=0
  1. . I AO'=1 S AO=$P(PXPOV800,U,2) I AO'=0 S AOA0=0
  1. . I IR'=1 S IR=$P(PXPOV800,U,3) I IR'=0 S IRA0=0
  1. . I EC'=1 S EC=$P(PXPOV800,U,4) I EC'=0 S ECA0=0
  1. . I MST'=1 S MST=$P(PXPOV800,U,5) I MST'=0 S MSTA0=0
  1. . I HNC'=1 S HNC=$P(PXPOV800,U,6) I HNC'=0 S HNCA0=0
  1. . I CV'=1 S CV=$P(PXPOV800,U,7) I CV'=0 S CVA0=0
  1. . I SHAD'=1 S SHAD=$P(PXPOV800,U,8) I SHAD'=0 S SHADA0=0
  1. S (VSIT("SCEF"),VSIT("AOEF"),VSIT("IREF"),VSIT("ECEF"))=0
  1. S (VSIT("MSTEF"),VSIT("HNCEF"),VSIT("CVEF"),VSIT("SHADEF"))=0
  1. I (SC=1)!(SCA0=1) S VSIT("SC")=SC,VSIT("SCEF")=1
  1. I (AO=1)!(AOA0=1) S VSIT("AO")=AO,VSIT("AOEF")=1
  1. I (IR=1)!(IRA0=1) S VSIT("IR")=IR,VSIT("IREF")=1
  1. I (EC=1)!(ECA0=1) S VSIT("EC")=EC,VSIT("ECEF")=1
  1. I (MST=1)!(MSTA0=1) S VSIT("MST")=MST,VSIT("MSTEF")=1
  1. I (HNC=1)!(HNCA0=1) S VSIT("HNC")=HNC,VSIT("HNCEF")=1
  1. I (CV=1)!(CVA0=1) S VSIT("CV")=CV,VSIT("CVEF")=1
  1. I (SHAD=1)!(SHADA0=1) S VSIT("SHAD")=SHAD,VSIT("SHADEF")=1
  1. I $G(VSIT("SC"))=1 S (VSIT("AO"),VSIT("IR"),VSIT("EC"))="@"
  1. D UPD^VSIT
  1. Q
  1. ;