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

ADEUTL.m

Go to the documentation of this file.
  1. ADEUTL ; IHS/HQT/MJL - PROGRAM ; [ 03/24/1999 9:04 AM ]
  1. ;;6.0;ADE;;APRIL 1999
  1. ;
  1. SETTYP ;EP
  1. ;Called by MUMPS X-ref
  1. ;Set "AD" Xref on Edit Type field of Dental Edit file
  1. S ^ADEDIT("AD",$P(^ADEDIT(DA,0),U),X,DA)=""
  1. Q
  1. ;
  1. KILTYP ;EP
  1. ;Called by MUMPS X-ref
  1. ;Kill "AD" Xref on Edit Type field of Dental Edit file
  1. K ^ADEDIT("AD",$P(^ADEDIT(DA,0),U),X,DA)
  1. Q
  1. ;
  1. SETEDT ;EP
  1. ;Called by MUMPS X-ref
  1. ;Set "AC" Xref on Resolution Type field of Dental Edit file
  1. N ADEJ,ADEGRP
  1. I $P(^ADEDIT(DA,0),U)'["[" S ^ADEDIT("AC",$P(^ADEDIT(DA,0),U),$E(X,1,30),DA)="" Q
  1. D GRPEDT
  1. F ADEJ=1:1:$L(ADEGRP,"|") D
  1. . S ^ADEDIT("AC",$P(ADEGRP,"|",ADEJ),$E(X,1,30),DA)=""
  1. Q
  1. K ADEGRP ;*NE
  1. ;
  1. KILEDT ;EP
  1. ;Called by MUMPS X-ref
  1. ;Kill "AC Xref on Resolution Type field of Dental Edit File
  1. N ADEJ,ADEGRP
  1. I $P(^ADEDIT(DA,0),U)'["[" K ^ADEDIT("AC",$P(^ADEDIT(DA,0),U),$E(X,1,30),DA) Q
  1. D GRPEDT
  1. F ADEJ=1:1:$L(ADEGRP,"|") D
  1. . K ^ADEDIT("AC",$P(ADEGRP,"|",ADEJ),$E(X,1,30),DA)
  1. Q
  1. ;
  1. GRPEDT ;Called by KILEDT and SETEDT to get list of codes in edit group
  1. S ADEGRP=$P($P(^ADEDIT(DA,0),U),"[",2)
  1. S ADEGRP=$O(^ADEDIT("GRP","B",ADEGRP,0))
  1. S ADEGRP=$P(^ADEDIT("GRP",ADEGRP,1),U)
  1. Q
  1. ;
  1. ENABLE(ADECOD,ADENBL) ;EP
  1. ;Enables (ADENBL=1) or disables (ADENBL=0) code edit ADECOD
  1. ;ADECOD is unique entry in ^ADEDIT(
  1. ;Currently, this sub is only used to toggle the
  1. ;state of the 1350 sealant code edit. If it's to be used
  1. ;on other edits that do not have unique ADEDIT keys, then
  1. ;a new ADEDIT field will need to be created and initialized
  1. ;with unique entries. For now, the 1350 code is unique.
  1. ;
  1. Q:ADECOD=""
  1. Q:'$D(^ADEDIT("B",ADECOD))
  1. S ADECOD=$O(^ADEDIT("B",ADECOD,0))
  1. Q:'+ADECOD
  1. Q:'$D(^ADEDIT(ADECOD,0))
  1. S DR="1.4///"_$S(ADENBL:"Y",1:"N")
  1. S DIE="^ADEDIT(",DA=ADECOD
  1. D ^DIE
  1. Q
  1. ;
  1. FY(ADEVDATE) ;EP
  1. ;Returns FM-date form of the first day of the fiscal
  1. ;year in which ADEVDATE falls
  1. ;ADEVDATE is not in FM-date form
  1. ;
  1. N ADEVFM,ADEFY,ADEJ,ADEK,ADECNT,ADENDFY,ADEFV,ADERV
  1. S %DT="T",X=ADEVDATE D ^%DT S ADEVFM=Y
  1. ;beginning Y2K fix
  1. ;S ADEFY=1000
  1. ;S ADEFY="2"_$S($E(ADEVFM,4,5)<10:$E(ADEVFM,2,3)-1,1:$E(ADEVFM,2,3))_ADEFY
  1. ;S ADENDFY=ADEFY,$E(ADENDFY,2,3)=$E(ADENDFY,2,3)+1
  1. Q:ADEVFM=-1 0 ;Y2000
  1. S ADEFY=$P($$FISCAL^XBDT(ADEVFM),U,2) ;Y2000
  1. ;end Y2K fix block
  1. Q ADEFY