ahdis / fhir-mapping-tutorial

13 stars 12 forks source link

Standardizing Tutorial Artifacts #36

Closed Dokotela closed 1 month ago

Dokotela commented 1 month ago

I was doing this for myself to do some testing, and thought it might be helpful for others as well. I've Been going through the tutorial and trying to standardize files and output.

  1. Ran all XML in maptutorial through a formatter so as not to pick up unimportant format changes while updating.
  2. Naming changes
  3. Added all StructureDefinitions in JSON
  4. Added all Sources in JSON
  5. Updated Map files for the above name changes
  6. There are 4 Map files where I changed some of the formatting in the logic to try and stay consistent with the tutorial on HL7, but If I've made a mistake on those, please let me know and I'll remove them.

If all of these updates look reasonable, I was planning on adding updated StructureMaps in XML and JSON. I could also add the results for all of the transformations if you think it would be helpful to have those as files in the repository.

oliveregger commented 1 month ago

@Dokotela wow thank you for that PR! I will have a look and integrate it! Do not hesitate to add the results of the transformations.

Dokotela commented 1 month ago

Alright, almost done. I had a question on 4 of them though that I wanted to run past you.

  1. 1b - I get an error when trying to run it on matchbox. I also get an error in my tests, but not when I run on dotnet. I'm not sure what's going on with this one.
  2. 4b - this is more just a question for myself, I think the answer I've supplied is correct. When the map file is converted into a StructureMap, it creates a FHIRPath expression, . But in FHIRPath, if something is surrounded by single quotes, wouldn't this make it an Identifier?
  3. 7b - Similar to the issue with 1b. Currently its saying it doesn't recognize the canonical url, but previously it was giving me an error about dependent groups.
  4. 7 - it doesn't give me an error, but the result I get from running it is just {"resourceType":"TRight"}. Again, the best I can tell is that it's running into issues with the DependentGroups, but my Java isn't good enough to explain why.
oliveregger commented 1 month ago

Alright, almost done. I had a question on 4 of them though that I wanted to run past you.

  1. 1b - I get an error when trying to run it on matchbox. I also get an error in my tests, but not when I run on dotnet. I'm not sure what's going on with this one.

Yes, this is known issue, I think it is because it does not know the primitive type string, I did not find a solution yet but it should be fixed, I agree.

  1. 4b - this is more just a question for myself, I think the answer I've supplied is correct. When the map file is converted into a StructureMap, it creates a FHIRPath expression, . But in FHIRPath, if something is surrounded by single quotes, wouldn't this make it an Identifier?
  2. 7b - Similar to the issue with 1b. Currently its saying it doesn't recognize the canonical url, but previously it was giving me an error about dependent groups.
  3. 7 - it doesn't give me an error, but the result I get from running it is just {"resourceType":"TRight"}. Again, the best I can tell is that it's running into issues with the DependentGroups, but my Java isn't good enough to explain why.

I will have a loot at those too, thanks a lot!

oliveregger commented 1 month ago

@Dokotela

4b - this is more just a question for myself, I think the answer I've supplied is correct. When the map file is converted into a StructureMap, it creates a FHIRPath expression, . But in FHIRPath, if something is surrounded by single quotes, wouldn't this make it an Identifier?

The problem with 4b is, that isInteger is not a valid FHIR Path function, I added a comment to it: https://github.com/ahdis/fhir-mapping-tutorial/blob/master/maptutorial/step4/map/step4b.map

7 - it doesn't give me an error, but the result I get from running it is just {"resourceType":"TRight"}. Again, the best I can tell is that it's running into issues with the DependentGroups, but my Java isn't good enough to explain why.

If an input type is defined as 0..* it has to be in an array in json, i fixed this on the latest master

I integrated all the tutorial maps as integration tests to matchbox and had to correct a few things, but now except our friend 1b everything runs through.

Thanks a lot for providing the additional maps and resources!