Immunization dates never render: ViewDefinition uses choice-shorthand path `occurrenceDateTime`

Open Beginner friendly
#71 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
94/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
kotlin
Domain
mobile-dev

Research direction

Update the Immunization column in Binary-Immunization.json, changing its path from occurrenceDateTime to occurrence. Review ImmunizationItemRenderer and ImmunizationItemConfig for the existing date flow, then verify that Immunization resources display the “Given {date}” subtitle on Android and desktop.

Written by the indexing model from the issue text.

Description

Summary. The immunization section's "Given {date}" subtitle never shows,
against any server. The rendering side is fully wired —
ImmunizationItemRenderer renders the subtitle, ImmunizationItemConfig
ships showDate: true, and the generated state has the occurrenceDate
field — but the column silently never populates.

Cause. Binary-Immunization.json declares the column as:

{
  "name": "occurrenceDate",
  "path": "occurrenceDateTime",
  "type": "http://hl7.org/fhir/StructureDefinition/dateTime"
}

occurrenceDateTime is the FHIR choice-shorthand element name, not a valid
FHIRPath step: Immunization.occurrence[x] is addressed in FHIRPath by its
base name (occurrence, optionally occurrence.ofType(dateTime)), never by
the type-suffixed form. kotlin-fhirpath accordingly resolves only the bare
property ("occurrence" -> this.occurrence in the generated Immunization
accessor), so the shorthand path evaluates to empty — no error, the subtitle
just silently stays absent, which reads as "the data has no date."

Fix (verified). One word in Binary-Immunization.json:

-          "path": "occurrenceDateTime",
+          "path": "occurrence",

kotlin-fhirpath's sealed-interface glue unwraps Immunization.Occurrence.DateTime
to its FhirDateTime value, which lands in the typed occurrenceDate column
as intended. Verified end-to-end on Android and desktop against a live HAPI
server with real Immunization resources (47 of them, mixed date/dateTime
precision) — all dates render.

occurrence.ofType(dateTime) would be the spec-strict form if the engine's
ofType() supports it; the bare path has the advantage of also surviving an
occurrenceString resource, and matches the style already used elsewhere in
the app's views (e.g. the medication view navigates the bare medication
choice).

Happy to send the one-line PR.

Dominant language
Kotlin
Stars
1
Forks
9
Avg merge
1d 5h
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ohs-foundation/player-reference

All issues in ohs-foundation/player-reference

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.