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

ADE0602.m

Go to the documentation of this file.
ADE0602 ;IHS/HQT/MJL - DENTAL TABLE UPDATES [ 12/20/1999  2:19 PM ]
 ;;6.0;ADE;**2**;NOVEMBER 1999
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)
 ; Changes made to 1351 so that 1351 is not restricted to a particular
 ; op site
 D RSLT("Update Data Entry Screens and Edits")
 F ADET=1:1 S ADEX=$P($T(UPDEDITS+ADET),";",3) Q:ADEX="END"  D EDITUPD(ADEX)
 ; Deactivates the edit codes for 1351
 S ADEDIE="^ADEDIT(",ADEDR="1.4///N"
 F ADEDA=14,17,19 S ADEY=$$DIE(ADEDIE,ADEDA,ADEDR)
 ; Modify the DENTAL CODE EDIT GROUP to remove 1351
 D RSLT("Dental Code Group Changes")
 F ADET=1:2 S ADEFROM=$T(GRPMODS+ADET) Q:$P(ADEFROM,";",3)="END"  S ADETO=$T(GRPMODS+(ADET+1)) D GRPMOD(ADEFROM,ADETO)
 D RSLT("Re-indexing Dental Edit File")
 K ^ADEDIT("AC"),^ADEDIT("AD")
 S DA=0,DIK="^ADEDIT(" F  S DA=$O(^ADEDIT(DA)) Q:'+DA  D IX^DIK
 Q
 ;
EDITUPD(L) ;
 N ADEJ,N,Y,ADEDR
 F ADEJ=2:1:8 S N(ADEJ-1)=$P(L,U,ADEJ)
 ;I $D(^ADEDIT("AD",N(1),N(2))) D RSLT("NOT ADDED: CODE EDIT EXISTS => "_N(1)_" TYPE "_N(2)) Q
 I $D(^ADEDIT("AD",N(1),N(2))) S DA=$O(^ADEDIT("AD",N(1),N(2),0)),DIK="^ADEDIT(" D ^DIK
 S ADEDR="1///"_N(2)_";3///"_N(3)_";4///"_N(4)_";2///"_N(5)_";2.4///"_N(6)_";6///"_N(7)
 S Y=$$FILE("^ADEDIT(",N(1),ADEDR,9002007.9)
 D RSLT($J("",5)_$S(Y<0:"Error: Update Failed",1:"Updated")_" : "_N(1))
 Q
 ;
UPDEDITS ;
 ;;^IH71^3^^1^IH71^X<20^W *7,"Patient must be 19 years old or younger"
 ;;^IH72^3^^1^IH72^X<20^W *7,"Patient must be 19 years old or younger"
 ;;END
 ;
ADAMODS ;
 ;;FROM^3220^VITAL PULPOTOMY^2834^18^3^VIT PULPOTOMY
 ;;TO^3220^VITAL PULPOTOMY^2834^18^3^VIT PULPOTOMY^^^n
 ;;FROM^3300^PULPECTOMY/ENDO ACCESS PREP, PERM. TOOTH^522.9^15^1^ACCESS PREP
 ;;TO^3300^PULPECTOMY/ENDO ACCESS PREP, PERM. TOOTH^522.9^15^1^ACCESS PREP^^T
 ;;FROM^5850^TISSUE CONDITIONING, MAXILLARY^525.1^30^3^TISSUE CONDIT.^^^^
 ;;TO^5850^TISSUE CONDITIONING, MAXILLARY^525.1^30^3^TISSUE CONDIT.^^^n^
 ;;END
 ;
GRPMODS ;
 ;;FROM^PERMANENT TOOTH PROCEDURES^
 ;;TO^PERMANENT TOOTH PROCEDURES^1355|2140|2150|2160|2161|2385|2540|2740|2750|2790|2810|2950|2952|2954|2960|3310|3311|3320|3321|3330|3331|3346|3347|3348|3351|3352|3353|3410|3421|3425|3430|3470|3950|3960|3961
 ;;FROM^PRIMARY TOOTH PROCEDURES^
 ;;TO^PRIMARY TOOTH PROCEDURES^2110|2120|2121|2130|2131|2380|2381|2382|2930|2932|3230
 ;;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))
 ;FHL 09/09/98 I 'ADEDA B  S ADEDA=$O(^AUTTADA("B",ADE("TO",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
 ;
GRPMOD(ADEFROM,ADETO)        ;
 ;
 ;ADEFROM and ADETO are in the form:
 ;  NAME^CODES
 ;
 N ADEJ,ADE,ADEDA,ADEDIE,ADEDR,ADEY
 F ADEJ=2:1:4 S ADE("FROM",ADEJ-1)=$P(ADEFROM,U,ADEJ),ADE("TO",ADEJ-1)=$P(ADETO,U,ADEJ)
 D RSLT($J("",15)_ADE("FROM",1)_"---->Converted")
 S ADEDA=$O(^ADEDIT("GRP","B",ADE("FROM",1),0))
 Q:'ADEDA
 Q:'$D(^ADEDIT("GRP",ADEDA,0))
 S ADEDIE="^ADEDIT(""GRP"","
 S ADEDR=""
 S ADEDR=ADEDR_"1///"_ADE("TO",2)
 I ADE("TO",3)]"" S ADEDR=ADEDR_";4///"_ADE("TO",3)
 S ADEY=$$DIE(ADEDIE,ADEDA,ADEDR)
 I ADEY["ERR" D RSLT("ERROR: EDIT GROUP FAILED => "_ADE("FROM",1)) Q
 Q
 ;