You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a typescript incompatibility problem on the Meta object types when using this library and the R4 FHIR definitions from @types/fhir. I thought it must be a problem in @types/fhir but when I compare both libraries to the HL7 specification it looks like the client-js types.d.ts file is incorrect in the type definition for the Meta object.
Specifically this is the error I get
Argument of type 'QuestionnaireResponse' is not assignable to parameter of type 'Resource'.
Types of property 'meta' are incompatible.
Type 'fhir4.Meta' is not assignable to type 'import("/home/*****/projects/*****/node_modules/fhirclient/lib/types").fhirclient.FHIR.Meta'.
Property 'lastUpdated' is optional in type 'Meta' but required in type 'Meta'.ts(2345)
The spec here for R4 (as well as the latest 5.0) show lastUpdated as an optional value when creating a resource: http://hl7.org/fhir/R4/resource.html
However in the client-js library it forces the lastUpdated to be mandatory which creates the error I'm running into.
I ran into a typescript incompatibility problem on the Meta object types when using this library and the R4 FHIR definitions from @types/fhir. I thought it must be a problem in @types/fhir but when I compare both libraries to the HL7 specification it looks like the client-js types.d.ts file is incorrect in the type definition for the Meta object.
Specifically this is the error I get
The spec here for R4 (as well as the latest 5.0) show lastUpdated as an optional value when creating a resource:
http://hl7.org/fhir/R4/resource.html
However in the client-js library it forces the lastUpdated to be mandatory which creates the error I'm running into.
client-js/dist/lib/types.d.ts
Line 1097 in 8f64b77
I believe this needs to be changed to be optional, but if I'm misreading the specification that's fine. The change would just need to be:
Happy to do a pull request if the project would accept it.
The text was updated successfully, but these errors were encountered: