YTWJSON ;SLC/KCM - Generate JSON Instrument Spec ; 7/20/2018
Source file <YTWJSON.m>
| 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
|
| Name | Line Occurrences |
|---|---|
| Function Call: WRITE |
|