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

Improve Support for ValueSet Versions #8

Merged
merged 3 commits into from
Jun 5, 2020
Merged

Conversation

cmoesel
Copy link
Member

@cmoesel cmoesel commented Jun 4, 2020

Previous to this PR, cql-exec-vsac supported looking up cached value sets by specific versions -- but it completely ignored version when downloading value sets (it always downloaded the latest). Now, if a value set version is specifically requested, it will download that specific version (if that version is not already in the cache).

The unit tests show this working, but if you want to test it IRL, here is one way you could test it:

  1. First you need to build a tgz of the updated cql-exec-vsac from this branch. Do this by checking out this branch, running yarn install and then running yarn pack. This will create a file named cql-exec-vsac-v1.1.1.tgz.
  2. Then clone (or pull) the Pain Management Summary.
  3. Open up the following file from the Pain Management Summary codebase in your favorite editor: src/cql/r4/Factors_to_Consider_in_Managing_Chronic_Pain_FHIRv400.json
  4. Add the following to the ValueSet definitions around line 60:
    {
      "name" : "C19HCC SARS coronavirus 2 Qualitative Detection Laboratory Tests",
      "id" : "2.16.840.1.113762.1.4.1032.109",
      "version": "20200417",
      "accessLevel" : "Public"
    },
  5. From the Pain Management Summary project, run the following command (substituting your UMLS username and password):
    node node src/utils/updateValueSetDB.js myUMLSUsername MyUMLSPassword
    
    This is downloading the value sets using the old cql-exec-vsac that does not support downloading by version.
  6. Open up the following file in your favorite editor: src/cql/valueset-db.json
  7. Search for 2.16.840.1.113762.1.4.1032.109 and note that it contains an empty set of codes:
    "2.16.840.1.113762.1.4.1032.109": {
      "20200417": []
    },
  8. Now upgrade cql-exec-vsac in the Pain Management Summary via a command like the following (substituting the path to the tgz you created in step 1:
    yarn upgrade cql-exec-vsac@file:path/to/cql-exec-vsac/cql-exec-vsac-v1.1.1.tgz
    
  9. Repeat step 5 to update the valueset-db.json file using the new cql-exec-vsac.
  10. Open the valueset-db.json file again and search for 2.16.840.1.113762.1.4.1032.109 again. If this is working, you'll see that it now contains a small number of codes:
    "2.16.840.1.113762.1.4.1032.109": {
      "20200417": [
        {
          "code": "94307-6",
          "system": "http://loinc.org",
          "version": "Provisional_2020-03-31"
        },
        {
          "code": "94308-4",
          "system": "http://loinc.org",
          "version": "Provisional_2020-03-31"
        },
        // etc.
      ]
    },

cmoesel added 2 commits June 4, 2020 14:00
Previous to this commit, the library would use version when looking up cached value sets -- but it completely ignored version when downloading value sets.  Now, if a value set version is specifically requested, it will download that specific version (if that version is not already in the cache).
@cmoesel cmoesel requested a review from dwwinters June 4, 2020 18:59
@dwwinters
Copy link

Confirming tests pass and Pain Management Summary operates as described in your instructions.

@dwwinters
Copy link

You should update the readme to make it clear to users that only the url option supports versions.

@cmoesel
Copy link
Member Author

cmoesel commented Jun 5, 2020

You should update the readme to make it clear to users that only the url option supports versions.

Done. See c1b5d4d.

@cmoesel cmoesel merged commit 8f71e15 into master Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants