Skip to content

Remove duplication of ResourceType strings and enums #3289

@lmsurpre

Description

@lmsurpre

Is your feature request related to a problem? Please describe.
Because of the way we generate code subtypes from code elements with a required binding, fhir-model in 4.x has two code subtype classes that are basically identical:

  • ResourceType
  • FHIRResourceType

Because working with resource types is so common in the codebase, and having an enum of all resource types is handy, we have a lot of places that use the underlying Value enums from these two classes (ResourceType.Value and FHIRResourceType.Value).

For #3268 I wanted to introduce a new ResourceType enum that could be used from fhir-config (and preferably without the complexity overhead of the existing ones) and so I introduce a new ResourceTypeName enum with almost the same content.

Describe the solution you'd like

  1. Core, ubiquitous enum constants for each resource type in the spec.
  2. A single code subtype that wraps this enum for use in the model.

Describe alternatives you've considered
Consolidate ResourceType and FHIRResourceType but keep the resulting class in fhir-model and do not have a separate enum for ResourceType in fhir-core.

Acceptance Criteria

  1. GIVEN [a precondition]
    AND [another precondition]
    WHEN [test step]
    AND [test step]
    THEN [verification step]
    AND [verification step]

Additional context

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions