Skip to content

Commit

Permalink
feat: add product of tmn-c and tmn-p
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickskowronekdkfz committed Nov 14, 2024
1 parent 4d09268 commit a7c4def
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions packages/lib/src/cql-translator-service/ast-to-cql-translator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ const getSingleton = (criterion: AstBottomLayerValue): string => {
case "observationMolecularMarkerDNAchange":
case "observationMolecularMarkerSeqRefNCBI":
case "observationMolecularMarkerEnsemblID":
case "department":
case "TNMp":
case "TNMc": {
case "department": {
if (typeof criterion.value === "string") {
// TODO: Check if we really need to do this or we can somehow tell cql to do that expansion it self
if (
Expand Down Expand Up @@ -219,7 +217,33 @@ const getSingleton = (criterion: AstBottomLayerValue): string => {

break;
}
case "TNMp":
case "TNMc": {
if (typeof criterion.value === "string") {
expression += "(";

expression += substituteCQLExpression(
criterion.key,
myCriterion.alias,
myCQL,
criterion.value as string,
);
expression += ") or (";

const myCQL2: string = cqltemplate.get(
myCriterion.type == "TNMc" ? "TNMp" : "TNMc",
);

expression += substituteCQLExpression(
criterion.key,
myCriterion.alias,
myCQL2,
criterion.value as string,
);
expression += ")";
}
break;
}
case "conditionRangeDate": {
expression += substituteRangeCQLExpression(
criterion,
Expand Down

0 comments on commit a7c4def

Please sign in to comment.