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

BQIPDSCL.m

Go to the documentation of this file.
  1. BQIPDSCL ;GDHD/HCS/ALA-Panel Filter Description continued ; 13 Feb 2017 12:09 PM
  1. ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
  1. ;
  1. ASPARM(FN) ;EP - Retrieve associated parameters from single value field
  1. NEW AP,APRM,ASTR
  1. ;First look for single value parameter
  1. S AP=0
  1. F S AP=$O(^BQICARE(OWNR,1,PLIEN,15,FN,2,AP)) Q:'AP D
  1. . NEW DA,IENS,APNAME,AVALUE,APTYP
  1. . S DA(3)=OWNR,DA(2)=PLIEN,DA(1)=FN,DA=AP,IENS=$$IENS^DILF(.DA)
  1. . S APNAME=$$GET1^DIQ(90505.1152,IENS,.01,"E") Q:APNAME=""
  1. . S APTYP=$$PTYP^BQIDCDF(FSOURCE,APNAME)
  1. . S AVALUE=$$GVAL^BQIPDSCF(APTYP,90505.1152,IENS,FSOURCE,APNAME)
  1. . I AVALUE'="" S APRM(APNAME)=AVALUE
  1. . ;
  1. . ;Now try looking for multi value parameter
  1. . I AVALUE="" D
  1. .. NEW MAP
  1. .. S MAP=0
  1. .. F S MAP=$O(^BQICARE(OWNR,1,PLIEN,15,FN,2,AP,1,MAP)) Q:'MAP D
  1. ... NEW DA,IENS,AVAL
  1. ... S DA(4)=OWNR,DA(3)=PLIEN,DA(2)=FN,DA(1)=AP,DA=MAP,IENS=$$IENS^DILF(.DA)
  1. ... S AVAL=$$GET1^DIQ(90505.11521,IENS,.01,"E")
  1. ... S AVAL=$$GMVAL^BQIPDSCF(APTYP,90505.11521,IENS,FSOURCE,APNAME)
  1. ... I AVAL'="" S AVALUE=AVALUE_$S(AVALUE="":"",1:$C(29))_AVAL
  1. .. S:AVALUE]"" APRM(APNAME)=AVALUE
  1. S ASTR=""
  1. S APRM="" F S APRM=$O(APRM(APRM)) Q:APRM="" D
  1. . ;
  1. . ;Form associate string
  1. . S ASTR=ASTR_$S(ASTR="":"",1:$C(26))_APRM_$C(28)_APRM(APRM)
  1. Q ASTR
  1. ;
  1. ASMPARM(MN) ;EP - Retrieve associated parameters from multiple value field
  1. NEW AP,APRM,ASTR
  1. ;First look for single value parameter
  1. S AP=0
  1. F S AP=$O(^BQICARE(OWNR,1,PLIEN,15,FN,1,MN,2,AP)) Q:'AP D
  1. . NEW DA,IENS,APNAME,AVALUE,APTYP
  1. . S DA(4)=OWNR,DA(3)=PLIEN,DA(2)=FN,DA(1)=MN,DA=AP,IENS=$$IENS^DILF(.DA)
  1. . S APNAME=$$GET1^DIQ(90505.11512,IENS,.01,"E") Q:APNAME=""
  1. . S APTYP=$$PTYP^BQIDCDF(FSOURCE,APNAME)
  1. . S AVALUE=$$GVAL^BQIPDSCF(APTYP,90505.11512,IENS,FSOURCE,APNAME)
  1. . I AVALUE'="" S APRM(APNAME)=AVALUE
  1. . ;Now try looking for multi value parameter
  1. . I AVALUE="" D
  1. .. NEW MAP
  1. .. S MAP=0
  1. .. F S MAP=$O(^BQICARE(OWNR,1,PLIEN,15,FN,1,MN,2,AP,1,MAP)) Q:'MAP D
  1. ... NEW DA,IENS,AVAL
  1. ... S DA(5)=OWNR,DA(4)=PLIEN,DA(3)=FN,DA(2)=MN,DA(1)=AP,DA=MAP,IENS=$$IENS^DILF(.DA)
  1. ... S AVAL=$$GET1^DIQ(90505.115121,IENS,.01,"E")
  1. ... S AVAL=$$GMVAL^BQIPDSCF(APTYP,90505.115121,IENS,FSOURCE,APNAME)
  1. ... I AVAL'="" S AVALUE=AVALUE_$S(AVALUE="":"",1:$C(29))_AVAL
  1. .. S:AVALUE]"" APRM(APNAME)=AVALUE
  1. S ASTR=""
  1. S APRM="" F S APRM=$O(APRM(APRM)) Q:APRM="" D
  1. . ;Form associate string
  1. . S ASTR=ASTR_$S(ASTR="":"",1:$C(26))_APRM_$C(28)_APRM(APRM)
  1. Q ASTR
  1. ;
  1. NVIS(PORD,VALUE,ASTR) ;EP - Assemble number of visits
  1. NEW I,CLIN,PROV,STR,N1,N2,FND,V,VAL
  1. S ASTR=$G(ASTR,"")
  1. S (CLIN,PROV)=""
  1. F I=1:1:$L($G(ASTR),$C(26)) D
  1. . NEW FINFO,FNAME,FVAL,NVAL,PC
  1. . S FINFO=$P(ASTR,$C(26),I)
  1. . S FNAME=$P(FINFO,$C(28)) Q:FNAME=""
  1. . S FVAL=$P(FINFO,$C(28),2) Q:FVAL=""
  1. . S NVAL=""
  1. . F PC=1:1:$L(FVAL,$C(29)) D
  1. .. S VAL=$P(FVAL,$C(29),PC) S:VAL]"" NVAL=NVAL_$S(NVAL]"":", ",1:"")_VAL
  1. . I FNAME]"",NVAL]"" S @FNAME=NVAL
  1. ;
  1. ;Get visit number(s)
  1. S (N1,FND)="" F I=1:1:$L(VALUE) Q:(FND=1&($E(VALUE,I)'?1N)) I $E(VALUE,I)?1N S N1=N1_$E(VALUE,I),FND=1
  1. Q:N1=""
  1. S (N2,FND)="" I I<$L(VALUE) F I=I:1:$L(VALUE) Q:(FND=1&($E(VALUE,I)'?1N)) I $E(VALUE,I)?1N S N2=N2_$E(VALUE,I),FND=1
  1. ;
  1. S STR="# of Visits"
  1. I CLIN]"" S STR=STR_" in clinic "_CLIN
  1. I PROV]"" S STR=STR_" for provider "_PROV
  1. ;
  1. S V=VALUE
  1. I V["~",V["'" S STR=STR_" in range (inclusive) "_N1_" thru "_N2
  1. E I V["~" S STR=STR_" out of range (exclusive) less than "_N1_" or greater than "_N2
  1. E I V["'<" S STR=STR_" greater than or equal to "_N1
  1. E I V["'>" S STR=STR_" less than or equal to "_N1
  1. E I V["<" S STR=STR_" less than "_N1
  1. E I V[">" S STR=STR_" greater than "_N1
  1. E S STR=STR_" equal to "_N1
  1. S VALUE=STR
  1. Q