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

GMRCDDX.m

Go to the documentation of this file.
  1. GMRCDDX ;SLC/DLT - AC cross-referenc logic for 123.5, field .01 ; 8/20/18 4:54pm
  1. ;;3.0;CONSULT/REQUEST TRACKING;**1,6,104**;DEC 27, 1997;Build 9
  1. ;
  1. SETAC ;Logic to set the heirarchy alphabetic cross reference on the menu item
  1. ;multiple based on the child-parent relationships in file 123.5
  1. ;The ACP cross-reference is used to find cross-reference entries that
  1. ;need to have the AC alphabetic cross-reference updated.
  1. ;The value in X will be used to create a new AC cross-reference.
  1. ; GMRCC=Child Service ien
  1. ; GMRCP=Parent Service ien
  1. ; GMRCE=Entry in Parent Sub-service multiple
  1. ;
  1. N GMRCC,GMRCP,GMRCE
  1. S GMRCC=DA,GMRCP=0
  1. F S GMRCP=$O(^GMR(123.5,"APC",GMRCC,GMRCP)) Q:'GMRCP D
  1. . S GMRCE=$O(^GMR(123.5,"APC",GMRCC,GMRCP,0)) Q:'GMRCE
  1. . S ^GMR(123.5,GMRCP,10,"AC",$E(X,1,63),GMRCE)=""
  1. . Q
  1. Q
  1. KILLAC ;Logic to kill the AC cross-reference entry with the name defined in
  1. ;the value of x.
  1. N GMRCC,GMRCP,GMRCE
  1. S GMRCC=DA,GMRCP=0
  1. F S GMRCP=$O(^GMR(123.5,"APC",GMRCC,GMRCP)) Q:'GMRCP D
  1. . S GMRCE=$O(^GMR(123.5,"APC",GMRCC,GMRCP,0)) Q:'GMRCE
  1. . K ^GMR(123.5,GMRCP,10,"AC",$E(X,1,63),GMRCE)
  1. . Q
  1. Q
  1. CHKDEL(DA) ;Logic to check if user can delete entries from file 123.5.
  1. ;1. Check to ensure the SUICIDE HOTLINE entry is never deleted.
  1. ;2. If we have an APC cross reference we will force the user to
  1. ; remove the child-parent relationship before deleting the parent.
  1. ;
  1. ;Varibles used:
  1. ; GMRCC=Child Service ien
  1. ; GMRCP=Parent Service ien
  1. ; GMRCE=Entry in Parent Sub-service multiple
  1. ; GMRCNC=Noded count for user message
  1. ; GMRCMSG=User message
  1. ; GMRCNAME=Name of Parent Service
  1. ;
  1. ;ICRs used:
  1. ; IA# 10142 EN^DDIOL
  1. ;
  1. N GMRCC,GMRCP,GMRCE,GMRCNC,GMRCMSG,GMRCNAME
  1. S GMRCC=DA,GMRCP=0,GMRCNC=1,(GMRCMSG,GMRCNAME)=""
  1. I $P(^GMR(123.5,GMRCC,0),U)="SUICIDE HOTLINE" Q "...Mandatory Entry. Please see GMRC*3.0*57 for details..."
  1. I $D(^GMR(123.5,"APC",GMRCC)) D Q " "
  1. . S GMRCMSG(1)="This entry cannot be deleted until it is removed as a sub-service of:"
  1. . F S GMRCP=$O(^GMR(123.5,"APC",GMRCC,GMRCP)) D Q:'+GMRCP
  1. .. I '+GMRCP Q
  1. .. S GMRCNC=GMRCNC+1
  1. .. S GMRCNAME=$P(^GMR(123.5,GMRCP,0),U)
  1. .. S GMRCMSG(GMRCNC)=GMRCNAME
  1. .. S GMRCMSG(GMRCNC,"F")="!?5"
  1. . D EN^DDIOL(.GMRCMSG)
  1. Q ""