npm package: @i4mi/fhir_ch
Description: Selected resources from FHIR CH implementation guides as TypeScript interfaces.
Author: Gabriel Hess, Joshua Drewlow @ Institute for Medical Informatics
Latest version: 0.0.4

# FHIR® CH Typescript Interfaces

This library includes some interfaces for representing [FHIR CH](https://fhir.ch) implementation guides and profiles. Due to the limitations of TypeScript interfaces, unfortunately not all constraints of the Implementation Guides can be represented.

This repository is in the early stages of development. It is intended for internal projects at the Institute of Medical Informatics I4MI at Bern University of Applied Sciences. You can use it for your own projects at your own risk, but there is no guarantee that the interfaces are correct or complete.

The interfaces are based on the FHIR® interfaces from [@i4mi/fhir_r4](https://www.npmjs.com/package/@i4mi/fhir_r4).

## Content Table

- [1 How to use](#1-how-to-use)
- [2 Interfaces and Types](#2-interfaces-and-types)
  - [2.1 CH Core](#21-ch-core)
  - [2.2 CH VACD](#22-ch-vacd)
  - [2.3 CH AllergyIntolerance](#23-ch-allergy-intolerance)
- [3 Legal](#3-legal)
  - [3.1 License](#31-license)
  - [3.2 FHIR Trademark](#32-fhir-trademark)
- [4 Changelog](#4-changelog)

# 1 How to use

Install it using
```console
npm i @i4mi/fhir_ch -D
```

After installing, you can import and use the interfaces in your application.
```typescript
import {CHPatientEPR} from '@i4mi/fhir_ch';

let myPatient: CHPatientEPR = {
  resourceType: 'Patient',
  meta: {
    profile: [
      'http://fhir.ch/ig/ch-core/StructureDefinition/ch-core-patient-epr'
    ]
  },
  resourceType: 'Patient',
  identifier: [
    {
      type : {
        coding : [
          {
            system : 'http://terminology.hl7.org/CodeSystem/v2-0203',
            code : 'MR'
          }
        ]
      },
      system : 'urn:oid:2.16.756.888888.3.1',
      value : '8733'
    }
  ],
  name: [
    {
      family : 'Brönnimann-Bertholet',
      given : [
        'Elisabeth'
      ]
    }
  ],
  gender: PatientAdministrativeGender.FEMALE,
  birthDate: '1937-05-03',
};
```

This then allows your IDE to highlight wrong or missing properties of your created ressource.

# 2 Interfaces and Type

## 2.1 CH Core

Interfaces for profiles from [CH Core](http://fhir.ch/ig/ch-core/index.html). This implementation guide is provided to support the use of FHIR® in Switzerland.

<!-- prettier-ignore -->
| Profile | Interface Name | Inherits from | Version |
| ------- | -------------- | -------------- | --------|
| [CH Core Patient EPR](https://fhir.ch/ig/ch-core/StructureDefinition-ch-core-patient-epr.html)| CHPatientEPR | Patient | 4.0.1 |
| [CH Core Document EPR](https://fhir.ch/ig/ch-core/StructureDefinition-ch-core-document-epr.html)| CHDocumentEPR | Bundle | 4.0.1 |
| [CH Core DocumentReference EPR](https://fhir.ch/ig/ch-core/StructureDefinition-ch-core-documentreference-epr.html)| CHDocumentReferenceEPR | DocumentReference |  4.0.1 | 

## 2.2 CH VACD

Interfaces for profiles from the [CH VACD](https://fhir.ch/ig/ch-vacd/index.html) implementation guide. The CH-VACD implementation guide describes the FHIR® representation of the defined documents for the exchange of vaccination and immunization information. This implementation guide is dependent on the [CH Core](http://fhir.ch/ig/ch-core/index.html) profiles which describes the Swiss specific resources.

<!-- prettier-ignore -->
| Profile | Interface Name | Inherits from | Version |
| ------- | -------------- | -------------- | --------|
| [CH VACD Vaccination Record Document](https://fhir.ch/ig/ch-vacd/StructureDefinition-ch-vacd-document-vaccination-record.html) | CHVacdVaccinationRecordDocument | Bundle | 4.0.1 |
| [CH VACD Vaccination Record Composition](https://fhir.ch/ig/ch-vacd/StructureDefinition-ch-vacd-composition-vaccination-record.html) | CHVacdCompositionVaccinationRecord | Composition | 4.0.1 |
| [CH VACD Immunization](https://fhir.ch/ig/ch-vacd/StructureDefinition-ch-vacd-immunization.html) | CHVacdImmunization | Immunization | 4.0.1 |
| [CH VACD Basic Immunization](https://fhir.ch/ig/ch-vacd/StructureDefinition-ch-vacd-basic-immunization.html) | use CHVacdCondition | | not implemented |
| [CH VACD Past Illness](https://fhir.ch/ig/ch-vacd/StructureDefinition-ch-vacd-pastillnesses.html) | CHVacdPastIllness | CHVacdCondition | 4.0.1 |
| [CH VACD Condition](https://fhir.ch/ig/ch-vacd/StructureDefinition-ch-vacd-condition.html) | CHVacdCondition | Condition | 4.0.1 |

## 2.3 CH AllergyIntolerance

Interfaces for profiles from [CH-AllergyIntolerance](https://fhir.ch/ig/ch-allergyintolerance/index.html).

<!-- prettier-ignore -->
| Profile | Interface Name | Inherited from | Version |
| ------- | -------------- | -------------- | --------|
| [CH Allergy Intolerance](https://fhir.ch/ig/ch-allergyintolerance/StructureDefinition-ch-allergyintolerance.html)| CHAllergyIntolerance | AllergyIntolerance | 2.0.1 |

## 3 Legal

## 3.1 License

This software is published under an [Apache 2.0 License](License.txt).

## 3.2 FHIR® Trademark

FHIR® is the registered trademark of HL7 and is used with the permission of HL7. Use of the FHIR® trademark does not constitute endorsement of this product by HL7.

# 4 Changelog

<!-- prettier-ignore -->
| Version | Date       | Changes                   |
| ------- | ---------- | ------------------------- |
| 0.0.4   | 2024-01-03 | - Update version numbers |
| 0.0.3   | 2023-12-21 | - Add CH Core DocumentReference EPR |
| 0.0.2   | 2023-12-12 | - Add CH Core Document EPR |
| 0.0.1   | 2023-12-08 | - Add CHPatientEPR<br />- Add CH VACD Profiles<br />- Add CHAllergyIntolerance   |