Git Product home page Git Product logo

polecat's Introduction

CircleCI Build Status

Polecat

A tool for browsing the Australian Medicines Terminology (AMT), using data from an instance of Medserve.

Features

  • Provides a full-text search facility for locating medicine concepts within AMT.
  • Supports searching of CTPP, TPP, TPUU, TP, MPP, MPUU, MP and substance concepts. Concept types are displayed alongside search results.
  • Selecting a concept renders an object diagram, showing its details along with its relationship to other concepts, in a manner which is faithful to the AMT Product Model.
  • Relationship types are rendered differently depending on whether they have inheritance, association or aggregation semantics.
  • ARTG IDs are shown against applicable concepts, along with a link to the relevant page on the TGA web site.
  • Re-focus on a related concept by clicking its SCT ID.
  • Copy an SCT ID or preferred term to the clipboard by clicking the clipboard icon adjacent.
  • Where child concepts or related packages are shown in large numbers, these are grouped with a link to the full listing.
  • The AMT Product Model view can be panned around by clicking and dragging, using scroll wheels or a trackpad. The view can be re-centred by double-clicking.
  • Control visibility of each type of concept. Settings are remembered once set.
  • Perform an advanced search, using the following fields:
    • Contains text - returns concepts which contain the supplied text within the preferred term.
    • Ingredient - returns concepts which have ingredients that match the supplied concept ID or text.
    • Package item - returns packages (MPP, TPP or CTPP) that contain concepts which match the supplied MPUU or TPUU concept or text.
    • Form - returns concepts which have a form which matches the supplied text (e.g. tablet).
    • Container - returns concepts which have a container which matches the supplied text (e.g. bottle).
    • Brand - returns concepts which have a brand (TP) which matches the supplied text (e.g. Voltaren).
    • PBS code - returns concepts which are mapped to a PBS item code.
    • ARTG ID - returns concepts which are mapped to a product listed on the Australian Register of Therapeutic Goods.
    • Parent - Returns concepts which are direct descendants of concepts that match the supplied text or concept ID.
    • Ancestor - Returns concepts which are descendants of concepts that match the supplied text or concept ID.
    • Last modified - Returns concepts which have a last modified date within the specified range.
    • Type - Narrow the search to only include a subset of concept types, i.e. CTPP, TPP, TPUU, MPP, MPUU or MP.
    • Status - Narrow the search to include only concepts with one of the selected statuses, i.e. Active, Inactive or Entered in Error.
  • Download the results of an advanced search in TSV (tab-separated values) format.
  • Can be configured to point to any Medserve instance, see Configuration.
  • Can be configured to report errors to Sentry.

Development dependencies

Polecat only has two development dependencies:

Common tasks

Start a development server on port 3000
yarn start
Run unit tests and monitor changes
yarn test
Start a Storybook server on port 9009

Storybook is an environment for developing and testing the components within Polecat in isolation from one another.

yarn storybook
Update test files

There are a set of files in the test directory that serve as fixtures for the unit tests and stories. These were taken from actual responses from Medserve, and can be refreshed by using the following command:

yarn update-test-files
Run the linter
yarn lint
Build a release

This will output a set of production-optimised static files in the build directory.

yarn build
Build the Docker image

This will package the build into a Docker image, ready for deployment.

yarn dockerize

This script requires you to set the DOCKER_IMAGE environment variable, which controls the name which is used to tag the image.

Configuration

Polecat is configured using the following environment variables, which can be passed using the environment key within a Docker Compose file:

  • POLECAT_FHIR_SERVER: the FHIR endpoint of the Medserve instance.
  • POLECAT_VERSION: the version of the application, which is used when reporting to Sentry. This is automatically set during the build (to the Git SHA), so does not
  • POLECAT_SENTRY_DSN: the string used to identify the application to Sentry.
  • POLECAT_GOOGLE_ANALYTICS_TRACKING_ID: tracking ID for sending analytics data to a Google Analytics account.
Example Docker Compose file
version: "3"

services:
  polecat:
    image: johngrimes/polecat
    ports:
      - "80:80"
    environment:
      POLECAT_FHIR_SERVER: https://medserve.online/fhir
      POLECAT_SENTRY_DSN: https://[email protected]/XXXXXX
      POLECAT_GOOGLE_ANALYTICS_TRACKING_ID: UA-XXXXXXXXX-X

Deployment requirements

  • Polecat must be served via HTTPS. This is because it relies on APIs within the browser which are not enabled in insecure contexts.
  • Polecat must communicate to Medserve via HTTPS. This is because browser security policy will not allow a secure page to make requests to a server over plain HTTP.
  • Polecat currently only supports deployment at the server root. For example, https://browse.medserve.online would be ok, while https://medserve.online/browse would not be supported.

Browser support

Polecat targets compatibility with the latest release version of the following browsers:

  • Google Chrome
  • Mozilla Firefox
  • Safari
  • Microsoft Edge

In addition to this, we also target compatibility with Mozilla Firefox 45.0esr.

polecat's People

Contributors

dependabot[bot] avatar dionmcm avatar johngrimes avatar stav09 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polecat's Issues

Search results with concept classes as columns rather than rows

Feature request passed on from Amy MacKay

The current search functionality allows Amy to identify CTPPs and TPPs created and retired since their last update, which is good.

However the search result shows CTPPs and TPPs as separate rows, and it would be much more convenient if the CTPPs and TPPs were columns with their values lining up across the rows. This is akin to the "AMT flat file" but in this case limited to the requested concept classes - CTPP and TPP.

This would be much easier to process as both CTPP and TPP can be dealt with at the same time for a product rather than revisiting each affected product twice.

Ampersand in search request triggers bad request

Expected behaviour

  • When I paste the following text into the quick search box, I expect to see either a set of results, or a message reporting no results found: "follitropin alfa 150 units (10.92 microgram) lutropin alfa 75 units injection [1 vial] (&) inert substance diluent [1 mL vial], 1 pack"

Actual behaviour

  • An error occurs: "Bad Request"

Steps to reproduce

  • Type the following text into the quick search box: "follitropin alfa 150 units (10.92 microgram) lutropin alfa 75 units injection [1 vial] (&) inert substance diluent [1 mL vial], 1 pack"

Environment

  • Chrome 69.0.3497, Windows 10

See https://sentry.io/share/issue/17854fb4bf23468587868373cd5a5037/ for further details.

Excel search result downloads

This is a feature request passed on from Amy MacKay.

Expected behaviour

  • Excel format download available for search results

Actual behaviour

  • Only TSV file download is available, Excel can import that but if care isn't taken the SCTIDs are truncated. An Excel format download option would be much easier.

Generic names for search results

Feature request passed on from Amy MacKay

The search functionality is useful to determine which CTPPs and TPPs have been created/retired since a certain date for Amy's processing. However for some CTPPs/TPPs the name provided in the search results (preferred term) doesn't always contain sufficient information to understand the generic medicine. A good example is https://browse.medserve.online/?q=Antiseptic%20Pharmacy%20Care where it isn't possible to determine this is povidone-iodine without finding the MPP.

Being able to toggle on and off a column containing the MPP (for CTPP/TPP entries) or MPUU (for TPUU entries) would help in this case.

Out-of-date paged results when changing search

Expected behaviour

When I perform a multi-page search and page through some results, then change the search and page again, I expect the results to be from the second search, not the first.

Actual behaviour

Results past the first page are being held over when scrolling down on a subsequent search.

Steps to reproduce

  • Open the advanced search.
  • Search for all TPPs made active from May 1-31.
  • Scroll down to retrieve some pages of results.
  • Change the search to all TPUUs made active from May 1-31.
  • Scroll down to retrieve some pages of results.
  • Observe that TPPs from the original search are shown.

Environment

  • Chrome 68.0.3440.17

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.