How to use the cql-execution.Interval 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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AHRQ-CDS / AHRQ-CDS-Connect-Authoring-Tool / frontend / src / actions / artifacts.js View on Github external
case 'interval_of_decimal':
        paramsObj[p.name] = new cql.Interval(p.value.firstDecimal, p.value.secondDecimal);
        break;
      case 'interval_of_integer':
        paramsObj[p.name] = new cql.Interval(p.value.firstInteger, p.value.secondInteger);
        break;
      case 'interval_of_quantity': {
        const q1 = p.value.firstQuantity != null ? new cql.Quantity({
          value: p.value.firstQuantity,
          unit: p.value.unit
        }) : null;
        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
github AHRQ-CDS / AHRQ-CDS-Connect-Authoring-Tool / frontend / src / actions / artifacts.js View on Github external
if (p.value.firstDate) {
          const str = p.value.firstTime ? `${p.value.firstDate}T${p.value.firstTime}` : p.value.firstDate;
          d1 = cql.DateTime.parse(str);
        }
        if (p.value.secondDate) {
          const str = p.value.secondTime ? `${p.value.secondDate}T${p.value.secondTime}` : p.value.secondDate;
          d2 = cql.DateTime.parse(str);
        }
        paramsObj[p.name] = new cql.Interval(d1, d2);
        break;
      }
      case 'interval_of_decimal':
        paramsObj[p.name] = new cql.Interval(p.value.firstDecimal, p.value.secondDecimal);
        break;
      case 'interval_of_integer':
        paramsObj[p.name] = new cql.Interval(p.value.firstInteger, p.value.secondInteger);
        break;
      case 'interval_of_quantity': {
        const q1 = p.value.firstQuantity != null ? new cql.Quantity({
          value: p.value.firstQuantity,
          unit: p.value.unit
        }) : null;
        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');
github AHRQ-CDS / AHRQ-CDS-Connect-Authoring-Tool / frontend / src / actions / artifacts.js View on Github external
break;
      case 'integer':
        paramsObj[p.name] = p.value;
        break;
      case 'interval_of_datetime': {
        let d1 = null;
        let d2 = null;
        if (p.value.firstDate) {
          const str = p.value.firstTime ? `${p.value.firstDate}T${p.value.firstTime}` : p.value.firstDate;
          d1 = cql.DateTime.parse(str);
        }
        if (p.value.secondDate) {
          const str = p.value.secondTime ? `${p.value.secondDate}T${p.value.secondTime}` : p.value.secondDate;
          d2 = cql.DateTime.parse(str);
        }
        paramsObj[p.name] = new cql.Interval(d1, d2);
        break;
      }
      case 'interval_of_decimal':
        paramsObj[p.name] = new cql.Interval(p.value.firstDecimal, p.value.secondDecimal);
        break;
      case 'interval_of_integer':
        paramsObj[p.name] = new cql.Interval(p.value.firstInteger, p.value.secondInteger);
        break;
      case 'interval_of_quantity': {
        const q1 = p.value.firstQuantity != null ? new cql.Quantity({
          value: p.value.firstQuantity,
          unit: p.value.unit
        }) : null;
        const q2 = p.value.secondQuantity != null ? new cql.Quantity({
          value: p.value.secondQuantity,
          unit: p.value.unit
github AHRQ-CDS / AHRQ-CDS-Connect-Authoring-Tool / frontend / src / actions / artifacts.js View on Github external
case 'interval_of_datetime': {
        let d1 = null;
        let d2 = null;
        if (p.value.firstDate) {
          const str = p.value.firstTime ? `${p.value.firstDate}T${p.value.firstTime}` : p.value.firstDate;
          d1 = cql.DateTime.parse(str);
        }
        if (p.value.secondDate) {
          const str = p.value.secondTime ? `${p.value.secondDate}T${p.value.secondTime}` : p.value.secondDate;
          d2 = cql.DateTime.parse(str);
        }
        paramsObj[p.name] = new cql.Interval(d1, d2);
        break;
      }
      case 'interval_of_decimal':
        paramsObj[p.name] = new cql.Interval(p.value.firstDecimal, p.value.secondDecimal);
        break;
      case 'interval_of_integer':
        paramsObj[p.name] = new cql.Interval(p.value.firstInteger, p.value.secondInteger);
        break;
      case 'interval_of_quantity': {
        const q1 = p.value.firstQuantity != null ? new cql.Quantity({
          value: p.value.firstQuantity,
          unit: p.value.unit
        }) : null;
        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;
      }