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

Fix the error : Transform evaluate takes 1 parameter but 2 were found #330

Open
Wambere opened this issue Jan 23, 2025 · 0 comments
Open
Labels

Comments

@Wambere
Copy link
Contributor

Wambere commented Jan 23, 2025

When validating a .json structureMap that has been generated from a .map structureMap (which has been validated and is valid), we're getting the following errors

EFSITY: :: INFO  :: Starting FHIR resource validation
EFSITY: :: INFO  :: Input file path project_name/structure_maps/json/anc/anc_extraction.json
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
EFSITY: :: INFO  :: project_name/structure_maps/json/anc/anc_extraction.json
EFSITY: :: ERROR ::  StructureMap.group[1].rule[0].rule[0].rule[1].target[0] - Transform c not checked yet
EFSITY: :: ERROR ::  StructureMap.group[1].rule[0].rule[0].rule[3].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[1].rule[0].rule[0].rule[3].rule[1].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[1].rule[0].rule[0].rule[4].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[2].rule[0].rule[0].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[2].rule[5].rule[0].rule[1].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[2].rule[5].rule[0].rule[2].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[2].rule[9].rule[1].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[2].rule[9].rule[2].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[4].rule[0].rule[4].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[4].rule[0].rule[6].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[4].rule[0].rule[7].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[5].rule[0].rule[4].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[5].rule[0].rule[6].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[5].rule[0].rule[7].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[6].rule[0].rule[5].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[6].rule[0].rule[6].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[6].rule[0].rule[7].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[7].rule[0].rule[5].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[7].rule[0].rule[6].rule[0].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: :: ERROR ::  StructureMap.group[7].rule[0].rule[7].target[0] - Transform evaluate takes 1 parameter(s) but 2 were found
EFSITY: Completed in 0 mins 05 secs  

This is coming from parts in the .json structureMap like

  "target": [
    {
      "context": "enPeriod",
      "contextType": "variable",
      "element": "start",
      "transform": "evaluate",
      "parameter": [
        {
          "valueId": "src"
        },
        {
          "valueString": "now()"
        }
      ]
    }
  ]

Which is generated from the following in a .map

src -> enPeriod.start = evaluate(src, now()) "r_en_per_start";

The evaluate in the .map needs two params, the source and the FHIRPath expression in order to evaluate correctly
So how can this be written to ensure the .json structureMap is also valid with 1 param?

For more context:

@Wambere Wambere added efsity FCT features Validation labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant