Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mdht-dev] MDHT Java code generation for setters in relationships

Hello all

Yet another MDHT question ...

I'm working with the ihe model. In the Medication class (which derives from SubstanceAdminstration) there is an association internalReference. Code generation made a getter out of it, but no setter.

/**

* <!-- begin-user-doc -->

* <!-- end-user-doc -->

* @model kind="operation" required="true" ordered="false"

*        annotation="http://www.eclipse.org/uml2/1.1.0/GenModel body='self.getActs()->select(act : cda::Act | not act.oclIsUndefined() and act.oclIsKindOf(ihe::InternalReference)).oclAsType(ihe::InternalReference)'"

* @generated

*/

EList<InternalReference> getInternalReferences();

To add an internalReference I add now directly an internalReference like this the relationship:

InternalReference internalReference = IHEFactory.eINSTANCE.createInternalReference().init();

EntryRelationship entryRelationShip = CDAFactory.eINSTANCE.createEntryRelationship();

entryRelationShip.setTypeCode(x_ActRelationshipEntryRelationship.RSON);

entryRelationShip.setAct(internalReference);

this.getMdht().getEntryRelationships().add(entryRelationShip);

This is working, but needs coding for every insertions, so my two questions:
  1. Are objects insertions to relations somehow supported or can be specified in modeling? (My models show the same code generation behaviour like the ihe model, read only getters)?
  2. Is my described way with adding an entry to a relationship the correct way or is there a better way?

Thanks for any advice
Oliver




--
oliver egger


-->  30.3.2016: FHIR workshop und hands-on, www.ahdis.ch/anmeldung

mobile: +41765795005
twitter: @oliveregger

ahdis gmbh
agile health data information systems
bertastrasse 4
8003 zürich
switzerland

Back to the top