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

AMQQATA.m

Go to the documentation of this file.
AMQQATA ;IHS/CMI/THL - GETS ATTRIBUTE ;
 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
 ;-----
EN ; - ENTRY POINT -
ATTRIB I '$D(AMQQCNAM) S AMQQQUIT="" Q
 I $D(AMQQRSAF) G AUTO
 K ^UTILITY("AMQQ REFUSAL",$J)
 K AMQQNATF,AMQQLCOF,AMQQCHRT
 W !
 W:$D(AMQQKONG) "[OR#",AMQQKGNO,"] "
 W "Attribute of ",AMQQCNAM,": "
 R X:DTIME E  S AMQQQUIT="" Q
CKX I $E(X)=U S AMQQQUIT="" Q
 I $E(X)="\" S X=$E(X,2,999),AMQQLCOF=""
 I X="",'$D(AMQQGTX),AMQQUATN=1,'$D(AMQQKONG),'$D(AMQQRAND) G ATTRIB
 I X="",'$D(AMQQGTX),AMQQUATN=1,$D(AMQQRAND),'$D(^UTILITY("AMQQ",$J,"Q")) S AMQQUATN=2,^UTILITY("AMQQ",$J,"WEIGHT",1,1)="",^UTILITY("AMQQ",$J,"Q",1)="3^NAME^F^^^^^'=^;;;EXISTS^^0.00^W ?6,""NAME""^^1^'=;;;;EXISTS;;" Q:AMQQCCLS="P"
 I $T,AMQQCCLS="V" S ^UTILITY("AMQQ",$J,"Q",1)="133^DATE OF VISIT^D^^^^^^^^^^^^0;999999999;" Q
 I X="" Q
 I X?3."?",AMQQCCLS="P" D ITEM^AMQQHELP G ATTRIB
 I X="??"!(X?3."?"&(AMQQCCLS="V")) S X="AF^"_$S(AMQQCCLS="H":16,AMQQCCLS="V":17,1:11) D RUN^AMQQHELP W:AMQQCCLS'="H"&(AMQQCCLS'="V") !,"Type ""???"" to see a complete list of attributes",!! G ATTRIB
 I X?1."?" N %A,%B S XQH=$O(^DIC(9.2,"B","AMQQATTRIBUTE","")) D EN1^XQH G ATTRIB
AUTO ; ENTRY POINT FROM AMQQQ
 I $D(AMQQRSAF) K AMQQRSAF S X="`"_$S(AMQQCCLS="P":109,1:220)
 I $E(X)="[" S AMQQCHRT=X,X="COHORT",AMQQ("BP COHORT FLG")=""
 S %=$E(X,1,3)
 I %="DPT"!(%="DTP")!(%="DTa")!(%="OPV")!(%="IPV")!(%="MMR") S AMQQIMMS=X,X=% G ADIC
 S %=$E(X,1,2)
 I %="DT"!(%="TD")!(%="TT")!(%="Td")!(%="MR") S AMQQIMMS=X,X=%
ADIC S DIC="^AMQQ(5,"
 S DIC(0)="ES"
 ;PATCH XXX
 ;S DIC("S")="I '$P($G(^(4)),U,8),$P(^(0),U,2)=AMQQCCLS,+Y<466!(+Y>499) D:+Y>1000 OKATTRIB^AMQQATAL(+Y) K AMQQLDFN"
 S DIC("S")="I '$P($G(^(4)),U,8),$P(^(0),U,2)=AMQQCCLS D:+Y>1000 OKATTRIB^AMQQATAL(+Y) K AMQQLDFN"
 S D="C"
 I X="COHORT"!($D(AMQQNECO)) S DIC(0)=""
 D IX^DIC
 K DIC
 I Y=-1,"^"[$E(X) S:$E(X)=U AMQQQUIT="" Q
 I $D(AMQQXX) Q
EN1 ; ENTRY POINT FROM AMQQQ2
SECURITY I +Y'=-1 D ^AMQQSEC
 I Y=-1 W "  ??",*7 G ATTRIB
 D IMM
 I $D(AMQQSGFL) K AMQQSGFL
 E  K AMQQMULT
 I Y="TAX" S X="" Q
 I $P($G(^AMQQ(5,+Y,0)),U,4)=5 D MSR ;IHS/CIM/THL PATH 19 ALIGN MEASUREMENT IENS
 I +Y=265,$D(AMQQKONG) W !!,"Sorry, a double KONGLOMERATOR is a no-no!  Try another attribute.",!!,*7 S Y=-1 G ATTRIB
 I +Y=368,$P($G(^AMQQ(8,DUZ(2),0)),U,2)="" W !,"Sorry, your site manager has not identified any secondary facilities...",*7,! G ATTRIB
 I +Y=315 S AMQQVPF="" D ^AMQQSQP Q
 I +Y=227 D GENERIC Q:$D(AMQQQUIT)  W !! G ATTRIB
 I $P(^AMQQ(5,+Y,0),U,4)=99 W !,"Enter the specific name of the ",$P($P(Y,U,2),",")," or type '???' to see choices",!! G ATTRIB
EN2 ; 
 I $D(^AMQQ(5,+Y,2)) S AMQQATN=+Y,Z=0,X=^(2,1,0) D SCR1^AMQQ1 S X="",AMQQSCPF="" Q
 S %=^AMQQ(5,+Y,0)
 S AMQQATNM=$P(Y,U,2)
 S AMQQLINK=$P(%,U,5)
 S AMQQATN=+Y
 S AMQQSBCT=$P(%,U,20)
 I $P(^AMQQ(1,AMQQLINK,0),U,10)="AUPNVXAM"!($P(^(0),U,10)="AUPNVNTS") S %=$P(^(0),U,11) I %,'$D(^AUPNVXAM("B",%))&'$D(^AUPNVNTS("B",%)) S AMQQNOL="" W:'$D(AMQQXX) !,"No results for this exam are in the database.  Don't bother asking.",! G ATTRIB
 I $P($G(^AMQQ(5,+Y,0)),U,4)=22 D EXAM
 I AMQQLINK=9 D ^AMQQATAL I $D(AMQQNOL) K AMQQNOL S Y=-1 G ATTRIB
 I $D(AMQQNATF) G SETAT
 I $G(AMQQSBCT)="" S AMQQSBCT=$P(^AMQQ(1,AMQQLINK,0),U,5)
 I $D(AMQQKONG),$P(^AMQQ(1,AMQQLINK,0),U,7) D NOKONG G ATTRIB
 S Z=$P(^AMQQ(1,AMQQLINK,0),U,5)
 S Z=$P(^AMQQ(4,Z,0),U)
 I Z="C" D COHORT^AMQQAT1 Q:$D(AMQQQUIT)  G:'$D(AMQQCHRT) ATTRIB G SETAT
 I Z="R" D ^AMQQAT1 G:'($D(AMQQRAND)+$D(AMQQQUIT)) ATTRIB Q
 I Z="L"!(Z="G") S AMQQTNAR=$P(%,U,15),AMQQTDIC=U_$P(%,U,16),AMQQTLOK=U_$P(%,U,18),AMQQTTX="" S:$D(^AMQQ(5,+Y,3)) AMQQTTX=^(3) D ^AMQQTX Q:$D(AMQQQUIT)  I '$D(AMQQTAX) G ATTRIB
SETAT S %=^AMQQ(1,AMQQLINK,0)
 S AMQQCTXS=$P(%,U,7)
 S AMQQVCL=$P(%,U,6)
 S AMQQFTYP=$P(^AMQQ(4,$P(%,U,5),0),U)
 S AMQQCCHK=""
 I $D(^AMQQ(1,AMQQLINK,6)) S AMQQCCHK=^(6)
 Q
 ;
NOKONG W *7
 N %A,%B
 S XQH=$O(^DIC(9.2,"B","AMQQKONG",""))
 D EN1^XQH
 Q
 ;
GENERIC I $D(^UTILITY("AMQQ",$J,"SQ",0)) W !!,"Sorry...you have already defined the generic visit conditions.",!,"They cannot be changed after they are entered.",!,"Type '^' at the next prompt if you want to start over.",!!,*7 Q
 N AMQQUSQN,AMQQUATN,AMQQILIN,AMQQMULX,AMQQQ
 S AMQQUSQN=-1
 S AMQQUATN=99
 S AMQQILIN=99
 S AMQQGVF=""
 S Y="226^VISIT"
 D EN2
 I $D(AMQQQUIT) G GEXIT
 D CTXS^AMQQAT,EXIT^AMQQAT
 I $D(AMQQQUIT) G GEXIT
 I $D(AMQQXSQF) K AMQQXSQF D LIST^AMQQ
 D ^AMQQATL
 D ^AMQQATS
GEXIT K AMQQGVF
 Q
 ;
NATL ; NATURAL LANGUAGE CHECKER
 D ^AMQQN2
 W $C(13),?79,$C(13),"Attribute of ",AMQQCNAM,": ",X
 I $G(AMQQCTXS)+$D(AMQQFAIL) Q
 S AMQQNATF=AMQQNCND_";"_AMQQNVAL,Y=AMQQNATT
 Q
 ;
IMM ;IF LOOKUP OF IMMUNIZATION CHECK IMMUNIZATION VERSION AND CONVERT TO
 ;NEW IMMUNIZATION TERMS IS USING NEW IMMUNIZATION VERSION
 ;PATCH XXX
 Q:"^269^270^271^272^273^274^275^276^277^278^279^280^281^282^283^284^285^286^403^404^424^425^426^427^460^462^463^464^465^"'[(U_+Y_U)
 Q:'$D(^AUTTIMM(101,0))
 I +Y=269 S $P(Y,U)=466 Q
 I +Y=271 S $P(Y,U)=488 Q
 ;I +Y=272 S $P(Y,U)=467 Q
 I +Y=273 S $P(Y,U)=468 Q
 I +Y=274 S $P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