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

import-csv-to-conceptmap is failing unexpectedly. #1320

Closed
dmuylwyk opened this issue May 27, 2019 · 7 comments
Closed

import-csv-to-conceptmap is failing unexpectedly. #1320

dmuylwyk opened this issue May 27, 2019 · 7 comments
Assignees
Labels

Comments

@dmuylwyk
Copy link
Collaborator

I've tested this using the contents of the CSV provided and the import worked without issue. I believe it is the file itself (some encoding issue).


loinc-to-phenx.csv.zip


Testing out the CSV importer for ConceptMaps today on our dev server, and got stuck b/c of this error:

ubuntu@fhir-dev:~/smilecdr/bin$ ./smileutil import-csv-to-conceptmap -v "r4" -t "http://localhost" -f "/home/ubuntu/tmp/loinc-to-phenx.csv" -l -u "http://loinc.org/cm/loinc-to-phenx" -i "http://loinc.org" -o "http://phenxtoolkit.org"
------------------------------------------------------------
🔥  Smile CDR CLI 2019.02.PRE - Command Line Tool
------------------------------------------------------------
Process ID                      : 2976@fhir-dev
Max configured JVM memory (Xmx) : 878.5MB
Detected Java version           : 1.8.0_201
------------------------------------------------------------
2019-03-21 17:54:54 [main] INFO  c.u.f.c.AbstractImportExportCsvConceptMapCommand Specified ConceptMap URL (ConceptMap.url): http://loinc.org/cm/loinc-to-phenx
2019-03-21 17:54:54 [main] INFO  c.u.f.c.ImportCsvToConceptMapCommand Specified source value set (i.e. ConceptMap.sourceUri): http://loinc.org
2019-03-21 17:54:54 [main] INFO  c.u.f.c.ImportCsvToConceptMapCommand Specified target value set (i.e. ConceptMap.targetUri): http://phenxtoolkit.org
2019-03-21 17:54:54 [main] INFO  c.u.f.c.ImportCsvToConceptMapCommand Converting CSV to ConceptMap...
2019-03-21 17:54:54 [main] ERROR ca.uhn.fhir.cli.App Error during execution: 
java.lang.IllegalArgumentException: Mapping for SOURCE_CODE_SYSTEM not found, expected one of [COMMENT, EQUIVALENCE, SOURCE_CODE, SOURCE_CODE_SYSTEM_VERSION, SOURCE_DISPLAY, TARGET_CODE, TARGET_CODE_SYSTEM, TARGET_CODE_SYSTEM_VERSION, TARGET_DISPLAY, SOURCE_CODE_SYSTEM]
    at org.apache.commons.csv.CSVRecord.get(CSVRecord.java:104)
    at org.apache.commons.csv.CSVRecord.get(CSVRecord.java:70)
    at ca.uhn.fhir.cli.ImportCsvToConceptMapCommand.parseCsvRecords(ImportCsvToConceptMapCommand.java:298)
    at ca.uhn.fhir.cli.ImportCsvToConceptMapCommand.convertCsvToConceptMapR4(ImportCsvToConceptMapCommand.java:193)
    at ca.uhn.fhir.cli.ImportCsvToConceptMapCommand.searchForConceptMapByUrl(ImportCsvToConceptMapCommand.java:139)
    at ca.uhn.fhir.cli.ImportCsvToConceptMapCommand.process(ImportCsvToConceptMapCommand.java:118)
    at ca.uhn.fhir.cli.AbstractImportExportCsvConceptMapCommand.run(AbstractImportExportCsvConceptMapCommand.java:107)
    at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:243)
    at ca.cdr.cli.App.main(App.java:56)
2019-03-21 17:54:54 [Thread-0] INFO  ca.uhn.fhir.cli.App Smile CDR CLI is shutting down...

You'll note in the file I was trying to load (attached), there is exactly the column SOURCE_CODE_SYSTEM, with is in the expected list.

@dmuylwyk dmuylwyk added the bug label May 27, 2019
@dmuylwyk dmuylwyk self-assigned this May 27, 2019
@dmuylwyk
Copy link
Collaborator Author

@dmuylwyk
Copy link
Collaborator Author

I'm able to reproduce this in a unit test. : )

@dmuylwyk
Copy link
Collaborator Author

The first header value is preceded by: \uFEFF/65279

@dmuylwyk
Copy link
Collaborator Author

That's a zero width no-break space / byte order mark.

@dmuylwyk
Copy link
Collaborator Author

I'll need to check for this and convert to UTF-8.

@dmuylwyk
Copy link
Collaborator Author

@dmuylwyk
Copy link
Collaborator Author

Pull request: #1322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant