Fixed
Details
Assignee
Mike SeatonMike SeatonReporter
Mike SeatonMike SeatonComplexity
LowPriority
Should
Details
Details
Assignee
Mike Seaton
Mike SeatonReporter
Mike Seaton
Mike SeatonComplexity
Low
Priority
Created March 2, 2023 at 12:06 AM
Updated April 12, 2023 at 7:15 PM
Resolved April 12, 2023 at 7:15 PM
I have been working on adding support for DrugReferenceMaps to Initializer, to allow specifying Mappings when creating/updating new Drugs from CSV.
The paradigm here is that the row represents a Drug and associated properties, and saving the Drug should cascade down into the nested properties and save.
So, if a new Drug contains new, unsaved DrugReferenceMaps which in turn contain new, unsaved ConceptReferenceTerms, saving a Drug should cascade down and also correctly save the DrugReferenceMaps and ConceptReferenceTerms without throwing any errors.
Unfortunately this is not the case.
Investigating, and comparing to how ConceptMap is implemented, I find 2 key differences in the ConceptMap.hbm.xml and DrugReferenceMap.hbm.xml files, which both lead to errors in saving Drugs:
ConceptMap has an unsaved-value="0" attribute on it's id property
ConceptMap has a cascade="save-update" attribute on it's conceptReferenceTerm association
If I add both of these into the DrugReferenceMap.hbm.xml file, I am able to save a Drug with new, unsaved Maps and Terms. If I do not, I get errors in saving.
/ / - FYI - should be easy enough to fix in core (and backport to whatever branches are desired).