# All files / blue-button/lib/parser/cda ccd.js

100% Statements 31/31
100% Branches 1/1
100% Functions 1/1
100% Lines 31/31

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    321x
    1x
    1x
    1x
    1x
    1x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    10x
    1x
    1x
     "use strict";

    var component = require("@amida-tech/blue-button-xml").component;
    var shared = require("./shared");

    var exportCCD = function (version) {
      var patient = require("./demographics").patient;
      var resultsSection = require("./sections/results").resultsSection(version)[0];
      var problemsSection = require("./sections/problems").problemsSection(version)[0];
      var encountersSection = require("./sections/encounters").encountersSection(version)[0];
      var proceduresSection = require("./sections/procedures").proceduresSection(version)[0];
      var medicationsSection = require("./sections/medications").medicationsSection(version)[0];
      var providersSection = require("./sections/providers").providersSection(version)[0];
      var payers_section = require("./sections/payers").payers_section(version)[0];

      return component.define("CCD")
        .fields([
          ["meta", "0..1", ".", shared.metaData],
          ["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
          ["providers", "0..*", "//h:documentationOf/h:serviceEvent/h:performer", providersSection],
          ["problems", "0..1", problemsSection.xpath(), problemsSection],
          ["encounters", "0..1", encountersSection.xpath(), encountersSection],
          ["medications", "0..1", medicationsSection.xpath(), medicationsSection],
          ["procedures", "0..1", proceduresSection.xpath(), proceduresSection],
          ["results", "0..1", resultsSection.xpath(), resultsSection],
          ["payers", "0..1", payers_section.xpath(), payers_section],
        ]);

    };

    exports.CCD = exportCCD;