; determine type of context
; based on FILE and FIELD combination
; D FIELD^DID(FILE,FIELD,FLAGS,ATTRIBUTES,TARGET_ROOT,MSG_ROOT)
NEWTERM(CTX,TIREF,VUID)
; create a new term reference with given VUID
; only for "set of codes"
; on success (term entry), new TERM array is returned
; create a new entry in the Kernel (8985.1) file only (set of codes)
CONTEXT(TFILE,TFIELD,CTX)
; determine and create context impl
; returns new CTX array
; CTX("TYPE")=<"SET" or "TABLE" or "ROOT">
; CTX("TERM FILE#")=<TFILE or "">
; CTX("TERM FIELD#")=<TFIELD or "">
; CTX("SOURCE FILE#")=<8985.1 or TFILE or "">
; CTX("TERMSTATUS SUBFILE#")=
; <subfile for the multi-valued field
; 99.991, EFFECTIVE DATE/TIME or "">
SRCHTRMS(CTX,VUID,XTCARR,MASTER)
; search term reference entries
; search term reference entries based on VUID and its context
ADDTARRY(XTC2ARR,FILE,FIELD,IREF,VALUE)
;
; adds element and value to XTC2ARR array (by name)
; called by CTX implementations of SRCHTRMS()
; increased count
FINDTERM(CTX,TIREF,TERM)
; find term
; find the single term reference for given term IREF
; return TERM data as new TERM array
; IREF is unique within a given CTX, except for "RO0T" context
; on success, attach CTX to TERM array
VALIDREF(CTX,TIREF)
; validate IREF
; validate internal reference against given CTX
GETTERM(CTX,FILE,IENS,TERM)
; get term
; return TERM data as new TERM array
; called from CTX implementations only
; subroutine might be moved to XTIDTERM
; D GETS^DIQ(FILE,IENS,FIELD,FLAGS,TARGET_ROOT,MSG_ROOT)
ROOTCTX(CTX)
; set up Context for "ROOT" type
; called from CONTEXT^XTIDCTX(TFILE,TFIELD,CTX)
; called only when TFILE is not defined