How to use the cql-execution.Concept function in cql-execution

To help you get started, we’ve selected a few cql-execution examples, based on popular ways it is used in public projects.

github AHRQ-CDS / AHRQ-CDS-Connect-Authoring-Tool / frontend / src / actions / artifacts.js View on Github external
const q2 = p.value.secondQuantity != null ? new cql.Quantity({
          value: p.value.secondQuantity,
          unit: p.value.unit
        }) : null;
        paramsObj[p.name] = new cql.Interval(q1, q2);
        break;
      }
      case 'string':
        // Remove the leading and trailing single-quotes
        paramsObj[p.name] = p.value.replace(/^'(.*)'$/, '$1');
        break;
      case 'system_code':
        paramsObj[p.name] = new cql.Code(p.value.code, p.value.uri);
        break;
      case 'system_concept':
        paramsObj[p.name] = new cql.Concept([new cql.Code(p.value.code, p.value.uri)]);
        break;
      case 'system_quantity':
        paramsObj[p.name] = new cql.Quantity({
          value: p.value.quantity,
          unit: p.value.unit
        });
        break;
      case 'time':
        // CQL exec doesn't expose a Time class, so we must construct a DT and then get the Time
        paramsObj[p.name] = cql.DateTime.parse(`@0000-01-01${p.value.slice(1)}`).getTime();
        break;
      default: // do nothing
    }
  });
  return paramsObj;