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

SDES893P.m

Go to the documentation of this file.
SDES893P ;ALB/JAS,MCB - SD*5.3*893 Post Init Routine ; OCT 04, 2024
 ;;5.3;SCHEDULING;**893**;AUG 13, 1993;Build 6
 ;;Per VHA Directive 6402, this routine should not be modified
 ;;
 Q
 ;
EN ; Update the VS GUI version in #409.98
 D WWIIUPDATE
 D TASK
 D TASK1
 Q
 ;
TASK ;
 D MES^XPDUTL("")
 D MES^XPDUTL("   SD*5.3*893 Post-Install to populate new comments auditing multiples")
 D MES^XPDUTL("   in the SDEC APPT REQUEST file (#409.85) and the SDEC APPOINTMENT file (#409.84)")
 D MES^XPDUTL("   is being queued to run in the background.")
 D MES^XPDUTL("")
 N ZTDESC,ZTRTN,ZTIO,ZTSK,X,ZTDTH,ZTSAVE
 S ZTDESC="SD*5.3*893 Post Install Routine"
 D NOW^%DTC S ZTDTH=X,ZTIO="",ZTRTN="COMMCONV^SDES893P",ZTSAVE("*")="" D ^%ZTLOAD
 I $D(ZTSK) D
 . D MES^XPDUTL("  >>>Task "_ZTSK_" has been queued.")
 . D MES^XPDUTL("")
 I '$D(ZTSK) D
 . D MES^XPDUTL("  UNABLE TO QUEUE THIS JOB.")
 . D MES^XPDUTL("  Please contact the National Help Desk to report this issue.")
 Q
 ;
TASK1 ;
 D MES^XPDUTL("")
 D MES^XPDUTL("   SD*5.3*893 Post-Install to populate VETERAN SELF-CANCEL on HOSPITAL LOCATION (#44)")
 D MES^XPDUTL("   is being queued to run in the background.")
 D MES^XPDUTL("")
 N ZTDESC,ZTRTN,ZTIO,ZTSK,X,ZTDTH,ZTSAVE
 S ZTDESC="SD*5.3*893 Post Install Routine"
 D NOW^%DTC S ZTDTH=X,ZTIO="",ZTRTN="HLPOST^SDES893P",ZTSAVE("*")="" D ^%ZTLOAD
 I $D(ZTSK) D
 . D MES^XPDUTL("  >>>Task "_ZTSK_" has been queued.")
 . D MES^XPDUTL("")
 I '$D(ZTSK) D
 . D MES^XPDUTL("  UNABLE TO QUEUE THIS JOB.")
 . D MES^XPDUTL("  Please contact the National Help Desk to report this issue.")
 Q
 ;
COMMCONV  ; Save Comments data into the new Comments mults
 ;
 N APPTIEN,APREQIEN,COMMARRAY,COMMENTS,COMMIEN,FDA
 S APREQIEN=0
 F  S APREQIEN=$O(^SDEC(409.85,APREQIEN)) Q:'APREQIEN  I $D(^SDEC(409.85,APREQIEN,0)) D
 . S COMMENTS=$$GET1^DIQ(409.85,APREQIEN,25,"E") I $L(COMMENTS) D
 . . Q:$D(^SDEC(409.85,APREQIEN,"COMAUD"))
 . . S FDA(409.8527,"+1,"_APREQIEN_",",.01)=$$GET1^DIQ(409.85,APREQIEN,9.5,"I")
 . . S FDA(409.8527,"+1,"_APREQIEN_",",1)=$$GET1^DIQ(409.85,APREQIEN,9,"I")
 . . S FDA(409.8527,"+1,"_APREQIEN_",",2)=COMMENTS
 . . D UPDATE^DIE("","FDA") K FDA
 ;
 S APPTIEN=0
 F  S APPTIEN=$O(^SDEC(409.84,APPTIEN)) Q:'APPTIEN  I $D(^SDEC(409.84,APPTIEN,1)) D
 . S COMMIEN=0
 . K COMMARRAY
 . F  S COMMIEN=$O(^SDEC(409.84,APPTIEN,1,COMMIEN)) Q:'COMMIEN  S COMMARRAY(COMMIEN)=^SDEC(409.84,APPTIEN,1,COMMIEN,0)
 . I $D(COMMARRAY) D
 . . Q:$D(^SDEC(409.84,APPTIEN,"NOTEAUD"))
 . . S COMMENTS=$$WPSTR^SDECUTL(.COMMARRAY)
 . . S FDA(409.847,"+1,"_APPTIEN_",",.01)=$$GET1^DIQ(409.84,APPTIEN,.09,"I")
 . . S FDA(409.847,"+1,"_APPTIEN_",",1)=$$GET1^DIQ(409.84,APPTIEN,.08,"I")
 . . S FDA(409.847,"+1,"_APPTIEN_",",2)=COMMENTS
 . . D UPDATE^DIE("","FDA") K FDA
 Q
 ;
WWIIUPDATE ; Update WORLD WAR II record in APPOINTMENT TYPE (#409.1) file
 ;
 D MES^XPDUTL("")
 D MES^XPDUTL(" SD*5.3*893 Post-Install has reset the IGNORE MEANS TEST BILLING (#2)")
 D MES^XPDUTL(" field in the APPOINTMENT TYPE file (#409.1) for the WORLD WAR II entry ")
 D MES^XPDUTL(" to prevent encounters from becoming non-billable. ")
 D MES^XPDUTL("")
 N APPTTYPEIEN,FDA
 S APPTTYPEIEN=$O(^SD(409.1,"B","WORLD WAR II",0))
 Q:APPTTYPEIEN=""
 ;
 S FDA(409.1,APPTTYPEIEN_",",2)="@"
 D FILE^DIE(,"FDA") K FDA
 Q
 ;
HLPOST ; Update HOSPITAL LOCATION file (#44) field VETERAN SELF-CANCEL (#63)
 N CIEN,NONCOUNT,FDA,PROHIBIT,VETCAN
 S CIEN=0 F  S CIEN=$O(^SC(CIEN)) Q:'CIEN  D
 .S NONCOUNT=$$GET1^DIQ(44,CIEN,2502,"I")
 .S NONCOUNT=$S(NONCOUNT="Y":1,1:0)
 .S PROHIBIT=$$GET1^DIQ(44,CIEN,2500,"I")
 .S PROHIBIT=$S(PROHIBIT="Y":1,1:0)
 .S VETCAN=$$GET1^DIQ(44,CIEN,63,"I") ; Check for existing value
 .I NONCOUNT D  Q
 ..;S FDA(44,CIEN_",",63)=$S(VETCAN'="":VETCAN,1:0) D FILE^DIE(,"FDA") K FDA
 ..S FDA(44,CIEN_",",63)=0 D FILE^DIE(,"FDA") K FDA
 .I 'PROHIBIT D  Q
 ..;S FDA(44,CIEN_",",63)=$S(VETCAN'="":VETCAN,1:1) D FILE^DIE(,"FDA") K FDA
 ..S FDA(44,CIEN_",",63)=1 D FILE^DIE(,"FDA") K FDA
 .I PROHIBIT D
 ..;S FDA(44,CIEN_",",63)=$S(VETCAN'="":VETCAN,1:$$PROXY(CIEN)) D FILE^DIE(,"FDA") K FDA
 ..S FDA(44,CIEN_",",63)=$$PROXY(CIEN) D FILE^DIE(,"FDA") K FDA
 Q
PROXY(CLINIEN) ;
 N SPROX,VPROX,PFLAG
 S SPROX=$O(^VA(200,"B","SDESOITEAS,SRV",0))
 S VPROX=$O(^VA(200,"B","VIABAPPLICATIONPROXY,VIAB",0))
 S PFLAG=0
 I SPROX,$D(^SC(CLINIEN,"SDPRIV",SPROX)) S PFLAG=1
 I VPROX,$D(^SC(CLINIEN,"SDPRIV",VPROX)) S PFLAG=1
 Q PFLAG
 ;