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

ADE0603.m

Go to the documentation of this file.
ADE0603 ;IHS/HQT/MJL - DENTAL TABLE UPDATES [ 02/08/2000  3:03 PM ]
 ;;6.0;ADE;**3**;FEBRUARY 2000
CTL ;
 K ^TMP("ADE697",$J)
 D DASH,RSLT($J("",15)_"IHS DENTAL TABLE UPDATES")
 D RSLT("ADA Code Changes")
 F ADET=1:2 S ADEFROM=$T(ADAMODS+ADET) Q:$P(ADEFROM,";",3)="END"  S ADETO=$T(ADAMODS+(ADET+1)) D ADAMOD(ADEFROM,ADETO)
 Q
 ;
ADAMODS ;
 ;;FROM^3220^VITAL PULPOTOMY^2834^18^3^VIT PULPOTOMY^^^n
 ;;TO^3220^VITAL PULPOTOMY^2834^18^3^VIT PULPOTOMY^^^@
 ;;END
 ;
DIE(DIE,DA,DR)     ;EP
 K Y
 LOCK +(@(DIE_DA_")")):10
 E  D RSLT($J("",5)_"ERROR: "_"Entry '"_DIE_DA_"' Is locked -- unable to edit.") Q "ERROR"
 D ^DIE
 LOCK -(@(DIE_DA_")"))
 Q "OK"
 ;
FILE(DIC,X,ADEDR,DLAYGO) ;EP
 K DD,DO
 S:ADEDR]"" DIC("DR")=ADEDR
 S DIC(0)="L"
 D FILE^DICN
 Q Y
 ;
RSLT(X) ;EP
 S ^TMP("ADE697",$J,0)=$G(^TMP("ADE697",$J,0))+1,^(^(0))=X W:'$D(ZTQUEUED) !,X Q
 W:'$D(ZTQUEUED) !,X
 Q
 ;
DASH D RSLT(""),RSLT($TR($J("",$S($G(IOM):IOM-10,1:70))," ","-")),RSLT("")
 Q
 ;
ADAMOD(ADEFROM,ADETO)        ;EP
 ;ADEFROM and ADETO are in the form:
 ;  CODE^DESC^DX^EST MIN^
 ;  LVL^SYN^EXC^INACT^NOOPSITE^MN
 ;
 N ADEJ,ADE,ADEDA,ADEDIE,ADEDR,ADEY
 F ADEJ=2:1:11 S ADE("FROM",ADEJ-1)=$P(ADEFROM,U,ADEJ),ADE("TO",ADEJ-1)=$P(ADETO,U,ADEJ)
 D RSLT($J("",15)_ADE("FROM",1)_"---->"_ADE("TO",1))
 S ADEDA=$O(^AUTTADA("B",ADE("FROM",1),0))
 I 'ADEDA S ADEDA=$O(^AUTTADA("B",ADE("TO",1),0))
 I 'ADEDA D  Q
 . D RSLT(ADE("FROM",1)_" NOT PRESENT, "_ADE("TO",1)_" WILL BE ADDED.")
 . D ADAADD(U_$P(ADETO,U,2,11))
 . Q
 ; Modify ADA Code
 S ADEDIE="^AUTTADA("
 S ADEDR=".01////"_ADE("TO",1)
 F ADEJ=2:1:9 S ADEDR=ADEDR_";.0"_ADEJ_"///"_ADE("TO",ADEJ)
 S ADEDR=ADEDR_";8801///"_ADE("TO",10)
 S ADEY=$$DIE(ADEDIE,ADEDA,ADEDR)
 I ADEY["ERR" D RSLT("ERROR: EDIT ADA CODE FAILED => "_ADE("FROM",1)) Q
 Q
 ;
ADAADD(L) ;
 N ADEJ,N,Y,ADEDR
 F ADEJ=2:1:11 S N(ADEJ-1)=$P(L,U,ADEJ)
 I $D(^AUTTADA("B",N(1))) D RSLT("NOT ADDED: ADA CODE EXISTS => "_N(1)) Q
 S %=$O(^ICD9("AB",N(3),0))
 I '% D RSLT("NOT ADDED: ICD DIAGNOSIS "_N(3)_" DOES NOT EXIST => "_N(1)) Q
 S ADEDR=".02///"_N(2)
 S:N(4)=0 N(4)=""
 F ADEJ=3:1:9 S ADEDR=ADEDR_";.0"_ADEJ_"///"_N(ADEJ)
 S ADEDR=ADEDR_";8801///"_N(10)
 S Y=$$FILE("^AUTTADA(",N(1),ADEDR,9999999.31)
 D RSLT($J("",5)_$S(Y<0:"Error: Update Failed",1:"Updated")_" : "_N(1))
 Q