source: WorldVistAEHR/trunk/r/CONSULT_REQUEST_TRACKING-GMRC-GMRS-GMRT/GMRCTIUA.m@ 1556

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

initial load of WorldVistAEHR

File size: 2.0 KB
RevLine 
[613]1GMRCTIUA ;SLC/DCM,DLT - Add the TIU note to the results multiple ;4/30/98 11:13
2 ;;3.0;CONSULT/REQUEST TRACKING;**4**;DEC 27, 1997
3ADD(TIUDA,GMRCO) ;Add a new note from TIU to the associated results
4 ;multiple and update the TIU NARRATIVE RESULT field as the last note
5 ;modified.
6 ;
7 ;Input parameters:
8 ; TIUDA = pointer value to TIU(8925, not in variable pointer format
9 ; GMRCO = consult entry from 123 to get the result
10 ;
11 N GMRCY S GMRCY=0
12 I '$D(^GMR(123,+GMRCO,50)),+$P(^GMR(123,+GMRCO,0),"^",20) S GMRCY=$$LOAD(GMRCO)
13 Q:GMRCY ;The consult is locked
14 S GMRCY=$$UPDATE(TIUDA,GMRCO)
15 Q
16 ;
17LOAD(GMRCO) ;function to load the result from field 16 into the 50th node
18 N RSLT16,DR,DA,DIE,GMRCQUT
19 S GMRCQUT=0
20 S RSLT16=$P(^GMR(123,+GMRCO,0),"^",20)_";TIU(8925,"
21 D ADDRSLT(GMRCO,RSLT16)
22 Q GMRCQUT
23 ;
24UPDATE(TIUDA,GMRCO) ;Update the TIU Narrative Result last updated
25 N GMRCVDA,DR,DA,DIE,GMRCQUT
26 S GMRCQUT=0
27 S DIE="^GMR(123,",DA=GMRCO,DR="16////"_TIUDA D ^DIE
28 ;
29 ;Add result to the result multiple
30 S GMRCVDA=TIUDA_";TIU(8925,"
31 D ADDRSLT(GMRCO,GMRCVDA)
32 Q GMRCQUT
33 ;
34ADDRSLT(GMRCO,RESULT) ;Add a result to the Associated Results multiple
35 Q:$O(^GMR(123,GMRCO,50,"B",RESULT,0))
36 L +^GMR(123,+GMRCO,50):5 E D Q
37 . S GMRCQUT=1,GMRCMSG="Result did NOT get associated with consult."
38 . S GMRCMSG(1)="Consult in use by another user. Try again later."
39 . D EXAC^GMRCADC(.GMRCMSG) K GMRCMSG
40 ;Check if this result has already been added to the results multiple
41 ;If it is already defined then quit processing this consult
42 ;
43 ;Get the next DA entry for a new result and add the result.
44 S DA=$$ADD50(GMRCO)
45 S DIE="^GMR(123,"_+GMRCO_",50,",DA(1)=+GMRCO,DR=".01////^S X=RESULT"
46 D ^DIE
47 L -^GMR(123,+GMRCO,50)
48 Q
49 ;
50ADD50(GMRCO) ;Add a field 50 node if does not exist; add a new multiple to 50 if it already exists. Returns DA of added node if successful.
51 N DA
52 S:'$D(^GMR(123,+GMRCO,50,0)) ^(0)="^123.03V^^"
53 S DA=$S(+$P(^GMR(123,+GMRCO,50,0),"^",3):$P(^(0),"^",3)+1,1:1)
54 S $P(^GMR(123,+GMRCO,50,0),"^",3,4)=DA_"^"_DA
55 Q DA
56 ;
Note: See TracBrowser for help on using the repository browser.