You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening the Resources page with an unrecognized type query parameter leaves the page without a selected rail item or an explanation. Clicking Create new then opens a draft whose resourceType is copied directly from the URL.
For example:
/ui/resources?type=NoLongerValid
produces:
{
"resourceType": "NoLongerValid"
}
The editor reports that the resource type and schema are unknown. Save is blocked, so the current evidence does not show invalid data reaching storage.
This behavior should not be treated as a confirmed product defect until HFS defines what counts as a valid create target for each FHIR version.
Why research is required
The FHIR create interaction creates an instance of the type named in POST [base]/[type]. The request body must contain a resource of that type. Servers publish supported resource types and their allowed interactions through CapabilityStatement.rest.resource.
FHIR R4 restricts this field to resource types defined by that version. The current R6 specification also permits additional or custom resource types when the server advertises them and provides their StructureDefinition.
A fix that validates only against HFS's generated core resource list could reject a valid R6 additional resource. Conversely, accepting every URL value creates drafts the editor and REST API cannot process.
This issue may be closed without code changes if the research establishes that URL passthrough is intentional, the current editor feedback is considered sufficient, and both the UI and REST write paths reliably prevent unsupported resources from being stored.
Environment
HFS 0.2.1
FHIR R4
SQLite
Spanish locale
Light theme
Steps to reproduce
Open:
/ui/resources?type=NoLongerValid
Inspect the resource-type rail and the main workspace.
Click Create new.
Inspect the generated document and validation messages.
Do not submit the document.
Actual behavior
The URL keeps the unknown type.
No resource in the rail is selected.
The page does not explain that the type is unknown or unavailable in the active FHIR version.
Create new remains enabled.
The generated draft uses the unknown value as resourceType.
The editor reports that the resource type and schema cannot be resolved.
Save validation blocks the document.
Research questions
Before changing code, determine:
Whether create targets should come from the active CapabilityStatement, the generated schema catalog, the resource rail, or a combination of these sources.
Whether the UI should require a create interaction for the selected resource type.
Whether HFS currently supports R6 additional resources or plans to support them.
How the editor should obtain schemas for additional resources.
Whether a type compiled into the binary but absent from the active FHIR version should be accepted by the REST write path.
Whether an unknown deep link should show an error, select a safe default, remove the invalid parameter, or preserve it without enabling creation.
Whether the current editor errors provide adequate recovery guidance.
Whether a stale URL should behave differently from a manually entered custom type.
Required validation matrix
Scenario
Example
Expected research
Core type shared across versions
Patient
Must remain selectable and creatable when advertised
Type introduced after R4
SubscriptionTopic or ActorDefinition
Compare R4, R4B, R5, and R6
R4 type absent from R6
Media or DocumentManifest
Verify stale links after switching versions
Unknown type
NoLongerValid
Define recovery and create-button behavior
Wrong case
patient
Verify case-sensitive handling
Missing or empty value
No type, or type=
Verify the intended default
Advertised type without create
CapabilityStatement entry lacking create
Creation should not be offered unless intentionally supported
R6 additional resource
Advertised with rest.resource.definition
Determine whether HFS and the editor can support it
Unadvertised additional resource
Custom-looking type absent from capabilities
Define rejection and feedback
Single-version build
R4-only or R6-only binary
Ensure validation does not depend on types from unavailable versions
Multi-version build
R4 and R6 enabled
Validate against the effective request version, not any compiled version
For each applicable row, verify:
Resource rail selection
Query-builder target
Create-button state
Generated editor document
Schema resolution
Save validation
Direct REST create response
Storage outcome
Behavior after changing the selected FHIR version
Current implementation notes
The Resources handler obtains the rail entries for the effective request version, but it copies the query parameter directly into selected_type without checking membership:
The REST extractor accepts resource types found in any FHIR version compiled into the binary. The research should verify that later validation consistently applies the effective request version:
PR #631 expands the resource rail and pre-fills the query builder from the selected type. Its current implementation still derives the selected type from the URL without validating it. The research and any resulting behavior should be applied to that branch before merge or tested immediately after merge.
Current test gap
The existing end-to-end coverage verifies that every type shown in the R4 rail can open a matching draft. It does not cover invalid types, version-specific types, stale links, additional R6 resources, or capabilities that omit create.
Unknown resource type produces no visible page-level warning
Create new carries the unknown type into an invalid draft
Acceptance criteria
The issue contains a written decision about the source of truth for valid create targets.
The decision covers R4, R4B, R5, R6, single-version builds, and multi-version builds.
The decision addresses R6 additional resources and CapabilityStatement.rest.resource.definition.
The validation matrix records the observed UI and REST behavior.
No implementation begins before the research determines the intended contract.
If a code change is required, the UI handles unsupported or version-incompatible types explicitly and consistently.
If no change is required, the issue documents why URL passthrough is intentional and provides tests proving that unsupported resources cannot reach storage.
Summary
Opening the Resources page with an unrecognized
typequery parameter leaves the page without a selected rail item or an explanation. Clicking Create new then opens a draft whoseresourceTypeis copied directly from the URL.For example:
produces:
{ "resourceType": "NoLongerValid" }The editor reports that the resource type and schema are unknown. Save is blocked, so the current evidence does not show invalid data reaching storage.
This behavior should not be treated as a confirmed product defect until HFS defines what counts as a valid create target for each FHIR version.
Why research is required
The FHIR create interaction creates an instance of the type named in
POST [base]/[type]. The request body must contain a resource of that type. Servers publish supported resource types and their allowed interactions throughCapabilityStatement.rest.resource.FHIR R4 restricts this field to resource types defined by that version. The current R6 specification also permits additional or custom resource types when the server advertises them and provides their
StructureDefinition.A fix that validates only against HFS's generated core resource list could reject a valid R6 additional resource. Conversely, accepting every URL value creates drafts the editor and REST API cannot process.
Relevant specification sections:
This issue may be closed without code changes if the research establishes that URL passthrough is intentional, the current editor feedback is considered sufficient, and both the UI and REST write paths reliably prevent unsupported resources from being stored.
Environment
Steps to reproduce
Open:
Inspect the resource-type rail and the main workspace.
Click Create new.
Inspect the generated document and validation messages.
Do not submit the document.
Actual behavior
resourceType.Research questions
Before changing code, determine:
CapabilityStatement, the generated schema catalog, the resource rail, or a combination of these sources.createinteraction for the selected resource type.Required validation matrix
PatientSubscriptionTopicorActorDefinitionMediaorDocumentManifestNoLongerValidpatienttype, ortype=createcreaterest.resource.definitionFor each applicable row, verify:
Current implementation notes
The Resources handler obtains the rail entries for the effective request version, but it copies the query parameter directly into
selected_typewithout checking membership:crates/ui/src/lib.rsThe template exposes that value to the Create button:
crates/ui/templates/pages/resources.htmlThe browser creates a document from that value:
crates/ui/assets/resources.jsThe save path revalidates the document and blocks submission when the editor reports errors:
crates/ui/assets/resources.jsHFS currently builds its CapabilityStatement from the core resource types for the requested version and advertises
createfor each listed type:crates/rest/src/handlers/capabilities.rscrates/rest/src/handlers/capabilities.rsThe REST extractor accepts resource types found in any FHIR version compiled into the binary. The research should verify that later validation consistently applies the effective request version:
crates/rest/src/fhir_types.rscrates/rest/src/extractors/fhir_resource.rsActive UI work
PR #631 expands the resource rail and pre-fills the query builder from the selected type. Its current implementation still derives the selected type from the URL without validating it. The research and any resulting behavior should be applied to that branch before merge or tested immediately after merge.
Current test gap
The existing end-to-end coverage verifies that every type shown in the R4 rail can open a matching draft. It does not cover invalid types, version-specific types, stale links, additional R6 resources, or capabilities that omit
create.crates/ui/e2e/tests/resources.spec.tsEvidence
Unknown resource type produces no visible page-level warning
Create new carries the unknown type into an invalid draft
Acceptance criteria
CapabilityStatement.rest.resource.definition.