Code Monkey home page Code Monkey logo

redmatch's Introduction

Redmatch

Redmatch is a tool designed to transform REDCap forms into FHIR resources.

Table of contents

General info

In recent years, clinical trials and studies have increasingly started using electronic systems to capture data required to conduct a range of analyses, such as the effectiveness of a new treatment or its economic value. However, even though these tools allow creating electronic forms easily, they are not designed to capture clinical data, impose few constraints on what should be captured and also have limited data sharing capabilities. One of the most popular tools currently used to capture research data is REDCap, a web application created at Vanderbilt University. Redmatch is a tool designed to define transformation rules between REDCap forms and FHIR resources. This allows exporting REDCap content in a standardised way.

This tool is targeted at domain experts that know about FHIR but don't necessarily have programming language skills. The rules engine implements a domain specific language that allows defining the transformation rules without the need to write any code.

Screenshots

Redmatch Visual Studio Code Plugin

Technologies

  • Spring Boot
  • HAPI FHIR
  • ANTLR
  • Visual Studio Code

Usage

The documentation can be accessed here.

Redmatch is experimental software. Use it at your own risk! Take a look at the full description of the current set of known issues.

Features

  • Domain specific language to define transformations between REDCap and FHIR
  • Integration with REDCap through its API
  • Support to define mappings to standardised terminologies
  • Export to FHIR JSON-LD format, compatible with Pathling

Status

The project is in progress. It is being developed as part of the Australian Genomics Clinical Phenotype Capture project.

Credits

This work is partly funded by Australian Genomics. Australian Genomics is supported by the National Health and Medical Research Council (GNT1113531).

Contact

Created by @ametke.

redmatch's People

Contributors

ametke avatar dependabot[bot] avatar johngrimes avatar lawley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redmatch's Issues

Add support for repeatable instruments in REDCap

Redmatch does not currently support repeatable instruments. This functionality might be useful in scenarios where multiple elements need to be captured, such as genomic test results, for example.

Implement support for aliases

Similar to FHIR Shorthand, using aliases can help make rules more readable. For example, in FSH you can define aliases like this:

Alias: SCT = http://snomed.info/sct

Then you can use the alias instead of the full URI.

Invalid reference checks

The compiler is generating an invalid error when a reference to a resource type points at a profile. For example, a reference of type Encounter that points at a profile of Encounter should be valid.

Missing default FHIR package on first run

There seems to be a problem where the following error gets thrown upon the first run of the plugin:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.RuntimeException: There was a problem loading FHIR basic types.
    at au.csiro.redmatch.exporter.HapiReflectionHelper.init(HapiReflectionHelper.java:112)
    at au.csiro.redmatch.exporter.HapiReflectionHelper.<init>(HapiReflectionHelper.java:59)
    at au.csiro.redmatch.lsp.RedmatchLanguageServer.<init>(RedmatchLanguageServer.java:48)
    at au.csiro.redmatch.lsp.Application.main(Application.java:26)
    ... 8 more
Caused by: java.nio.file.NoSuchFileException: /Users/obr187/.fhir/packages/hl7.fhir.r4.core#4.0.1/package
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
    at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
    at java.base/java.nio.file.Files.readAttributes(Files.java:1764)
    at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
    at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
    at java.base/java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
    at java.base/java.nio.file.FileTreeIterator.<init>(FileTreeIterator.java:71)
    at java.base/java.nio.file.Files.walk(Files.java:3825)
    at java.base/java.nio.file.Files.walk(Files.java:3879)
    at au.csiro.redmatch.util.FhirUtils.getStructureDefinitions(FhirUtils.java:42)
    at au.csiro.redmatch.exporter.HapiReflectionHelper.init(HapiReflectionHelper.java:68)
    ... 11 more

Redmatch server failure

When I run mvn clean verify I get error from the server as stated below: I've tried to install

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Redmatch
[INFO] Redmatch UI
[INFO] Redmatch Server
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Redmatch 1.3.4
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ redmatch ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (copy-resources) @ redmatch ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Redmatch UI 1.3.4
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ ui ---
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:exec (exec-yarn-install) @ ui ---
yarn install v1.22.17
warning ../../../../../package.json: No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.56s.
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:exec (exec-yarn-antlr4ts) @ ui ---
yarn run v1.22.17
warning ../../../../../package.json: No license field
$ antlr4ts -visitor src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.g4 src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.interp' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.g4'
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.ts' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.g4'
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.tokens' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.g4'
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.interp' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4'
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.ts' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4'
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchGrammarListener.ts' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4'
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchGrammarVisitor.ts' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4'
Generating file '/Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.tokens' for grammar 'src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4'
Done in 0.92s.
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:exec (exec-yarn-build) @ ui ---
yarn run v1.22.17
warning ../../../../../package.json: No license field
$ react-app-rewired build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run the following command: npx browserslist --update-db
Compiled with warnings.

src/api/RedmatchApi.ts
Line 9:10: 'AxiosResponse' is defined but never used @typescript-eslint/no-unused-vars
Line 10:10: 'IParameters' is defined but never used @typescript-eslint/no-unused-vars
Line 68:1: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export

src/components/CodeSearch.tsx
Line 72:13: 'ServerResponse' is defined but never used @typescript-eslint/no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

862.75 KB build/static/js/2.a16a9a91.chunk.js
73.6 KB build/json.worker.js
44.03 KB build/editor.worker.js
28.84 KB build/static/js/3.0f82bb1b.chunk.js
20.42 KB build/static/js/main.a8940e43.chunk.js
12.5 KB build/static/css/2.92855bb5.chunk.css
1.17 KB build/static/js/runtime-main.2126936a.js
278 B build/static/css/main.6dea0f05.chunk.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

yarn global add serve
serve -s build

Find out more about deployment here:

https://cra.link/deployment

Done in 45.92s.
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (copy-resources) @ ui ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/ui/server/src/main/antlr4
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Redmatch Server 1.3.4
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ server ---
[INFO] Deleting /Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/server/target
[INFO]
[INFO] --- build-helper-maven-plugin:3.2.0:add-source (default) @ server ---
[INFO] Source directory: /Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/server/target/generated-sources/antlr4/java added.
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (copy-resources) @ server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/server/server/src/main/antlr4
[INFO]
[INFO] --- antlr4-maven-plugin:4.8-1:antlr4 (antlr-java) @ server ---
[INFO] ANTLR 4: Processing source directory /Users/ethelschinedu/fhirGenomics/fhirGenomeApp/redMatch/redmatch/server/src/main/antlr4
[INFO] Processing grammar: au/csiro/redmatch/grammar/RedmatchLexer.g4
[INFO] Processing grammar: au/csiro/redmatch/grammar/RedmatchGrammar.g4
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Redmatch ........................................... SUCCESS [ 0.278 s]
[INFO] Redmatch UI ........................................ SUCCESS [ 48.213 s]
[INFO] Redmatch Server .................................... FAILURE [ 1.338 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.211 s
[INFO] Finished at: 2021-11-17T16:58:27+00:00
[INFO] Final Memory: 33M/381M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party (add-third-party) on project server: The plugin org.codehaus.mojo:license-maven-plugin:2.0.0 requires Maven version 3.5.4 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginIncompatibleException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :server

I noticed some issues with yarn add -W caniuse-lite and have tried to resolve it and getting

error An unexpected error occurred: "https://registry.yarnpkg.com/hl7.fhir.us.mcode: Not found".

Please, is there any help you can offer?

Installation/Tutorial Issues

Hello,

i've had a few problems following the installation tutorial.
First problem: Dead Link for redcap dictionary (FIXED: can be found manually)
Secound problem: Dictonary has doubles in it (FIXED: you have to rename a few variables yourself before uploading)
Third (UNFIXED) problem: Error during

maven clean verify :

(---------- SNIPPLET -------------)
[INFO] Building Redmatch UI 1.3.4 [2/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ ui ---
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:exec (exec-yarn-install) @ ui ---
yarn install v1.22.10
warning ../package.json: No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.99s.
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:exec (exec-yarn-antlr4ts) @ ui ---
yarn run v1.22.10
warning ../package.json: No license field
$ antlr4ts -visitor src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.g4 src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4
error(7): cannot find or open file: src/grammar/au/csiro/redmatch/grammar/RedmatchLexer.g4
error(7): cannot find or open file: src/grammar/au/csiro/redmatch/grammar/RedmatchGrammar.g4
child process exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[ERROR] Command execution failed.
(---------- END OF SNIPPLET -------------)

It feels like some files in the repo have been moved incorrectly? Can someone help me with this issue?
Thanks in advance

Cheers Raphael

Mapping calculation could take rule conditions into account

It would be good if the calculation of the mappings took into account conditions like VALUE(xx) != 3 and a CONCEPT_SELECTED used in the body of the rules. This pattern is quite common if the author is only intersted in some of the values of a drop down box, for example, if only abnormal values trigger the creation of FHIR resources. At the moment the mappings include all the values of the drop down box, even though in this case value 3 will never be assigned.

Support SQL and AUTOCOMPLETE fields

REDCap dropbox fields can be configured to support autocomplete and the type then becomes AUTOCOMPLETE. This is currently ignored by Redmatch and a type of NONE is assigned. SQL queries are also currently unsupported in Redmatch and these can also be turned into AUTOCOMPLETE fields.

Improve error message structure in REST API

The error messages at the REST API level could be more detailed. At the moment only a string is returned. It would be better to return structured JSON, like in FHIR or like the GitHub API, e.g.,

ย 

HTTP/1.1 422 Unprocessable Entity
Content-Length: 149

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Issue",
      "field": "title",
      "code": "missing_field"
    }
  ]
}

Implement support for FHIR implementation guides

The application should support IGs in the following way:

  • A code system for validation should be created based on the IG
    • The IG should be based on the current supported FHIR version
    • The main grammar should work fine, but the validation needs to be updated
  • The validation and autocomplete functionality (when implemented) should support referring to any extensions through shortcuts based on the names defined in the IG
  • The FHIR exporter needs to identify that a path shortcut is an extension to create the extensions in FHIR
  • The validator should be aware of profiles and issue errors accordingly

Quick fix for mappings is not escaping descriptions

When a mapping is missing and it is added using a quick fix, the label is not being escaped.

For example:

cmdt_result___1|'A cause for this patient's condition has not been identified' -> http://snomed.info/sct|138875005|'SNOMED CT Concept'; should be cmdt_result___1|'A cause for this patient\'s condition has not been identified' -> http://snomed.info/sct|138875005|'SNOMED CT Concept';

Also, a warning is being shown when the user manually escapes the string.

Server installation configuration?

Hello,

i tried to install redmatch onto a virtual machine, so that multiple parties can access and try it out. In the end it even showed a loading screen which then redirected to localhost (on client PC) which obviously had no service (i think it was for keycloak) running.
Is there a server configuration/version available? This would be very helpful, probably also for other people who can not install it on a local machine. Or is there an easy fix to suppress the redirection to local machine? Maybe just put in an option for an IP instead of the localhost reference?
Thanks in advance!

Cheers Raphael

REST operations are inconsistent

A PUT operation with a project resource that has all required fields should create the project if it doesn't exist. Also, a POST operation with a project should be rejected if it contains an id and if a complete project is POSTed then the system should not create the project in the usual way but rather copy all its contents.

Resource creation behaviour issue

Redmatch creates a single resource when a rule does not reference any REDCap fields. However, the behaviour when a rule has a reference to another resource is incorrect. Currently Redmatch creates a single resource if no other attributes reference any fields, regardless of whether the referenced resource is a single resource or not. When the referenced resource is created by a set of rules that do reference REDCap fields and hence multiple resources instances are created, multiple referencing resources should also be created.

Add visualisation of transformation result

At the moment there is no way of visualising the result of the transformation, i.e., the FHIR resources, until they are uploaded to a FHIR server. It would be useful to be able to generate a visualisation in Redmatch so the author can verify that the rules are in fact producing the desired outcome.

Compiler is not validating that references exist

The compiler could look at the definitions of FHIR resources and warn the user if a reference has been specified to a resource that doesn't exist. For example,

TRUE { Patient<p>: * identifier.type.text = 'Medicare Number' }
TRUE { Observation<sex>: * subject = REF(Patient<r>) }

should generate an error highlighting that no resource Patient<r> exists.

Need an option to export the data from multiple projects

Currently, only the data from a single project can be exported at a time. This means that data has to be merged externally. It would be good to have the option of exporting data from multiple projects as a single collection of ND-JSON files.

Mappings should be validated using the terminology server

Currently, mappings are not being validated. This is not problematic if the mappings are generated using the UI because the UI uses the terminology server to find the target concepts, so these will be valid. However, if the mappings are loaded using an Excel spreadsheet, then some of these might be invalid and the target FHIR representation might include invalid concepts.

Mappings disappear unexpectedly

There seem to be some circumstances where existing mappings disappear unexpectedly. I suspect this has to do with a case where the rules are saved with errors and therefore the system assumes no mappings are necessary and thus erases any current mappings. This is obviously the expected behaviour.

Unable to Create New Project

Hello! I am a graduate student researcher with Columbia University's Department of Biomedical Informatics and I am looking to integrate Redmatch as part of a larger clinical data interoperability pipeline. I have been deploying this through Docker on my local machine along with a HAPI FHIR server. However, I have been running into some issues when trying to create a new project in Redmatch.

Initially, I was running into this error that would pop-up immediately after logging in as well as when clicking 'Save': Unable to create new project: TypeError: Cannot read property 'status' of undefined
image

Due to the limitations of the implementation of the HAPI server I am working with, I had to try and switch Redmatch off 8080 to a different port, but I couldn't avoid getting this error. It also seemed to be consistently associated with a call to localhost:8082/project and I didn't see anywhere in the code a direct call to this port. The one spot I could find was in the React code referring to the environmental variable as defined in the Dockerfile, which did not mention 8082. I could not get it to work even being the only Docker container running.

I stepped away from this for a week or so, but then today when I went to run Redmatch alone again, I did not see the undefined error. However, today I did not have that error and instead ran into this 502 error: Unable to create new project: Error: Request failed with status code 502

image

Would you be able to help me diagnose either of these issues (if the first were to come up again)? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.