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

GMRCTIUA.m

Go to the documentation of this file.
  1. GMRCTIUA ;SLC/DCM,DLT - Add the TIU note to the results multiple ;4/30/98 11:13
  1. ;;3.0;CONSULT/REQUEST TRACKING;**4**;DEC 27, 1997
  1. ADD(TIUDA,GMRCO) ;Add a new note from TIU to the associated results
  1. ;multiple and update the TIU NARRATIVE RESULT field as the last note
  1. ;modified.
  1. ;
  1. ;Input parameters:
  1. ; TIUDA = pointer value to TIU(8925, not in variable pointer format
  1. ; GMRCO = consult entry from 123 to get the result
  1. ;
  1. N GMRCY S GMRCY=0
  1. I '$D(^GMR(123,+GMRCO,50)),+$P(^GMR(123,+GMRCO,0),"^",20) S GMRCY=$$LOAD(GMRCO)
  1. Q:GMRCY ;The consult is locked
  1. S GMRCY=$$UPDATE(TIUDA,GMRCO)
  1. Q
  1. ;
  1. LOAD(GMRCO) ;function to load the result from field 16 into the 50th node
  1. N RSLT16,DR,DA,DIE,GMRCQUT
  1. S GMRCQUT=0
  1. S RSLT16=$P(^GMR(123,+GMRCO,0),"^",20)_";TIU(8925,"
  1. D ADDRSLT(GMRCO,RSLT16)
  1. Q GMRCQUT
  1. ;
  1. UPDATE(TIUDA,GMRCO) ;Update the TIU Narrative Result last updated
  1. N GMRCVDA,DR,DA,DIE,GMRCQUT
  1. S GMRCQUT=0
  1. S DIE="^GMR(123,",DA=GMRCO,DR="16////"_TIUDA D ^DIE
  1. ;
  1. ;Add result to the result multiple
  1. S GMRCVDA=TIUDA_";TIU(8925,"
  1. D ADDRSLT(GMRCO,GMRCVDA)
  1. Q GMRCQUT
  1. ;
  1. ADDRSLT(GMRCO,RESULT) ;Add a result to the Associated Results multiple
  1. Q:$O(^GMR(123,GMRCO,50,"B",RESULT,0))
  1. L +^GMR(123,+GMRCO,50):5 E D Q
  1. . S GMRCQUT=1,GMRCMSG="Result did NOT get associated with consult."
  1. . S GMRCMSG(1)="Consult in use by another user. Try again later."
  1. . D EXAC^GMRCADC(.GMRCMSG) K GMRCMSG
  1. ;Check if this result has already been added to the results multiple
  1. ;If it is already defined then quit processing this consult
  1. ;
  1. ;Get the next DA entry for a new result and add the result.
  1. S DA=$$ADD50(GMRCO)
  1. S DIE="^GMR(123,"_+GMRCO_",50,",DA(1)=+GMRCO,DR=".01////^S X=RESULT"
  1. D ^DIE
  1. L -^GMR(123,+GMRCO,50)
  1. Q
  1. ;
  1. ADD50(GMRCO) ;Add a field 50 node if does not exist; add a new multiple to 50 if it already exists. Returns DA of added node if successful.
  1. N DA
  1. S:'$D(^GMR(123,+GMRCO,50,0)) ^(0)="^123.03V^^"
  1. S DA=$S(+$P(^GMR(123,+GMRCO,50,0),"^",3):$P(^(0),"^",3)+1,1:1)
  1. S $P(^GMR(123,+GMRCO,50,0),"^",3,4)=DA_"^"_DA
  1. Q DA
  1. ;