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

ECX147PT.m

Go to the documentation of this file.
  1. ECX147PT ;ALB/AG-ECX*3.0*147 Post-Init Rtn;10/8/13; ; 12/4/13 3:52pm
  1. ;;3.0;DSS EXTRACTS;**147**;Dec 22,1997;Build 4
  1. ;
  1. ;Post-init routine adding new entries and updating current entries to
  1. ;
  1. ;NATIONAL CLINIC file(#728.441)
  1. ;
  1. Q
  1. ;
  1. EN ;
  1. ;Routine entry point
  1. D UNLOCK ;unlock Data Dictionary to allow changes
  1. D ADDNEW ;add new Clinic codes
  1. D UPDATE ;change name to existing Clinic codes
  1. D LOCK ;lock Data Dictionary to restrict changes
  1. Q
  1. ;
  1. UNLOCK ;
  1. K ^DD(728.441,.01,7.5)
  1. N ECXI
  1. F ECXI=.01,1,3 S $P(^DD(728.441,ECXI,0),"^",2)=$TR($P(^DD(728.441,ECXI,0),"^",2),"I","")
  1. Q
  1. ADDNEW ;Add new entry to file 728.441
  1. ;ECXREC is in format:code^short description
  1. ;
  1. ;
  1. N ECXFDA,ECXERR,ECXCODE,ECXREC,ECXI
  1. ;
  1. ;-get National Clinic record
  1. F ECXI=1:1 S ECXREC=$P($T(ADDCLIN+ECXI),";;",2) Q:ECXREC="QUIT" D
  1. .;
  1. .;-National Clinic Code
  1. .S ECXCODE=$P(ECXREC,"^")
  1. .;
  1. .;-quit w/error message if entry already exists in file #728.441
  1. .I $$FIND1^DIC(728.441,"","X",ECXCODE) D Q
  1. ..D BMES^XPDUTL(">>>..."_ECXCODE_" "_$P(ECXREC,U,2)_" not added, entry already exists.")
  1. ..D BMES^XPDUTL(">>> Contact Support for assistance.")
  1. .;
  1. .;Setup field values of new entry
  1. .S ECXFDA(728.441,"+1,",.01)=ECXCODE
  1. .S ECXFDA(728.441,"+1,",1)=$P(ECXREC,"^",2)
  1. .;
  1. .;-add new entry to file #728.441
  1. .D UPDATE^DIE("E","ECXFDA","","ECXERR")
  1. .;
  1. .I '$D(ECXERR) D BMES^XPDUTL(">>>...."_ECXCODE_" "_$P(ECXREC,U,2)_" added to file.")
  1. .I $D(ECXERR) D BMES^XPDUTL(">>>....Unable to add "_ECXCODE_" "_$P(ECXREC,U,2)_" to file.") D
  1. ..D BMES^XPDUTL(">>>....Contact Support for assistance.")
  1. ;
  1. Q
  1. UPDATE ;changing short description of existing clinic
  1. N ECXCODE,ECXDESC,ECXIEN,DIE,DA,DR,ECXI
  1. D BMES^XPDUTL(">>>Updating entry in the NATIONAL CLINIC (728.441) file...")
  1. I $P(^DD(728.441,.01,0),"^",2)["I" D Q
  1. .D BMES^XPDUTL(">>Unable to update File 728.441 is locked")
  1. .D BMES^XPDUTL("Contact support for assistance")
  1. F ECXI=1:1 S ECXREC=$P($T(UPDCLIN+ECXI),";;",2) Q:ECXREC="QUIT" D
  1. .S ECXCODE=$P(ECXREC,"^"),ECXDESC=$P(ECXREC,"^",2)
  1. .S ECXIEN=$$FIND1^DIC(728.441,"","X",ECXCODE,"","","ERR")
  1. .I 'ECXIEN D Q
  1. ..D BMES^XPDUTL(">>>....Unable to add "_ECXCODE_" "_$P(ECXREC,U,2)_" to file.")
  1. ..D BMES^XPDUTL(">>>....Contact support for assistance")
  1. .S DIE="^ECX(728.441,",DA=ECXIEN,DR="1///^S X=ECXDESC"
  1. .D ^DIE
  1. .D BMES^XPDUTL(">>>...."_ECXCODE_" "_$P(ECXREC,U,2)_" updated")
  1. Q
  1. ;
  1. LOCK ;
  1. N ECXI
  1. S ^DD(728.441,.01,7.5)="I $G(DIC(0))[""L"",'$D(ECX4CHAR) D EN^DDIOL(""Entries can only be added by CHAR4 Council."","""",""!?5"") K X"
  1. F ECXI=.01,1,3 I $P(^DD(728.441,ECXI,0),U,2)'["I" S $P(^DD(728.441,ECXI,0),U,2)=$P(^DD(728.441,ECXI,0),U,2)_"I" ;Makes all fields uneditable
  1. Q
  1. ADDCLIN ;Contains the NATIONAL CLINIC entries to be added
  1. ;;AMSM^Antimicrb Stwrdshp MD
  1. ;;PEER^Peer Support
  1. ;;APSZ^E-Consult NP or CNS
  1. ;;CLSZ^E-Consult PSO or POD
  1. ;;PASZ^E-Consult PA
  1. ;;RESZ^E-Consult Resident/Fellow
  1. ;;VL5Z^E-Consult Contract Labor
  1. ;;QUIT
  1. UPDCLIN ;Contains the NATIONAL CLINIC entry description to be updated
  1. ;;FEEZ^Profee
  1. ;;HDGC^Employment Specialist
  1. ;;RHAC^Reserved
  1. ;;RHEC^Rehab Audiology
  1. ;;RHFC^Rehab Blind Rehab
  1. ;;RHGC^Rehab Chiropractic
  1. ;;RHHC^Rehab KT
  1. ;;RHJC^Rehab MD
  1. ;;RHMC^Rehab OT
  1. ;;RHRC^Rehab RT
  1. ;;RHSC^Rehab SP
  1. ;;CNSZ^E-Consult MD/PSI/Gen'l
  1. ;;QUIT