lantanagroup / FHIR.js

Node.JS library for serializing/deserializing FHIR resources between JS/JSON and XML using various node.js XML libraries
Apache License 2.0
102 stars 29 forks source link

Parsing of custom profiles #36

Closed lschmierer closed 3 years ago

lschmierer commented 3 years ago

This is a first step on the path to #29.

The PR adresses 4 issues:

  1. It enables parsing of custom StructureDefinitions where id != type by using structureDefinition.type instead of structureDefinition.id when extracting (snapshot) element ids.
  2. Changes a wrong Typescript Definition for ParseConformance.parsedStructureDefinitions. (Thereby fixing an error in ensurePropertyMetaData, which actually did nothing when it was called from the ParseConformance constructor.
  3. Fix handling of ids in FHIR version 4.0.1 ressources. Latest FHIR resources use code "http://hl7.org/fhirpath/System.String" instead of "id" for resource ids.
  4. Call ensurePropertyMetaData for Backbone elements.
lschmierer commented 3 years ago

Since ensurePropertyMetaData now actually does something, the tests take longer and sometimes timeout. I will increase the mocha timeout for the Serialization and Validation test cases.

seanmcilvenna commented 3 years ago

I've merged your changes and published them as 4.8.0 on NPM. Thanks!@