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

ADEGRL5B.m

Go to the documentation of this file.
ADEGRL5B ; IHS/HQT/MJL - DENTAL CODE EDITS PT 2 ;  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;;APRIL 1999
RESOLVE ;EP - DO APPROPRIATE RESOLUTION
 I ADERTYP=1 D R1
 I ADERTYP=2 D R2
 I ADERTYP=3 D R3
 Q
R1 ;RESOLUTION 1 - REJECT CODE (WITH MESSAGE)
 I '$D(ADEOPC) K ADEV(ADECOD)
 I $D(ADEOPC),+ADEV(ADECOD)<2 K ADEV(ADECOD)
 I $D(ADEOPC),$D(ADEV(ADECOD)) S ADEV(ADECOD)=$$DELOP^ADEGRL5C(ADEOPC,ADEV(ADECOD))
 W !,ADECOD," " W:$D(ADEOPC) "OPSITE ",^ADEOPS(ADEOPC,88) W ":  "
 X ^ADEDIT(ADERDFN,3)
 ;W !,"Return data entry SLIP TO REPORTING DENTIST FOR CORRECTION"
 S ADEXFLG=1
 Q
R2 ;RESOLUTION 2 - CHANGE CODE -- ONLY NON OPSITE CODES
 ;HAVE TO PUT CHANGED CODE BACK THRU EDITS VIA RECURSION
 ;BUT BE CAREFUL OF ENDLESS LOOPS!
 N ADETMP
 S ADETMP=$P(^ADEDIT(ADERDFN,2),U,3)
 I $D(ADEOPC) D R2A S ADEREDO=1 D R2CUR Q
 I '$D(ADEOPC) D R2B S ADEREDO=1 D R2CUR Q
 Q
R2CUR ;Call ADEGRL5A recursively
 N ADECOD
 S ADECOD=ADETMP
 D ^ADEGRL5A
 Q  ;QUITTING R2CUR
R2A ;First, delete the opsite from current adev(adecod)
 N ADESFC
 S ADESFC=$$GETSFC^ADEGRL5C(ADEOPC,ADEV(ADECOD))
 I +ADEV(ADECOD)<2 K ADEV(ADECOD),ADES(ADECOD)
 E  S ADEV(ADECOD)=$$DELOP^ADEGRL5C(ADEOPC,ADEV(ADECOD))
 ;next, if adev(adetmp) doesnt exist, create it
 I '$D(ADEV(ADETMP)) S ADEV(ADETMP)="" S ADEDES(ADETMP)=$$DES^ADEGRL5B(ADETMP)
 ;next, add the opsite to adev(adetmp).
 S ADEV(ADETMP)=$$ADDOP^ADEGRL5(ADEOPC,ADESFC,ADEV(ADETMP))
 W !,ADECOD," OPSITE ",^ADEOPS(ADEOPC,88),": recoded to ",ADETMP
 S ADEXFLG=1
 Q
R2B S ADEV(ADETMP)=ADEV(ADECOD),ADEXFLG=1
 W !,ADECOD," recoded to ",ADETMP
 K ADEV(ADECOD),ADEDES(ADECOD)
 S ADEDES(ADETMP)=$$DES(ADETMP)
 Q
R3 ;RESOLUTION 3 - FLAG AS NON-REPORTABLE
 I '$D(ADEOPC) S $P(ADEV(ADECOD),U,5)="y"
 I $D(ADEOPC),+ADEV(ADECOD)<2 S $P(ADEV(ADECOD),U,5)="y"
 I $D(ADEOPC),$D(ADEV(ADECOD)) S ADEV(ADECOD)=$$NONREP(ADEOPC,ADEV(ADECOD))
 I $D(ADEOPC),'$D(ADENRP(ADECOD,ADEOPC)) W !,ADECOD," " W:$D(ADEOPC) "OPSITE ",^ADEOPS(ADEOPC,88) W ": " S ADENRP(ADECOD,ADEOPC)="" X ^ADEDIT(ADERDFN,3)
 I '$D(ADEOPC),$D(ADENRP(ADECOD))'=1 W !,ADECOD,":" S ADENRP(ADECOD)="" X ^ADEDIT(ADERDFN,3)
 S ADEXFLG=1
 Q
 ;
RETURN ;EP - Press return to continue
 N DIR
 S DIR(0)="FAO^1:1",DIR("A")="Press 'Return' to continue... "
 W ! D ^DIR
 K DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
 Q
 ;
DES(ADETMP) ;EP - Returns short description of ADA CODE ADETMP
 S ADETMP=$O(^AUTTADA("B",ADETMP,0))
 S ADETMP=$P(^AUTTADA(ADETMP,0),U,6)
 Q ADETMP
 ;
NONREP(ADEOPC,ADEVCOD) ;Mark opsite ADEOPC in ADEVCOD unreportable
 N ADETST,ADEJ,ADENONR
 S ADETST=$P(ADEVCOD,U,2),ADENONR=$P(ADEVCOD,U,5)
 F ADEJ=1:1:+ADEVCOD I ADEOPC=$P(ADETST,",",ADEJ) S $P(ADENONR,",",ADEJ)="y" Q
 S $P(ADEVCOD,U,5)=ADENONR
 Q ADEVCOD
 K ADEVCOD ;*NE