FHIR Chat · ccda-to-fhir · CCDA / FHIR mapping stream

Stream: CCDA / FHIR mapping stream

Topic: ccda-to-fhir


view this post on Zulip David Boerner (Jun 10 2020 at 19:14):

I'm looking to try using the opensource solution here https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Mapping+Language for mapping CCDA to FHIR.

I'm really struggling to get the CLI tool to work and was hoping someone might be able to point me in the right direction.

It appears from the example I'm working with at https://wiki.hl7.org/Using_the_FHIR_Validator_to_transform_content#CCDA_to_FHIR which references this solution that there are numerous out of date / broken references.

Does anyone have an up to date project/command that I could reference?

I am trying /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java -jar org.hl7.fhir.validator.jar /Users/davidboerner/Documents/GitHub/ArielCCD.xml -transform /Users/davidboerner/Documents/GitHub/ccda-to-fhir/mappings/CCDAToFHIR.map -ig hl7.fhir.us.ccda -ig /Users/davidboerner/Documents/GitHub/ccda-to-fhir/mappings/ -output /Users/davidboerner/Documents/GitHub/ccda-to-fhir/output/ariel.json -ig hl7.fhir.r4.core -version 4.0 -log test.txt

but getting this error, even though I'm referencing the input structure as CCDA (-ig hl7.fhir.us.ccda) which I had to update from -ig hl7.fhir.cda#2.0 which is a broken link

...Failure: This does not appear to be a FHIR resource (unknown namespace/name "urn:hl7-org:v3::ClinicalDocument") at line 0 col 0
org.hl7.fhir.exceptions.FHIRFormatError: This does not appear to be a FHIR resource (unknown namespace/name "urn:hl7-org:v3::ClinicalDocument") at line 0 col 0

Any help most appreciated!

view this post on Zulip Oliver Egger (Jun 11 2020 at 08:25):

The error message looks like the validator has the CDA Logical Model not available. I do not have experience with the CCDA Model, but maybe cou can specify the CDA Logical Model itself directly with the parameter -ig https://build.fhir.org/ig/HL7/cda-core-2.0/package.tgz to look if the validator can parse the file. Are you using the latest version of the validator?

view this post on Zulip David Boerner (Jun 12 2020 at 13:04):

Thanks @Oliver Egger that perhaps has gotten me a bit further? I am using the latest versions.

I tried java -jar org.hl7.fhir.validator.jar /Users/davidboerner/Documents/GitHub/ArielCCD.xml -transform /Users/davidboerner/Documents/GitHub/ccda-to-fhir/mappings/CCDAToFHIR.map -ig https://build.fhir.org/ig/HL7/cda-core-2.0/package.tgz -ig /Users/davidboerner/Documents/GitHub/ccda-to-fhir/mappings/ -output /Users/davidboerner/Documents/GitHub/ccda-to-fhir/output/ariel.json -version 4.0 -log test.txt

and now getting the following error:

  • .. load IG from https://build.fhir.org/ig/HL7/cda-core-2.0/package.tgz
    ...Failure: Type 'IVL_TS' is not an acceptable type for 'effectiveTime' on property SubstanceAdministration.effectiveTime
    org.hl7.fhir.exceptions.DefinitionException: Type 'IVL_TS' is not an acceptable type for 'effectiveTime' on property SubstanceAdministration.effectiveTime

Is this a problem with the CDA logical definition I'm trying to pull from?

view this post on Zulip David Boerner (Jun 12 2020 at 13:47):

I edited my inbound CCD a bit and was able to get past those validation errors, but looks like I'm choking on the transform bit.

In general I'm wondering if anybody has a functional project that transforms a CCDA to FHIR bundle?

Should I be using https://github.com/HL7/ccda-to-fhir or the validator within https://github.com/hapifhir/org.hl7.fhir.core#download ?

view this post on Zulip Oliver Egger (Jun 14 2020 at 13:28):

The CDA logical model currently defines IVL-TS as type and not IVL_TS, I assume the error comes from that. I made a PR to propose a solution since the FHIR Mapping Language cannot work currently with the - character. You can try to use apply the map with the CDA Model containing the PR and use -ig http://build.fhir.org/ig/ahdis/cda-core-2.0/branches/pullrequests/package.tgz

view this post on Zulip Kailash (Nov 30 2020 at 15:51):

@Oliver Egger Hi, I am looking of logical models for CDA similar what is there at http://build.fhir.org/ig/ahdis/cda-core-2.0/branches/pullrequests/package.tgz and not in R4 but STU3. Thanks!

view this post on Zulip Oliver Egger (Nov 30 2020 at 16:01):

The logical model is here: https://github.com/hl7/cda-core-2.0. Why do you need that in a STU3 version? The logical model itself is independent of the version, however it is described in conformance resources with R4, I don't think backporting to STU3 would be easy.

view this post on Zulip Kailash (Dec 01 2020 at 01:43):

@Oliver Egger I was assuming its version dependent. Thanks you for the help.

view this post on Zulip Oliver Egger (Dec 01 2020 at 07:30):

@Kailash depending what you want to use the model for, the logical model conformance resource versions could have an impact.

view this post on Zulip Kailash (Dec 01 2020 at 07:54):

I want to use logical model for ccd to FHIR mapping (transformation) for STU3

view this post on Zulip Oliver Egger (Dec 01 2020 at 08:43):

i think that might work, but you would need to develop the maps to STU3 and find or configure an mapping engine that can directly run the maps.

view this post on Zulip Kailash (Dec 01 2020 at 10:43):

@Oliver Egger thanks , I am still not clear if transformation possible directly using maps (mapping using FHIR mapping language) or I need to first $convert it into StructureMap resource and then use $transform for input data? If both case are possible then should I choose the approach based on server capabilities for supported operations?

view this post on Zulip Oliver Egger (Dec 01 2020 at 10:53):

this depends on the tooling you use. the java validator can handle maps directly (converts it to StructureMap internally), if you use a server based setup you will need to provide the StructureMap and can then use the $transform operation, see also https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Mapping+Language

view this post on Zulip Kailash (Dec 01 2020 at 12:21):

Thanks for the input this will help to choose both the tooling and approach.

view this post on Zulip Ilayaraja (Jun 17 2021 at 10:51):

I am getting "The Coding provided (http://terminology.hl7.org/CodeSystem/v3-Ethnicity#2135-2) is not in the value set http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837, and a code is required from this value set. (error message = Not in value set http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837)" on FHIR validation.
I am trying to use http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity extension in Patient resource.
Kindly help me on resolving this issue.

view this post on Zulip Lloyd McKenzie (Jun 24 2021 at 20:54):

You might be best raising this in #united states or #FHIR Validator as it doesn't seem like a mapping issue

view this post on Zulip Ilayaraja (Jul 14 2021 at 16:16):

I am using .Net Hl7.Fhir.Validation and in that I tried ExternalTerminologyService but it is getting failed with the following error,
"Terminology service failed while validating code 'work' (system ''): Operation was unsuccessful because of a client error (NotFound). OperationOutcome: Overall result: FAILURE (1 errors and 0 warnings)
[ERROR] (no details)(further diagnostics: Endpoint returned a body with contentType 'text/html', while a valid FHIR xml/json body type was expected. Is this a FHIR endpoint?)."

I am using the following .Net code for the implementation,

var validationSource = new CachedResolver(ZipSource.CreateValidationSource());
var settings = new FhirClientSettings
{
Timeout = 12000,
PreferredFormat = ResourceFormat.Json,
VerifyFhirVersion = true,
PreferredReturn = Prefer.ReturnMinimal
};

var client = new FhirClient(new Uri("http://tx.fhir.org"), settings);
var valuesetExpanderSettings = new ValueSetExpanderSettings()
{
ValueSetSource = validationSource,
MaxExpansionSize = 500,
IncludeDesignations = true
};

var validationSettings = new ValidationSettings()
{
//ConstraintBestPractices = ConstraintBestPractices.Enabled,
//SkipConstraintValidation = false,
ResourceResolver = validationSource,
GenerateSnapshot = true,
EnableXsdValidation = true,
Trace = false,
ResolveExternalReferences = true,
TerminologyService = new LocalTerminologyService(validationSource, valuesetExpanderSettings)//new ExternalTerminologyService(client)
};
var validator1 = new Validator(validationSettings);
var validationResult = validator1.Validate(collection);
if (!validationResult.Success) { }

Kindly help me on resolving this issue.

view this post on Zulip Lloyd McKenzie (Jul 14 2021 at 16:37):

I think you need to do "http://tx.fhir.org/r4"


Last updated: Apr 12 2022 at 19:14 UTC