standardhealth / shr-es6-export

ES6 library for exporting SHR models to ES6 classes
Apache License 2.0
3 stars 0 forks source link

fromFHIR doesn't handle "is type" correctly #39

Closed dehall closed 5 years ago

dehall commented 5 years ago

Example, from the spec as of ~ mcode 0.5:

Abstract Element:   ExistenceAssertion
Based on:           Finding
Description:        "An assertion of a relationship, situation, condition, or other phenomenon is present or absent, or an event has (or has not) taken place.
For assertions, the FindingTopicCode represents the thing asserted to be present or absent; i.e., the type of condition, event, relationship or phenomenon that is being asserted to exist or not exist."
FindingTopicCode is type ConditionOrDiagnosisCode 

Generated ES6 class snippet:

    if (fhir['code'] != null) {
      inst.conditionOrDiagnosisCode = FHIRHelper.createInstanceFromFHIR('shr.base.ConditionOrDiagnosisCode', fhir['code'], shrId, allEntries, mappedResources, referencesOut, false);
    }

should be inst.findingTopicCode = ...

dehall commented 5 years ago

Fixed by #41