Data Model Libraries
    Preparing search index...

    Interface IPrimitiveType<T>

    Represents a generic primitive type interface, extending the IDataType interface. Provides methods to interact with and manipulate the underlying value of the primitive type.

    interface IPrimitiveType<T> {
        getValue: () => undefined | T;
        setValue: (value?: T) => this;
        hasValue: () => boolean;
        getValueAsString: () => undefined | string;
        setValueAsString: (value?: string) => void;
        encodeToString: (value: T) => string;
        parseToPrimitive: (value: string) => T;
        toSiblingJSON: () => undefined | Value;
        isDataType: () => boolean;
        dataTypeName: () => string;
        getId: () => undefined | string;
        setId: (value: undefined | string) => this;
        hasId: () => boolean;
        fhirType: () => string;
        isEmpty: () => boolean;
        copy: () => any;
        toJSON: () => undefined | Value;
        isRequiredFieldsEmpty: () => boolean;
        isResource: () => boolean;
        isComplexDataType: () => boolean;
        isPrimitive: () => boolean;
        isBooleanPrimitive: () => boolean;
        isStringPrimitive: () => boolean;
        isNumberPrimitive: () => boolean;
        isBigIntPrimitive: () => boolean;
        isDateTimePrimitive: () => boolean;
        getExtension: () => undefined | IExtension[];
        setExtension: (extension: undefined | IExtension[]) => this;
        hasExtension: (url?: string) => boolean;
        getExtensionByUrl: (url: string) => undefined | IExtension;
        addExtension: (extension: undefined | IExtension) => this;
        removeExtension: (url: string) => void;
    }

    Type Parameters

    • T

      The type of the primitive value.

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    getValue: () => undefined | T

    Type Declaration

      • (): undefined | T
      • Returns undefined | T

        the generic T property value

    setValue: (value?: T) => this

    Assigns the provided value.

    Type Declaration

      • (value?: T): this
      • Parameters

        • Optionalvalue: T

          the generic T value

        Returns this

        this

    PrimitiveTypeError for invalid value

    hasValue: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the generic T value exists and has a value; false otherwise

    getValueAsString: () => undefined | string

    Type Declaration

      • (): undefined | string
      • Returns undefined | string

        the generic T property value as a string

    setValueAsString: (value?: string) => void

    Assigns the provided value and coerces it to the T type.

    Type Declaration

      • (value?: string): void
      • Parameters

        • Optionalvalue: string

          the string value of the primitive type

        Returns void

    PrimitiveTypeError for invalid value

    encodeToString: (value: T) => string

    Encodes the provided generic T value as a string.

    Type Declaration

      • (value: T): string
      • Parameters

        • value: T

          the generic T value

        Returns string

        the string representation of T

    PrimitiveTypeError for invalid value

    parseToPrimitive: (value: string) => T

    Parses the provided string value and coerces it into the generic T value.

    Type Declaration

      • (value: string): T
      • Parameters

        • value: string

          the string representation of the generic T value

        Returns T

        the generic T value

    PrimitiveTypeError for invalid value

    toSiblingJSON: () => undefined | Value

    Type Declaration

      • (): undefined | Value
      • Returns undefined | Value

        the primitive data type's sibling JSON value containing the id and/or extension properties

    isDataType: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR complex or primitive datatype; false otherwise

    dataTypeName: () => string

    Type Declaration

      • (): string
      • Returns string

        the complex or primitive data model type name (e.g., 'Period", 'StringType', `UriType', etc.)

    getId: () => undefined | string

    Type Declaration

      • (): undefined | string
      • Returns undefined | string

        the id property value

    setId: (value: undefined | string) => this

    Assigns the provided value to the id property.

    Type Declaration

      • (value: undefined | string): this
      • Parameters

        • value: undefined | string

          the id value

        Returns this

        this

    PrimitiveTypeError for invalid value

    hasId: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if id exists and has a value; false otherwise

    fhirType: () => string

    Type Declaration

      • (): string
      • Returns string

        the FHIR type defined in the FHIR standard

    isEmpty: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is empty; false otherwise

    copy: () => any

    Creates a copy of the current instance.

    Type Declaration

      • (): any
      • Returns any

        the a new instance copied from the current instance

    toJSON: () => undefined | Value

    Type Declaration

      • (): undefined | Value
      • Returns undefined | Value

        the JSON value

    isRequiredFieldsEmpty: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if and only if the data model has required fields (min cardinality > 0) and at least one of those required fields in the instance is empty; false otherwise

    isResource: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR resource; false otherwise

    isComplexDataType: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR complex datatype; false otherwise

    isPrimitive: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR primitive datatype; false otherwise

    isBooleanPrimitive: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR primitive boolean datatype; false otherwise

    isStringPrimitive: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR primitive string-based datatype; false otherwise

    isNumberPrimitive: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR primitive number-based datatype; false otherwise

    isBigIntPrimitive: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR primitive bigint-based datatype; false otherwise

    isDateTimePrimitive: () => boolean

    Type Declaration

      • (): boolean
      • Returns boolean

        true if the instance is a FHIR primitive datetime-based datatype; false otherwise

    getExtension: () => undefined | IExtension[]

    Returns the array of extension values

    setExtension: (extension: undefined | IExtension[]) => this

    Assigns the provided array of Extension values to the extension property.

    Type Declaration

      • (extension: undefined | IExtension[]): this
      • Parameters

        • extension: undefined | IExtension[]

          array of Extensions

        Returns this

    hasExtension: (url?: string) => boolean

    Determines if the extension property exists.

    Type Declaration

      • (url?: string): boolean
      • Parameters

        • Optionalurl: string

          the url that identifies a specific Extension

        Returns boolean

    If the url is provided, determines if an Extension having the provided url exists. If the url is not provided, determines if the extension property exists and has any values.

    AssertionError for invalid url

    getExtensionByUrl: (url: string) => undefined | IExtension

    Returns the Extension having the provided url.

    Type Declaration

      • (url: string): undefined | IExtension
      • Parameters

        • url: string

          the url that identifies a specific Extension

        Returns undefined | IExtension

    AssertionError for invalid url

    addExtension: (extension: undefined | IExtension) => this

    Adds the provided Extension to the extension property array.

    Type Declaration

      • (extension: undefined | IExtension): this
      • Parameters

        • extension: undefined | IExtension

          the Extension value to add to the extension property array

        Returns this

    removeExtension: (url: string) => void

    Removes the Extension having the provided url from the extension property array.

    Type Declaration

      • (url: string): void
      • Parameters

        • url: string

          the url that identifies a specific Extension to remove

        Returns void

    AssertionError for invalid url