# All files / blue-button/lib/parser/ccda header.js

100% Statements 43/43
100% Branches 0/0
100% Functions 0/0
100% Lines 43/43

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
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    441x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
     "use strict";

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

    var Author = component.define("Author")
      .fields([
        ["author", "0..*", "h:assignedAuthor", shared.assignedEntity],
        ["date_time", "1..1", "h:time", shared.EffectiveTime],
      ]);

    var Performer = component.define("Performer")
      .fields([
        ["performer", "0..*", "h:assignedEntity", shared.assignedEntity],
        ["code", "0..1", "h:functionCode", shared.ConceptDescriptor],
      ]);

    var ServiceEvent = component.define("ServiceEvent")
      .fields([
        ["code", "0..1", "h:code", shared.ConceptDescriptor],
        ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime],
        ["performer", "0..*", "h:performer", Performer],
      ]);

    exports.header = component.define("Header")
      .fields([
        ["identifiers", "0..*", "h:id", shared.Identifier],
        ["confidentiality_code", "0..1", "h:confidentialityCode", shared.ConceptDescriptor],
        ["code", "0..1", "h:code", shared.ConceptDescriptor],
        ["template", "0..*", "h:templateId/@root", processor.asString],
        ["title", "0..1", "h:title", processor.asString],
        ["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime],

        ["author", "0..1", "//h:author", Author],
        ["data_enterer", "0..1", "//h:dataEnterer/h:assignedEntity", shared.assignedEntity],
        ["informant", "0..1", "//h:informant/h:assignedEntity", shared.assignedEntity],

        ["custodian", "0..1", "//h:representedCustodianOrganization", shared.Organization],

        ["service_event", "0..1", "//h:documentationOf/h:serviceEvent", ServiceEvent]

      ]);