Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Info |  Source |  Call Graph |  Caller Graph |  Entry Points |  External References |  Interaction Calls |  Global Variables Directly Accessed |  Label References |  Naked Globals |  Local Variables  | All
Print Page as PDF
Routine: YTWJSON

Package: Mental Health

Routine: YTWJSON


Information

YTWJSON ;SLC/KCM - Generate JSON Instrument Spec ; 7/20/2018

Source Information

Source file <YTWJSON.m>

Call Graph

Call Graph

Call Graph Total: 4

Package Total Call Graph
Kernel 2 $$EC^%ZOSV  (,UNWIND)^%ZTER  
Mental Health 2 FMTJSON^YTWJSONO  ($$HTMLESC,BLDTXT)^YTWJSONU  

Caller Graph

Legends:

Legend of Colors

Package Component Superscript legend

action A extended action Ea event driver Ed subscriber Su protocol O limited protocol LP run routine RR broker B edit E server Se print P screenman SM inquire I

Caller Graph

Caller Graph Total: 2

Package Total Caller Graph
Mental Health 2 YTWJSONF  YTWJSONO  

Entry Points

Name Comments DBIA/ICR reference
GETSPEC(JSON,TEST) ; Get the JSON admin spec for instrument TEST
ERRHND ; Handle errors & clear stack
CONTENT(TEST,TREE) ; build TEST spec as TREE for JSON conversion
RADIO(QSTN,DISP,CTYP) ; add properties for radio group (1 MCHOICE)
; add choices, inline/columns
SPIN(QSTN,DISP) ; add properties for spin control (2 INTEGER)
; add inline, default value, max, min
TEXT(QSTN,DISP) ; add properties for edit control (3 STRING)
DATE(QSTN,DISP) ; add properties for date picker (4 DATE)
MEMO(QSTN,DISP) ; add properties for memo control (5 MEMO)
; add width, default value
RANGE(QSTN,DISP,CTYP) ; add properties for range/slider (7 TRACK BAR)
CHECK(QSTN,DISP,CTYP) ; add properties for check list (11 CHECKLIST)
; add choices, inline/columns
MINMAX(QSTN) ; set max/min properties
MASK(DISP) ; set properties from |-delimited MASK field
CHLOOP(CTYP,CALL) ; loop through choices for a choice type
; CTYP: Id for ChoiceTypes (601.751) and ChoiceIdentifier (601.89)
; CALL: Code to call for building appropriate type of node
SECTIONS(TEST,SECTIONS) ; build list of sections for TEST
; SECTIONS(questionIEN)=ID^TEST^Question^TabName^Header^Format
ADDSECT(X0) ; add section node
; expects TREE, CTNTIDX from CONTENT
; X0: ID^TEST^Question^TabName^Header^Format
ADDINTRO(IEN,FORMAT,PREPEND) ; add intro node
; expects TREE, CTNTIDX from CONTENT
ADDQSTN(IEN,DESIG,FORMAT) ; add question node
ADDCH(INDEX,IDENTIEN,CHIEN) ; add choice node
; child of current question, use current CTNTIDX
ADDLGND(INDEX,CHIEN) ; add legend based on choices
RULES(TEST,TREE) ; add RULES for TEST to spec TREE for JSON conversion
TRUTHVAL(QSTN,VALUE) ; return the target value for the rule
; if MCHOICE, convert from Delphi itemIndex value to choice id
SETSKIPS(RID,RIDX) ; set skipped questions for rule RID at index RIDX

External References

Name Field # of Occurrence
$$EC^%ZOSV ERRHND+1
^%ZTER ERRHND+4
UNWIND^%ZTER ERRHND+2, ERRHND+6
FMTJSON^YTWJSONO GETSPEC+7
$$HTMLESC^YTWJSONU CONTENT+4, ADDCH+7
BLDTXT^YTWJSONU ADDINTRO+7, ADDQSTN+6, ADDQSTN+11

Interaction Calls

Name Line Occurrences
Function Call: WRITE
  • Prompt: !,"Test:",TEST," Qstn:",QSTN," Cols:",$P(X0,U,11)
  • Line Location: RADIO+9

Global Variables Directly Accessed

Name Line Occurrences  (* Changed,  ! Killed)
^YTT(601.71 - [#601.71] GETSPEC+1, CONTENT+1, CONTENT+2, CONTENT+4, CONTENT+5
^YTT(601.72 - [#601.72] CONTENT+17, MINMAX+1, ADDQSTN+3, ADDQSTN+6, TRUTHVAL+2, TRUTHVAL+4
^YTT(601.73 - [#601.73] ADDINTRO+5, ADDINTRO+7, ADDQSTN+11
^YTT(601.75 - [#601.75] ADDCH+3, ADDCH+7, ADDLGND+1
^YTT(601.751 - [#601.751] CHLOOP+5, CHLOOP+6, TRUTHVAL+5, TRUTHVAL+6
^YTT(601.76 - [#601.76] CONTENT+14, CONTENT+15, CONTENT+16
^YTT(601.79 - [#601.79] SETSKIPS+3, SETSKIPS+4
^YTT(601.81 - [#601.81] SECTIONS+3, SECTIONS+4
^YTT(601.82 - [#601.82] RULES+6
^YTT(601.83 - [#601.83] RULES+3, RULES+4, RULES+5
^YTT(601.88 - [#601.88] RADIO+5, CHECK+4, MASK+2, MASK+3
^YTT(601.89 - [#601.89] CHLOOP+4, ADDCH+5

Label References

Name Line Occurrences
$$TRUTHVAL RULES+9, RULES+15
ADDCH CHLOOP+8, CHLOOP+10
ADDINTRO CONTENT+23
ADDLGND CHLOOP+9
ADDQSTN CONTENT+26
ADDSECT CONTENT+25
CHECK CONTENT+37
CHLOOP RADIO+3, RANGE+4, CHECK+3
CONTENT GETSPEC+5
DATE CONTENT+34
MASK SPIN+4, TEXT+4, DATE+3, MEMO+3
MEMO CONTENT+35
MINMAX SPIN+3, TEXT+3, RANGE+3
RADIO CONTENT+31
RANGE CONTENT+36
RULES GETSPEC+6
SECTIONS CONTENT+8
SETSKIPS RULES+16
SPIN CONTENT+32
TEXT CONTENT+33

Naked Globals

Name Field # of Occurrence
^(1 RULES+6
^(2 ADDQSTN+3

Local Variables

Legend:

>> Not killed explicitly
* Changed
! Killed
~ Newed

Name Field # of Occurrence
CALL CHLOOP~, CHLOOP+8, CHLOOP+9, CHLOOP+10
CHID CHLOOP+3~, CHLOOP+6*, CHLOOP+8, CHLOOP+9, CHLOOP+10, TRUTHVAL+3~, TRUTHVAL+4*, TRUTHVAL+6*, TRUTHVAL+8
CHIEN ADDCH~, ADDCH+3, ADDCH+7, ADDLGND~, ADDLGND+1
CIDF CHLOOP+3~, CHLOOP+4*, CHLOOP+8, CHLOOP+10
CIDX CHLOOP+3~, CHLOOP+4*, CHLOOP+7*, CHLOOP+8, CHLOOP+9, CHLOOP+10
CIEN CHLOOP+3~
CSEQ CHLOOP+3~, CHLOOP+5*, CHLOOP+6, TRUTHVAL+3~, TRUTHVAL+4*, TRUTHVAL+5*, TRUTHVAL+6
CTNT CONTENT+13~, CONTENT+15*, CONTENT+16
CTNTIDX CONTENT+9~*, RADIO+2, RADIO+7, RADIO+8, SPIN+2, TEXT+2, DATE+2, MEMO+2, RANGE+2, CHECK+2
, CHECK+6, CHECK+7, MINMAX+2, MINMAX+3, MASK+4, MASK+5, MASK+6, ADDSECT+3*, ADDSECT+6, ADDSECT+7
, ADDSECT+8, ADDINTRO+4*, ADDINTRO+5, ADDINTRO+6, ADDINTRO+9, ADDQSTN+2*, ADDQSTN+5, ADDQSTN+7, ADDQSTN+8, ADDQSTN+9
, ADDQSTN+12, ADDCH+3, ADDCH+7, ADDCH+9, ADDLGND+1
CTYP CONTENT+13~, CONTENT+17*, CONTENT+31, CONTENT+36, CONTENT+37, RADIO~, RADIO+3, RANGE~, RANGE+4, CHECK~
, CHECK+3, CHLOOP~, CHLOOP+4, CHLOOP+5, CHLOOP+6, TRUTHVAL+3~, TRUTHVAL+4*, TRUTHVAL+5, TRUTHVAL+6
DESIG ADDQSTN~, ADDQSTN+4*, ADDQSTN+8
DISP CONTENT+13~, CONTENT+16*, CONTENT+31, CONTENT+32, CONTENT+33, CONTENT+34, CONTENT+35, CONTENT+36, CONTENT+37, RADIO~
, RADIO+4, RADIO+5, SPIN~, SPIN+4, TEXT~, TEXT+4, DATE~, DATE+3, MEMO~, MEMO+3
, RANGE~, CHECK~, CHECK+4, MASK~, MASK+1, MASK+2, MASK+3
DONE TRUTHVAL+3~, TRUTHVAL+4*, TRUTHVAL+5, TRUTHVAL+6*
ERR GETSPEC+4~
ERROR ERRHND+1~*, ERRHND+2
FORMAT ADDINTRO~, ADDQSTN~
IDBASE ADDCH+2~, ADDCH+5*, ADDCH+6
IDENTIEN ADDCH~, ADDCH+5
IDX TRUTHVAL+3~, TRUTHVAL+4*, TRUTHVAL+6, TRUTHVAL+7*
IEN SECTIONS+2~, SECTIONS+3*, SECTIONS+4, ADDINTRO~, ADDINTRO+2, ADDINTRO+5, ADDINTRO+7, ADDQSTN~, ADDQSTN+3, ADDQSTN+6
INDEX ADDCH~, ADDCH+3, ADDCH+6, ADDCH+7, ADDCH+9, ADDLGND~, ADDLGND+1
IRID RULES+1~, RULES+4*, RULES+5
ITEXT ADDQSTN+1~, ADDQSTN+11, ADDQSTN+12
JSON GETSPEC~, GETSPEC+7, ERRHND+5!
LSTINTRO CONTENT+10~*, CONTENT+19*
MASK MASK+3~*, MASK+4, MASK+5, MASK+6
NUM ADDCH+2~, ADDCH+6*, ADDCH+7, ADDCH+8
PREPEND ADDINTRO~, ADDINTRO+8
QID SETSKIPS+1~, SETSKIPS+4*, SETSKIPS+6
QSTN CONTENT+13~, CONTENT+16*, CONTENT+17, CONTENT+21, CONTENT+25, CONTENT+26, CONTENT+31, CONTENT+32, CONTENT+33, CONTENT+34
, CONTENT+35, CONTENT+36, CONTENT+37, RADIO~, SPIN~, SPIN+3, TEXT~, TEXT+3, DATE~, MEMO~
, RANGE~, RANGE+3, CHECK~, MINMAX~, MINMAX+1, TRUTHVAL~, TRUTHVAL+2, TRUTHVAL+4
QSTN1 RULES+1~, RULES+3*, RULES+4, RULES+7, RULES+9
QSTN2 RULES+1~, RULES+11*, RULES+13, RULES+15
QUICK ADDCH+2~, ADDCH+8*, ADDCH+9
RID RULES+1~, RULES+5*, RULES+6, RULES+16, SETSKIPS~, SETSKIPS+3
RIDX RULES+1~, RULES+2*, RULES+5*, RULES+7, RULES+8, RULES+9, RULES+12, RULES+13, RULES+14, RULES+15
, RULES+16, SETSKIPS~, SETSKIPS+6
RTYP CONTENT+13~, CONTENT+17*, CONTENT+31, CONTENT+32, CONTENT+33, CONTENT+34, CONTENT+35, CONTENT+36, CONTENT+37
SECTHDR CONTENT+20~*, CONTENT+21*, CONTENT+22*, CONTENT+23
SECTIONS CONTENT+8~, SECTIONS~
SECTIONS( CONTENT+21, CONTENT+25, SECTIONS+5*
SEQ CONTENT+13~, CONTENT+14*, CONTENT+15
SID SETSKIPS+1~, SETSKIPS+3*, SETSKIPS+4
SIDX SETSKIPS+1~, SETSKIPS+2*, SETSKIPS+5*, SETSKIPS+6
TEST GETSPEC~, GETSPEC+1*, GETSPEC+5, GETSPEC+6, CONTENT~, CONTENT+1, CONTENT+2, CONTENT+4, CONTENT+5, CONTENT+8
, CONTENT+14, CONTENT+15, SECTIONS~, SECTIONS+3, RULES~, RULES+3, RULES+4
TEXT ADDINTRO+3~, ADDINTRO+7, ADDINTRO+8*, ADDINTRO+9, ADDQSTN+1~, ADDQSTN+6, ADDQSTN+7
TREE GETSPEC+4~, GETSPEC+5, GETSPEC+6, GETSPEC+7, CONTENT~, RULES~
TREE("content" RADIO+2*, RADIO+7*, RADIO+8*, SPIN+2*, TEXT+2*, DATE+2*, MEMO+2*, RANGE+2*, CHECK+2*, CHECK+6*
, CHECK+7*, MINMAX+2*, MINMAX+3*, MASK+4*, MASK+5*, MASK+6*, ADDSECT+6*, ADDSECT+7*, ADDSECT+8*, ADDINTRO+5*
, ADDINTRO+6*, ADDINTRO+9*, ADDQSTN+5*, ADDQSTN+7*, ADDQSTN+8*, ADDQSTN+9*, ADDQSTN+12*, ADDCH+3*, ADDCH+7*, ADDCH+9*
, ADDLGND+1*
TREE("copyright" CONTENT+4*
TREE("name" CONTENT+1*
TREE("printTitle" CONTENT+2*
TREE("restartDays" CONTENT+5*, CONTENT+6*
TREE("rules" RULES+7*, RULES+8*, RULES+9*, RULES+12*, RULES+13*, RULES+14*, RULES+15*, SETSKIPS+6*
U CONTENT+1, CONTENT+2, CONTENT+5, CONTENT+16, CONTENT+17, CONTENT+19, CONTENT+21, CONTENT+23, CONTENT+26, RADIO+7
, RADIO+8, CHECK+6, CHECK+7, MINMAX+2, MINMAX+3, MASK+3, SECTIONS+5, ADDSECT+5, ADDSECT+8, ADDQSTN+9
, ADDCH+5, RULES+5, RULES+6, RULES+9, RULES+10, RULES+11, RULES+15, TRUTHVAL+2, TRUTHVAL+4, SETSKIPS+4
VALUE TRUTHVAL~, TRUTHVAL+2, TRUTHVAL+6
X RULES+1~, RULES+6*, RULES+8, RULES+11*, RULES+14
X0 CONTENT+13~, CONTENT+16*, CONTENT+23, CONTENT+26, RADIO+5~*, RADIO+7, RADIO+8, CHECK+4~*, CHECK+6, CHECK+7
, SECTIONS+2~, SECTIONS+4*, SECTIONS+5, ADDSECT~, ADDSECT+5, ADDSECT+6, ADDSECT+8, ADDQSTN+1~, ADDQSTN+3*, ADDQSTN+5
, RULES+1~, RULES+6*, RULES+9, RULES+10, RULES+11
X1 RULES+1~, RULES+6*, RULES+10, RULES+11, RULES+15
X2 CONTENT+13~, CONTENT+17*, CONTENT+19, CONTENT+23, MINMAX+1~*, MINMAX+2, MINMAX+3, ADDQSTN+1~, ADDQSTN+3*, ADDQSTN+9
, ADDQSTN+10, ADDQSTN+11
Info |  Source |  Call Graph |  Caller Graph |  Entry Points |  External References |  Interaction Calls |  Global Variables Directly Accessed |  Label References |  Naked Globals |  Local Variables  | All