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

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

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
    32
    331x
    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
    10x
    1x
    1x
     "use strict";

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

    var exportC32 = function (version) {
      var patient = require("./demographics").patient;
      var allergiesSection = require("./sections/allergies").allergiesSection(version)[0];
      var vitalSignsSection = require("./sections/vitals").vitalSignsSection(version)[0];
      var resultsSection = require("./sections/results").resultsSection(version)[0];
      var problemsSection = require("./sections/problems").problemsSection(version)[0];
      var proceduresSection = require("./sections/procedures").proceduresSection(version)[0];
      var immunizationsSection = require("./sections/immunizations").immunizationsSection(version)[0];
      var medicationsSection = require("./sections/medications").medicationsSection(version)[0];
      var encountersSection = require("./sections/encounters").encountersSection(version)[0];
      return component.define("C32")
        .fields([
          ["meta", "0..1", ".", shared.metaData],
          ["demographics", "1..1", "(/ | //h:recordTarget/h:patientRole)[last()]", patient],
          ["allergies", "0..1", allergiesSection.xpath(), allergiesSection],
          ["encounters", "0..1", encountersSection.xpath(), encountersSection],
          ["immunizations", "0..1", immunizationsSection.xpath(), immunizationsSection],
          ["medications", "0..1", medicationsSection.xpath(), medicationsSection],
          ["problems", "0..1", problemsSection.xpath(), problemsSection],
          ["procedures", "0..1", proceduresSection.xpath(), proceduresSection],
          ["vitals", "0..1", vitalSignsSection.xpath(), vitalSignsSection],
          ["results", "0..1", resultsSection.xpath(), resultsSection]
        ]);

    };

    exports.C32 = exportC32;