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

XUMVIDTA.m

Go to the documentation of this file.
  1. XUMVIDTA ;MVI/CKN - MVI New Person Data Analysis ;8/20/19 11:03
  1. ;;8.0;KERNEL;**705,711,710**;Jul 10, 1995;Build 2
  1. Q
  1. EP(RETURN,SEL,ACTSEL) ;
  1. ;RPC - XUS MVI NEW PERSON DATA
  1. ;This RPC is called by MPI to get data analysis report from
  1. ;NEW PERSON file (#200) for active VistA sites
  1. ;Input:
  1. ; SEL (Required) - 1 : All - Active New Person and Non Active New Person
  1. ; 2 : Active New Person
  1. ; 3 : Non Active New Person
  1. ; ACTSEL (Optional for Non Active) - 1 : All
  1. ; 1 : All
  1. ; 2 : Active records having a SecID value
  1. ; 3 : Active records having an Email value
  1. ; 4 : Active records having a NT USERNAME value
  1. ;Output:
  1. ; RETURN - Total Count^Total Non Active^Total Active^Total SECID^Total Email
  1. ; ^Total NT User^Total Visitors
  1. ;
  1. N XUDUZ,U,TOTVIS,TOTCNT,NONACT,ACT,TOTNACT,TOTACT,TOTSECID,TOTEMAIL,TOTNTUSR,ARR
  1. S (TOTCNT,TOTNACT,TOTACT,TOTSECID,TOTEMAIL,TOTNTUSR,TOTVIS)=0
  1. S U="^"
  1. S XUDUZ=.9 F S XUDUZ=$O(^VA(200,XUDUZ)) Q:+XUDUZ=0 D
  1. .K ARR
  1. .S TOTCNT=TOTCNT+1
  1. .D GET(XUDUZ,.ARR)
  1. .I $G(ARR("VISITOR"))=1 S TOTVIS=TOTVIS+1 ; Visitor records ;**710 - STORY_952862 (dri) remove QUIT to stop filtering, allow person to also be counted as active
  1. .;Inactive New Person
  1. .I SEL=3 D Q
  1. ..S NONACT=$$NONACT(.ARR)
  1. ..I NONACT S TOTNACT=TOTNACT+1
  1. .;Active New Person
  1. .I SEL=2 D Q
  1. ..S ACT=$$ACT(.ARR) I 'ACT Q
  1. ..S TOTACT=TOTACT+1
  1. ..D GETACT(ACTSEL,.ARR)
  1. .;All Active and Inactive New Person
  1. .I SEL=1 D
  1. ..S NONACT=$$NONACT(.ARR) I NONACT S TOTNACT=TOTNACT+1 Q
  1. ..I '$$ACT(.ARR) Q
  1. ..S TOTACT=TOTACT+1
  1. ..D GETACT(ACTSEL,.ARR)
  1. ;
  1. ;RETURN - Total Count^Total Non Active^Total Active^Total SECID^Total Email
  1. ; ^Total NT User^Total Visitors
  1. S RETURN=TOTCNT_U_TOTNACT_U_TOTACT_U_TOTSECID_U_TOTEMAIL_U_TOTNTUSR_U_TOTVIS
  1. Q
  1. GET(XUDUZ,ARR) ;
  1. ;Get all necessary fields from New Person file (#200)
  1. N NPDATA
  1. S DR="201;205.1;205.5;501.1;7;9.2",DIC=200,DA=XUDUZ,DIQ="NPDATA",DIQ(0)="I" D EN^DIQ1
  1. S ARR("PRIMOPT")=$G(NPDATA(200,XUDUZ,201,"I"))
  1. S ARR("SECID")=$G(NPDATA(200,XUDUZ,205.1,"I"))
  1. S ARR("EMAIL")=$G(NPDATA(200,XUDUZ,205.5,"I"))
  1. S ARR("NTUSR")=$G(NPDATA(200,XUDUZ,501.1,"I"))
  1. S ARR("DISUSR")=$G(NPDATA(200,XUDUZ,7,"I"))
  1. S ARR("TERMDT")=$G(NPDATA(200,XUDUZ,9.2,"I"))
  1. I $O(^VA(200,XUDUZ,8910,0)) S ARR("VSTDATA")=1
  1. I $G(ARR("VSTDATA")),$G(ARR("PRIMOPT"))'="" S ARR("VISITOR")=1
  1. K DIC,DA,DR,DIQ
  1. Q
  1. NONACT(ARR) ;
  1. ;Inactive Person - Disuser=Y and/or Termination date is not a future date
  1. I $G(ARR("DISUSR"))=1!(($G(ARR("TERMDT"))'="")&($G(ARR("TERMDT"))'>DT)) Q 1
  1. Q 0
  1. ACT(ARR) ;
  1. ;Active Person - not Disuser=Y and/or no Termination date.
  1. ;**711 Story 977780 (ckn) - Add check for primary option assigned.
  1. I $G(ARR("DISUSR"))'=1,($G(ARR("TERMDT"))=""!($G(ARR("TERMDT"))>DT)),($G(ARR("PRIMOPT"))'="") Q 1
  1. Q 0
  1. GETACT(ACTSEL,ARR) ;
  1. ;Aggregate total Active records has a SECID value
  1. I ACTSEL=2,$G(ARR("SECID"))'="" S TOTSECID=TOTSECID+1 Q
  1. ;Agreegate total Active records has an Email value
  1. I ACTSEL=3,$G(ARR("EMAIL"))'="" S TOTEMAIL=TOTEMAIL+1 Q
  1. ;Aggregate total Active records has a NT UserName value
  1. I ACTSEL=4,$G(ARR("NTUSR"))'="" S TOTNTUSR=TOTNTUSR+1 Q
  1. ;Aggregate all - SECID, AUPDN and NT UserName
  1. I ACTSEL=1 D
  1. .I $G(ARR("SECID"))'="" S TOTSECID=TOTSECID+1
  1. .I $G(ARR("EMAIL"))'="" S TOTEMAIL=TOTEMAIL+1
  1. .I $G(ARR("NTUSR"))'="" S TOTNTUSR=TOTNTUSR+1
  1. Q