smilecdr / FHIR.ts

TypeScript/JavaScript FHIR Library
https://www.npmjs.com/package/@smile-cdr/fhirts
Apache License 2.0
37 stars 10 forks source link

Error Deserializing Patient Resource #84

Open matttsai-orx opened 4 days ago

matttsai-orx commented 4 days ago

Description

When following the instructions in the FHIR.ts Getting Started guide, I encountered an error related to deserializing a Patient resource. The specific error message is: Error deserializing Patient resource: TypeError: resourceUtils.deserializedPatientResource is not a function

Steps to Reproduce

  1. Navigate to the Getting Started guide.
  2. Follow the provided code examples for initializing a Patient resource.
  3. Observe the error mentioned above.

Expected Behavior

The Patient resource should be successfully deserialized without any errors.

Additional Context

AD1306 commented 4 days ago

Hello @matttsai-orx, that function doesn't exist and might've been leftover during some cleanup. Apologies for that. For your solution you can actually just use type assertion : https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions

Example:

const patient = object as Patient;