Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConvertToJs

Hierarchy

  • ConvertToJs

Index

Constructors

constructor

Properties

Private parser

Methods

convert

  • convert(xml: any): { resourceType: any }
  • Converts the specified XML resource to a JS object, storing arbitrary-length decimals as strings since FHIR spec requires arbitrary precision.

    Parameters

    • xml: any

      Resource XML string

    Returns { resourceType: any }

    A Resource object converted from the XML Resource. Decimals stored as strings.

    • resourceType: any

convertToJSON

  • convertToJSON(xml: any): string
  • Converts the specified XML resource to JSON, turning arbitrary-length decimals into JSON numbers as per the FHIR spec.

    Parameters

    • xml: any

      Resource XML string

    Returns string

    JSON with Numbers potentially too large for normal JavaScript & JSON.parse

Private findReferenceType

  • findReferenceType(relativeType: any): any
  • Finds a property definition based on a reference to another type. Should be a BackboneElement or Element

    Parameters

    • relativeType: any

      Example: "#QuestionnaireResponse.item"

    Returns any

Private maxLengthOfDs

  • maxLengthOfDs(obj: any): any

Private propertyToJS

  • propertyToJS(xmlObj: any, obj: any, property: any, surroundDecimalsWith: any): void
  • Parameters

    • xmlObj: any
    • obj: any
    • property: any
    • surroundDecimalsWith: any

    Returns void

Private resourceToJS

  • resourceToJS(xmlObj: any, surroundDecimalsWith: any): { resourceType: any }
  • Parameters

    • xmlObj: any
    • surroundDecimalsWith: any

    Returns { resourceType: any }

    • resourceType: any

Generated using TypeDoc