VistA Analysis » VistA Reference » RPCs » TIU FIELD SAVE

TIU FIELD SAVE

Saves a single Template Field

Properties

Property Value
Label SAVE
MUMPS Implementation TIUSRVF
Return Type SINGLE VALUE

Input Parameters

Name Type Maximum Data Length Required Description
TIUDA       IEN of dialog field, if any
TIUX LIST     Data to save in template field

MUMPS Method Description

Property Value
Method SAVE^TIUSRVF
Method Comment Save Template Field
Input Parameters TIUDA, TIUX
First Comment
 Input:
TIUDA=IEN of TEMPLATE record
TIUX(SEQ)=IEN of item
Output:
SUCCESS=IEN of item if successful, or
0^ Explanatory message if not
Code
 N FLD,TMP
S SUCCESS=""
I (+TIUDA'>0)!($G(TIUX(.01))'="") D Q:$P(SUCCESS,U,1)="0"
. I $L($G(TIUX(.01)))<3 D Q
. . S SUCCESS="0^Template Field name must be at least 3 characters"
. S TIUX(.01)=$$UPPER^TIULS(TIUX(.01))
. N FOUNDIEN
. S FOUNDIEN=$O(^TIU(8927.1,"B",TIUX(.01),0))
. I FOUNDIEN>0,FOUNDIEN'=TIUDA D Q
. . S SUCCESS="0^"_TIUX(.01)_" is not a unique name"
. I +TIUDA'>0 D
. . S TIUDA=$$CREATE($G(TIUX(.01)))
S SUCCESS=TIUDA Q:'+SUCCESS
D LOCK^TIUSRVF1(.TMP,TIUDA)
I TMP=0 D Q
. S SUCCESS="0^Template Field currently being edited by another user"
F FLD=2,10 D
. I +$O(TIUX(FLD,0)) D Q:$D(TIUX)'>9
. . K ^TIU(8927.1,TIUDA,FLD)
. . I $G(TIUX(FLD,1))="@" K TIUX(FLD) Q
. . M ^TIU(8927.1,TIUDA,FLD)=TIUX(FLD) K TIUX(FLD)
. . D SETXT0(TIUDA,FLD)
I $D(TIUX)>9 D FILE(.SUCCESS,""""_TIUDA_",""",.TIUX)
D UNLOCK^TIUSRVF1(.TMP,TIUDA)

CPRS

File Type Description
Executable Only  


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