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

EC2P132C.m

Go to the documentation of this file.
EC2P132C ;ALB/DE - EC National Procedure Update ; 4/8/16 11:00am
 ;;2.0;EVENT CAPTURE;**132**;8 May 96;Build 3
 ;
 ;this routine is used as a post-init in a KIDS build
 ;to modify the EC National Procedure file (#725)
 ;
 Q
 ;
INACT ;* inactivate national procedures
 ;
 ;  ECXX is in format:
 ;   NATIONAL NUMBER^INACTIVATION DATE^FIRST NATIONAL NUMBER SEQUENCE^
 ;   LAST NATIONAL NUMBER SEQUENCE
 ;
 N ECX,ECXX,ECEXDT,ECINDT,ECDA,DIC,DIE,DA,DR,X,Y,%DT,ECBEG,ECEND,ECADD
 N ECSEQ,ECCODE,ECCODX
 D MES^XPDUTL(" ")
 D BMES^XPDUTL("Inactivating procedures EC NATIONAL PROCEDURE File (#725)...")
 D MES^XPDUTL(" ")
 F ECX=1:1 K DD,DO,DA S ECXX=$P($T(OLD+ECX),";;",2) Q:ECXX="QUIT"  D
 .S ECEXDT=$P(ECXX,U,2),X=ECEXDT,%DT="X" D ^%DT S ECINDT=$P(Y,".",1)
 .S ECCODE=$P(ECXX,U),ECBEG=$P(ECXX,U,3),ECEND=$P(ECXX,U,4),ECCODX=ECCODE
 .I ECBEG="" D UPINACT Q
 .F ECSEQ=ECBEG:1:ECEND D
 ..S ECADD="000"_ECSEQ,ECADD=$E(ECADD,$L(ECADD)-2,$L(ECADD))
 ..S ECCODE=ECCODX_ECADD
 ..D UPINACT
 Q
UPINACT ;Update codes as inactive
 ;
 S ECDA=+$O(^EC(725,"D",ECCODE,0))
 I $D(^EC(725,ECDA,0)) D
 .S DA=ECDA,DR="2///^S X=ECINDT",DIE="^EC(725," D ^DIE
 .D MES^XPDUTL(" ")
 .D BMES^XPDUTL("   "_ECCODE_" inactivated as of "_ECEXDT_".")
 Q
 ;
OLD ;national procedures to be inactivated - national code #^inact. date
 ;;SD001^10/1/2016
 ;;SD002^10/1/2016
 ;;SD003^10/1/2016
 ;;SD004^10/1/2016
 ;;SD005^10/1/2016
 ;;SD006^10/1/2016
 ;;SD007^10/1/2016
 ;;SD008^10/1/2016
 ;;SD009^10/1/2016
 ;;SD012^10/1/2016
 ;;SD013^10/1/2016
 ;;SD014^10/1/2016
 ;;SD015^10/1/2016
 ;;SD016^10/1/2016
 ;;SD017^10/1/2016
 ;;SD018^10/1/2016
 ;;SD019^10/1/2016
 ;;SD020^10/1/2016
 ;;SD021^10/1/2016
 ;;SD022^10/1/2016
 ;;SD023^10/1/2016
 ;;SD024^10/1/2016
 ;;SD025^10/1/2016
 ;;SD026^10/1/2016
 ;;SD027^10/1/2016
 ;;SD028^10/1/2016
 ;;SD029^10/1/2016
 ;;SD030^10/1/2016
 ;;SD031^10/1/2016
 ;;SD032^10/1/2016
 ;;SD033^10/1/2016
 ;;SD034^10/1/2016
 ;;SD035^10/1/2016
 ;;SD036^10/1/2016
 ;;SD037^10/1/2016
 ;;SD038^10/1/2016
 ;;SD039^10/1/2016
 ;;SD040^10/1/2016
 ;;SD041^10/1/2016
 ;;SD042^10/1/2016
 ;;SH001^10/1/2016
 ;;SH002^10/1/2016
 ;;SH003^10/1/2016
 ;;SH004^10/1/2016
 ;;SH005^10/1/2016
 ;;SH006^10/1/2016
 ;;SH007^10/1/2016
 ;;SH008^10/1/2016
 ;;SH009^10/1/2016
 ;;SH012^10/1/2016
 ;;SH013^10/1/2016
 ;;SH014^10/1/2016
 ;;SH015^10/1/2016
 ;;SH016^10/1/2016
 ;;SH017^10/1/2016
 ;;SH018^10/1/2016
 ;;SH019^10/1/2016
 ;;SH020^10/1/2016
 ;;SN001^10/1/2016
 ;;SN002^10/1/2016
 ;;SN003^10/1/2016
 ;;SN004^10/1/2016
 ;;SN005^10/1/2016
 ;;SN006^10/1/2016
 ;;SN007^10/1/2016
 ;;SN008^10/1/2016
 ;;SN009^10/1/2016
 ;;SN012^10/1/2016
 ;;SN013^10/1/2016
 ;;SN014^10/1/2016
 ;;SN015^10/1/2016
 ;;SN016^10/1/2016
 ;;SN017^10/1/2016
 ;;SN018^10/1/2016
 ;;SN019^10/1/2016
 ;;SN020^10/1/2016
 ;;SN021^10/1/2016
 ;;SN022^10/1/2016
 ;;SN023^10/1/2016
 ;;SN024^10/1/2016
 ;;SN025^10/1/2016
 ;;SN026^10/1/2016
 ;;SN027^10/1/2016
 ;;SN028^10/1/2016
 ;;SN029^10/1/2016
 ;;SN030^10/1/2016
 ;;SN031^10/1/2016
 ;;SN032^10/1/2016
 ;;SN033^10/1/2016
 ;;SN034^10/1/2016
 ;;SN035^10/1/2016
 ;;SN036^10/1/2016
 ;;SN037^10/1/2016
 ;;SN038^10/1/2016
 ;;SN039^10/1/2016
 ;;SN040^10/1/2016
 ;;SN041^10/1/2016
 ;;SN042^10/1/2016
 ;;SN043^10/1/2016
 ;;SN044^10/1/2016
 ;;SN045^10/1/2016
 ;;SN046^10/1/2016
 ;;SN047^10/1/2016
 ;;SN048^10/1/2016
 ;;SN049^10/1/2016
 ;;SN050^10/1/2016
 ;;SN051^10/1/2016
 ;;SN052^10/1/2016
 ;;SN053^10/1/2016
 ;;SN054^10/1/2016
 ;;SN055^10/1/2016
 ;;SN056^10/1/2016
 ;;SN057^10/1/2016
 ;;SN058^10/1/2016
 ;;SN059^10/1/2016
 ;;SN060^10/1/2016
 ;;SN061^10/1/2016
 ;;SN062^10/1/2016
 ;;SN063^10/1/2016
 ;;SN064^10/1/2016
 ;;SN065^10/1/2016
 ;;SN066^10/1/2016
 ;;SN067^10/1/2016
 ;;SN068^10/1/2016
 ;;SN069^10/1/2016
 ;;SN070^10/1/2016
 ;;SN071^10/1/2016
 ;;SN072^10/1/2016
 ;;SN073^10/1/2016
 ;;SN074^10/1/2016
 ;;SN075^10/1/2016
 ;;SN076^10/1/2016
 ;;SN077^10/1/2016
 ;;SN078^10/1/2016
 ;;SN079^10/1/2016
 ;;SN080^10/1/2016
 ;;SN081^10/1/2016
 ;;SN082^10/1/2016
 ;;SN083^10/1/2016
 ;;SN084^10/1/2016
 ;;SN085^10/1/2016
 ;;SN086^10/1/2016
 ;;SN087^10/1/2016
 ;;SN088^10/1/2016
 ;;SN089^10/1/2016
 ;;SN090^10/1/2016
 ;;SN091^10/1/2016
 ;;SN092^10/1/2016
 ;;SN093^10/1/2016
 ;;SN094^10/1/2016
 ;;SN095^10/1/2016
 ;;SN096^10/1/2016
 ;;SN097^10/1/2016
 ;;SN098^10/1/2016
 ;;SN099^10/1/2016
 ;;SN100^10/1/2016
 ;;QUIT
 ;
CPTCHG ;* change cpt codes
 ;
 ;  ECXX is in format:
 ;  NATIONAL NUMBER^NEW CPT^FIRST NATIONAL NUMBER SEQUENCE^LAST NATIONAL
 ;  NUMBER SEQUENCE
 ;
 N ECX,ECXX,ECCPT,DIC,DIE,DA,DR,X,Y,ECBEG,ECEND,ECADD,ECSEQ,ECSTR,ECCPTIEN
 D MES^XPDUTL(" ")
 D BMES^XPDUTL("Changing CPT Codes in EC NATIONAL PROCEDURE file (#725)")
 D MES^XPDUTL(" ")
 F ECX=1:1 S ECXX=$P($T(CPT+ECX),";;",2) Q:ECXX="QUIT"  D
 .S ECBEG=$P(ECXX,U,3),ECEND=$P(ECXX,U,4),ECCPTIEN=$P(ECXX,U,2)
 .S ECCPTIEN=$S(ECCPTIEN="":"@",1:$$FIND1^DIC(81,"","X",ECCPTIEN))
 .I ECCPTIEN'="@",+ECCPTIEN<1 D  Q
 ..S ECSTR=$P(ECXX,U)_":  CPT code "_$P(ECXX,U,2)_" is invalid."
 ..D MES^XPDUTL(" ")
 ..D BMES^XPDUTL("   "_ECSTR)
 .I ECBEG="" S ECCPT($P(ECXX,U))=ECCPTIEN_U_$P(ECXX,U,2) Q
 .F ECSEQ=ECBEG:1:ECEND D
 ..S ECADD="000"_ECSEQ,ECADD=$E(ECADD,$L(ECADD)-2,$L(ECADD))
 ..S ECCPT($P(ECXX,U)_ECADD)=ECCPTIEN_U_$P(ECXX,U,2)
 S ECXX=""
 F  S ECXX=$O(ECCPT(ECXX)) Q:ECXX=""  D
 .S ECX=$O(^EC(725,"D",ECXX,0))
 .Q:+ECX=0
 .I '$D(^EC(725,ECX,0))!(+ECX=0) D  Q
 ..D MES^XPDUTL(" ")
 ..D BMES^XPDUTL("   Can't find entry for "_ECXX_",CPT code not updated.")
 .S ECCPT=$P(ECCPT(ECXX),U),DA=ECX,DR="4///"_ECCPT,DIE="^EC(725," D ^DIE
 .D MES^XPDUTL(" ")
 .S ECSTR="   Entry #"_ECX_" for "_ECXX
 .D BMES^XPDUTL(ECSTR_" updated to use CPT code "_$P(ECCPT(ECXX),U,2))
 Q
 ;
CPT ;cpt codes to be changed - national #^new CPT code
 ;;SP086^92570
 ;;SP256^92522
 ;;SP064^92537
 ;;SP231^92538
 ;;QUIT