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

AMQQSQP.m

Go to the documentation of this file.
AMQQSQP ; IHS/CMI/THL - SPECIAL SUBQUERY FOR PROVIDERS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
INTRO W @IOF,?17,"*****  PROVIDER-RELATED CRITERIA  *****"
 W !!!,"You can either specify one or more providers by NAME, or.....",!
 W "You can specify one or more PROVIDER ATTRIBUTES (affiliation, specialty, etc)"
 W !,"to be used as selection criteria.",!!!
 S DIR(0)="SO^1:NAME(S) of providers;2:ATTRIBUTE(S) of providers"
 S DIR("A")=$C(10)_"     Your choice"
 S DIR("B")="NAME(S)"
 D ^DIR
 K DIR
 I $D(DUOUT)+$D(DTOUT) K DUOUT,DIRUT,DTOUT S AMQQQUIT="" G EXIT
 I Y="" Q
 S AMQQSQPY=Y
RUN D @$P("NAME^ATT",U,Y)
 I $D(AMQQQUIT) G EXIT
 I $D(AMQQSQPQ) K AMQQSQPQ G EXIT
 D PRIME
 I $D(AMQQSQPQ)!($D(AMQQQUIT)) K AMQQSQPQ G EXIT
 D @$P("SETN^SETA",U,AMQQSQPY)
 I '$D(AMQQXX),AMQQSQFN>1 W !! F %=0:0 S %=$O(^UTILITY("AMQQ",$J,"SQL",AMQQUSQN,%)) Q:'%  W ! X ^(%)
EXIT K X,Y,AMQQSQPH,AMQQSQPL,AMQQSQPY,%,Z,AMQQSQP
 W !!
 Q
 ;
NAME N AMQQTAX
 S X=35
 D EN1^AMQQTX
 I '$D(AMQQTAX) S AMQQSQPQ="",AMQQQUIT="" Q
 S AMQQSQP=AMQQTAX
 S (AMQQSQP1,AMQQSQP2)=AMQQUQQN+1+('$D(AMQQVPF))
 Q
 ;
PRIME W !!,"When I check the providers from each encounter, you can limit my analysis"
 W !,"to the PRIMARY provider only, SECONDARY providers, or ALL providers.",!!
 S DIR(0)="SO^1:PRIMARY provider only;2:SECONDARY providers only;3:ALL providers"
 S DIR("A")=$C(10)_"     Your choice"
 S DIR("B")="ALL"
 D ^DIR
 K DIR
 I $D(DUOUT)+$D(DTOUT) K DUOUT,DIRUT,DTOUT S (Y,AMQQQUIT)=""
 I Y="" Q
 S AMQQSQPS=Y
 S AMQQSQPL=$S(AMQQSQPS=1:"PRIMARY",AMQQSQPS=2:"SECONDARY",1:"")
 I AMQQSQPL'="" S AMQQSQPL=AMQQSQPL_" "
 Q
 ;
SETA I $D(AMQQVPF) D SETVP G SETA1
 D CHK
 S ^UTILITY("AMQQ",$J,"SQL",AMQQUSQN,AMQQSQFN)="W ?"_$S($D(AMQQGVF):6,1:((3*AMQQUSQL)+6))_","""_AMQQSQPL_"PROVIDER ATTRIBUTES"""
 S ^UTILITY("AMQQ",$J,"QQ",AMQQSQPH)="212^PROVIDER^Y^0^^^^^"_AMQQSQPS_";"_AMQQSQP1_";"_AMQQSQP2_"^^^^^^"_AMQQSQPS_";"_AMQQSQP1_";"_AMQQSQP2
 S ^UTILITY("AMQQ",$J,"SQ",AMQQUSQN,AMQQSQFN)="0^LINK^22^SUB^AMQQF1^V^"_AMQQSQPH
 D SQIX
SETA1 S AMQQSQFN=AMQQSQFN+1
 Q
 ;
SETN I $D(AMQQVPF) D SETVP G SETN1
 D CHK
 D SETZ
 S Z=AMQQSQPL_"PROVIDERS "_Z
 S ^UTILITY("AMQQ",$J,"SQL",AMQQUSQN,AMQQSQFN)="W ?"_$S($D(AMQQGVF):6,1:((3*AMQQUSQL)+6))_","""_Z_""""
 S AMQQUQQN=AMQQUQQN+1
 S ^UTILITY("AMQQ",$J,"QQ",AMQQUQQN)="212^PROVIDER^Y^0^^^^^"_AMQQSQPS_";"_AMQQSQP1_";"_AMQQSQP2_"^^^^^^"_AMQQSQPS_";"_AMQQSQP1_";"_AMQQSQP2
 S ^UTILITY("AMQQ",$J,"SQ",AMQQUSQN,AMQQSQFN)="0^LINK^22^SUB^AMQQF1^V^"_AMQQUQQN
 D SQIX
 S AMQQSQFN=AMQQSQFN+1
SETN1 S AMQQUQQN=AMQQUQQN+1
 S ^UTILITY("AMQQ",$J,"QQ",AMQQUQQN)="203^PROVIDER^L^0^^^^^;;;"_AMQQSQP_"^^^^^1^"_AMQQSQP_";"_AMQQSQP_";^0^"_AMQQSQP
 Q
 ;
SETZ N AMQQQ
 S AMQQQ="203^^^^^^^^;;;"_AMQQSQP,Z="" I AMQQSQPY=1 D ZSET^AMQQATL1
 Q
 ;
SETVP S AMQQLINK=212
 S AMQQATNM="PROVIDER"
 S AMQQCTXS=0
 S AMQQCOMP=AMQQSQPS_";"_AMQQSQP1_";"_AMQQSQP2_";"_$G(AMQQSQP),AMQQNVAR=1,AMQQFTYP="Y",AMQQSQFN=0
 I AMQQSQPY=2 S AMQQLINK=212.1
 K AMQQTAX
 Q
 ;
CHK I AMQQSQFN=1 D SET1^AMQQSQS S AMQQSQQQ="Next"_$S($D(AMQQGVF):" generic visit condition",1:(" condition of """_AMQQSQSJ_""""))_": "
 Q
 ;
SQIX I '$D(AMQQGVF) S %=@$S(AMQQUSQL>1:"AMQQSQAA",1:"AMQQUATN"),X=$S(AMQQUSQL>1:"SQXS",1:"SQXQ") I '$D(^UTILITY("AMQQ",$J,X,%)) S ^(%,1)=""
 Q
 ;
ATT N AMQQSQQF,AMQQCCLS,AMQQQ,AMQQLINK,AMQQFTYP,AMQQCTXS,AMQQCOND,AMQQNOCO,AMQQCONM,AMQQSYMB,AMQQCOMP,AMQQVCL,AMQQSER,AMQQORTX,AMQQFRED,AMQQNVAR,AMQQFILT,AMQQSNOT,AMQQTAX,AMQQUATN,AMQQATNM,AMQQCNAM
 S AMQQSQPH=AMQQUQQN+('$D(AMQQVPF))
 S AMQQCCLS="H"
 S AMQQCNAM="PROVIDER"
 S AMQQUATN=1
ATT1 S AMQQQ=""
 W !!
 D ATT2
 I $G(AMQQQ)="" S AMQQSQP1=AMQQSQPH+1,AMQQSQP2=AMQQUQQN S:AMQQUQQN<AMQQSQPH AMQQSQPQ="" Q
 I AMQQUQQN<AMQQSQPH S AMQQUQQN=AMQQUQQN+1
 S (AMQQSQQF,AMQQUQQN)=AMQQUQQN+1
 S AMQQUATN=AMQQUATN+1
 D ^AMQQATS
 I '$D(AMQQVPF) D ALIST
 G ATT1
 Q
 ;
ATT2 N AMQQVPF
 D ^AMQQAT
 Q
 ;
ALIST S %=AMQQSQFN
 N AMQQSQLS,AMQQSQCT,AMQQSQFN,AMQQSQNN
 S AMQQSQFN=+(%_"."_AMQQSQQF)
 S AMQQSQLS="W ?"_$S($D(AMQQGVF):9,$D(AMQQUSQL):(3*AMQQUSQL+6),1:9)_","""
 S AMQQSQNN=AMQQUSQN+1
 S AMQQSQCT="V"
 D EN1^AMQQSQL
 Q
 ;