Skip to content

Commit

Permalink
Configurable DAK processor (#493)
Browse files Browse the repository at this point in the history
* Fixed observation-style data elements
Enhanced questionnaire support
Streamlined concept/valueset creation and usage
Expanded support for base profiles used in context and selector logic

* Added configuration support to the data dictionary

* Fixed concept maps not being generated in some cases

* Code system generation fixes

* Fixed DTProcessor write issue

* #469: Added a libraryPath parameter to support specifying expected lo…
26701a1
…cation for library resources

* Updated translator to 3.3.2
Added skip-packages option to refresh ig operation
Removed operation processing for narrative refresh operations and drools operation
NOTE: This is known not to compile at this point, I've removed all the code related to the narrative refresh and drools operations locally, and have published a release based on that local code. This is in anticipation of a reorganization of the tooling that moves different operations into different packages, so I'm committing the changes here that are released as 2.6.0 from my local compile.

* Test Cases for DAK (#496)

* Unit test cases for WHO content.

* Fixed platform specific differences causing test failures

* Added separator to avoid windows discrapencies.

* simplify the tests, going to start with counts and drill down

* WIP Who tests

---------

Co-authored-by: Chalma Maadaadi <[email protected]>
Co-authored-by: Bryn Rhodes <[email protected]>

---------

Co-authored-by: Bryn Rhodes <[email protected]>
Co-authored-by: Chalma Maadaadi <[email protected]>
  • Loading branch information
3 people authored Nov 30, 2023
1 parent 3b42f54 commit 8c4092a
Show file tree
Hide file tree
Showing 19 changed files with 851 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ static Operation createOperation(String operationName) {
throw new IllegalArgumentException("Invalid operation: " + operationName);
}
}
}
}
3 changes: 1 addition & 2 deletions tooling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.13.2</version>
<version>2.14.2</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -304,7 +304,6 @@
<artifactId>model-jackson</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>info.cqframework</groupId>
<artifactId>engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
import org.opencds.cqf.tooling.Operation;
import org.opencds.cqf.tooling.terminology.SpreadsheetHelper;
import org.opencds.cqf.tooling.utilities.IOUtils;

import ca.uhn.fhir.context.FhirContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ca.uhn.fhir.context.FhirContext;

public class DTProcessor extends Operation {

private static final Logger logger = LoggerFactory.getLogger(DTProcessor.class);
Expand Down Expand Up @@ -362,7 +362,7 @@ private void mergeActions(PlanDefinition.PlanDefinitionActionComponent currentAc
currentAction.getCondition().add(newCondition);
}
else if (newCondition != null) {
currentCondition.getExpression().setDescription(String.format("(%s)\n OR (%s)", currentCondition.getExpression().getDescription(), newCondition.getExpression().getDescription()));
currentCondition.getExpression().setDescription(String.format("(%s)%n OR (%s)", currentCondition.getExpression().getDescription(), newCondition.getExpression().getDescription()));
}
}

Expand Down Expand Up @@ -473,7 +473,7 @@ private PlanDefinition.PlanDefinitionActionComponent processAction(Iterator<Row>
else {
for (String conditionValue : conditionValues) {
if (applicabilityCondition.length() > 0) {
applicabilityCondition.append(String.format("\n AND "));
applicabilityCondition.append(String.format("%n AND "));
}
applicabilityCondition.append("(");
applicabilityCondition.append(conditionValue);
Expand Down Expand Up @@ -690,11 +690,11 @@ private String buildPlanDefinitionIndex() {
}

public void writePlanDefinitionIndex(String outputPath) {
String outputFilePath = IOUtils.concatFilePath(outputPath,
"input", "pagecontent", "PlanDefinitionIndex.md");
String outputFilePath = outputPath + File.separator + "input" + File.separator + "pagecontent";
ensurePath(outputFilePath);

try (FileOutputStream writer = new FileOutputStream(outputFilePath)) {
String outputFile = outputFilePath + File.separator + "PlanDefinitionIndex.md";
try (FileOutputStream writer = new FileOutputStream(outputFile)) {
writer.write(buildPlanDefinitionIndex().getBytes());
writer.flush();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,15 +685,17 @@ else if (value instanceof Extension) {
if (ed.getType("Extension") != null && ed.getType("Extension").getProfile() != null && atlas != null && atlas.getValueSets() != null && atlas.getExtensions() != null) {
StructureDefinition sdExtension = atlas.getExtensions().getByCanonicalUrlWithVersion(ed.getType("Extension").getProfile().get(0).getValue());
ElementDefinition extensionElement = sdExtension.getDifferential().getElement().stream()
.filter(x -> x.hasBinding() && x.getBinding().hasValueSetElement()).findFirst().get();
.filter(x -> x.hasBinding() && x.getBinding().hasValueSetElement()).findFirst().orElse(null);

Type extensionValue = null;
if (extensionElement.getType("CodeableConcept") != null) {
extensionValue = new CodeableConcept();
}
if (extensionElement != null) {
Type extensionValue = null;
if (extensionElement.getType("CodeableConcept") != null) {
extensionValue = new CodeableConcept();
}

generateValue(sdExtension, extensionElement, extensionValue, givenValue);
value.addExtension(new Extension().setUrl(extensionElement.getShort()).setValue(extensionValue));
generateValue(sdExtension, extensionElement, extensionValue, givenValue);
value.addExtension(new Extension().setUrl(extensionElement.getShort()).setValue(extensionValue));
}
}
}
}
Expand Down
Loading

0 comments on commit 8c4092a

Please sign in to comment.