FHIR Chat · Shr CLI exception · cimpl

Stream: cimpl

Topic: Shr CLI exception


view this post on Zulip Kurt Allen (Jul 15 2019 at 17:45):

Hey @Chris Moesel and @Mark Kramer
I am getting an exception in the cli. I sont know if I am doing something wrong, or if this might be a bug.

The offending Entry is:

*Element: BreastBodyLocation
Parent: BodyLocation
Description: "Location of the breast abnormality."
Property: breastrad.Breastdepth 0..1
Code = SCT#76752008
RelationToLandmark.LandmarkToBodyLocationDirection only ClockFaceDirection
RelationToLandmark.LandmarkLocation.Code = SCT#181139003
RelationToLandmark.LandmarkType = SCT#361083003
RelationToLandmark.LandmarkToBodyLocationDistance[Quantity].Units = UCUM#cm
*
If I remove the line

  • RelationToLandmark.LandmarkToBodyLocationDirection only ClockFaceDirection
    *
    then I do not get the exception erro rmessage.

The exception message is:

*[17:36:59.573Z] ERROR shr: (module=shr-fhir-export, shrId=breastrad.BreastAbnormality, target=Observation)
Unexpected error processing mapping rule. ERROR_CODE:13050 TypeError: Cannot read property 'type' of undefined
at FHIRExporter.getElementInExtension (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:2504:12)
at FHIRExporter.getElementInExtension (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:2505:19)
at FHIRExporter.applyConstraints (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:2229:32)
at FHIRExporter.addExtension (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:3282:10)
at FHIRExporter.processFieldToExtensionMappingRule (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:1050:10)
at FHIRExporter.processMappingRules (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:1005:18)
at FHIRExporter.mappingToProfile (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:359:12)
at FHIRExporter.export (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:100:14)
at Object.exportToFHIR (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:44:25)
at Object.<anonymous> (C:\Development\MITRE\cimpl\shr-cli\app.js:255:23)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
--
mappingRule: BreastBodyLocation.RelationToLandmark maps to bodySite.extension
*

If you want, you can get the full code at https://github.com/applicadia/Fhir-BreastRadiologyReport.git
(It should be public, let me know if not)
I put the directory Fhir-BreastRadiologyReport in the directory that contains the shr-cli subdirectory. BuildProfiles.bat executes the cli build (windows...)

view this post on Zulip Chris Moesel (Jul 15 2019 at 17:50):

Hi @Kurt Allen -- I'm afraid I can't look at this right now (about to go into a meeting), but I wanted you to know we just released a new CLI: https://github.com/standardhealth/shr-cli/releases/tag/v6.2.2

I doubt it fixes the problem above, but still wanted you to know.

view this post on Zulip Kurt Allen (Jul 15 2019 at 17:57):

Hey @Chris Moesel Have fun! I did just download and compiled 6.2.2 (thanks for the heads up) and have the same issue.

Below is the 6.2.2 exception message

*[17:53:07.456Z] ERROR shr: (module=shr-fhir-export, shrId=breastrad.BreastAbnormality, target=Observation)
Unexpected error processing mapping rule. ERROR_CODE:13050 TypeError: Cannot read property 'type' of undefined
at FHIRExporter.getElementInExtension (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:2504:12)
at FHIRExporter.getElementInExtension (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:2505:19)
at FHIRExporter.applyConstraints (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:2229:32)
at FHIRExporter.addExtension (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:3282:10)
at FHIRExporter.processFieldToExtensionMappingRule (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:1050:10)
at FHIRExporter.processMappingRules (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:1005:18)
at FHIRExporter.mappingToProfile (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:359:12)
at FHIRExporter.export (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:100:14)
at Object.exportToFHIR (C:\Development\MITRE\cimpl\shr-cli\node_modules\shr-fhir-export\lib\export.js:44:25)
at Object.<anonymous> (C:\Development\MITRE\cimpl\shr-cli\app.js:255:23)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
--
mappingRule: BreastBodyLocation.RelationToLandmark maps to bodySite.extension*

view this post on Zulip Chris Moesel (Jul 17 2019 at 13:49):

Hi @Kurt Allen -- I tried to look at this, but I can't find the definition of BreastBodyLocation that you reference. When I grep for it, I find two definitions.

The first is in BreastAbnormality.txt:
pasted image

And the second is in BreastBodyLocation.txt:
pasted image

Did you recently change this? Is it still an issue or is it OBE?

view this post on Zulip Kurt Allen (Jul 17 2019 at 17:32):

Yo @Chris Moesel
(Sorry to take so long getting back to you, my Dad is having some health issues and my time is kinda fragmented...)

My bad, I think you were using the master branch, and I should have said use the development branch. Sorry about that. I created a CliException branch that has the bug in it,so if you wanna checkout that branch and run BuildProfiles.bat you should get the same exception.

Many Thanks!
Kurt A.


Last updated: Apr 12 2022 at 19:14 UTC