Skip to content

Latest commit

 

History

History
323 lines (209 loc) · 7.24 KB

ROADMAP.md

File metadata and controls

323 lines (209 loc) · 7.24 KB

Aidbox .NET SDK Roadmap

DONE

Mappings from FHIR resources to C# classes

Typed Search Params

GetInfo

Read Resource by Id

Create Resource

Delete Resource

Update Resource

Search / List Resource

TODO

FHIR to C# Mappings

Use appropriate field types for storing fhir dates, date times (and other types)

var patient = new Patient();
// instead of string
patient.BirtDate = "2000-01-01";
// use Date type
patient.BirthDate = new DateOnly(2000, 1, 1);

FHIR "primitive" datatypes

var fhirBool = new FhirBoolean(true);
var fhirString = new FhirString("sample string");
var fhirDate = new FhirDate("2024-01-01");
...

Instead of using one of the fields like here

var patient = new Patient();
patient.DeceasedBoolean = true;
// or
patient.DeceasedDateTime = new DateOnly("2024-01-01") 

Use polymorphic field

var patient = new Patient();
patient.Deceased = new FhirBoolean(true);
// or
patient.Deceased = new FhirDateTime("2024-01-01T100:00:00") 

Value sets as enums

enum AdministrativeGender 
{
  Male,
  Female,
  Other,
  Unknown
}

var patient = new Patient();
patient.Gender = AdministrativeGender.Unknown;

Or value sets as union types

public abstract record AdministrativeGender
{   
    private AdministrativeGender(){ }
    public record Male(): AdministrativeGender;
    public record Female() : AdministrativeGender;
    public record Other() : AdministrativeGender;
    public record Unknown() : AdministrativeGender;
}

var patient = new Patient();
patient.Gender = AdministrativeGender.Unknown();

FHIR extensions

Make it possible to add extensions.

var patient = new Patient();
var mothersName = new Extension("http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", "Doe");

patient.Extension.Add(patient);

List / circular structure / recursive structure

There are fields with the same name as resources in FHIR. It is not allowed to have the same property name as a class name. Come up with a workaround.

Reference [re-design Reference class] (aidbox format)

Problem: we don't want to concat string every time "Patient" + "/" + ""

// FHIR: { reference: "Patient/<uuid>" }
// AIDBOX: { resourceType: Patient, id: <uuid> }

patient.managingOrganization = new Reference<Organization>() { id:<uuid> }

JsonParse(patient) => { "name": [], "managingOrganization": { "reference": "Organization/<uuid>" } } 

First-Class extensions (aka aidbox format)

It is hard to reach the exact extension in array with nested extensions. Implement a convenient way of extractting data from extension.

Given example of patient data:

{
  "resourceType" : "Patient",
  "id" : "child-example",
  "meta" : {
    "profile" : ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient|7.0.0"]
  },
  "extension" : [
    {
      "extension" : [
        {
          "url" : "ombCategory",
          "valueCoding" : {
            "system" : "urn:oid:2.16.840.1.113883.6.238",
            "code" : "2028-9",
            "display" : "Asian"
          }
        },
        {
          "url" : "text",
          "valueString" : "Asian"
        }
      ],
      "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"
    },
    ...
    {
      "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
      "valueCode" : "M"
    },
    {
      "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex",
      "valueCode" : "248153007"
    }
  ]
}

Instead of extracting patient extension data like in the next example:

var raceExtension = patient.extension.FirstOrDefault(e => e["url"].ToString() == "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race");

var raceText = raceExtension.extension.FirstOrDefault(e => e["url"].ToString() == "text")["valueString"];

We would like to provide a more convenient way:

var raceName = patient.Race.Text;

Profiles

Implement FHIR Profiles Patterns

{
  "code": {
    "pattern": {
      "coding": [
        {
          "system": "http://loinc.org",
          "code": "29549-3",
          "display": "Medication administered Narrative"
        }
      ]
    }
  }
}
class CodeableConcept1 : CodeableConcept {
  readonly coding: [new Conding295493() { System = "http://loinc.org", Code = "29549-3"}]
}

Bindings (resource code type suggestion from CodeSystem)

patient.gender = male | female

Client methods

PATCH method

Link to aidbox doc: https://docs.aidbox.app/api-1/api/crud-1/patch#merge-patch

var (result, error) = await aidbox.Patch<Patient>(newData);

Batch/Transaction Operation

Link to aidbox doc: https://docs.aidbox.app/api-1/transaction

Chaining of params, pagination, sorting (like in TypeScript SDK)

var search = aidbox.Search<Patient>(params)
  .Where(...)
  .SortBy(...);

Request exceptions

Handle HTTP exceptions with appropriate C# classes.

OperationOutcome example in Aidbox:

resourceType: OperationOutcome
text:
  status: generated
  div: Invalid resource
issue:

  - severity: fatal
    code: invalid
    expression:
      - Appointment.participant
        diagnostics: ':participant is required'
  - severity: fatal
    code: invalid
    expression:
      - Appointment.status
        diagnostics: ':status is required'

Model Validation

Exceptions during runtime based on type-system [c# serialize/parse out of box]

Example TBD

Constraint on properties / cross-properties [transformation to validation functions]

Example TBD

Slicing (min/max; order; pattern; open/close) [transformation to validation functions]

Example TBD

Value-set / reference to a specific version of the resource [fhir-server]

Example TBD

Custom operations

https://docs.aidbox.app/app-development/aidbox-sdk/aidbox-apps

Delivery

It might not be so trivial, considering there are numerous FHIR profiles and each client would need its own set.