Skip to content

Commit

Permalink
Add check to naiveExpand for existence of compose codes
Browse files Browse the repository at this point in the history
  • Loading branch information
barhodes committed Oct 10, 2024
1 parent f236c13 commit 04f1b62
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,18 @@ public ValueSet.ValueSetExpansionParameterComponent createNaiveParameter() {

@Override
public void naiveExpand() {
var expansion = newExpansion().addParameter(createNaiveParameter());

for (var code : getCodesInCompose(fhirContext, getValueSet())) {
expansion
.addContains()
.setCode(code.getCode())
.setSystem(code.getSystem())
.setVersion(code.getVersion())
.setDisplay(code.getDisplay());
var codes = getCodesInCompose(fhirContext, getValueSet());
if (codes != null && !codes.isEmpty()) {
var expansion = newExpansion().addParameter(createNaiveParameter());
for (var code : codes) {
expansion
.addContains()
.setCode(code.getCode())
.setSystem(code.getSystem())
.setVersion(code.getVersion())
.setDisplay(code.getDisplay());
}
getValueSet().setExpansion(expansion);
}
getValueSet().setExpansion(expansion);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,18 @@ public ValueSet.ValueSetExpansionParameterComponent createNaiveParameter() {

@Override
public void naiveExpand() {
var expansion = newExpansion().addParameter(createNaiveParameter());

for (var code : getCodesInCompose(fhirContext, getValueSet())) {
expansion
.addContains()
.setCode(code.getCode())
.setSystem(code.getSystem())
.setVersion(code.getVersion())
.setDisplay(code.getDisplay());
var codes = getCodesInCompose(fhirContext, getValueSet());
if (codes != null && !codes.isEmpty()) {
var expansion = newExpansion().addParameter(createNaiveParameter());
for (var code : codes) {
expansion
.addContains()
.setCode(code.getCode())
.setSystem(code.getSystem())
.setVersion(code.getVersion())
.setDisplay(code.getDisplay());
}
getValueSet().setExpansion(expansion);
}
getValueSet().setExpansion(expansion);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,18 @@ public ValueSet.ValueSetExpansionParameterComponent createNaiveParameter() {

@Override
public void naiveExpand() {
var expansion = newExpansion().addParameter(createNaiveParameter());

for (var code : getCodesInCompose(fhirContext, getValueSet())) {
expansion
.addContains()
.setCode(code.getCode())
.setSystem(code.getSystem())
.setVersion(code.getVersion())
.setDisplay(code.getDisplay());
var codes = getCodesInCompose(fhirContext, getValueSet());
if (codes != null && !codes.isEmpty()) {
var expansion = newExpansion().addParameter(createNaiveParameter());
for (var code : codes) {
expansion
.addContains()
.setCode(code.getCode())
.setSystem(code.getSystem())
.setVersion(code.getVersion())
.setDisplay(code.getDisplay());
}
getValueSet().setExpansion(expansion);
}
getValueSet().setExpansion(expansion);
}
}

0 comments on commit 04f1b62

Please sign in to comment.