@smile-cdr/fhirts 2.2.2 → 2.2.4
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/CHANGELOG.md +6 -0
- package/GETTINGSTARTED.md +84 -45
- package/README.md +23 -5
- package/dist/FHIR-R3.d.ts +35 -1
- package/dist/FHIR-R3.js +5 -2
- package/dist/library/ResourceUtils/ResourceUtils.d.ts +4 -4
- package/package.json +1 -1
- package/src/FHIR-R3.ts +36 -1
- package/src/library/ResourceUtils/ResourceUtils.ts +8 -8
package/CHANGELOG.md
CHANGED
package/GETTINGSTARTED.md
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
# Getting Started
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Setting Up Your First FHIR Resource
|
|
4
4
|
|
|
5
|
-
Navigate to your project and install the library using `npm`
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
$ npm i @smile-cdr/fhirts
|
|
9
|
-
```
|
|
6
|
+
> NOTE: At the moment, the fhirR3 library only supports classes
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
#### Table of Contents
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
- [Class and Interface usage](#models-usage)
|
|
11
|
+
- [Resource Narrowing](#resource-narrowing)
|
|
12
|
+
- [Utilities](#utilities)
|
|
13
|
+
- [PatchUtils](#patchutils)
|
|
14
|
+
- [QueryBuilder](#querybuilder)
|
|
15
|
+
- [BundleUtils](#bundleutilities)
|
|
16
|
+
- [ResourceUtils](#resourceutilities)
|
|
17
|
+
- [Bundle Utilities (static BundleUtils)](#bundleutilities)
|
|
18
|
+
- [Resource Utilities (static ResourceUtils)](#resourceutilities)
|
|
14
19
|
|
|
15
|
-
> At the moment, the fhirR3 library only supports classes
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### Class and Interface usage
|
|
18
22
|
|
|
19
23
|
```js
|
|
20
24
|
|
|
@@ -59,29 +63,8 @@ let patient: fhirR5.Patient = {
|
|
|
59
63
|
|
|
60
64
|
Fields in FHIR.ts have strict typing to them. For example, in `Patient`, you can only select a `gender` that's in the list of accepted values.
|
|
61
65
|
|
|
62
|
-
## Example
|
|
63
|
-
|
|
64
|
-
Here's an example of setting up a `Patient` resource in R4 using classes:
|
|
65
|
-
|
|
66
|
-
```js
|
|
67
|
-
import { fhirR4 } from '@smile-cdr/fhirts';
|
|
68
|
-
|
|
69
|
-
const patient = new fhirR4.Patient();
|
|
70
|
-
const identifer = new fhirR4.Identifier();
|
|
71
|
-
const humanName = new fhirR4.HumanName();
|
|
72
|
-
|
|
73
|
-
humanName.family = 'Doe'
|
|
74
|
-
humanName.given = ['John', 'Edward'];
|
|
75
|
-
|
|
76
|
-
identifer.system = 'https://smilecdr.com';
|
|
77
|
-
identifer.value = '123';
|
|
78
|
-
|
|
79
|
-
patient.resourceType = 'Patient';
|
|
80
|
-
patient.identifier = [identifer];
|
|
81
|
-
patient.name = [humanName]
|
|
82
|
-
```
|
|
83
66
|
|
|
84
|
-
|
|
67
|
+
### Resource Narrowing
|
|
85
68
|
|
|
86
69
|
When working with Resources from a Bundle, by investigating the values and properties of those Resources Typescript will automatically infer the correct type. For example take the following code:
|
|
87
70
|
```js
|
|
@@ -93,17 +76,73 @@ function getResourceType(resource:Resource){
|
|
|
93
76
|
```
|
|
94
77
|
If you try writing this out you will see that the variable `resource` inside the `if` block is of type `CarePlan`. This was inferred automatically using the `if` condition (since as per the specification the only resources which can have `resourceType:"CarePlan"` are `CarePlan` resources).
|
|
95
78
|
|
|
96
|
-
|
|
79
|
+
Read more about resource narrowing here : https://www.typescriptlang.org/docs/handbook/2/narrowing.html
|
|
97
80
|
|
|
98
|
-
|
|
81
|
+
### Utilities
|
|
82
|
+
|
|
83
|
+
- There are 4 new utilities available :
|
|
99
84
|
- BundleUtilities
|
|
100
85
|
- ResourceUtilities
|
|
86
|
+
- PatchUtilities
|
|
87
|
+
- QueryBuilder
|
|
101
88
|
- All of the above mentioned classes are currently in preliminary phase and will be refined in future as per needs.
|
|
102
89
|
- The above utlity classes include common functionalities used by front end applications using FHIR.
|
|
103
|
-
- All utilities functions are static right now, so, no need for instantiating classes. **Note: This is subject to change in future**
|
|
104
90
|
|
|
105
|
-
|
|
106
|
-
|
|
91
|
+
#### PatchUtils
|
|
92
|
+
- Published in `v2.2.0`.
|
|
93
|
+
- Example usage demonstrated below.
|
|
94
|
+
```js
|
|
95
|
+
import { PatchUtils } from '@smile-cdr/fhirts';
|
|
96
|
+
|
|
97
|
+
const patchUtils = new PatchUtils();
|
|
98
|
+
// returns patch parameters
|
|
99
|
+
const patchParameters = patchUtils.createDeleteParameters("Patient.identifier[3]").getPatchParameters();
|
|
100
|
+
console.log(patchParameters)
|
|
101
|
+
// console logs
|
|
102
|
+
/*
|
|
103
|
+
* {
|
|
104
|
+
"resourceType": "Parameters",
|
|
105
|
+
"parameter": [
|
|
106
|
+
{
|
|
107
|
+
"name": "operation",
|
|
108
|
+
"part": [
|
|
109
|
+
{
|
|
110
|
+
"name": "type",
|
|
111
|
+
"valueCode": "delete"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "path",
|
|
115
|
+
"valueString": "Patient.identifier[3]"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
*
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### QueryBuilder
|
|
125
|
+
- Published in `v2.1.2`.
|
|
126
|
+
- Example usage demonstrated below.
|
|
127
|
+
```js
|
|
128
|
+
import { QueryBuilder } from '@smile-cdr/fhirts';
|
|
129
|
+
|
|
130
|
+
const queryBuilder = new QueryBuilder();
|
|
131
|
+
// returns encoded url
|
|
132
|
+
const query = queryBuilder.setBaseResource("Observation")
|
|
133
|
+
.revincludeAll()
|
|
134
|
+
.include("based-on")
|
|
135
|
+
.sort("status", SORT_ORDER.ASCENDING)
|
|
136
|
+
.getCompleteUrl();
|
|
137
|
+
console.log(query)
|
|
138
|
+
// console logs
|
|
139
|
+
// "Observation?_revinclude=*&_include=Observation%3Abased-on&_sort=status"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
#### BundleUtils
|
|
144
|
+
- Published in `v2.1.0`.
|
|
145
|
+
- Example usage demonstrated below.
|
|
107
146
|
```js
|
|
108
147
|
import { BundleUtils } from '@smile-cdr/fhirts';
|
|
109
148
|
|
|
@@ -114,12 +153,12 @@ const claimsList = bundleUtils.getResourcesFromBundle(Bundle.entry, 'Claim');
|
|
|
114
153
|
const resource = bundleUtils.getResourceFromBundle(Bundle.entry, '123');
|
|
115
154
|
```
|
|
116
155
|
|
|
117
|
-
#### ResourceUtils
|
|
156
|
+
#### ResourceUtils
|
|
157
|
+
- Published in `v2.1.0`.
|
|
158
|
+
- Example usage demonstrated below.
|
|
118
159
|
```js
|
|
119
160
|
import { ResourceUtils } from '@smile-cdr/fhirts';
|
|
120
161
|
const resourceUtils = new ResourceUtils();
|
|
121
|
-
// returns deserialized Patient resource
|
|
122
|
-
const deserializedPatientResource = resourceUtils.deserializeResource(jsonPatientPayload, new Patient());
|
|
123
162
|
|
|
124
163
|
// returns Patient.gender
|
|
125
164
|
const patientGender = resourceUtils.getResourceProperty(jsonPatientPayload, 'gender');
|
|
@@ -141,8 +180,9 @@ const references = resourceUtils.getAllReferencesFromResource(resourcePayload);
|
|
|
141
180
|
|
|
142
181
|
|
|
143
182
|
|
|
144
|
-
|
|
145
|
-
|
|
183
|
+
#### BundleUtilities
|
|
184
|
+
- Published in `v2.0.0`.
|
|
185
|
+
- Example usage demonstrated below.
|
|
146
186
|
```js
|
|
147
187
|
import { BundleUtilities } from '@smile-cdr/fhirts';
|
|
148
188
|
|
|
@@ -150,13 +190,12 @@ import { BundleUtilities } from '@smile-cdr/fhirts';
|
|
|
150
190
|
const claimsList = BundleUtilities.getResourcesFromBundle(Bundle.entry, 'Claim');
|
|
151
191
|
```
|
|
152
192
|
|
|
153
|
-
#### ResourceUtilities
|
|
193
|
+
#### ResourceUtilities
|
|
194
|
+
- Published in `v2.0.0`.
|
|
195
|
+
- Example usage demonstrated below.
|
|
154
196
|
```js
|
|
155
197
|
import { ResourceUtilities } from '@smile-cdr/fhirts';
|
|
156
198
|
|
|
157
|
-
// returns deserialized Patient resource
|
|
158
|
-
const deserializedPatientResource = ResourceUtilities.deserializeResource(jsonPatientPayload, new Patient());
|
|
159
|
-
|
|
160
199
|
// returns Patient.gender
|
|
161
200
|
const patientGender = ResourceUtilities.getResourceProperty(jsonPatientPayload, 'gender');
|
|
162
201
|
|
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
|
|
package/dist/FHIR-R3.d.ts
CHANGED
|
@@ -655,6 +655,40 @@ export declare class ProcessRequest extends BaseResource {
|
|
|
655
655
|
provider: Reference;
|
|
656
656
|
request: Reference;
|
|
657
657
|
}
|
|
658
|
+
export declare class Condition extends BaseResource {
|
|
659
|
+
resourceType: "Condition";
|
|
660
|
+
identifier?: Identifier[];
|
|
661
|
+
clinicalStatus?: "active" | "recurrence" | "inactive" | "remission" | "resolved";
|
|
662
|
+
verificationStatus?: "provisional" | "differential" | "confirmed" | "refuted" | "entered-in-error" | "unknown";
|
|
663
|
+
category?: CodeableConcept[];
|
|
664
|
+
severity?: CodeableConcept;
|
|
665
|
+
code?: CodeableConcept;
|
|
666
|
+
bodySite?: CodeableConcept[];
|
|
667
|
+
subject: Reference;
|
|
668
|
+
context?: Reference;
|
|
669
|
+
onsetDateTime?: string | Date;
|
|
670
|
+
onsetAge?: Age;
|
|
671
|
+
onsetPeriod?: Period;
|
|
672
|
+
onsetRange?: Range;
|
|
673
|
+
onsetString?: string;
|
|
674
|
+
abatementDateTime?: string | Date;
|
|
675
|
+
abatementAge?: Age;
|
|
676
|
+
abatementBoolean?: boolean;
|
|
677
|
+
abatementPeriod?: Period;
|
|
678
|
+
abatementRange?: Range;
|
|
679
|
+
abatementString?: string;
|
|
680
|
+
assertedDate?: string | Date;
|
|
681
|
+
asserter?: Reference;
|
|
682
|
+
stage?: {
|
|
683
|
+
summary?: CodeableConcept;
|
|
684
|
+
assessment?: Reference[];
|
|
685
|
+
};
|
|
686
|
+
evidence?: {
|
|
687
|
+
code?: CodeableConcept[];
|
|
688
|
+
detail?: Reference[];
|
|
689
|
+
}[];
|
|
690
|
+
note?: Annotation[];
|
|
691
|
+
}
|
|
658
692
|
export declare class Encounter extends BaseResource {
|
|
659
693
|
resourceType: "Encounter";
|
|
660
694
|
identifier: Identifier[];
|
|
@@ -1185,5 +1219,5 @@ export declare class ValueSetContains extends BackboneElement {
|
|
|
1185
1219
|
designation?: ValueSetDesignation[];
|
|
1186
1220
|
contains?: ValueSetContains[];
|
|
1187
1221
|
}
|
|
1188
|
-
export type Resource = AllergyIntolerance | ClinicalImpression | Schedule | HealthcareService | Bundle | AuditEvent | CommunicationRequest | Immunization | Observation | Device | Practitioner | PractitionerRole | ProcedureRequest | Task | Communication | CarePlan | EpisodeOfCare | CareTeam | Encounter | ProcessRequest | Account | Location | Organization | AppointmentResponse | Appointment | QuestionnaireResponse | Questionnaire | Slot | Patient | DocumentReference | ValueSet;
|
|
1222
|
+
export type Resource = AllergyIntolerance | ClinicalImpression | Condition | Schedule | HealthcareService | Bundle | AuditEvent | CommunicationRequest | Immunization | Observation | Device | Practitioner | PractitionerRole | ProcedureRequest | Task | Communication | CarePlan | EpisodeOfCare | CareTeam | Encounter | ProcessRequest | Account | Location | Organization | AppointmentResponse | Appointment | QuestionnaireResponse | Questionnaire | Slot | Patient | DocumentReference | ValueSet;
|
|
1189
1223
|
export {};
|
package/dist/FHIR-R3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Restriction = exports.SampledData = exports.Output = exports.Input = exports.Range = exports.Ratio = exports.Component = exports.Timing = exports.Activity = exports.EncounterParticipant = exports.Participant = exports.ReferenceRange = exports.Context = exports.ContextRelated = exports.Annotation = exports.FHIROption = exports.Answer = exports.EnableWhen = exports.Network = exports.Payload = exports.Identifier = exports.Reference = exports.ContactDetail = exports.ContactPoint = exports.Contact = exports.PatientCommunication = exports.Link = exports.Content = exports.Qualification = exports.Attachment = exports.VaccinationProtocol = exports.ImmunizationReaction = exports.ImmunizationExplaination = exports.PractitionerForImmunization = exports.UsageContext = exports.Quantity = exports.Period = exports.CodeableConcept = exports.Meta = exports.Address = exports.Extension = exports.HumanName = exports.DoseCoding = exports.Coding = exports.Code = exports.Narrative = exports.BaseResource = exports.DomainResource = exports.BackboneElement = exports.FHIRElement = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.ValueSetContains = exports.ValueSetParameter = exports.ValueSetExpansion = exports.ValueSetFilter = exports.ValueSetDesignation = exports.ValueSetConcept = exports.ValueSetInclude = exports.ValueSetCompose = exports.ValueSet = exports.Age = exports.AllergyIntoleranceReaction = exports.AllergyIntolerance = void 0;
|
|
4
|
+
exports.ClinicalImpressionInvestigation = exports.ClinicalImpression = exports.Slot = exports.Schedule = exports.HealthcareService = exports.Bundle = exports.AuditEvent = exports.CommunicationRequest = exports.Immunization = exports.Observation = exports.Device = exports.Practitioner = exports.PractitionerRole = exports.ProcedureRequest = exports.Task = exports.Communication = exports.CarePlan = exports.EpisodeOfCare = exports.CareTeam = exports.CareTeamParticipant = exports.Encounter = exports.Condition = exports.ProcessRequest = exports.Account = exports.Location = exports.Organization = exports.AppointmentResponse = exports.Appointment = exports.DocumentReference = exports.Patient = exports.Questionnaire = exports.QuestionnaireResponse = exports.Udi = exports.Entity = exports.EntityDetail = exports.Source = exports.Agent = exports.Item = exports.QuestionnaireResponseItem = exports.Requester = exports.Position = exports.ActivityDetail = exports.BundleEntry = exports.BundleResponse = exports.BundleRequest = exports.Search = exports.BundleSignature = exports.BundleLink = exports.NotAvailable = exports.AvailableTime = void 0;
|
|
5
|
+
exports.ValueSetContains = exports.ValueSetParameter = exports.ValueSetExpansion = exports.ValueSetFilter = exports.ValueSetDesignation = exports.ValueSetConcept = exports.ValueSetInclude = exports.ValueSetCompose = exports.ValueSet = exports.Age = exports.AllergyIntoleranceReaction = exports.AllergyIntolerance = exports.ClinicalImpressionFinding = void 0;
|
|
6
6
|
/* This is base class from which other elements are derived */
|
|
7
7
|
class FHIRElement {
|
|
8
8
|
}
|
|
@@ -314,6 +314,9 @@ exports.Account = Account;
|
|
|
314
314
|
class ProcessRequest extends BaseResource {
|
|
315
315
|
}
|
|
316
316
|
exports.ProcessRequest = ProcessRequest;
|
|
317
|
+
class Condition extends BaseResource {
|
|
318
|
+
}
|
|
319
|
+
exports.Condition = Condition;
|
|
317
320
|
class Encounter extends BaseResource {
|
|
318
321
|
}
|
|
319
322
|
exports.Encounter = Encounter;
|
|
@@ -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
package/src/FHIR-R3.ts
CHANGED
|
@@ -809,6 +809,41 @@ export class ProcessRequest extends BaseResource {
|
|
|
809
809
|
request: Reference;
|
|
810
810
|
}
|
|
811
811
|
|
|
812
|
+
export class Condition extends BaseResource {
|
|
813
|
+
resourceType: "Condition";
|
|
814
|
+
identifier?: Identifier[];
|
|
815
|
+
clinicalStatus?: "active" | "recurrence" | "inactive" | "remission" | "resolved";
|
|
816
|
+
verificationStatus?: "provisional" | "differential" | "confirmed" | "refuted" | "entered-in-error" | "unknown";
|
|
817
|
+
category?: CodeableConcept[];
|
|
818
|
+
severity?: CodeableConcept;
|
|
819
|
+
code?: CodeableConcept;
|
|
820
|
+
bodySite?: CodeableConcept[];
|
|
821
|
+
subject: Reference;
|
|
822
|
+
context?: Reference;
|
|
823
|
+
onsetDateTime?: string | Date;
|
|
824
|
+
onsetAge?: Age;
|
|
825
|
+
onsetPeriod?: Period;
|
|
826
|
+
onsetRange?: Range;
|
|
827
|
+
onsetString?: string;
|
|
828
|
+
abatementDateTime?: string | Date;
|
|
829
|
+
abatementAge?: Age;
|
|
830
|
+
abatementBoolean?: boolean;
|
|
831
|
+
abatementPeriod?: Period;
|
|
832
|
+
abatementRange?: Range;
|
|
833
|
+
abatementString?: string;
|
|
834
|
+
assertedDate?: string | Date;
|
|
835
|
+
asserter?: Reference;
|
|
836
|
+
stage?: {
|
|
837
|
+
summary?: CodeableConcept;
|
|
838
|
+
assessment?: Reference[];
|
|
839
|
+
};
|
|
840
|
+
evidence?: {
|
|
841
|
+
code?: CodeableConcept[];
|
|
842
|
+
detail?: Reference[];
|
|
843
|
+
}[];
|
|
844
|
+
note?: Annotation[]
|
|
845
|
+
}
|
|
846
|
+
|
|
812
847
|
export class Encounter extends BaseResource {
|
|
813
848
|
resourceType: "Encounter";
|
|
814
849
|
identifier: Identifier[];
|
|
@@ -1376,4 +1411,4 @@ export class ValueSetContains extends BackboneElement {
|
|
|
1376
1411
|
}
|
|
1377
1412
|
|
|
1378
1413
|
|
|
1379
|
-
export type Resource = AllergyIntolerance | ClinicalImpression | Schedule | HealthcareService | Bundle | AuditEvent | CommunicationRequest | Immunization | Observation | Device | Practitioner | PractitionerRole | ProcedureRequest | Task | Communication | CarePlan | EpisodeOfCare | CareTeam | Encounter | ProcessRequest | Account | Location | Organization | AppointmentResponse | Appointment | QuestionnaireResponse | Questionnaire | Slot | Patient | DocumentReference | ValueSet;
|
|
1414
|
+
export type Resource = AllergyIntolerance | ClinicalImpression | Condition | Schedule | HealthcareService | Bundle | AuditEvent | CommunicationRequest | Immunization | Observation | Device | Practitioner | PractitionerRole | ProcedureRequest | Task | Communication | CarePlan | EpisodeOfCare | CareTeam | Encounter | ProcessRequest | Account | Location | Organization | AppointmentResponse | Appointment | QuestionnaireResponse | Questionnaire | Slot | Patient | DocumentReference | ValueSet;
|
|
@@ -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
|
: [];
|