Ahryman40k / typescript-fhir-types

Typescript / Javascript object model for FHIR standard
MIT License
126 stars 27 forks source link

Fhir enums are a little bit annoying ... #5

Closed Ahryman40k closed 5 years ago

Ahryman40k commented 5 years ago

When I generated enums for library, I took some ease. So, In order to generate my code I've done things like this:

export enum ExpressionLanguageKind {
        textCql = 'textCql',
        textFhirpath = 'textFhirpath',
        applicationXFhirQuery = 'applicationXFhirQuery'
}

and create the adapted keyof type with io-ts.

but data in json are more like that:

 "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/cqf-expression",
            "valueExpression": {
              "language": "text/cql",
              "expression": "Now()"
            }
          }
        ]

See text/cql vs textCql ... I need a better way to fix this !

Ahryman40k commented 5 years ago

solved in 4.0.5