Skip to content

Commit

Permalink
Cleanup (#81)
Browse files Browse the repository at this point in the history
* revert some changes with resourceutils and cleanup docs
  • Loading branch information
AD1306 authored Jun 10, 2024
1 parent ed0eb2f commit 630f1f7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
8 changes: 0 additions & 8 deletions GETTINGSTARTED.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Getting Started

## Installing FHIR.ts

Navigate to your project and install the library using `npm`

```shell
$ npm i @smile-cdr/fhirts
```

## Setting Up Your First FHIR Resource

FHIR.ts offers both classes & interfaces for various FHIR resources - which one(s) you choose to use will depend on what your use case is.
Expand Down
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,52 @@

## About

FHIR.ts is a library that aims to assist web developers building FHIR applications by providing a set of classes & interfaces that match the resources outlined in the [FHIR spec](https://www.hl7.org/fhir/)
`FHIR.ts` is a library that aims to assist web developers building FHIR applications by providing a set of utility methods as well as classes & interfaces that match the resources outlined in the [FHIR spec](https://www.hl7.org/fhir/).

The following library contains classes and interfaces for [FHIR](https://www.hl7.org/fhir/) versions.

* R3 is intended for projects using FHIR [R3](https://www.hl7.org/fhir/stu3/).
* R4 is intended for projects using FHIR [R4](http://hl7.org/fhir/index.html). The definitions are generated using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen).
* R4 is intended for projects using FHIR [R4](https://hl7.org/fhir/R4/). The definitions are generated using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen).
* R5 is intended for projects using FHIR. [R5](https://hl7.org/fhir/R5/). The definitions are generated using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)


**Note**: This library does not include all FHIR TypeScript definitions for R3. The idea is to collaborate and expand this library.

#### Table of Contents

- [Installation](#installation)
- [Contribute](#contribute)
- [File a bug](#file-a-bug)

## Installation

Using npm:
```shell
$ npm i @smile-cdr/fhirts
```

Using yarn:
```shell
$ yarn add @smile-cdr/fhirts
```

## Usage

Checkout the [Getting Started section](GETTINGSTARTED.md) for how to use the library.

## Dev Process
## Contribute

1. Create an issue.
1. Create an [issue](https://github.com/smilecdr/FHIR.ts/issues) and attach appropriate labels.
2. Create a branch related to the issue.
3. Make necessary changes and upgrade library version in `package.json` file. This is a must as npm doesn't allow publish on same version.
3. Make necessary changes and upgrade library version in `package.json` file. This is a must as currently we don't have a CI job which can override a package with same version. doesn't allow publish on same version.
4. Push changes & create a Pull Request.
5. Get reviewed and merged !!!


## File a bug

1. Create an [issue](https://github.com/smilecdr/FHIR.ts/issues) and attach appropriate labels.
2. The issue will be prioritized and worked on.



2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smile-cdr/fhirts",
"version": "2.2.2",
"version": "2.2.3",
"description": "Fhir ts/js library for frontend apps",
"license": "Apache-2.0",
"main": "dist/index.js",
Expand Down
16 changes: 8 additions & 8 deletions src/library/ResourceUtils/ResourceUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Coding, CodingKeys, Extension, Identifier, IdentifierKeys } from "../dataTypes";
import { CodingKeys, IdentifierKeys } from "../dataTypes";

export class ResourceUtils {
/**
Expand All @@ -25,10 +25,10 @@ export class ResourceUtils {
* @limitations currently does not work with identifier.type, identifier.period & identifier.assigner
*/
getIdentifiersByProperty(
identifierList: Identifier[],
identifierList: any[],
propertyToCompare: IdentifierKeys,
propertyValue: Identifier[IdentifierKeys]
): Identifier[] {
propertyValue: any[IdentifierKeys]
): any[] {
return identifierList?.length
? identifierList.filter((x) => x[propertyToCompare] === propertyValue)
: [];
Expand All @@ -40,7 +40,7 @@ export class ResourceUtils {
* @param extensionUrl Extension.url to compare
* @returns array of matches
*/
getExtensionsByUrl(extensionList: Extension[], extensionUrl: string): Extension[] {
getExtensionsByUrl(extensionList: any[], extensionUrl: string): any[] {
return extensionList?.length
? extensionList.filter((x) => x["url"] === extensionUrl)
: [];
Expand All @@ -54,10 +54,10 @@ export class ResourceUtils {
* @returns array of matches
*/
getCodingsByProperty(
codingList: Coding[],
codingList: any[],
propertyToCompare: CodingKeys,
propertyValue: Coding[CodingKeys]
): Coding[] {
propertyValue: any[CodingKeys]
): any[] {
return codingList?.length
? codingList.filter((x) => x[propertyToCompare] === propertyValue)
: [];
Expand Down

0 comments on commit 630f1f7

Please sign in to comment.