GMRC1233 ;SLC/JFR - CREATE/EDIT GMRC PROCEDURES;1/11/99 12:05
;;3.0;CONSULT/REQUEST TRACKING;**15**;DEC 27, 1997
EN ;START HERE
N DLAYGO,DIE,DIC,X,Y,GMRCNEW,GMRCTIT,DUOUT,DTOUT,DA,DR,UPDATE
S DIC="^GMR(123.3,",DIC(0)="AELZMQ",DLAYGO=123.3
S DIC("A")="Select Procedure:"
D ^DIC I Y<1 Q
S GMRCIT=+Y
I $P(Y,U,3) S GMRCNEW=1
S DIE=DIC,DA=GMRCIT,DR="[GMRC PROCEDURE SETUP]" D ^DIE
S UPDATE=$$OI(+$G(GMRCNEW),GMRCIT)
I +UPDATE W !!,"Orderable Item Updated"
I '+UPDATE W !!,$C(7),"Unable to update Orderable Item"
Q
OI(NEW,PROC) ;get procedure info and update orderable item
I '$D(PROC) Q 0
I '$D(^GMR(123.3,+PROC)) Q 0
N NAME,CTRLC,ACTION,GMRCSYNS,GMRCMSG
S NAME=$P(^GMR(123.3,+PROC,0),U)
I $G(NEW) S CTRLC="MAD",ACTION="REP"
;I +$P(^GMR(123.3,+PROC,0),U,2),'$G(NEW) S CTRLC="MDC"
I +$P(^GMR(123.3,+PROC,0),U,2) S CTRLC="MDC"
I '$D(CTRLC) S CTRLC="MUP"
I '$D(ACTION) S ACTION="UPD"
D SYNS(PROC,.GMRCSYNS)
D EN^GMRC101H(CTRLC,ACTION,+PROC,NAME,.GMRCSYNS,"GMRCR ")
D MSG^XQOR("GMRC ORDERABLE ITEM UPDATE",.GMRCMSG)
Q 1
SYNS(IEN,ARRAY) ;get synonyms and load into ARRAY
Q:'IEN
N I S I=0
F S I=$O(^GMR(123.3,IEN,1,I)) Q:'I D
. S ARRAY(I)=$P(^GMR(123.3,IEN,1,I,0),U)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRC1233 1224 printed Dec 13, 2024@01:44:41 Page 2
GMRC1233 ;SLC/JFR - CREATE/EDIT GMRC PROCEDURES;1/11/99 12:05
+1 ;;3.0;CONSULT/REQUEST TRACKING;**15**;DEC 27, 1997
EN ;START HERE
+1 NEW DLAYGO,DIE,DIC,X,Y,GMRCNEW,GMRCTIT,DUOUT,DTOUT,DA,DR,UPDATE
+2 SET DIC="^GMR(123.3,"
SET DIC(0)="AELZMQ"
SET DLAYGO=123.3
+3 SET DIC("A")="Select Procedure:"
+4 DO ^DIC
IF Y<1
QUIT
+5 SET GMRCIT=+Y
+6 IF $PIECE(Y,U,3)
SET GMRCNEW=1
+7 SET DIE=DIC
SET DA=GMRCIT
SET DR="[GMRC PROCEDURE SETUP]"
DO ^DIE
+8 SET UPDATE=$$OI(+$GET(GMRCNEW),GMRCIT)
+9 IF +UPDATE
WRITE !!,"Orderable Item Updated"
+10 IF '+UPDATE
WRITE !!,$CHAR(7),"Unable to update Orderable Item"
+11 QUIT
OI(NEW,PROC) ;get procedure info and update orderable item
+1 IF '$DATA(PROC)
QUIT 0
+2 IF '$DATA(^GMR(123.3,+PROC))
QUIT 0
+3 NEW NAME,CTRLC,ACTION,GMRCSYNS,GMRCMSG
+4 SET NAME=$PIECE(^GMR(123.3,+PROC,0),U)
+5 IF $GET(NEW)
SET CTRLC="MAD"
SET ACTION="REP"
+6 ;I +$P(^GMR(123.3,+PROC,0),U,2),'$G(NEW) S CTRLC="MDC"
+7 IF +$PIECE(^GMR(123.3,+PROC,0),U,2)
SET CTRLC="MDC"
+8 IF '$DATA(CTRLC)
SET CTRLC="MUP"
+9 IF '$DATA(ACTION)
SET ACTION="UPD"
+10 DO SYNS(PROC,.GMRCSYNS)
+11 DO EN^GMRC101H(CTRLC,ACTION,+PROC,NAME,.GMRCSYNS,"GMRCR ")
+12 DO MSG^XQOR("GMRC ORDERABLE ITEM UPDATE",.GMRCMSG)
+13 QUIT 1
SYNS(IEN,ARRAY) ;get synonyms and load into ARRAY
+1 if 'IEN
QUIT
+2 NEW I
SET I=0
+3 FOR
SET I=$ORDER(^GMR(123.3,IEN,1,I))
if 'I
QUIT
Begin DoDot:1
+4 SET ARRAY(I)=$PIECE(^GMR(123.3,IEN,1,I,0),U)
End DoDot:1
+5 QUIT