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

GoFSH handles inline CodeSystems poorly #252

Closed
cmoesel opened this issue Dec 13, 2023 · 0 comments · Fixed by #270
Closed

GoFSH handles inline CodeSystems poorly #252

cmoesel opened this issue Dec 13, 2023 · 0 comments · Fixed by #270
Labels
bug Something isn't working

Comments

@cmoesel
Copy link
Member

cmoesel commented Dec 13, 2023

Given:

{
  "resourceType": "ValueSet",
  "id": "example-valueset",
  "contained": [
    {
      "resourceType": "CodeSystem",
      "id": "example-codesystem",
      "url": "http://example.org/codesystem",
      "version": "1.0.0",
      "content": "complete",
      "status": "active",
      "concept": [
        {
          "code": "example-code-1",
          "display": "Example Code 1"
        },
        {
          "code": "example-code-2",
          "display": "Example Code 2"
        },
        {
          "code": "example-code-3",
          "display": "Example Code 3"
        }
      ]
    }
  ],
  "url": "http://example.org/valueset",
  "version": "1.0.0",
  "status": "active",
  "compose": {
    "include": [
      {
        "system": "#example-codesystem"
      }
    ]
  }
}

GoFSH produces:

ValueSet: ExampleValueset
Id: example-valueset
* ^contained.resourceType = "CodeSystem"
* ^contained.id = "example-codesystem"
* ^contained.url = "http://example.org/codesystem"
* ^contained.version = "1.0.0"
* ^contained.content = #complete
* ^contained.concept[0] = #example-code-1 "Example Code 1"
* ^contained.concept[+] = #example-code-2 "Example Code 2"
* ^contained.concept[+] = #example-code-3 "Example Code 3"
* ^url = "http://example.org/valueset"
* ^version = "1.0.0"
* ^status = #active
* include codes from system #example-codesystem

There are multiple issues with this:

  1. Instead of defining the whole CodeSystem inline (which SUSHI currently errors on, see SUSHI#1404), it should probably create a separate Instance w/ Usage: #inline.
  2. Since contained.concept is not a code/Coding/CodeableConcept, I don't think it's valid to assign a FSH code (and SUSHI rightfully complains). If using Instance/caret syntax for contained.concept, the code and display need to be assigned separately.
  3. SUSHI doesn't handle include codes from system #example-codesystem well (due to the #). SUSHI probably should handle this, but we need to track SUSHI#1403 and only export the # if SUSHI supports it. It may be better practice to just export the id (although SUSHI also doesn't handle this correctly per SUSHI#1402).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants