Skip to content

TypeScript: Profile as an Adapter #23

@ryukzak

Description

@ryukzak

Feature Description
OOP-style support for profiles for TypeScript.

Problem Statement
Current support for profiles in TypeScript is very limited:

  • profile types which reshape the original resource
  • attach/extract function work
  • slices and extensions not supported

Also, this approach looks too functional for the TypeScript environment.

Describe the solution you'd like
What we want to try in src/api/writer-generator/typescript.ts:

// templating (constants)
// extensions
// slices

const pt = Patient(...);
const ptpr = UsCorePatient(pt);
ptpr.race = race;
ptpr.setRace('white');

client.post(pt)
client.post(ptpr.resource)
client.post(ptpr.getResource)
  • Editing profiles causes updating the original resource.

The great starting point is to extend the design doc: docs/design/profiles.md, because the current notes look too rough.

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions