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

BQIDCMSP.m

Go to the documentation of this file.
  1. BQIDCMSP ;VNGT/HS/ALA-MY PATIENTS-SPECIALTY PROVIDER ; 12 Dec 2008 1:42 PM
  1. ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
  1. ;
  1. Q
  1. ;
  1. FND(DATA,PARMS,MPARMS) ;EP - Find records
  1. ;
  1. ;Description
  1. ; Executable that finds all patients who has a designated case manager
  1. ;Input
  1. ; PARMS = Array of parameters and their values
  1. ; MPARMS = Multiple array of a parameter (not currently used for this definition)
  1. ;Expected to return DATA
  1. ;
  1. ; If the DSPM package is not installed, quit as there is no other case manager
  1. ; alternative
  1. I $$VERSION^XPDUTL("BDP")="" Q
  1. ;
  1. NEW UID,NM,PSPEC,SPEC,DFN,PROV
  1. S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
  1. S DATA=$NA(^TMP("BQIDCMCM",UID))
  1. K @DATA
  1. ;
  1. ; Set the parameters into variables
  1. I '$D(PARMS),'$D(MPARMS) Q
  1. ;
  1. S NM=""
  1. F S NM=$O(PARMS(NM)) Q:NM="" D
  1. . S @NM=$P(PARMS(NM),U,1)
  1. . F I=2:1:$L(PARMS(NM),U) S @($P(PARMS(NM),U,I))
  1. ;
  1. ; Go through the BDP DESG SPECIALTY PROVIDER File to find any patient
  1. ; with the specified case manager
  1. ;
  1. S IEN=""
  1. F S IEN=$O(^BDPRECN("AC",PROV,IEN)) Q:IEN="" D
  1. . S PSPEC=$$GET1^DIQ(90360.1,IEN_",",.01,"I")
  1. . I $G(SPEC)'="",PSPEC'=SPEC Q
  1. . I $D(MPARMS("SPEC")),'$D(MPARMS("SPEC",PSPEC)) Q
  1. . S DFN=$$GET1^DIQ(90360.1,IEN_",",.02,"I") I DFN="" Q
  1. . ; User may now select Living, Deceased or both as a filter so
  1. . ; if no filters defined assume living patients otherwise let filter decide
  1. . I $O(^BQICARE(OWNR,1,PLIEN,15,0))="",$P($G(^DPT(DFN,.35)),U,1)'="" Q
  1. . ; If patient has no active HRNs, quit
  1. . I '$$HRN^BQIUL1(DFN) Q
  1. . ; If patient has no visit in last 3 years, quit
  1. . ;I '$$VTHR^BQIUL1(DFN) Q
  1. . S @DATA@(DFN)=""
  1. Q