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

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

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
    411x
    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 Guardian = component.define("Guardian")
      .fields([
        ["relation", "0..1", "h:code", shared.ConceptDescriptor],
        ["addresses", "0..*", "h:addr", shared.Address],
        ["names", "1..*", "h:guardianPerson/h:name", shared.IndividualName],
        ["phone", "0..*", shared.phone.xpath(), shared.phone],
        ["email", "0..*", shared.email.xpath(), shared.email],
      ]);

    var LanguageCommunication = component.define("LanguageCommunication")
      .fields([
        ["language", "1..1", "h:languageCode", shared.ConceptDescriptor],
        ["preferred", "1..1", "h:preferenceInd/@value", processor.asBoolean],
        ["mode", "0..1", "h:modeCode", shared.ConceptDescriptor],
        ["proficiency", "0..1", "h:proficiencyLevelCode", shared.ConceptDescriptor]
      ]);

    exports.patient = component.define("Patient")
      .fields([
        ["name", "1..1", "h:patient/h:name", shared.IndividualName],
        ["dob", "1..1", "h:patient/h:birthTime", shared.EffectiveTime],
        ["gender", "1..1", "h:patient/h:administrativeGenderCode", shared.ConceptDescriptor],
        ["identifiers", "0..*", "h:id", shared.Identifier],
        ["marital_status", "0..1", "h:patient/h:maritalStatusCode", shared.ConceptDescriptor],
        ["addresses", "0..*", "h:addr", shared.Address],
        ["phone", "0..*", shared.phone.xpath(), shared.phone],
        ["email", "0..*", shared.email.xpath(), shared.email],
        ["race", "0..1", "h:patient/h:raceCode", shared.ConceptDescriptor],
        ["ethnicity", "0..1", "h:patient/h:ethnicGroupCode", shared.ConceptDescriptor],
        ["languages", "0..*", "h:patient/h:languageCommunication", LanguageCommunication],
        ["religion", "0..1", "h:patient/h:religiousAffiliationCode", shared.ConceptDescriptor],
        ["birthplace", "0..1", "h:patient/h:birthplace/h:place/h:addr", shared.Address],
        ["guardians", "0..*", "h:patient/h:guardian", Guardian]
      ]);