ehrbase / openEHR_SDK

A SDK to facilitate the development of openEHR applications
Other
48 stars 28 forks source link

Composition.composer is not serialized when composer is PartyIdentified #31

Closed ppazos closed 4 years ago

ppazos commented 4 years ago
  1. generate the composition using a template
  2. create code to initialize a composition instance, setting composition.composer with new PartyIdentified()
  3. when committing that composition to EHRBASE, the composition.composer attribute doesn't appear in the JSON.

Sample code:

LaborbefundComposition composition = new LaborbefundComposition();
...
composition.setLanguage(Language.EN);
        composition.setLocation("test");
        composition.setSettingDefiningcode(SettingDefiningcode.EMERGENCYCARE);
        composition.setTerritory(Territory.DE);
        composition.setCategoryDefiningcode(CategoryDefiningcode.EVENT);
        composition.setStartTimeValue(OffsetDateTime.now());

        PartyProxy composer = new PartyIdentified();
        composition.setComposer(composer);

The JSON serialization of composer only works setting new PartySelf(), but PARTY_SELF type is used for the patient, in general the patient is not the composer of the composition.

ppazos commented 4 years ago

2020-07-28: re-tested for https://github.com/ehrbase/project_management/issues/319

This is actually working, got the identified party correctly serialized:

  "composer" : {
    "_type" : "PARTY_IDENTIFIED",
    "identifiers" : [ {
      "_type" : "DV_IDENTIFIER",
      "id" : "Practitioner/f201"
    } ]
  },