standardhealth / shr-es6-export

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

To fhir subelement #17

Closed arscan closed 6 years ago

arscan commented 6 years ago

Handles the following cases

addMapping('Patient.name.text', {'identity': 'shr', 'map': '<shr.simple.StringValue>'});
addMapping('Practitioner.active', {'identity': 'shr', 'map': '<shr.simple.DoubleNestedBooleanValue>.<shr.simple.NestedBooleanValue>.<shr.simple.BooleanValue>'});
addMapping('Practitioner.name.text', {'identity': 'shr', 'map': '<shr.simple.NestedStringValue>.<shr.simple.StringValue>'});

Note mapping 2 levels deep into name on the FHIR side, and from 2 and 3 levels deep on the shr ES6 side.

I also refactored the fixtures. Everything in the fhir namespace maps to a fhir resource. It references various 'simple' elements in the simple namespace. I'll reuse when I can, but will make new simple elements when necessary.

arscan commented 6 years ago

I agree, that code was gross. Updated it to be more readable.