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

GMRAOR7.m

Go to the documentation of this file.
  1. GMRAOR7 ;HIRMFO/WAA,FPT-OERR HL7 UTILITY ;8/28/03 13:52
  1. ;;4.0;Adverse Reaction Tracking;**4,17**;Mar 29, 1996
  1. ADVERSE(GMRAPA,GMRAL) ;Add a Adverse reaction entry to file 120.85
  1. ;INPUT
  1. ; GMRAPA = the entry in file 120.8 that was added
  1. ; GMRAL = The entry in the GMRAL array that is being added
  1. ;
  1. N GMRAO,GMRAPA1,X,Y
  1. S GMRAO=0 F S GMRAO=$O(GMRAL(GMRAL,"O",GMRAO)) Q:GMRAO<1 D
  1. .K DD,DO,DIC,DINUM,DLAYGO
  1. .S DIC="^GMR(120.85,",DLAYGO=120.85,DIC(0)="L",X=$P(GMRAL(GMRAL,"O",GMRAO),U)
  1. .D FILE^DICN
  1. .K DD,DO,DIC,DINUM,DLAYGO
  1. .Q:Y=-1 S GMRAPA1=+Y
  1. .N GMRALN
  1. .F Q:$$LOCK^GMRAUTL(120.85,GMRAPA1)
  1. .S GMRALN=^GMR(120.85,GMRAPA1,0)
  1. .S $P(GMRALN,U,2)=GMRADFN
  1. .S $P(GMRALN,U,13)=$P(GMRAL(GMRAL),U,7)
  1. .I $P(GMRAL(GMRAL,"O",GMRAO),U,3)]"" S $P(GMRALN,U,13)=$P(GMRAL(GMRAL,"O",GMRAO),U,3)
  1. .S $P(GMRALN,U,14)=$P(GMRAL(GMRAL,"O",GMRAO),U,2)
  1. .S $P(GMRALN,U,15)=GMRAPA
  1. .S ^GMR(120.85,GMRAPA1,0)=GMRALN
  1. .I $D(GMRAL(GMRAL,"S",1)) D SIGN^GMRAOR6(120.85,GMRAPA1,.GMRAL) ;S/S
  1. .S ^GMR(120.85,GMRAPA1,3,0)="^120.8503^1^1"
  1. .S ^GMR(120.85,GMRAPA1,3,1,0)=$P(GMRAL(GMRAL),U,3)
  1. .K DIK,DA S DIK="^GMR(120.85,",DA=GMRAPA1 D IX^DIK K DIK,DA ;17 changed GMRAPA to GMRAPA1
  1. .D UNLOCK^GMRAUTL(120.85,GMRAPA1)
  1. .Q
  1. Q