Skip to content
This repository has been archived by the owner on Oct 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #24 from standardhealth/fix_possible_identifiers_f…
Browse files Browse the repository at this point in the history
…or_expand

Fix possibleIdentifiers (affects shr-expand only)
  • Loading branch information
cmoesel authored Apr 18, 2018
2 parents 21336f5 + faa1d22 commit ccf89f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ class Value {

let card = this.effectiveCard;
if (this.card != null && this.effectiveCard != null && this.card != this.effectiveCard && this.card.history) {
card.history = this.card.history
card.history = this.card.history;
}

return {
Expand Down Expand Up @@ -1624,11 +1624,17 @@ class IdentifiableValue extends Value {

getPossibleIdentifiers(withIncludesTypeIdentifiers=false) {
const idMap = new Map();
// First add its original identifier
idMap.set(this.identifier.fqn, this.identifier);
// Then add its effective identifier
// NOTE: This is usually in the constraint history, but at one point in shr-expand, it might not be
idMap.set(this.effectiveIdentifier.fqn, this.effectiveIdentifier);
// Then add any other historical type constraints
const typeConstraintsHistories = this.constraintHistory.type.own.histories;
for (const tch of typeConstraintsHistories) {
idMap.set(tch.constraint.isA.fqn, tch.constraint.isA);
}
// Then add any include type constraints if requested
if (withIncludesTypeIdentifiers) {
const includesTypeConstraints = this.constraintsFilter.own.includesType.constraints;
for (const itc of includesTypeConstraints) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shr-models",
"version": "5.5.1",
"version": "5.5.2",
"description": "Models used to represent SHR namespaces, data elements, value sets, code systems, and mappings for import/export",
"author": "",
"license": "Apache-2.0",
Expand Down

0 comments on commit ccf89f7

Please sign in to comment.