[Bug] - Fix histopathology modifier values not being imported in CIM-11#45
[Bug] - Fix histopathology modifier values not being imported in CIM-11#45Xusifob wants to merge 1 commit into
Conversation
Block-type entries (no code) in modifiers.csv were silently skipped, so diseases referencing histopathology block IDs had empty modifiers. The import now builds a parent→children tree and expands block IDs into their coded leaf descendants. A new `category` column stores the direct parent block name for grouping, and a --force-modifiers flag allows re-importing modifiers on already-processed diseases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex, can you review this PR ? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08e07d6f68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| $this->output->writeln("Modifier {$case->value} already set in $cim11Disease"); | ||
| continue; | ||
| } | ||
| $cim11Disease->removeModifier($case); |
There was a problem hiding this comment.
Delete replaced modifiers on the owning side
When --force-modifiers is used for a disease that already has this modifier type, this call only removes the old Cim11Modifier from Cim11::$modifiers, which is the inverse side of the OneToMany(mappedBy: 'cim11') association; the owning Cim11Modifier::$cim11 still points at the disease and there is no orphan removal, so flush keeps the old row and adds the new one. Reloading the disease then returns duplicate modifiers of the same type instead of replacing the existing values, so the force re-import does not actually clean up stale modifiers.
Useful? React with 👍 / 👎.
Block-type entries (no code) in modifiers.csv were silently skipped, so diseases referencing histopathology block IDs had empty modifiers. The import now builds a parent→children tree and expands block IDs into their coded leaf descendants. A new
categorycolumn stores the direct parent block name for grouping, and a --force-modifiers flag allows re-importing modifiers on already-processed diseases.