google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
497 stars 296 forks source link

resourcemapper.extract ($transorm operation) fails for id part of the source resource #1595

Open delcroip opened 2 years ago

delcroip commented 2 years ago

Describe the bug when the mapping is between an automatically generated id (i.e. not part of the source) then it worked but if the id was defined in the source src.id -> tgt->id then it fails with that error message

    org.hl7.fhir.exceptions.FHIRException: Unable to convert a rg.hl7.fhir.r4.model.StringType to a Id

Component resourcemapper.extract https://github.com/google/android-fhir/wiki/SDCL%3A-Use-ResourceMapper#extract-fhir-resources-from-a-questionnaire-response

To Reproduce Steps to reproduce the behavior:

  1. follow the guide above with the attached questionnaireResponse and StructureMap

Expected behavior

as long as the String is compatible with the id constraints Regex: [A-Za-z0-9-.]{1,64} the String should be converted to the id type

Smartphone (please complete the following information):

Additional context qr.txt structuremap-emcarea.registration.p.txt

this transform works with matchbox FHIR server

this issue is blocking the WHO EmCare project

Would you like to work on the issue? unfortunately I don't have the required knowledge and skills

delcroip commented 2 years ago

Ref to HL7 lib https://github.com/hapifhir/org.hl7.fhir.core/issues/791