Skip to content

Make FHIRSchema types more strict #7

@ryukzak

Description

@ryukzak

Problem: currently FHIRSchema type is too careless. E.g.: package_meta is optional, url and name are represented by string.

In codegen we fix it by intermediate type:

export type Name = string & { readonly __brand: unique symbol };
export type CanonicalUrl = string & { readonly __brand: unique symbol };

export interface PackageMeta {
    name: string;
    version: string;
}

export type RichFHIRSchema = Omit<FS.FHIRSchema, "package_meta" | "base" | "name" | "url"> & {
    package_meta: PackageMeta;
    name: Name;
    url: CanonicalUrl;
    base: CanonicalUrl;
};
  • Do we need to add package_meta to FHIRSchema as a part of standard?
  • Do we to make more specific types for FHIRSchema fields in TS?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions