Class ParameterConverter


  • public class ParameterConverter
    extends java.lang.Object
    Provide conversion logic for FHIR Parameter objects both to and from the CQL System types. This relies on data type conversion logic from the FHIRTypeConverter and then is further responsible for encoding those conversions in the needed Parameter format.
    • Constructor Detail

      • ParameterConverter

        public ParameterConverter​(FHIRTypeConverter typeConverter)
        Initialize with the given data type conversion logic.
        Parameters:
        typeConverter - FHIR data type conversion logic
    • Method Detail

      • toParameter

        public Parameters.Parameter toParameter​(java.lang.String paramName,
                                                java.util.Map<java.lang.String,​java.lang.Object> expressionResults)
        Convert CQL parameters into a FHIR Parameter resource
        Parameters:
        paramName - Name of the FHIR parameter to generate
        expressionResults - CQL types to convert
        Returns:
        FHIR Parameter resource
      • toParameter

        public Parameters.Parameter.Builder toParameter​(java.lang.Object value)
        Convert CQL value to partial FHIR parameter
        Parameters:
        value - CQL value
        Returns:
        partial FHIR parameter
      • toParameter

        public Parameters.Parameter.Builder toParameter​(Parameters.Parameter.Builder p,
                                                        java.lang.Object value)
        Add a CQL value to a FHIR parameter that is being built. FHIR BackboneElement types are not supported as target values and will fail. Iterable results that are lists of resources are automatically converted into FHIR bundle resources in the generated parameter. Lists of primitive values as results are not currently supported.
        Parameters:
        value - CQL value
        Returns:
        partial FHIR parameter with added value
      • toCql

        public java.lang.Object toCql​(Parameters.Parameter p)
        Convert FHIR parameter contents to a CQL value
        Parameters:
        value - FHIR parameter
        Returns:
        CQL value