1 | MDRPCNT ; HOIFO/NCA - Document Handler Object (TMDNOTE) ;5/23/05 15:50
|
---|
2 | ;;1.0;CLINICAL PROCEDURES;**6**;Apr 01, 2004;Build 102
|
---|
3 | ; Reference IA #2944 [Subscription] Calls to TIUSRVR1.
|
---|
4 | ; 2240 [Supported] ENCRYP^XUSRB1 call
|
---|
5 | ; 2241 [Supported] DECRYP^XUSRB1 call
|
---|
6 | ; 2693 [Subscription] TIULQ call
|
---|
7 | ;
|
---|
8 | RPC(RESULTS,OPTION,MDSID,MDTIU,MDDTE,MDAUTH,MDESIG,MDNTL,MDTXT) ; [Procedure] Main RPC call
|
---|
9 | ; RPC: [MD TMDNOTE]
|
---|
10 | ;
|
---|
11 | ; MDSID=702 IEN
|
---|
12 | ; MDTIU=Note Internal Entry Number
|
---|
13 | ; MDDTE=Date/Time of Note
|
---|
14 | ; MDAUTH=Author of Note
|
---|
15 | ; MDESIG=Encoded E-Sig
|
---|
16 | ; MDNTL=Note Title
|
---|
17 | ; MDTXT=Array containing the text for the note
|
---|
18 | ;
|
---|
19 | D CLEAN^DILF
|
---|
20 | S RESULTS=$NA(^TMP("MDKUTL",$J)) K @RESULTS
|
---|
21 | I $T(@OPTION)="" D Q
|
---|
22 | .S @RESULTS@(0)="-1^Error in RPC: MD TMDNOTE at "_OPTION_U_$T(+0)
|
---|
23 | D @OPTION S:'$D(@RESULTS) @RESULTS@(0)="-1^No return"
|
---|
24 | D CLEAN^DILF
|
---|
25 | Q
|
---|
26 | ;
|
---|
27 | NEWDOC ; Add additional new note
|
---|
28 | ;
|
---|
29 | I '$D(^MDD(702,+MDSID,0)) S @RESULTS@(0)="-1^No such study" Q
|
---|
30 | I $D(MDTXT)<1 S @RESULTS@(0)="-1^No note text" Q
|
---|
31 | K ^TMP("MDTXT",$J)
|
---|
32 | N X,Y S X="",Y=0
|
---|
33 | F S X=$O(MDTXT(X)) Q:X="" S Y=Y+1,^TMP("MDTXT",$J,Y)=MDTXT(X)
|
---|
34 | I Y<1 S @RESULTS@(0)="-1^No note text" Q
|
---|
35 | S MDESIG=$$DECRYP^XUSRB1(MDESIG),MDESIG=$$ENCRYP^XUSRB1(MDESIG)
|
---|
36 | I $G(MDDTE)="" D NOW^%DTC S MDDTE=% K %
|
---|
37 | S @RESULTS@(0)=$$SUBMIT^MDRPCNT1(+MDSID,MDDTE,MDAUTH,MDESIG,MDNTL,$NA(^TMP("MDTXT",$J)))
|
---|
38 | ;
|
---|
39 | K ^TMP("MDTXT",$J)
|
---|
40 | Q
|
---|
41 | ;
|
---|
42 | NOTELIST ; Get list of documents
|
---|
43 | ; Return:
|
---|
44 | ; Note Ien
|
---|
45 | ; Note Title
|
---|
46 | ; Date/Time Creation
|
---|
47 | ; Author
|
---|
48 | ;
|
---|
49 | N MDCST,MDDL,MDK,MDX1 S MDDL="" K ^TMP("MDDLST",$J)
|
---|
50 | S MDK=0 F S MDK=$O(^MDD(702.001,"ASTUDY",MDSID,MDK)) Q:MDK<1 S MDX1=+MDK D
|
---|
51 | .N MDDOC,MDTIUER
|
---|
52 | .S (MDDOC,MDTIUER)="" K ^TMP("MDTIUST",$J)
|
---|
53 | .D EXTRACT^TIULQ(+MDX1,"^TMP(""MDTIUST"",$J)",MDTIUER,".01;.05;1201;1202;1205") Q:+MDTIUER
|
---|
54 | .I $G(^TMP("MDTIUST",$J,MDX1,.05,"E"))'="COMPLETED" Q
|
---|
55 | .S @RESULTS@(MDK)=+MDX1_"^"_$G(^TMP("MDTIUST",$J,MDX1,.01,"E"))_"^"_$G(^TMP("MDTIUST",$J,MDX1,1201,"E"))_"^"_$G(^TMP("MDTIUST",$J,MDX1,1202,"E"))_"^"_$G(^TMP("MDTIUST",$J,MDX1,1205,"E"))
|
---|
56 | .K ^TMP("MDTIUST",$J)
|
---|
57 | .Q
|
---|
58 | Q
|
---|
59 | ;
|
---|
60 | VIEWTIU ; [Procedure] View the associated TIU document
|
---|
61 | I '$G(MDTIU) S @RESULTS@(0)="-1^NO TIU NOTE FOR THIS STUDY" Q
|
---|
62 | D TGET^TIUSRVR1(.RESULTS,+MDTIU)
|
---|
63 | Q
|
---|