VistA Analysis » VistA Reference » RPCs » TIU CREATE RECORD

TIU CREATE RECORD

This remote procedure allows the creation of TIU DOCUMENT records.

Properties

Property Value
Label MAKE
MUMPS Implementation TIUSRVP
Return Type SINGLE VALUE

Input Parameters

Name Type Maximum Data Length Required Description
DFN LITERAL   true This REQUIRED PARAMETER is the pointer to the patient file.
TITLE LITERAL   true This is the pointer to the TIU DOCUMENT DEFINITION FILE which identifiesthe TITLE of the document to be filed.
VDT LITERAL   true This optional parameter is the Date/time of visit. If the parameter VSITis present, this will be ignored. Otherwise, the RPC will attempt togenerate a match with a visit based on DFN, VDT, and VLOC (visitlocation). In the event that the RPC cannot generate such a match, a newEVENT-type Visit will be created with the current date/time.
VLOC LITERAL   true This optional parameter is the Location of Visit (e.g., CardiologyClinic). It is a pointer to Hospital location (File #44).
VSIT LITERAL   true This is a pointer to the Visit File (#9000010) entry for the visit towhich the document is to be linked.
TIUX LIST   true This is the input array in which the identifiers of the document, as wellas its text, are to be stored in the format described for the TIU UPDATERECORD RPC.
VSTR LITERAL   true This parameter identifies the visit location, date/time, and ServiceCategory (Hospitalization, Ambulatory, Telecommunications, or Event(HISTORICAL)) in the form of a semi-colon delimited string (e.g.,"469;2970616.1415;A").
SUPPRESS LITERAL 1 true BOOLEAN flag indicating whether or not to suppress execution of the COMMITACTION for the document in question. This gives the calling applicationcontrol over the circumstances in which the COMMIT CODE should beexecuted.
NOASF LITERAL 1 true This parameter can optionally be set to 1 to indicate the ASAVE cross-reference in the TIU Document file (#8925) should not be set when calling this RPC. The intent of this cross-reference is for telnet type sessions where a user could be dropped. The cross-reference is used to provide the user with an easy way to resume editing the TIU Document they were working on when they were dropped. In the Clinical Procedures realm, for example, where the stub is created in the 'background' thiscross-reference should not be set since the user is not interactivelyinvolved in the creation of the record.

MUMPS Method Description

Property Value
Method MAKE^TIUSRVP
Method Comment New Document
Input Parameters DFN, TITLE, VDT, VLOC, VSIT, TIUX, VSTR, SUPPRESS, NOASF
First Comment
 SUCCESS = (by ref) TIU DOCUMENT # (PTR to 8925)
= 0^Explanatory message if no SUCCESS
DFN = Patient (#2)
TITLE = TIU Document Definition (#8925.1)
[VDT] = Date(/Time) of Visit
[VLOC] = Visit Location (HOSPITAL LOCATION)
[VSIT] = Visit file ien (#9000010)
[VSTR] = Visit string (i.e., VLOC;VDT;VTYPE)
[NOASF] = if 1=Do Not Set ASAVE cross-reference
TIUX = (by ref) array containing field data and document body
Code
 N TIU,TIUDA,LDT,NEWREC
S SUCCESS=0
I +$G(VSIT) S VSTR=$$VSTRBLD(+VSIT)
I $L($G(VSTR)) D
. S VDT=$S(+$G(VDT):+$G(VDT),1:$P(VSTR,";",2))
. S LDT=$S(+$G(VDT):$$FMADD^XLFDT(VDT,"","",1),1:"")
. S VLOC=$S(+$G(VLOC):+$G(VLOC),1:$P(VSTR,";"))
. ; If note is for Ward Location, call MAIN^TIUMOVE
. I $P($G(^SC(+VLOC,0)),U,3)="W" D MAIN^TIUMOVE(.TIU,DFN,"",VDT,LDT,1,"LAST",0,+VLOC) Q
. ; Otherwise, call PATVADPT^TIULV
. D PATVADPT^TIULV(.TIU,DFN,"",VSTR)
I '+$G(VSIT),'$L($G(VSTR)),+$G(VDT),+$G(VLOC) D
. S VDT=$G(VDT),LDT=$S(+$G(VDT):$$FMADD^XLFDT(VDT,"","",1),1:"")
. ; If note is for Ward Location, call MAIN^TIUMOVE
. I $P($G(^SC(+VLOC,0)),U,3)="W" D MAIN^TIUMOVE(.TIU,DFN,"",VDT,LDT,1,"LAST",0,+VLOC) Q
. ; Otherwise, call MAIN^TIUVSIT
. D MAIN^TIUVSIT(.TIU,DFN,"",VDT,LDT,"LAST",0,VLOC)
I '+$G(TIU("VSTR")) D
. D EVENT^TIUSRVP1(.TIU,DFN)
S TIU("INST")=$$DIVISION^TIULC1(+TIU("LOC"))
I $S($D(TIU)'>9:1,+$G(DFN)'>0:1,1:0) S SUCCESS="0^"_$$EZBLD^DIALOG(89250001) Q
S TIUDA=$$GETREC(DFN,.TIU,TITLE,.NEWREC)
I +TIUDA'>0 S SUCCESS="0^"_$$EZBLD^DIALOG(89250002) Q
S SUCCESS=+TIUDA
D STUFREC^TIUSRVP1(+TIUDA,.TIUX,DFN,,TITLE,.TIU)
S:'+$G(NOASF) ^TIU(8925,"ASAVE",DUZ,TIUDA)=""
K ^TIU(8925,+TIUDA,"TEMP")
M ^TIU(8925,+TIUDA,"TEMP")=TIUX("TEXT") K TIUX("TEXT")
D SETXT0(TIUDA)
D FILE(.SUCCESS,+TIUDA,.TIUX,+$G(SUPPRESS))
I +SUCCESS'>0 D DIK^TIURB2(TIUDA) Q
I +$O(^TIU(8925,+TIUDA,"TEMP",0)) D MERGTEXT^TIUEDI1(+TIUDA,.TIU)
I +$G(TIU("STOP")) D DEFER^TIUVSIT(TIUDA,TIU("STOP")) I 1
E D QUE^TIUPXAP1
I '+$G(SUPPRESS) D
. D RELEASE^TIUT(TIUDA,1)
. D UPDTIRT^TIUDIRT(.TIU,TIUDA)
K ^TIU(8925,+TIUDA,"TEMP")

CPRS

File Type Description
Pascal File rDCSumm.pas
Pascal File rTIU.pas


Document generated on August 31st 2022, 2:55:43 pm