-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
The workbench deployment consists of a number of containers that together compromise the application. Each of the components is briefly described here.
The CQF Ruler is an implementation of the FHIR Clinical Reasoning Module. It is essentially a HAPI FHIR server with a built-in CQL engine. It stores FHIR resources in the deployed PostgreSQL instance. CQL is evaluated by submitting a payload to the $cql
extended operation (see here for the full payload format). For example:
curl 'https://workbench.phema.science:4321/fhir/$cql' \
-H 'Content-Type: application/json' \
--data-binary '{"resourceType":"Parameters","parameter":[{"name":"code","valueString":"define _: 1 + 1"}]}'
The Workbench API is the API backend for the PhEMA Workbench. It is a RESTful API server written in Java, and includes cql-on-omop
and elm-utils
as dependencies.
Currently, there are endpoints for running cql-on-omop
, translating CQL to ELM, and generating a Graphviz DOT representation of a CQL library. The Workbench API is still in the early phases of development. More documentation to follow.
The Workbench App (code in this repository) is the part of the PhEMA Workbench that runs in the browser. It is primarily written in TypeScript and React, and the code is arranged in a monorepo using a Yarn workspace. See the main readme for more information. All packages are contained in the /packages
directory. The packages are briefly described below.
The connection-manager
package contains the code responsible for adding and viewing server connections (editing and deleting are still TODO). The interface for the ConnectionManager
React component is:
interface ConnectionManagerProps {
connections: Connections;
setConnections: (connections: Connections) => void;
}
See all package type definitions here.
The cql-editor
package exports the CQL code editor component, which uses Monaco.
The fhir-utils
package contains utilities for working with FHIR servers and data.
The phenotype-visualizer
package contains the very early stages of the browser part of the phenotype visualization code.
See dedicated wiki page.
The terminology-utils
package contains utility functions for working with FHIR terminologies and OMOP concept sets.
The workbench-app
is the main entry point. It contains the main outer component mounted into the DOM.
The workbench-common
package contains components that are shared between multiple other packages.
The CORS proxy is an instance of cors-anywhere
and is mainly to support querying the VSAC FHIR server, which unfortunately is not correctly configured to handle cross-origin requests.
To use the CORS proxy, just add the desired URL as a suffix in the request:
fetch('https://cors.phema.science:4321/http://cts.nlm.nih.gov/fhir')
.then(response => console.log(response))
The ingress is a simple Nginx reverse proxy that forwards requests to the appropriate service depending on the URL.