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

ADE697B.m

Go to the documentation of this file.
ADE697B ;IHS/HQW/MJL - DENTAL TABLE UPDATES;  [ 03/24/1999   8:35 AM ]
 ;;6.0;ADE;;APRIL 1999
 ;
 ;
OPSITE ;EP Dental Operative Site Changes
 ;
 N ADET,ADEFROM,ADETO,ADEJ,ADELINE,ADERTN
 Q:'$P($G(^ADEOPS(0)),U,3)
 D RSLT^ADE697A("Dental Operative Site Changes")
 F ADEJ=1:1:1 S ADERTN="^ADE6O"_ADEJ D
 . F ADET=1:2 S ADELINE="S ADEFROM=$T(OPMOD+"_ADET_ADERTN_")" X ADELINE Q:$P(ADEFROM,";",3)="END"  S ADELINE="S ADETO=$T(OPMOD+"_(ADET+1)_ADERTN_")" X ADELINE D OPMOD(ADEFROM,ADETO)
 . Q
 Q
 ;
OPMOD(ADEFROM,ADETO)         ;
 ;
 ;ADEFROM and ADETO are in the form:
 ;  ANATOMIC NAME^SYNONYM^MNEMONIC
 ;
 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^ADE697A($J("",15)_ADE("FROM",3)_"---->"_ADE("TO",3))
 S ADEDA=$O(^ADEOPS("B",ADE("FROM",3),0))
 Q:'ADEDA
 Q:'$D(^ADEOPS(ADEDA,0))
 S ADEDIE="^ADEOPS("
 S ADEDR=".01///"_ADE("TO",1)
 S ADEDR=ADEDR_";8802///"_ADE("TO",2)
 S ADEDR=ADEDR_";8801///"_ADE("TO",3)
 S ADEY=$$DIE^ADE697A(ADEDIE,ADEDA,ADEDR)
 I ADEY["ERR" D RSLT^ADE697A("ERROR: EDIT OPSITE FAILED => "_ADE("FROM",1)) Q
 Q
 ;
GROUP ;EP Code Edit Group Mods
 ;
 N ADET,ADEFROM,ADETO,ADEJ,ADELINE,ADERTN
 Q:'$P($G(^ADEDIT("GRP",0)),U,3)
 D RSLT^ADE697A("Dental Code Group Changes")
 D RSLT^ADE697A("  Converting to Primary Letter codes and Bar delimiters")
 F ADEJ=1:1:1 S ADERTN="^ADE6G"_ADEJ D
 . F ADET=1:2 S ADELINE="S ADEFROM=$T(OPMOD+"_ADET_ADERTN_")" X ADELINE Q:$P(ADEFROM,";",3)="END"  S ADELINE="S ADETO=$T(OPMOD+"_(ADET+1)_ADERTN_")" X ADELINE D GRPMOD(ADEFROM,ADETO)
 . Q
 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^ADE697A($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^ADE697A(ADEDIE,ADEDA,ADEDR)
 I ADEY["ERR" D RSLT^ADE697A("ERROR: EDIT GROUP FAILED => "_ADE("FROM",1)) Q
 Q
 ;
EDIT ;EP
 ;Disable Sealant & prophy age limits, prophy and perio surgery edits
 N ADEDJ,ADEDA,ADEDIE,ADEDR,ADEY,DA
 D RSLT^ADE697A("  Modifying DENTAL EDIT entries.")
 S ADEDIE="^ADEDIT("
 S ADEDR="1.4///N"
 F ADEDA=15,16,19,10,11,14,17,18 D
 . S ADEY=$$DIE^ADE697A(ADEDIE,ADEDA,ADEDR)
 ;
 N T,L,ADEJ
 D RSLT^ADE697A("Add New Data Entry Screens and Edits")
 F ADEJ=1:1:1 S ADERTN="^ADE6E"_ADEJ D
 . F T=1:1 S ADELINE="S L=$T(ADDEDIT+T"_ADERTN_")" X ADELINE S L=$P(L,";",3) Q:L="END"  D EDITADD(L)
 . Q
 ;Re-index file
RENDX D RSLT^ADE697A("Re-indexing Dental Edit File")
 K ^ADEDIT("AC"),^ADEDIT("AD")
 S DA=0,DIK="^ADEDIT(" F  S DA=$O(^ADEDIT(DA)) Q:'+DA  D
 . D IX^DIK
 Q
 ;
EDITADD(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^ADE697A("NOT ADDED: CODE EDIT EXISTS => "_N(1)_" TYPE "_N(2)) Q
 S ADEDR="1///"_N(2)
 S ADEDR=ADEDR_";3///"_N(3)
 S ADEDR=ADEDR_";4///"_N(4)
 S ADEDR=ADEDR_";2///"_N(5)
 S ADEDR=ADEDR_";2.4///"_N(6)
 S ADEDR=ADEDR_";6///"_N(7)
 S Y=$$FILE^ADE697A("^ADEDIT(",N(1),ADEDR,9002007.9)
 D ADDFAIL^ADE697A(N(1)):Y<0,ADDOK^ADE697A(N(1)):Y>0
 Q