@smile-cdr/fhirts 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GETTINGSTARTED.md
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
# Getting Started
|
|
2
2
|
|
|
3
|
-
## Installing FHIR.ts
|
|
4
|
-
|
|
5
|
-
Navigate to your project and install the library using `npm`
|
|
6
|
-
|
|
7
|
-
```shell
|
|
8
|
-
$ npm i @smile-cdr/fhirts
|
|
9
|
-
```
|
|
10
|
-
|
|
11
3
|
## Setting Up Your First FHIR Resource
|
|
12
4
|
|
|
13
5
|
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.
|
package/README.md
CHANGED
|
@@ -4,16 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
## About
|
|
6
6
|
|
|
7
|
-
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/)
|
|
7
|
+
`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/).
|
|
8
8
|
|
|
9
9
|
The following library contains classes and interfaces for [FHIR](https://www.hl7.org/fhir/) versions.
|
|
10
10
|
|
|
11
11
|
* R3 is intended for projects using FHIR [R3](https://www.hl7.org/fhir/stu3/).
|
|
12
|
-
* R4 is intended for projects using FHIR [R4](
|
|
12
|
+
* 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).
|
|
13
|
+
* 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)
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
**Note**: This library does not include all FHIR TypeScript definitions for R3. The idea is to collaborate and expand this library.
|
|
16
17
|
|
|
18
|
+
#### Table of Contents
|
|
19
|
+
|
|
20
|
+
- [Installation](#installation)
|
|
21
|
+
- [Contribute](#contribute)
|
|
22
|
+
- [File a bug](#file-a-bug)
|
|
23
|
+
|
|
17
24
|
## Installation
|
|
18
25
|
|
|
19
26
|
Using npm:
|
|
@@ -21,17 +28,28 @@ Using npm:
|
|
|
21
28
|
$ npm i @smile-cdr/fhirts
|
|
22
29
|
```
|
|
23
30
|
|
|
31
|
+
Using yarn:
|
|
32
|
+
```shell
|
|
33
|
+
$ yarn add @smile-cdr/fhirts
|
|
34
|
+
```
|
|
35
|
+
|
|
24
36
|
## Usage
|
|
25
37
|
|
|
26
38
|
Checkout the [Getting Started section](GETTINGSTARTED.md) for how to use the library.
|
|
27
39
|
|
|
28
|
-
##
|
|
40
|
+
## Contribute
|
|
29
41
|
|
|
30
|
-
1. Create an issue.
|
|
42
|
+
1. Create an [issue](https://github.com/smilecdr/FHIR.ts/issues) and attach appropriate labels.
|
|
31
43
|
2. Create a branch related to the issue.
|
|
32
|
-
3. Make necessary changes and upgrade library version in `package.json` file. This is a must as
|
|
44
|
+
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.
|
|
33
45
|
4. Push changes & create a Pull Request.
|
|
46
|
+
5. Get reviewed and merged !!!
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## File a bug
|
|
34
50
|
|
|
51
|
+
1. Create an [issue](https://github.com/smilecdr/FHIR.ts/issues) and attach appropriate labels.
|
|
52
|
+
2. The issue will be prioritized and worked on.
|
|
35
53
|
|
|
36
54
|
|
|
37
55
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CodingKeys, IdentifierKeys } from "../dataTypes";
|
|
2
2
|
export declare class ResourceUtils {
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -16,14 +16,14 @@ export declare class ResourceUtils {
|
|
|
16
16
|
* @returns array of matches
|
|
17
17
|
* @limitations currently does not work with identifier.type, identifier.period & identifier.assigner
|
|
18
18
|
*/
|
|
19
|
-
getIdentifiersByProperty(identifierList:
|
|
19
|
+
getIdentifiersByProperty(identifierList: any[], propertyToCompare: IdentifierKeys, propertyValue: any[IdentifierKeys]): any[];
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
* @param extensionList list of extensions
|
|
23
23
|
* @param extensionUrl Extension.url to compare
|
|
24
24
|
* @returns array of matches
|
|
25
25
|
*/
|
|
26
|
-
getExtensionsByUrl(extensionList:
|
|
26
|
+
getExtensionsByUrl(extensionList: any[], extensionUrl: string): any[];
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
29
|
* @param codingList list of codings
|
|
@@ -31,7 +31,7 @@ export declare class ResourceUtils {
|
|
|
31
31
|
* @param propertyValue value we want to compare against string or boolean
|
|
32
32
|
* @returns array of matches
|
|
33
33
|
*/
|
|
34
|
-
getCodingsByProperty(codingList:
|
|
34
|
+
getCodingsByProperty(codingList: any[], propertyToCompare: CodingKeys, propertyValue: any[CodingKeys]): any[];
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
37
|
* @param resource resource for which path needs to be validated
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CodingKeys, IdentifierKeys } from "../dataTypes";
|
|
2
2
|
|
|
3
3
|
export class ResourceUtils {
|
|
4
4
|
/**
|
|
@@ -25,10 +25,10 @@ export class ResourceUtils {
|
|
|
25
25
|
* @limitations currently does not work with identifier.type, identifier.period & identifier.assigner
|
|
26
26
|
*/
|
|
27
27
|
getIdentifiersByProperty(
|
|
28
|
-
identifierList:
|
|
28
|
+
identifierList: any[],
|
|
29
29
|
propertyToCompare: IdentifierKeys,
|
|
30
|
-
propertyValue:
|
|
31
|
-
):
|
|
30
|
+
propertyValue: any[IdentifierKeys]
|
|
31
|
+
): any[] {
|
|
32
32
|
return identifierList?.length
|
|
33
33
|
? identifierList.filter((x) => x[propertyToCompare] === propertyValue)
|
|
34
34
|
: [];
|
|
@@ -40,7 +40,7 @@ export class ResourceUtils {
|
|
|
40
40
|
* @param extensionUrl Extension.url to compare
|
|
41
41
|
* @returns array of matches
|
|
42
42
|
*/
|
|
43
|
-
getExtensionsByUrl(extensionList:
|
|
43
|
+
getExtensionsByUrl(extensionList: any[], extensionUrl: string): any[] {
|
|
44
44
|
return extensionList?.length
|
|
45
45
|
? extensionList.filter((x) => x["url"] === extensionUrl)
|
|
46
46
|
: [];
|
|
@@ -54,10 +54,10 @@ export class ResourceUtils {
|
|
|
54
54
|
* @returns array of matches
|
|
55
55
|
*/
|
|
56
56
|
getCodingsByProperty(
|
|
57
|
-
codingList:
|
|
57
|
+
codingList: any[],
|
|
58
58
|
propertyToCompare: CodingKeys,
|
|
59
|
-
propertyValue:
|
|
60
|
-
):
|
|
59
|
+
propertyValue: any[CodingKeys]
|
|
60
|
+
): any[] {
|
|
61
61
|
return codingList?.length
|
|
62
62
|
? codingList.filter((x) => x[propertyToCompare] === propertyValue)
|
|
63
63
|
: [];
|