GithubHelp home page GithubHelp logo

fhir / gofsh Goto Github PK

View Code? Open in Web Editor NEW
33.0 33.0 6.0 1.81 MB

GoFSH is a FHIR Shorthand (FSH) decompiler, able to convert formal FHIR definitions from JSON/XML to FSH.

License: Apache License 2.0

JavaScript 1.32% TypeScript 98.45% HTML 0.13% GLSL 0.11%

gofsh's People

Contributors

aymericgrassart avatar cmoesel avatar guhanthuran avatar jafeltra avatar julianxcarter avatar mint-thompson avatar ngfreiter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gofsh's Issues

GoFSH does not escape quotes in code definitions

GoFSH properly escapes quotes in some, but not all, circumstances. For example, given this CodeSystem:

{
  "resourceType": "CodeSystem",
  "status": "active",
  "content": "complete",
  "name": "MyCodeSystem",
  "id": "MyCodeSystem",
  "version": "0.1.0",
  "url": "http://example.org/CodeSystem/MyCodeSystem",
  "concept": [
    {
      "code": "foo",
      "display": "Foo",
      "definition": "The \"Foo\" system"
    }
  ],
  "count": 1
}

GoFSH produces this FSH:

CodeSystem: MyCodeSystem
Id: MyCodeSystem
* ^status = #active
* ^content = #complete
* ^version = "0.1.0"
* ^count = 1
* #foo "Foo" "The "Foo" system"

Note that the definition should be "The \"Foo\" system". I'm not sure, but I think maybe this is actually happening somewhere in one of SUSHI's toFSH() functions?

Improve Summary at end of run

SUSHI outputs a nice summary at the end of a run:

╔════════════════════════ SUSHI RESULTS ══════════════════════════╗
║ ╭──────────┬────────────┬───────────┬─────────────┬───────────╮ ║
║ │ Profiles │ Extensions │ ValueSets │ CodeSystems │ Instances │ ║
║ ├──────────┼────────────┼───────────┼─────────────┼───────────┤ ║
║ │    32    │     8      │    59     │      1      │    88     │ ║
║ ╰──────────┴────────────┴───────────┴─────────────┴───────────╯ ║
║                                                                 ║
╠═════════════════════════════════════════════════════════════════╣
║ Cool and So-fish-ticated!              0 Errors      0 Warnings ║
╚═════════════════════════════════════════════════════════════════╝

Consider doing something similar in GoFSH to give it a more polished feel.

Replace cpy-cli w/ copyfiles

The cpy-cli package has vulnerabilities in its dependencies, but it appears cpy-cli will not fix them. As a result, we need to move to something else. This was already done for SUSHI, so we should just do the same here.

See FHIR/sushi#1012.

GoFSH creates Quantities that SUSHI can't convert to single rules (non-UCUM systems)

In FSH, you can do a quantity assignment like such:

* valueQuantity = 55 'mm'

This assumes that mm is a valid UCUM unit. The FshQuantity toString function constructs the stringified version of Quantity using this format. In SUSHI, this is fine because the only time the FshQuantity is ever constructed is when the units are UCUM.

In GoFSH, however, we can construct FshQuantity with non-UCUM unit systems. In this case, when the rules are created, the FshQuantity.toString isn't quite right since the unit is not UCUM. But there isn't any way to make it right because there is no single string representation of a quantity with non-UCUM units. So we are at an impasse.

In a future version of FSH, we may support a Quantity representation using non-UCUM units like this: 55 http://foo.org#mm -- in which case we have a good way to solve this problem. For FSH 1.0, however, we will need to have GoFSH break up Quantities into multiple statements when the unit system is not UCUM.

(This issue is also noted in FHIR/sushi#716).

Files in /output cause GoFSH to hang

There are a set of json files that are generated by the IG Publisher as a matter or course and exist in the /output directory. The files include:

qa.json
canonicals.json
expansions.json
usage-stats.json
package.manifest.json

If someone wants GoFSH to convert publisher outputs to FSH files, GoFSH will hang. I believe expansions.json file is causing this.

My suggestion is to create a hardcoded "files to skip" list, and ignore these files.

r3 Exclusive dependency

When running against FHIR 3.0.2 definitions using '-d [email protected]' both r3 and the default r4 - v4.0.1 are loaded and used. This seems to cause failures related to differences between the r3 and r4 StructureDefinition.

I think the following (processing.ts:ln120-122 is responsible

 if (!dependencies.some(dep => /hl7\.fhir\.r(4|5|4b)\.core/.test(dep))) {
    dependencies.push('[email protected]');
  }

Could this case be added for r3 please?

Unnecessary aliases for FHIR resources

GoFSH is defining unnecessary* aliases for base FHIR resources, e.g.:

Alias: $Identifier = http://hl7.org/fhir/StructureDefinition/Identifier
Alias: $Composition = http://hl7.org/fhir/StructureDefinition/Composition
Alias: $Endpoint = http://hl7.org/fhir/StructureDefinition/Endpoint
Alias: $HealthcareService = http://hl7.org/fhir/StructureDefinition/HealthcareService
Alias: $Observation = http://hl7.org/fhir/StructureDefinition/Observation
Alias: $PractitionerRole = http://hl7.org/fhir/StructureDefinition/PractitionerRole

One complicating factor is that this IG defines a profile named "Composition" that is based on Composition (really horrible style), so maybe this is necessary??

afourquet/us-odh@40c7487

GoFSH always ignores SD/VS/CS url

GoFSH currently assumes that the url in a StructureDefinition, ValueSet, or CodeSystem will match whatever SUSHI would construct from the canonical (e.g., {canonical}/{type}/{id}). This, however, is not a guarantee, so GoFSH should check the URL in the JSON against what SUSHI would create -- and if it's different, generate a caret value rule.

See:

const RESOURCE_IGNORED_PROPERTIES = {
ValueSet: [
'resourceType',
'id',
'url',
'name',
'title',
'description',
'compose.include',
'compose.exclude'
],
CodeSystem: ['resourceType', 'id', 'url', 'name', 'title', 'description', 'concept'],
StructureDefinition: [
'resourceType',
'id',
'url', // NOTE: For now, we assume URL matches canonical and is generated
'name',
'title',
'description',
'fhirVersion',
'mapping',
'baseDefinition',
'derivation',
'snapshot',
'differential'
]
};

Handling `meta.profile` in instances

Currently, if an instance JSON/XML has any meta.profile entries, GoFSH will use the first entry as InstanceOf. There are three potential problems with this:

  1. If that meta.profile URL doesn't resolve to something in the IG or its dependencies, SUSHI will fail.
  2. If there are multiple meta.profile entries, GoFSH is making an assumption by choosing the first one.
  3. If the instance doesn't really conform to its advertised profile, SUSHI will either force it to or report errors. (Some might argue this is not actually a problem).

We should consider changing the default behavior and/or making it configurable.

Change Default Behavior

If the meta.profile has a single URL and it can be resolved to an SD, then use it as InstanceOf.

If the meta.profile has a single URL and it cannot be resolved to an SD, issue a warning, set the InstanceOf to the base resource instead, and add the meta.profile entry as a caret rule.

If the meta.profile has multiple URLs, do not use any of them as InstanceOf. Instead just use the base resource and add caret rules for all meta.profile entries.

Make It Configurable

Allow users to indicate how they want GoFSH to translate meta.profile entries:

  • default behavior (as described above)
  • always set first meta.profile entry as InstanceOf
  • never set any meta.profile entry as InstanceOf

See: https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/Handling.20meta.2Eprofile.20in.20instances

Appending -of-X-Instance

I have some Library and Measure resources that share the same ID. They are unique in their resource/path, e.g. /Library/Steve or /Measure/Steve, but it seems GoFSH doesn't like that one bit and appends to the IDs -of-Library-Steve etc. Is this a FSH thing or a GoFSH thing?

GoFSH creating `^` rules against the wrong constraints

If you run SUSHI 1.2.0 against https://github.com/HL7/fhir-mCODE-ig/ and then run GoFSH against the resulting fsh-generated folder (using the fshing-trip option), you'll notice that several invariants are produced from the GoFSH definitions that aren't produced from the original FSH definitions. For example:
image

If you look at the produced FSH for that profile, you'll see this:
image

I think this has something to do w/ SUSHI 1.2.0 differentials no longer carrying the full array of constraint and mapping -- but only carrying those elements that are different. It's causing the ^ rules to target the wrong elements -- but really, I don't think we should need ^ rules there at all? At least not in this case?

Do duplicate names really represent an error?

In trying to convert the UTG IG, GoFSH reports several errors because of duplicate name. Going into the IG itself, it turns out that indeed, there are cases where two value sets have the same name. However, they have different defining URLs. The question is whether that it legal and acceptable practice, or whether the current behavior of throwing out an error message is correct.

Here's an example of two value sets with the same name but different URL:
https://terminology.hl7.org/ValueSet-v2-0719.html
https://terminology.hl7.org/ValueSet-v3-InformationSensitivityPolicy.html

GoFSH assumes 4.0.1

We've had a report that GoFSH does not work with FHIR 4.5.0 IGs, and honestly, that's not surprising at all. We should add support for the same FHIR versions as SUSHI supports (e.g., >= 4.0.1).

GoFSH doesn't error or warn on duplicate names

If the source to GoFSH contains two profiles w/ the same name, GoFSH happily generates both definitions in FSH -- each with the same name. This also happens for Extensions (and I'm guessing for other types too). You can easily reproduce this by following the instructions in #78.

GoFSH should either:

  • emit an error in this case
  • or emit a warning and rename one of them

Double Definition Error on Inherited Slices

I am getting the following error in the second step of round-tripping mCODE (FHIR to FSH back to FHIR):

error  Slice named conditionCode already exists on element Observation.component:alcoholAbuse.extension of CancerRelatedComorbidities
  File: C:\Users\mkramer\Documents\GitHub\mcode-gofsh\input\fsh\resources.fsh
  Line: 352

Here are the profiles generated by GoFSH for CancerRelatedComorbidities and its parent:

Profile:  ComorbiditiesParent
Parent: Observation
---snip---
* component.extension contains
    ComorbidConditionCode named conditionCode 0..* and
    ComorbidConditionReference named conditionReference 0..*
---snip---

Profile: CancerRelatedComorbidities
Parent: ComorbiditiesParent
---snip ---
* component contains
    alcoholAbuse 0..1 and ...
--- snip---
* component[alcoholAbuse].extension contains conditionCode 0..*

.text is currently ignored

Currently GoFSH ignores the .text element. Example: https://fshschool.org/FSHOnline/#/share/3yACorz

Expected behaviour:
.text is also converted to FSH (at least optionally)

edit: providing json:

{
    "resourceType": "Composition",
    "id": "composition01",
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table><tr><td><b>Systolisch</b></td><td><b>Diastolisch</b></td><td><b>Einheit</b></td><td><b>Uhrzeit</b></td></tr><tr><td>140</td><td>110</td><td>mmHG</td><td>17:15h</td></tr></table></div>"
    }
}

GoFSH Hangs on Instance Conversion

I was trying to convert the UTG IG to FSH, but GoFSH hangs when it reaches "Processing Instances..." phase.

The repo to check out is HL7/UTG@208a5ab

The command used to launch the process is: gofsh -t json-and-xml -s single-file

PS - After waiting 15 minutes or so, it looks like the process is still alive, but moving extremely slowly. So call it no quite dead, but nearly dead.

Warnings about not finding parents that are in the same IG

If I use SUSHI to generate mCODE FHIR definitions, and then run those definitions through GoFSH, I get a bunch of warnings like the following:

warn Cannot reliably export top-level caret rules for PrimaryCancerCondition because GoFSH cannot find a definition for its parent: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-condition-parent. If its parent is from another IG, run GoFSH again declaring that IG as a dependency.

Since the source for mcode-cancer-condition-parent is one of the inputs to GoFSH, it should be able to find it and use it.

GoFSH not reflecting `^status` correctly

If you run SUSHI 1.2.0 against https://github.com/HL7/fhir-mCODE-ig/ and then run GoFSH against the resulting fsh-generated folder (using the fshing-trip option), one definition will have the wrong status:
image

I'll need to look at the SUSHI code, but I think maybe SUSHI defaults status to active, and GoFSH is not creating a ^status rule even though the SD has it marked as draft.

Change from error to warning?

I'm converting US Core to FSH. The IG has both JSON and XML definitions. GoFSH finds some XML files that are unrelated to resources (e.g. menu.xml) and reports errors when it can't make sense of them. I'm wondering if these errors should be warnings.

error Could not load FHIR-us-core.xml: Unknown resource type: specification
error Could not load fsh-generated\includes\menu.xml: Unknown resource type: ul
error Could not load input-cache\jiraspec.xml: Unknown resource type: specification
error Could not load input-cache\workgroups.xml: Unknown resource type: workgroups

GoFSH should ignore ig-r4.json

When running GoFSH on some packages, it will report an error because it detects two ImplementationGuide files with the same id. This is because the IG Publisher will produce an ig-r4.json file representing the same information as the original ImplementationGuide file (but conforming to R4).

For example, when running GoFSH on US Core 4.0.0, we get the following error:

error Encountered 1 definition(s) with the same resourceType and id as a previous definition. FHIR definitions should have unique resourceType and id. The following duplicate definitions will not be processed by GoFSH:

  • /Users/cmoesel/.fhir/packages/hl7.fhir.us.core#4.0.0/package/ig-r4.json (ImplementationGuide/hl7.fhir.us.core) matches /Users/cmoesel/.fhir/packages/hl7.fhir.us.core#4.0.0/package/ImplementationGuide-hl7.fhir.us.core.json

GoFSH should ignore the ig-r4.json file so this does not happen.

Enable generation of "Stand alone" FSH

The FSH that is generated by GoFSH cannot always stand alone. The main example I am thinking of here is with aliases. The FSH snippet cannot be copy and pasted into a tool like FSHOnline, without copying the corresponding aliases that are used in that FSH. We should consider adding an option which would allow the user to specify that they do not want to break aliases out into their own definitions.

GoFSH Replacing Many #inline Instances w/ Blank Operation Outcomes

Running GoFSH against US Core -- and then running SUSHI -- I noticed a lot of errors like this:

error Element OperationOutcome.issue has minimum cardinality 1 but occurs 0 time(s).
  File: /Users/cmoesel/dev/fhir/GoFSH/gofsh-master/input/fsh/instances/AllergyIntolerance-example.fsh
  Line: 1 - 3

Looking at the generated FSH, it is:

Instance: AllergyIntolerance-example
InstanceOf: OperationOutcome
Usage: #inline

This is not correct. The AllergyIntolerance-example resource in the US Core package I used was definitely NOT and OperationOutcome. Looking at more instances, it seems that this is happening a LOT! The pattern seems to be that it happens on instances w/ Usage: #inline.

Actually, looking into it further, I think the other/validation-oo.json file in the package is being processed. It is a bundle and actually redefines many of these resources as OperationOutcomes!

Running GoFSH after FSHing trip causes duplicate FSH definitions

If you run GoFSH FSHing Trip (e.g., gofsh . -f), it will run SUSHI on the GoFSH output, creating JSON files in gofsh/input/fsh-generated/resources. Then if you run GoFSH again (with or without FSHing Trip), GoFSH will read both the original JSON definitions and the new SUSHI-generated definitions, causing duplicate definitions in the generated FSH files.

I think we need to do one of the following:

  • delete the output folder before generating more output (like SUSHI does w/ fsh-generated)
  • warn the user if the output folder already exists (but still continue)
  • prompt the user to ask if the output folder should be deleted

Output a heartbeat or progress counter while running

There is no sign of life while GoFSH is executing, after the message info Using output directory: gofsh and before the message info Exported 33 Profiles. Usually the pause is only a few seconds, so it isn't too disconcerting, but with large IGs, it actually takes some time to generate all the FSH. The user can be left wondering if anything is really happening.
If possible, can you add some sort of output during this period, to let the user know what's happening, and that the process hasn't died?

Concept specifies system multiple times

When we process CodeSystem concept rules, we sometimes double-up on the system (e.g., FOO#bar from system FOO). For a real-world example, run GoFSH against mCODE's fsh-generated and you'll find stuff like:

* include http://ncithesaurus-stage.nci.nih.gov#C146985 "AJCC Cancer Staging Manual 8th Edition" from system http://ncithesaurus-stage.nci.nih.gov

When you run SUSHI against a project with rules like this, you get errors like this from SUSHI:

error Concept C146985 specifies system multiple times

Rendering new lines in descriptions

Any newline in a description field is rendering as \r\n. Is it possible to actually get new lines instead?
Here is what it typically looks like:

Description: "Records an alteration in the most common DNA nucleotide sequence. The term variant can be used to describe an alteration that may be benign, pathogenic, or of unknown significance. The term variant is increasingly being used in place of the term mutation.\r\n\r\nConformance statement:\r\n\r\nObservation resources associated with an mCODE patient with Observation.code LOINC 69548-6 MUST conform to this profile. Beyond this requirement, a producer of resources SHOULD ensure that any resource instance associated with an mCODE patient that would reasonably be expected to conform to this profile SHOULD be published in this form."

GoFSH translates logical models and resources as FSH Profiles

I know that we're working on GoFSH support for the FSH STU2 Logical and Resource authoring -- but assuming that still has some work to do, I think we should release a quick fix on this ASAP.

The problem is that if you pass a logical model or resource to GoFSH, it generates a FSH profile with invalid paths. For example, the following logical model:

{
  "resourceType": "StructureDefinition",
  "id": "LogicalExample",
  "url": "http://example.org/StructureDefinition/LogicalExample",
  "version": "1.0.0",
  "name": "LogicalExample",
  "status": "active",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "name": "RIM Mapping",
      "uri": "http://hl7.org/v3"
    }
  ],
  "kind": "logical",
  "abstract": false,
  "type": "http://example.org/StructureDefinition/LogicalExample",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Base",
  "derivation": "specialization",
  "differential": {
    "element": [
      {
        "id": "LogicalExample",
        "path": "LogicalExample"
      },
      {
        "id": "LogicalExample.foo",
        "path": "LogicalExample.foo",
        "short": "A foo",
        "definition": "A foo",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ]
      }
    ]
  }
}

gets translated as:

Profile: LogicalExample
Parent: Base
Id: LogicalExample
* ^version = "1.0.0"
* ^kind = #logical
* ^abstract = false
* ^type = "http://example.org/StructureDefinition/LogicalExample"
* foo 0..1
* foo only string
* foo ^short = "A foo"
* foo ^definition = "A foo"

This is obviously wrong.

The correct behavior is that if GoFSH encounters a StructureDefinition whose derivation is specialization, then it should output it as an Instance of a StructureDefinition. I'm assuming this is a fairly easy fix to hold us over until we have proper support for Logical and Resource.

GoFSH allows names with spaces

Running GoFSH on dk-core created a value set with spaces in the name. As a result, SUSHI choked on it and the value set was incomplete in the results. GoFSH should probably handle this. Maybe detect it, issue a warning, replace spaces with _, and set the name back to original value via a caret rule?

fsh-trip: Configuration missing required property: status

When using GoFSH with the fshing-trip feature gofsh/sushi-config.yaml is missing the status property, leading to an error:

error Configuration missing required property: status
  File: gofsh/sushi-config.yaml

Expected behaviour: status is set by fsh-trip

Use of Index Instead of Slice Name Causes Error

Again, this is from attempting to roundtrip from mCODE FHIR (latest master branch) to FSH via GoFSH, and back to FHIR using SUSHI.

SUSHI errors on the the following example because ctcae-grade slice is required (1..1), and the value $ctcae-grade-code-system#2 "Moderate Adverse Event" is assigned to extension[0], which isn't the same as assigning it to extension[grade]:

Instance: ctc-adverse-event-example-1
InstanceOf: CTCAdverseEvent
Usage: #example
* contained[0] = mcode-medication-example-1
* extension[0].url = "http://hl7.org/fhir/us/mcode/StructureDefinition/ctcae-grade"
* extension[0].valueCodeableConcept = $ctcae-grade-code-system#2 "Moderate Adverse Event"
* extension[1].url = "http://hl7.org/fhir/us/mcode/StructureDefinition/adverse-event-expectation"
* extension[1].valueCodeableConcept = $ncithesaurus-stage#C41333 "Expected Adverse Event"
* extension[2].url = "http://hl7.org/fhir/us/mcode/StructureDefinition/adverse-event-resolved-date"
* extension[2].valueDateTime = "2020-05-21"
* actuality = #actual
---snip---

Undefined Alias

GoFSH is generating this rule, although SNOMED_CT is undefined

* SNOMED_CT#442452003 "Life threatening severity (qualifier value)"

To see the example, use this URL in FSH Online, convert to JSON, then run GoFSH to convert back to FSH:

https://bit.ly/34rIMmU

I am planning to use this example at DevDays, so please give this priority.

Generating invalid FSH from certain styles of extension

These errors are easiest to recreate by downloading the VRDR package and running gofsh -f on it.

One set of errors look to be due to a difference in how VRDR represents certain extensions vs how SUSHI processes them. For example, the first screenshot below shows how VRDR represents an extension. The second shows an example from mCODE (built with SUSHI). In the SUSHI example, the type of the extension is profiled to the relevant extension (http://hl7.org/fhir/R4/extension-condition-asserteddate in this case). In VRDR, the type is just Extension, and url is constrained. We actually disallowed this sort of behavior in SUSHI previously, and standardized it so SUSHI would only produce extensions using the approach you see in mCODE. So in these cases, I'm not sure there is a way for GoFSH to generate valid FSH without changing the content of the resulting JSON, which we avoid doing in GoFSH.

image (1)
image (2)

For another set of errors, in VRDR, there are certain extensions which have a structure like I’ve shown in the first screenshot. Note that the sliceName of the extension is date-year-absent-reason, but the extension.url is constrained to year-absent-reason, which does not match. In the second screenshot (from the Sara Alert IG, built using FSH/SUSHI), you can see that the sliceName and extension.url match exactly at contact-of-known-case. Again this is a decision that is built into SUSHI, when someone defines a simple extension on a complex extension, we automatically set the url to be the sliceName of the extension. So then trying to re-set the url will result in errors. Again, this is a case of essentially something that we can’t really accomplish in FSH, without changing the resulting JSON.

image (3)
image (4)

I'm not sure what the best approach is in these cases. I don't think we want to purposefully modify the resulting JSON, but I'm not sure how we can generate FSH that will result in the original JSON with no errors.

Generating illegal FSH

Running GoFSH on us-odh. GoFSH is generating the following rule in translating odh-PastOrPresentJob.json:

* extension[odh-isCurrentJob-extension] contains odhIsCurrentJob
* extension[odh-isCurrentJob-extension] only ODHIsCurrentJobExtension

The "contains" rule is broken because (1) it refers to a slice that does not exist, and (2) it does not have the "named foo" clause.

Incorrect slice cardinality in generated FSH

If an element in the differential does not contain a min value, GoFSH appears to use the min value from the base (what is being sliced). Sometimes this results in a slice being marked as required when it shouldn't be. See: https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/Optional.20slices.20and.20goFSH

The proper behavior for determining min of a slice should be:

  • If the differential element for the slice has a min, use it;
  • Otherwise, if the snapshot element for the slice has a min, use it;
  • Otherwise, default the slice min to 0.

The proper behavior for determining max of a slice should be:

  • If the differential element for the slice has a max, use it;
  • Otherwise, if the snapshot element for the slice has a max, use it;
  • Otherwise, default the max to '*'.

Profiles of Logical Models are generated as Instances

SUSHI now supports creating Profiles of Logical Models. However, when GoFSH is run on a StructureDefinition with "kind": "logical" and "derivation: constraint", an Instance of StructureDefinition is created instead of a Profile.

For example, running SUSHI on the following ProfiledLogicalModel produces a StructureDefinition with "kind": "logical" and "derivation: constraint":

Logical: MyLM
* name 0..* SU HumanName "Name(s) of the human"

Profile: ProfiledLogicalModel
Parent: MyLM
* name 1..1

If you run GoFSH on the resulting StructureDefinitions (that SUSHI produced), GoFSH will create a Logical and an Instance, when it should really create a Logical and Profile.

Running SUSHI and then GoFSH on this FSH Online link demonstrates this issue.

GoFSH fails with non-snapshot IGs from Simplifier

problem
When referencing a non-snapshot IG (Simplifier) in GoFSH the following error is shown:
info Downloading de.gematik.isik-basismodul#1.0.2...
error Failed to load [email protected]: Request failed with status code 404

The correct error message should point to the true reason: no snapshots found in IG

To reproduce:
gofsh -d [email protected]

If you download the snapshot including package manually and put it into the .fhir cache GoFSH works as expected:

expected behaviour
GoFSH error message points to the missing snapshot element.

Contained resources on Parameters are handled incorrectly

There's special logic in getFSHValue for handling contained resources on a Bundle or DomainResource, but the logic is based on the path for those resource types. Parameters can have resources contained at Parameters.parameter.resource, so it should get handled the same way so that the correct FSH values are found. The example Parameters instance demonstrates this issue. GoFSH produces the following:

Instance: example
InstanceOf: Parameters
Usage: #example
* parameter[0].name = "exact"
* parameter[=].valueBoolean = true
* parameter[+].name = "property"
* parameter[=].part[0].name = "code"
* parameter[=].part[=].valueCode = #focus
* parameter[=].part[+].name = "value"
* parameter[=].part[=].valueCode = #top
* parameter[+].name = "patient"
* parameter[=].resource.resourceType = "Patient"
* parameter[=].resource.id = "example"
* parameter[=].resource.name.use = "official"
* parameter[=].resource.name.family = "Chalmers"
* parameter[=].resource.name.given[0] = "Peter"
* parameter[=].resource.name.given[+] = "James"

The problem occurs in this rule, which sets a string value:

* parameter[=].resource.name.use = "official"

But the type of this element is code. The correct rule would be:

* parameter[=].resource.name.use = #official

GoFSH processing some non-FHIR JSON files (again)

GoFSH used to process the US Core 4.0 package with only one error (related to a duplicate id). A recent change, however, resulted in the following additional errors when processing US Core 4.0:
image

I'm not positive, but I suspect it may have been introduced w/ the PR that added warnings for large files.

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.