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

GMRAMCU0.m

Go to the documentation of this file.
  1. GMRAMCU0 ;HIRMFO/WAA-ID BAND/CHART MARKING UTILITIES ; 7/30/15
  1. ;;4.0;Adverse Reaction Tracking;**49**;Mar 29, 1996;Build 2
  1. ;
  1. IDBAND(DFN,DATE,USR) ; This program will mark all the ID Band fields for
  1. ; all reactions for a patient
  1. ;
  1. ; INPUT
  1. ; DFN = IEN for a patient in file 2 (Required)
  1. ; DATE = Date of marking in File Manager format (optional-
  1. ; if undefined or null current date/time will be used).
  1. ; USR = User Marking the ID band (optional- if undefined null
  1. ; will be used indicating data automatically entered).
  1. ;
  1. N GMRADT,GMRAPA,GMRAUSR,GMRASITE
  1. S GMRADT=$G(DATE),GMRAUSR=$G(USR)
  1. I GMRADT="" S GMRADT=$$HTFM^XLFDT($H)
  1. S X=GMRADT,%DT="TS" D ^%DT S GMRADT=Y
  1. D SITE^GMRAUTL S GMRASITE(0)=$G(^GMRD(120.84,+GMRASITE,0)) ;49
  1. I $P(GMRASITE(0),U,5)=0 Q ;49
  1. Q:$G(DFN)<1!(GMRADT<0)!(GMRAUSR'=""&(GMRAUSR'>0))
  1. S GMRAPA=0 F S GMRAPA=$O(^GMR(120.8,"B",DFN,GMRAPA)) Q:GMRAPA<1 D
  1. .Q:$P($G(^GMR(120.8,GMRAPA,0)),U,2)=""!+$G(^GMR(120.8,GMRAPA,"ER"))
  1. .N DA,DD,DO,DIC,DIE,DINUM,DR
  1. .S DIC="^GMR(120.8,"_GMRAPA_",14,",DIC(0)="L",DIC("P")="120.814DA",DLAYGO=120.8,DA(1)=GMRAPA,X=GMRADT D FILE^DICN K DA,DIC
  1. .I Y>0,GMRAUSR'="" D
  1. ..S DA(1)=GMRAPA,DA=+Y,DIE="^GMR(120.8,"_DA(1)_",14,",DR="1////"_GMRAUSR
  1. ..D ^DIE
  1. ..Q
  1. .Q
  1. Q