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

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

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
    281x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    11x
    1x
    1x
     "use strict";

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

    var exportProvidersSection = function (version) {

      var providers = component.define("providers")
        .templateRoot(["2.16.840.1.113883.5.90"])
        .fields([
          ["date_time", "0..1", "h:time", shared.EffectiveTime],
          ["identifiers", "0..*", "h:assignedEntity/h:id", shared.Identifier],
          ["type", "0..1", "h:assignedEntity/h:code", shared.ConceptDescriptor],
          ["role", "0..1", "h:functionCode/h:code", shared.ConceptDescriptor],
          ["name", "0..1", "h:assignedEntity/h:assignedPerson/h:name", shared.IndividualName],
          ["addresses", "0..*", "h:assignedEntity/h:addr", shared.Address],
          ["phone", "0..*", "h:assignedEntity/" + shared.phone.xpath(), shared.phone],
          ["email", "0..*", "h:assignedEntity/" + shared.email.xpath(), shared.email],
          ["organization", "0..1", "h:assignedEntity/h:representedOrganization", shared.Organization]
        ]);

      return [providers];
    };

    exports.providersSection = exportProvidersSection;