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

SD5357PT.m

Go to the documentation of this file.
  1. SD5357PT ;ALB/REW - SD*5.3*57 Post-init Checker ; 7 Aug 1996
  1. ;;5.3;Scheduling;**57**;SEP 25, 1993
  1. EN ;entry point
  1. ;look through HOSPITAL LOCATION File (#44) to find any active
  1. ;clinics without a stop code
  1. N SCCL,SCST,SCNM,SCNODE
  1. K ^TMP($J,"SC CLEANUP")
  1. D INTRO
  1. D SEARCH
  1. D PRINT
  1. D EXIT
  1. Q
  1. ;
  1. INTRO ;header info for output
  1. D MES^XPDUTL(" Any clinic record in the HOSPITAL LOCATION File (#44)")
  1. D MES^XPDUTL(" without a STOP CODE field (#8) will cause errors if used.")
  1. D BMES^XPDUTL(" *** Clinics should be created/updated via the Set up a Clinic option.")
  1. Q
  1. ;
  1. N SCCL,SC44NODE,SCST,SCNM,SCSTIN
  1. ; SCCL - ptr to #44
  1. ; SC44NODE - zero node of #44
  1. ; SCST - ptr to 40.7 (not amis stop code)
  1. ; SCNM - name of clinic
  1. ; SCIN - clinic inactivation node: inactivation date^reactivation date
  1. ; SCSTND - 0 node of #40.7 (stop code)
  1. S SCCL=0
  1. D BMES^XPDUTL(">>>Searching HOSPITAL LOCATION File...")
  1. F S SCCL=$O(^SC("AC","C",SCCL)) Q:'SCCL D
  1. .N SCIN,SCRE
  1. .S SCIN=$G(^SC(SCCL,"I"))
  1. .;quit if inactivate date exists & is before today & not reactive now
  1. .Q:$S('SCIN:0,(SCIN>DT):0,('$P(SCIN,U,2)):1,($P(SCIN,U,2)<DT):0,1:1)
  1. .S SC44NODE=$G(^SC(SCCL,0)),SCST=$P(SC44NODE,U,7),SCNM=$P(SC44NODE,U,1)
  1. .IF 'SCST D
  1. ..;for no stop code
  1. ..S ^TMP($J,"SC CLEANUP","B",SCNM,SCCL)=SCNM_" [#"_SCCL_"]"
  1. .ELSE D
  1. ..S SCSTND=$G(^DIC(40.7,SCST,0))
  1. ..;if stopcode inactive date exists and is before today
  1. ..S:$P(SCSTND,U,3)&($P(SCSTND,U,3)<DT) ^TMP($J,"SC CLEANUP","B",SCNM,SCCL)=SCNM_" [#"_SCCL_"] -- inactive STOP CODE: "_$P(SCSTND,U,1)_" ("_$P(SCSTND,U,2)_")"
  1. Q
  1. ;
  1. PRINT ;display clinics with stop code problems
  1. N SCNM,SCCL,SCTMPND
  1. D BMES^XPDUTL("The following are ACTIVE clinics without an active STOP CODE field:")
  1. IF '$D(^TMP($J,"SC CLEANUP")) D
  1. .D MES^XPDUTL(" All active clinics have an active STOP CODE field.")
  1. .D MES^XPDUTL(" No further action is required.")
  1. S SCNM=""
  1. F S SCNM=$O(^TMP($J,"SC CLEANUP","B",SCNM)) Q:SCNM="" D
  1. .S SCCL=0
  1. .F S SCCL=$O(^TMP($J,"SC CLEANUP","B",SCNM,SCCL)) Q:'SCCL S SCTMPND=$G(^(SCCL)) D
  1. ..D MES^XPDUTL(SCTMPND)
  1. Q
  1. ;
  1. EXIT ;final cleanup
  1. K ^TMP($J,"SC CLEANUP")
  1. D BMES^XPDUTL("This post-install output is saved in the INSTALL File (#9.7)")
  1. D MES^XPDUTL("under 'SD*5.3*57'")
  1. Q