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

GMRAOR1.m

Go to the documentation of this file.
GMRAOR1 ; HIRMFO/RM,WAA - OERR UTILITIES ;May 11, 2021@12:07:22
 ;;4.0;Adverse Reaction Tracking;**21,41,46,63**;Mar 29, 1996;Build 34
EN1(DFN,ARRAY) ;RETURN CONDENSED LIST OF PATIENT REACTIONS
 ;CONTROLLED BY CONTROLLED SUBSCRIPTION INTEGRATION AGREEMENT #2421
 ;PARAMETERS: DFN => INTERNAL ENTRY NUMBER (IEN) OF THE PATIENT
 ;                   IN THE PATIENT FILE (#2).
 ;            ARRAY => NAME OF THE ARRAY IN WHICH TO RETURN THE
 ;                     REACTIONS. IF NOTHING IS PASSED IN, DATA
 ;                     IS RETURNED IN THE GMRARXN ARRAY.
 ;            GMRA => REACTION SEARCH CRITERIA; REFER TO ^GMRADPT
 ;                    FOR DETAILS
 ;            GMRAIDT => WHEN SET, WILL RETURN THE DATE ENTERED FOR
 ;                       THE SIGN/SYMPTOM IN THE SECOND SEMI-COLON
 ;                       PIECE
 Q:+$G(DFN)'>0
 S ARRAY=$G(ARRAY,"GMRARXN")
 Q:ARRAY="GMRAL"
 N GMRAL
 K @ARRAY
 D EN2^GMRADPT
 I GMRAL D
 .N GMRAIEN,GMRASS
 .S GMRAIEN="" F  S GMRAIEN=$O(GMRAL(GMRAIEN)) Q:GMRAIEN=""  D
 ..N GMRAGMR,GMRAIDX,GMRASEV
 ..S @ARRAY=1+$G(@ARRAY)
 ..I $P(GMRAL(GMRAIEN),U,7)["D" D
 ...S GMRAGMR=$$EXTERNAL^DILFD(120.8,1,,$P(GMRAL(GMRAIEN),U,9))
 ...I $P(GMRAL(GMRAIEN),U,2)'=GMRAGMR,($P(GMRAL(GMRAIEN),U,9)'["50.605") S @ARRAY@(@ARRAY)=GMRAGMR_" ["_$P(GMRAL(GMRAIEN),U,2)_"]"
 ..I $P(GMRAL(GMRAIEN),U,7)'["D"!('$D(@ARRAY@(@ARRAY))) D
 ...S @ARRAY@(@ARRAY)=$P(GMRAL(GMRAIEN),U,2)
 ..I $P($P(GMRAL(GMRAIEN),U,10),";",2)="o" D
 ...S GMRAIDX=0 F  S GMRAIDX=$O(GMRAL(GMRAIEN,"O",GMRAIDX)) Q:'+GMRAIDX  D
 ....I $P($P(GMRAL(GMRAIEN,"O",GMRAIDX),U),";",2)>$G(GMRASEV) S GMRASEV=$P($P(GMRAL(GMRAIEN,"O",GMRAIDX),U),";",2)
 ...I $G(GMRASEV)>0 S GMRASEV=$$EXTERNAL^DILFD(120.85,14.5,,GMRASEV)
 ..I $P($P(GMRAL(GMRAIEN),U,10),";",2)="h" D
 ...S GMRASEV=$P($P(GMRAL(GMRAIEN,"H"),U),";")
 ..S @ARRAY@(@ARRAY)=@ARRAY@(@ARRAY)_U_$G(GMRASEV)_U_GMRAIEN
 ..S GMRASS=0 F  S GMRASS=$O(GMRAL(GMRAIEN,"S",GMRASS)) Q:GMRASS<1  D
 ...S @ARRAY@(@ARRAY,"S",GMRASS)=$P($P(GMRAL(GMRAIEN,"S",GMRASS),U),";")_$S($G(GMRAIDT):";"_$P($P(GMRAL(GMRAIEN,"S",GMRASS),U,2),";",2),1:"")
 S @ARRAY=GMRAL
 Q
 ;*BD
SETNODE(ITEM,DATA) ;
 N VALUE
 S VALUE=""
 I ITEM[DATA S VALUE=ITEM Q VALUE
 I DATA="LOCAL" D  Q VALUE
 .I ITEM="" S VALUE="LOCAL" Q
 .I ITEM["REMOTE SITE(S)" S VALUE="LOCAL AND REMOTE SITE(S)"
 I DATA="REMOTE SITE(S)" D  Q VALUE
 .I ITEM="" S VALUE="REMOTE SITE(S)" Q
 .I ITEM["LOCAL" S VALUE="LOCAL AND REMOTE SITE(S)"
 Q VALUE
 ;*ED