Skip to main content

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

thx and have a nice weekend! next questions will be how to model in a different namespace ...
oliver

On 29 January 2016 at 18:16, Sean Muir <sean.w.muir@xxxxxxxxx> wrote:
This falls into some of the short cuts supported and exposed through the modeling
The getInternalReferences() is meant to be a connivence method
The method you show to add a reference is valid - there has been an outstanding need to simplify parts of the API

mostly we looked into a fluent api

so 
1 - not currently but you can extend the model to add methods
2 - its currently the best way

thanks

Sean








On Jan 29, 2016, at 11:06 AM, Oliver Egger <oliver.egger@xxxxxxxx> wrote:

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
_______________________________________________
mdht-dev mailing list
mdht-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdht-dev


_______________________________________________
mdht-dev mailing list
mdht-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mdht-dev




--
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