Skip to content

Parsing Variables Containing Special Characters without a Separator #8000

@Sanjana-Attanayake

Description

@Sanjana-Attanayake

Description

The variables of FHIR IGs, which use a special character, without a separator, just embedded to its original value, cases a error when the ballerina files are generated, as they violate the Ballerina languages syntax.

Consider the below ENUM record generated from the Swiss Core FHIR profile.

Ballerina Record

# CHCorePatientEPRGender enum
public enum CHCorePatientEPRGender {
   CODE_GENDER_OTHER = "other",
   CODE_GENDER_FEMALE = "female",
   CODE_GENDER_MALE = "male",
   CODE_GENDER_UNKNOWN* = "unknown*"
}

FHIR Definition

{
        "id": "Patient.gender",
        "path": "Patient.gender",
        "short": "male | female | other | unknown* (* see warning 'ch-pat-2')",
        ....
}

The "unknown" type has an asterisk (*) mark embedded to its value, causing the tool to generate a invalid variable type.

Steps to Reproduce

  1. In the FHIR-Health Tool, try to parse the below IG for Swiss Core national base.

Swiss Core Implementation Guide

Version

3.0.0

Environment Details (with versions)

JDK: 21.0 or 17.0
Ballerina: 2201.12.3 or 2201.10.2

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions