Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review Notes column updated: SpreadsheetValidateVSandCS output adjusted; #538

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package org.opencds.cqf.tooling.cli;

//import org.opencds.cqf.tooling.jsonschema.SchemaGenerator;
import org.opencds.cqf.tooling.casereporting.transformer.ErsdTransformer;
import org.opencds.cqf.tooling.dateroller.DataDateRollerOperation;
import org.opencds.cqf.tooling.terminology.*;
import org.opencds.cqf.tooling.terminology.templateToValueSetGenerator.TemplateToValueSetGenerator;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
Expand Down Expand Up @@ -213,8 +218,10 @@ static Operation createOperation(String operationName) {
return new QICoreElementsToSpreadsheet();
case "StripGeneratedContent":
return new StripGeneratedContentOperation();
case "SpreadsheetValidateVSandCS":
return new SpreadsheetValidateVSandCS();
default:
throw new IllegalArgumentException("Invalid operation: " + operationName);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class StructureDefinitionBindingObject extends StructureDefinitionBaseObj
String bindingValueSetURL;
String bindingValueSetVersion;
String bindingValueSetName;
String bindingObjectExtension;
int cardinalityMin;

public String getBindingStrength() {return bindingStrength;}
public void setBindingStrength(String bindingStrength) {this.bindingStrength = bindingStrength;}
Expand All @@ -17,4 +19,8 @@ public class StructureDefinitionBindingObject extends StructureDefinitionBaseObj
public void setBindingValueSetName(String bindingValueSetName) {this.bindingValueSetName = bindingValueSetName;}
public String getCodeSystemsURLs() {return codeSystemsURLs;}
public void setCodeSystemsURLs(String codeSystemsURLs) {this.codeSystemsURLs = codeSystemsURLs;}
public String getBindingObjectExtension() {return bindingObjectExtension;}
public void setBindingObjectExtension(String bindingObjectExtension) {this.bindingObjectExtension = bindingObjectExtension;}
public int getCardinalityMin(){return cardinalityMin;};
public void setCardinalityMin(int cardinalityMin){this.cardinalityMin = cardinalityMin;}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.ElementDefinition;
import org.hl7.fhir.r4.model.StructureDefinition;
import org.hl7.fhir.r4.model.ValueSet;
import org.hl7.fhir.r4.model.*;

import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -75,6 +72,10 @@ private void getBindings(String sdName, List<ElementDefinition> eds, String sdUR
if (ed.hasMin() && ed.hasMax()) {
String edCardinality = ed.getMin() + "..." + ed.getMax();
sdbo.setCardinality(edCardinality);
if(ed.getMin() > 0){sdbo.setCardinalityMin(ed.getMin());}
}
if(getBindingObjectExtension(ed).equalsIgnoreCase("qicore-keyelement")){
sdbo.setBindingObjectExtension("qicore-keyelement");
}
String bindingValueSet = ed.getBinding().getValueSet();
String pipeVersion = "";
Expand Down Expand Up @@ -129,6 +130,17 @@ else if (ed.hasExtension()) {
}
}

private String getBindingObjectExtension(ElementDefinition ed) {
for (Extension ext : ed.getExtension()) {
if (!ext.getUrl().isEmpty()) {
if (ext.getUrl().contains("qicore-keyelement")) {
return "qicore-keyelement";
}
}
}
return "";
}

private void visitExtensions(ElementDefinition ed, Map<String, StructureDefinitionBindingObject> bindingObjects, String sdName, String sdURL, String sdVersion) {
StructureDefinitionBindingObject sdbo = new StructureDefinitionBindingObject();
sdbo.setSdName(sdName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ private void addBindingObjectRowDataToCurrentSheet(XSSFSheet currentSheet, int r

currentCell = currentRow.createCell(cellCount++);
if ((null != bo.getBindingStrength() && bo.getBindingStrength().equalsIgnoreCase("required")) ||
null != bo.getMustSupport() && bo.getMustSupport().equalsIgnoreCase("Y")) {
null != bo.getMustSupport() && bo.getMustSupport().equalsIgnoreCase("Y") ||
null != bo.getBindingObjectExtension() && bo.getBindingObjectExtension().equalsIgnoreCase("qicore-keyElement") ||
bo.getCardinalityMin() > 0
) {
currentCell.setCellValue("Needed");
}
}
Expand Down
Loading