source: WorldVistAEHR/trunk/r/ADVERSE_REACTION_TRACKING-GMRA-GMA/GMRAGUI.m@ 1096

Last change on this file since 1096 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1GMRAGUI ;SLC/DAN - CPRS GUI support ;12/22/04 10:16
2 ;;4.0;Adverse Reaction Tracking;**21**;Mar 29, 1996
3 ;
4GETREC(GMRAIEN,GMRARRAY) ;
5 ;GMRAIEN = IEN of object record from file 120.8
6 ;GMRARRAY = array specifier ie.^TMP($J,"ART")
7 K @GMRARRAY
8 N ND,STRING,SSNODE,GMRA,GMRACA,GMRAT,GMRANOR,SSLIM,SSNUM,GMRASSI,GMRASS,GMRADT,Y,GMRAODUZ,COMFLAG,COMNUM,I
9 N COMMENTS,GMRACODT,GMRACDUZ,GMRACUS,PREFIX,COMLINE,IDMNOD,IDMLIM,IDMNUM,GMRAIDB,CHMNOD,CHMLIM,CHMNUM,GMRACHM,GMRAVDUZ,GMRAVYN,GMRAOBS,OBSIEN,USRNAM,USR,SEVCOD,SEVER
10 S ND=1
11 I '$D(GMRAIEN)!('+GMRAIEN) Q
12 S GMRA(0)=$G(^GMR(120.8,+GMRAIEN,0)) Q:'$L(GMRA(0))
13 S STRING="~CAUSATIVE AGENT" D NEXT
14 S GMRACA=$P(GMRA(0),U,2)
15 S STRING="d"_GMRACA D NEXT
16 S STRING="~ALLERGY TYPE" D NEXT
17 S GMRAT=$P(GMRA(0),U,20)
18 S STRING="d"_GMRAT_"^"_$TR($$OUTTYPE^GMRAUTL(GMRAT)," ","") D NEXT
19 S STRING="~NATURE OF REACTION" D NEXT
20 S GMRANOR=$P(GMRA(0),U,14)
21 S STRING="d"_GMRANOR_U_$S(GMRANOR="A":"ALLERGY",GMRANOR="R":"ADVERSE REACTION",GMRANOR="P":"PHARMACOLOGICAL",1:"UNKNOWN") D NEXT
22 S STRING="~SIGN/SYMPTOMS" D NEXT
23 S SSNODE=$G(^GMR(120.8,GMRAIEN,10,0)),SSLIM=$P(SSNODE,U,3),SSNUM=0
24 I SSLIM<1 G ORIG
25SSLOOP S SSNUM=$O(^GMR(120.8,GMRAIEN,10,SSNUM))
26 I SSNUM<1!(SSNUM>SSLIM) G ORIG
27 S GMRASSI=$P($G(^GMR(120.8,GMRAIEN,10,SSNUM,0)),U,1),GMRASS=$P($G(^GMRD(120.83,GMRASSI,0)),U,1),GMRADT=$P($G(^GMR(120.8,GMRAIEN,10,SSNUM,0)),U,4)
28 S Y=$$FMTE^XLFDT(GMRADT,"D")
29 S STRING="i"_GMRASSI_"^"_GMRASS_"^"_GMRADT_"^ "_Y D NEXT G SSLOOP
30ORIG S STRING="~ORIGINATOR" D NEXT
31 S GMRAODUZ=$P(GMRA(0),U,5)
32 S STRING="d"_GMRAODUZ_"^"_$S(GMRAODUZ:$$GET1^DIQ(200,GMRAODUZ_",",".01"),1:"") D NEXT
33 S STRING="~ORIGINATED" D NEXT
34 S STRING="d"_$P(GMRA(0),U,4) D NEXT
35 S COMFLAG=0,COMNUM=0
36 S STRING="~COMMENTS" D NEXT
37 S COMMENTS=$G(^GMR(120.8,GMRAIEN,26,0)) S:COMMENTS'="" COMFLAG=1
38CLOOP1 I COMFLAG D ;
39 .S COMNUM=$O(^GMR(120.8,GMRAIEN,26,COMNUM))
40 .Q:COMNUM<1
41 .S GMRACODT=$P($G(^GMR(120.8,GMRAIEN,26,COMNUM,0)),U,1)
42 . S Y=$$FMTE^XLFDT(GMRACODT,"D")
43 . S STRING="tComment Date: "_Y
44 .D NEXT
45 .S GMRACDUZ=$P($G(^GMR(120.8,GMRAIEN,26,COMNUM,0)),U,2) S GMRACUS=$S('GMRACDUZ:"",1:$$GET1^DIQ(200,GMRACDUZ_",",".01"))
46 .S STRING="tEntered By : "_GMRACUS
47 .D NEXT
48 .S PREFIX="tComments : "
49 .S COMLINE=$O(^GMR(120.8,GMRAIEN,26,COMNUM,2,0))
50CLOOP2 .D:COMLINE ;
51 ..S STRING=PREFIX_$G(^GMR(120.8,GMRAIEN,26,COMNUM,2,COMLINE,0)) D NEXT
52 ..S PREFIX="t "
53 .S COMLINE=$O(^GMR(120.8,GMRAIEN,26,COMNUM,2,COMLINE))
54 .I COMLINE>0 G CLOOP2
55 .S STRING="t"
56 .F I=1:1:60 S STRING=STRING_"-"
57 .D NEXT
58 I COMNUM>0 G CLOOP1
59IDBM S STRING="~ID BAND MARKED" D NEXT
60 S IDMNOD=$G(^GMR(120.8,GMRAIEN,14,0)),IDMLIM=$P(IDMNOD,U,3),IDMNUM=0
61 I IDMLIM<1 G CHM
62IDBLOOP S IDMNUM=$O(^GMR(120.8,GMRAIEN,14,IDMNUM))
63 I IDMNUM<1!(IDMNUM>IDMLIM) G CHM
64 S GMRAIDB=$P($G(^GMR(120.8,GMRAIEN,14,IDMNUM,0)),U,1)
65 S STRING="i"_GMRAIDB D NEXT G IDBLOOP
66CHM S STRING="~CHART MARKED" D NEXT
67 S CHMNOD=$G(^GMR(120.8,GMRAIEN,13,0)),CHMLIM=$P(CHMNOD,U,3),CHMNUM=0
68 I CHMLIM<1 G VER
69CHMLOOP S CHMNUM=$O(^GMR(120.8,GMRAIEN,13,CHMNUM))
70 I CHMNUM<1!(CHMNUM>CHMLIM) G VER
71 S GMRACHM=$P($G(^GMR(120.8,GMRAIEN,13,CHMNUM,0)),U,1)
72 S STRING="i"_GMRACHM D NEXT G CHMLOOP
73VER S STRING="~VERIFIER" D NEXT
74 S GMRAVDUZ=$P(GMRA(0),U,18) I GMRAVDUZ<1 G VFD
75 S STRING="d"_GMRAVDUZ_"^"_$$GET1^DIQ(200,GMRAVDUZ_",",".01") D NEXT
76VFD S STRING="~VERIFIED" D NEXT
77 S GMRAVYN=$P(GMRA(0),U,16)
78 S STRING="d"_$S(GMRAVYN=1:"YES",1:"NO")_"^"_$P(GMRA(0),U,17) D NEXT
79ERR S STRING="~ENTERED IN ERROR" D NEXT
80 S STRING="d"_$S(+$G(^GMR(120.8,GMRAIEN,"ER"))=1:"YES",1:"NO") D NEXT
81OBSHIST S STRING="~OBS/HIST" D NEXT
82 S GMRAOBS=$P(GMRA(0),U,6)
83 S STRING="d"_GMRAOBS_"^"_$S(GMRAOBS="o":"OBSERVED",GMRAOBS="h":"HISTORICAL",1:"") D NEXT
84 I GMRAOBS'="o" G EXIT
85 D EN1^GMRAGUI1
86EXIT Q
87NEXT ;SET ARRAY NODE AND INCREMENT ARRAY COUNTER
88 S @GMRARRAY@(ND)=STRING,ND=ND+1,STRING=""
89 Q
Note: See TracBrowser for help on using the repository browser.