@smile-cdr/fhirts 1.2.11 → 1.4.0
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/.changeset/README.md +8 -0
- package/.changeset/blue-ducks-grow.md +8 -0
- package/.changeset/config.json +11 -0
- package/CHANGELOG.md +23 -0
- package/GETTINGSTARTED.md +7 -0
- package/dist/FHIR-DSTU2.d.ts +147 -0
- package/dist/FHIR-DSTU2.js +81 -0
- package/dist/FHIR-R3.d.ts +36 -1
- package/dist/FHIR-R3.js +15 -2
- package/dist/FHIR-R4/classes/models-r4.js +5 -1
- package/dist/FHIR-R4/interfaces/IModel.js +5 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/package.json +2 -1
- package/src/FHIR-DSTU2.ts +179 -0
- package/src/FHIR-R3.ts +41 -1
- package/src/index.ts +2 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
+
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
|
6
|
+
|
|
7
|
+
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@1.7.0/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "restricted",
|
|
8
|
+
"baseBranch": "master",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
### Updates (R3)
|
|
6
|
+
|
|
7
|
+
* The `Participant` class has been re-tooled to only be used in the `Appointment` class
|
|
8
|
+
* Droped the `Period` field in the `Participant` class as it is not used in `Appointment.participant`
|
|
9
|
+
* Added `EncounterParticipant` to replace the class type in `Encounter.participant`
|
|
10
|
+
* `EncounterParticipant` follows the STU3 spec for `Encounter.participant`
|
|
11
|
+
|
|
12
|
+
This release introduces a breaking change for Encounter.If you're using `Encounter` in your code, the `participant` field will have a new type, `EncounterParticipant` with the appropriate changes. This will break existing implementations, unless they are updated to take advantage of the new `EncounterParticipant` class. The `Period` in the `Participant` class has been removed as it's not using by the `Appointment.participant` field.
|
|
13
|
+
|
|
14
|
+
## 1.3.1
|
|
15
|
+
---
|
|
16
|
+
### Updates (R3)
|
|
17
|
+
|
|
18
|
+
* Added class for `ClinicalImpression` resource.
|
|
19
|
+
|
|
20
|
+
## 1.3.0
|
|
21
|
+
|
|
22
|
+
### Updates (DSTU2)
|
|
23
|
+
|
|
24
|
+
* Added initial classes for DSTU2.
|
|
25
|
+
|
|
3
26
|
## 1.2.11
|
|
4
27
|
---
|
|
5
28
|
|
package/GETTINGSTARTED.md
CHANGED
|
@@ -17,6 +17,10 @@ FHIR.ts offers both classes & interfaces for various FHIR resources - which one(
|
|
|
17
17
|
To start, you'll need to first import the library:
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
+
|
|
21
|
+
// if using FHIR DSTU2
|
|
22
|
+
import { dstu2 } from '@smile-cdr/fhirts';
|
|
23
|
+
|
|
20
24
|
// if using FHIR R3
|
|
21
25
|
import { fhirR3 } from '@smile-cdr/fhirts';
|
|
22
26
|
|
|
@@ -30,6 +34,9 @@ import { IfhirR4 } from '@smile-cdr/fhirts';
|
|
|
30
34
|
Next, depending on the library & whether you're using classes or interfaces, the way you initialize resources might look a bit different:
|
|
31
35
|
|
|
32
36
|
```js
|
|
37
|
+
// if using FHIR DSTU2
|
|
38
|
+
let patient = new dstu2.Patient();
|
|
39
|
+
|
|
33
40
|
// if using FHIR R3
|
|
34
41
|
let patient = new fhirR3.Patient();
|
|
35
42
|
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export declare class FHIRElement {
|
|
2
|
+
id: string;
|
|
3
|
+
extension: Extension[];
|
|
4
|
+
}
|
|
5
|
+
export declare class BackboneElement extends FHIRElement {
|
|
6
|
+
modifierExtension: any;
|
|
7
|
+
}
|
|
8
|
+
export declare class Id {
|
|
9
|
+
private id;
|
|
10
|
+
constructor(input?: string);
|
|
11
|
+
}
|
|
12
|
+
export declare class DomainResource {
|
|
13
|
+
text: Narrative;
|
|
14
|
+
contained: Resource[];
|
|
15
|
+
extension: Extension[];
|
|
16
|
+
modifierExtension: Extension[];
|
|
17
|
+
}
|
|
18
|
+
export declare class Resource extends DomainResource {
|
|
19
|
+
resourceType: string;
|
|
20
|
+
id: string;
|
|
21
|
+
meta: Meta;
|
|
22
|
+
implicitRules: string;
|
|
23
|
+
language: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class Meta extends FHIRElement {
|
|
26
|
+
versionId: Id;
|
|
27
|
+
lastUpdated: Date;
|
|
28
|
+
profile: string;
|
|
29
|
+
security: Coding;
|
|
30
|
+
tag: Coding;
|
|
31
|
+
}
|
|
32
|
+
export declare class Narrative {
|
|
33
|
+
status: string;
|
|
34
|
+
div: string;
|
|
35
|
+
}
|
|
36
|
+
export declare class CodeableConcept extends FHIRElement {
|
|
37
|
+
coding: Coding[];
|
|
38
|
+
text: string;
|
|
39
|
+
}
|
|
40
|
+
export declare class Identifier extends FHIRElement {
|
|
41
|
+
use: string;
|
|
42
|
+
type: CodeableConcept;
|
|
43
|
+
system: string;
|
|
44
|
+
value: string;
|
|
45
|
+
period: Period;
|
|
46
|
+
assigner: Reference;
|
|
47
|
+
}
|
|
48
|
+
export declare class Reference extends FHIRElement {
|
|
49
|
+
reference: string;
|
|
50
|
+
identifier: Identifier;
|
|
51
|
+
display: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class HumanName extends FHIRElement {
|
|
54
|
+
use: string;
|
|
55
|
+
text: string;
|
|
56
|
+
family: string[];
|
|
57
|
+
given: string[];
|
|
58
|
+
prefix: string[];
|
|
59
|
+
suffix: string[];
|
|
60
|
+
period: Period;
|
|
61
|
+
}
|
|
62
|
+
export declare class Extension {
|
|
63
|
+
url: string;
|
|
64
|
+
valueString: string;
|
|
65
|
+
valueCode: string;
|
|
66
|
+
valueAddress: Address;
|
|
67
|
+
valueBoolean?: boolean;
|
|
68
|
+
valueHumanName: HumanName;
|
|
69
|
+
valueReference: Reference;
|
|
70
|
+
valueDate: Date;
|
|
71
|
+
valueIdentifier: string;
|
|
72
|
+
valueDecimal?: number;
|
|
73
|
+
valueInteger: number;
|
|
74
|
+
valuePeriod: Period;
|
|
75
|
+
}
|
|
76
|
+
export declare class Coding extends FHIRElement {
|
|
77
|
+
system: string;
|
|
78
|
+
version: string;
|
|
79
|
+
code: string;
|
|
80
|
+
display: string;
|
|
81
|
+
userSelected: boolean;
|
|
82
|
+
}
|
|
83
|
+
export declare class Period extends FHIRElement {
|
|
84
|
+
start: string;
|
|
85
|
+
end: string;
|
|
86
|
+
}
|
|
87
|
+
export declare class Address extends FHIRElement {
|
|
88
|
+
use: string;
|
|
89
|
+
type: string;
|
|
90
|
+
text: string;
|
|
91
|
+
line: string[];
|
|
92
|
+
city: string;
|
|
93
|
+
district: string;
|
|
94
|
+
state: string;
|
|
95
|
+
postalCode: string;
|
|
96
|
+
country: string;
|
|
97
|
+
period: Period;
|
|
98
|
+
}
|
|
99
|
+
export declare class Contact extends BackboneElement {
|
|
100
|
+
relationship: CodeableConcept[];
|
|
101
|
+
name: HumanName;
|
|
102
|
+
telecom: ContactPoint[];
|
|
103
|
+
address: Address;
|
|
104
|
+
gender: string;
|
|
105
|
+
organization: Reference;
|
|
106
|
+
period: Period;
|
|
107
|
+
}
|
|
108
|
+
export declare class ContactPoint extends FHIRElement {
|
|
109
|
+
system: string;
|
|
110
|
+
value: string;
|
|
111
|
+
use: string;
|
|
112
|
+
rank: number;
|
|
113
|
+
period: Period;
|
|
114
|
+
}
|
|
115
|
+
export declare class Link extends BackboneElement {
|
|
116
|
+
other: Reference;
|
|
117
|
+
type: string;
|
|
118
|
+
}
|
|
119
|
+
export declare class PatientCommunication extends BackboneElement {
|
|
120
|
+
language: CodeableConcept;
|
|
121
|
+
preferred: boolean;
|
|
122
|
+
}
|
|
123
|
+
export declare class Patient extends Resource {
|
|
124
|
+
identifier: Identifier[];
|
|
125
|
+
active: boolean;
|
|
126
|
+
name: HumanName[];
|
|
127
|
+
telecom: ContactPoint[];
|
|
128
|
+
gender: string;
|
|
129
|
+
birthDate: string;
|
|
130
|
+
address: Address[];
|
|
131
|
+
maritalStatus: CodeableConcept;
|
|
132
|
+
contact: Contact[];
|
|
133
|
+
communication: PatientCommunication[];
|
|
134
|
+
generalPractitioner: Reference[];
|
|
135
|
+
managingOrganization: Reference;
|
|
136
|
+
link: Link[];
|
|
137
|
+
}
|
|
138
|
+
export declare class OperationOutcome extends Resource {
|
|
139
|
+
issue: Issue[];
|
|
140
|
+
}
|
|
141
|
+
export declare class Issue extends BackboneElement {
|
|
142
|
+
severity: string;
|
|
143
|
+
code: string;
|
|
144
|
+
details: CodeableConcept;
|
|
145
|
+
diagnostics: string;
|
|
146
|
+
location: string[];
|
|
147
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Issue = exports.OperationOutcome = exports.Patient = exports.PatientCommunication = exports.Link = exports.ContactPoint = exports.Contact = exports.Address = exports.Period = exports.Coding = exports.Extension = exports.HumanName = exports.Reference = exports.Identifier = exports.CodeableConcept = exports.Narrative = exports.Meta = exports.Resource = exports.DomainResource = exports.Id = exports.BackboneElement = exports.FHIRElement = void 0;
|
|
4
|
+
/* This is base class from which other elements are derived */
|
|
5
|
+
class FHIRElement {
|
|
6
|
+
}
|
|
7
|
+
exports.FHIRElement = FHIRElement;
|
|
8
|
+
class BackboneElement extends FHIRElement {
|
|
9
|
+
}
|
|
10
|
+
exports.BackboneElement = BackboneElement;
|
|
11
|
+
/* FHIR classes used in resources */
|
|
12
|
+
class Id {
|
|
13
|
+
constructor(input) {
|
|
14
|
+
const re = new RegExp('[A-Za-z0-9\\-\\.]{1,64}');
|
|
15
|
+
if (re.test(input)) {
|
|
16
|
+
this.id = input;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
throw new RangeError('Not a valid Id string - must match reg exp [A-Za-z0-9\\-\\.]{1,64} Was provided: ' + input);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Id = Id;
|
|
24
|
+
class DomainResource {
|
|
25
|
+
}
|
|
26
|
+
exports.DomainResource = DomainResource;
|
|
27
|
+
class Resource extends DomainResource {
|
|
28
|
+
}
|
|
29
|
+
exports.Resource = Resource;
|
|
30
|
+
class Meta extends FHIRElement {
|
|
31
|
+
}
|
|
32
|
+
exports.Meta = Meta;
|
|
33
|
+
class Narrative {
|
|
34
|
+
}
|
|
35
|
+
exports.Narrative = Narrative;
|
|
36
|
+
class CodeableConcept extends FHIRElement {
|
|
37
|
+
}
|
|
38
|
+
exports.CodeableConcept = CodeableConcept;
|
|
39
|
+
class Identifier extends FHIRElement {
|
|
40
|
+
}
|
|
41
|
+
exports.Identifier = Identifier;
|
|
42
|
+
class Reference extends FHIRElement {
|
|
43
|
+
}
|
|
44
|
+
exports.Reference = Reference;
|
|
45
|
+
// Human Name - Last name is an array for DSTU2
|
|
46
|
+
class HumanName extends FHIRElement {
|
|
47
|
+
}
|
|
48
|
+
exports.HumanName = HumanName;
|
|
49
|
+
class Extension {
|
|
50
|
+
}
|
|
51
|
+
exports.Extension = Extension;
|
|
52
|
+
class Coding extends FHIRElement {
|
|
53
|
+
}
|
|
54
|
+
exports.Coding = Coding;
|
|
55
|
+
class Period extends FHIRElement {
|
|
56
|
+
}
|
|
57
|
+
exports.Period = Period;
|
|
58
|
+
class Address extends FHIRElement {
|
|
59
|
+
}
|
|
60
|
+
exports.Address = Address;
|
|
61
|
+
class Contact extends BackboneElement {
|
|
62
|
+
}
|
|
63
|
+
exports.Contact = Contact;
|
|
64
|
+
class ContactPoint extends FHIRElement {
|
|
65
|
+
}
|
|
66
|
+
exports.ContactPoint = ContactPoint;
|
|
67
|
+
class Link extends BackboneElement {
|
|
68
|
+
}
|
|
69
|
+
exports.Link = Link;
|
|
70
|
+
class PatientCommunication extends BackboneElement {
|
|
71
|
+
}
|
|
72
|
+
exports.PatientCommunication = PatientCommunication;
|
|
73
|
+
class Patient extends Resource {
|
|
74
|
+
}
|
|
75
|
+
exports.Patient = Patient;
|
|
76
|
+
class OperationOutcome extends Resource {
|
|
77
|
+
}
|
|
78
|
+
exports.OperationOutcome = OperationOutcome;
|
|
79
|
+
class Issue extends BackboneElement {
|
|
80
|
+
}
|
|
81
|
+
exports.Issue = Issue;
|
package/dist/FHIR-R3.d.ts
CHANGED
|
@@ -273,6 +273,10 @@ export declare class Participant extends BackboneElement {
|
|
|
273
273
|
actor: Reference;
|
|
274
274
|
required: string;
|
|
275
275
|
status: string;
|
|
276
|
+
}
|
|
277
|
+
export declare class EncounterParticipant extends BackboneElement {
|
|
278
|
+
type: CodeableConcept[];
|
|
279
|
+
individual: Reference;
|
|
276
280
|
period: Period;
|
|
277
281
|
}
|
|
278
282
|
export declare class Activity extends BackboneElement {
|
|
@@ -649,7 +653,7 @@ export declare class Encounter extends Resource {
|
|
|
649
653
|
status: string;
|
|
650
654
|
episodeOfCare: Reference[];
|
|
651
655
|
subject: Reference;
|
|
652
|
-
participant:
|
|
656
|
+
participant: EncounterParticipant[];
|
|
653
657
|
}
|
|
654
658
|
export declare class CareTeamParticipant extends BackboneElement {
|
|
655
659
|
role: CodeableConcept;
|
|
@@ -969,4 +973,35 @@ export declare class Slot extends Resource {
|
|
|
969
973
|
overbooked: boolean;
|
|
970
974
|
comment: string;
|
|
971
975
|
}
|
|
976
|
+
export declare class ClinicalImpression extends Resource {
|
|
977
|
+
identifier: Identifier[];
|
|
978
|
+
status: string;
|
|
979
|
+
code: CodeableConcept;
|
|
980
|
+
description: string;
|
|
981
|
+
subject: Reference;
|
|
982
|
+
context: Reference;
|
|
983
|
+
effectiveDateTime: string;
|
|
984
|
+
effectivePeriod: Period;
|
|
985
|
+
date: string;
|
|
986
|
+
assessor: Reference;
|
|
987
|
+
previous: Reference;
|
|
988
|
+
problem: Reference[];
|
|
989
|
+
investigation: ClinicalImpressionInvestigation[];
|
|
990
|
+
protocol: string[];
|
|
991
|
+
summary: string;
|
|
992
|
+
finding: ClinicalImpressionFinding[];
|
|
993
|
+
prognosisCodeableConcept: CodeableConcept[];
|
|
994
|
+
prognosisReference: Reference[];
|
|
995
|
+
action: Reference[];
|
|
996
|
+
note: Annotation[];
|
|
997
|
+
}
|
|
998
|
+
export declare class ClinicalImpressionInvestigation extends BackboneElement {
|
|
999
|
+
code: CodeableConcept;
|
|
1000
|
+
item: Reference[];
|
|
1001
|
+
}
|
|
1002
|
+
export declare class ClinicalImpressionFinding extends BackboneElement {
|
|
1003
|
+
basis: string;
|
|
1004
|
+
itemCodeableConcept: CodeableConcept;
|
|
1005
|
+
itemReference: Reference;
|
|
1006
|
+
}
|
|
972
1007
|
export {};
|
package/dist/FHIR-R3.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
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.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;
|
|
3
|
+
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.Resource = exports.DomainResource = exports.Id = exports.BackboneElement = exports.FHIRElement = 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.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 = exports.Restriction = void 0;
|
|
5
|
+
exports.ClinicalImpressionFinding = void 0;
|
|
5
6
|
/* This is base class from which other elements are derived */
|
|
6
7
|
class FHIRElement {
|
|
7
8
|
}
|
|
@@ -211,6 +212,9 @@ exports.ReferenceRange = ReferenceRange;
|
|
|
211
212
|
class Participant extends BackboneElement {
|
|
212
213
|
}
|
|
213
214
|
exports.Participant = Participant;
|
|
215
|
+
class EncounterParticipant extends BackboneElement {
|
|
216
|
+
}
|
|
217
|
+
exports.EncounterParticipant = EncounterParticipant;
|
|
214
218
|
class Activity extends BackboneElement {
|
|
215
219
|
}
|
|
216
220
|
exports.Activity = Activity;
|
|
@@ -379,3 +383,12 @@ exports.Schedule = Schedule;
|
|
|
379
383
|
class Slot extends Resource {
|
|
380
384
|
}
|
|
381
385
|
exports.Slot = Slot;
|
|
386
|
+
class ClinicalImpression extends Resource {
|
|
387
|
+
}
|
|
388
|
+
exports.ClinicalImpression = ClinicalImpression;
|
|
389
|
+
class ClinicalImpressionInvestigation extends BackboneElement {
|
|
390
|
+
}
|
|
391
|
+
exports.ClinicalImpressionInvestigation = ClinicalImpressionInvestigation;
|
|
392
|
+
class ClinicalImpressionFinding extends BackboneElement {
|
|
393
|
+
}
|
|
394
|
+
exports.ClinicalImpressionFinding = ClinicalImpressionFinding;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as fhirR4 from './FHIR-R4/classes/models-r4';
|
|
2
2
|
import * as IfhirR4 from './FHIR-R4/interfaces/IModel';
|
|
3
3
|
import * as fhirR3 from './FHIR-R3';
|
|
4
|
-
|
|
4
|
+
import * as dstu2 from './FHIR-DSTU2';
|
|
5
|
+
export { fhirR4, fhirR3, IfhirR4, dstu2 };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IfhirR4 = exports.fhirR3 = exports.fhirR4 = void 0;
|
|
3
|
+
exports.dstu2 = exports.IfhirR4 = exports.fhirR3 = exports.fhirR4 = void 0;
|
|
4
4
|
const fhirR4 = require("./FHIR-R4/classes/models-r4");
|
|
5
5
|
exports.fhirR4 = fhirR4;
|
|
6
6
|
const IfhirR4 = require("./FHIR-R4/interfaces/IModel");
|
|
7
7
|
exports.IfhirR4 = IfhirR4;
|
|
8
8
|
const fhirR3 = require("./FHIR-R3");
|
|
9
9
|
exports.fhirR3 = fhirR3;
|
|
10
|
+
const dstu2 = require("./FHIR-DSTU2");
|
|
11
|
+
exports.dstu2 = dstu2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smile-cdr/fhirts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Fhir ts/js library for frontend apps",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"build": "tsc"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
+
"@changesets/cli": "^2.21.0",
|
|
13
14
|
"typescript": "^4.0.2"
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/* This is base class from which other elements are derived */
|
|
2
|
+
export class FHIRElement {
|
|
3
|
+
id: string;
|
|
4
|
+
extension: Extension[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class BackboneElement extends FHIRElement {
|
|
8
|
+
modifierExtension: any;
|
|
9
|
+
}
|
|
10
|
+
/* FHIR classes used in resources */
|
|
11
|
+
export class Id {
|
|
12
|
+
private id: string;
|
|
13
|
+
|
|
14
|
+
constructor(input?: string) {
|
|
15
|
+
const re = new RegExp('[A-Za-z0-9\\-\\.]{1,64}');
|
|
16
|
+
|
|
17
|
+
if (re.test(input)) {
|
|
18
|
+
this.id = input;
|
|
19
|
+
} else {
|
|
20
|
+
throw new RangeError('Not a valid Id string - must match reg exp [A-Za-z0-9\\-\\.]{1,64} Was provided: ' + input);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class DomainResource {
|
|
26
|
+
text: Narrative;
|
|
27
|
+
contained: Resource[];
|
|
28
|
+
extension: Extension[];
|
|
29
|
+
modifierExtension: Extension[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class Resource extends DomainResource {
|
|
33
|
+
resourceType: string;
|
|
34
|
+
id: string;
|
|
35
|
+
meta: Meta;
|
|
36
|
+
implicitRules: string;
|
|
37
|
+
language: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class Meta extends FHIRElement {
|
|
41
|
+
versionId: Id;
|
|
42
|
+
lastUpdated: Date;
|
|
43
|
+
profile: string;
|
|
44
|
+
security: Coding;
|
|
45
|
+
tag: Coding;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class Narrative {
|
|
49
|
+
status: string;
|
|
50
|
+
div: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class CodeableConcept extends FHIRElement {
|
|
54
|
+
coding: Coding[];
|
|
55
|
+
text: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class Identifier extends FHIRElement {
|
|
59
|
+
use: string;
|
|
60
|
+
type: CodeableConcept;
|
|
61
|
+
system: string;
|
|
62
|
+
value: string;
|
|
63
|
+
period: Period;
|
|
64
|
+
assigner: Reference;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export class Reference extends FHIRElement {
|
|
68
|
+
reference: string;
|
|
69
|
+
identifier: Identifier;
|
|
70
|
+
display: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Human Name - Last name is an array for DSTU2
|
|
74
|
+
export class HumanName extends FHIRElement {
|
|
75
|
+
use: string;
|
|
76
|
+
text: string;
|
|
77
|
+
family: string[];
|
|
78
|
+
given: string[];
|
|
79
|
+
prefix: string[];
|
|
80
|
+
suffix: string[];
|
|
81
|
+
period: Period;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class Extension {
|
|
85
|
+
url: string;
|
|
86
|
+
valueString: string;
|
|
87
|
+
valueCode: string;
|
|
88
|
+
valueAddress: Address;
|
|
89
|
+
valueBoolean?: boolean;
|
|
90
|
+
valueHumanName: HumanName;
|
|
91
|
+
valueReference: Reference;
|
|
92
|
+
valueDate: Date;
|
|
93
|
+
valueIdentifier: string;
|
|
94
|
+
valueDecimal?: number;
|
|
95
|
+
valueInteger: number;
|
|
96
|
+
valuePeriod: Period;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export class Coding extends FHIRElement {
|
|
100
|
+
system: string;
|
|
101
|
+
version: string;
|
|
102
|
+
code: string;
|
|
103
|
+
display: string;
|
|
104
|
+
userSelected: boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export class Period extends FHIRElement {
|
|
108
|
+
start: string;
|
|
109
|
+
end: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export class Address extends FHIRElement {
|
|
113
|
+
use: string;
|
|
114
|
+
type: string;
|
|
115
|
+
text: string;
|
|
116
|
+
line: string[];
|
|
117
|
+
city: string;
|
|
118
|
+
district: string;
|
|
119
|
+
state: string;
|
|
120
|
+
postalCode: string;
|
|
121
|
+
country: string;
|
|
122
|
+
period: Period;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export class Contact extends BackboneElement {
|
|
126
|
+
relationship: CodeableConcept[];
|
|
127
|
+
name: HumanName;
|
|
128
|
+
telecom: ContactPoint[];
|
|
129
|
+
address: Address;
|
|
130
|
+
gender: string;
|
|
131
|
+
organization: Reference;
|
|
132
|
+
period: Period;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class ContactPoint extends FHIRElement {
|
|
136
|
+
system: string;
|
|
137
|
+
value: string;
|
|
138
|
+
use: string;
|
|
139
|
+
rank: number;
|
|
140
|
+
period: Period;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export class Link extends BackboneElement {
|
|
144
|
+
other: Reference;
|
|
145
|
+
type: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class PatientCommunication extends BackboneElement {
|
|
149
|
+
language: CodeableConcept;
|
|
150
|
+
preferred: boolean;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export class Patient extends Resource {
|
|
154
|
+
identifier: Identifier[];
|
|
155
|
+
active: boolean;
|
|
156
|
+
name: HumanName[];
|
|
157
|
+
telecom: ContactPoint[];
|
|
158
|
+
gender: string;
|
|
159
|
+
birthDate: string;
|
|
160
|
+
address: Address[];
|
|
161
|
+
maritalStatus: CodeableConcept;
|
|
162
|
+
contact: Contact[];
|
|
163
|
+
communication: PatientCommunication[];
|
|
164
|
+
generalPractitioner: Reference[];
|
|
165
|
+
managingOrganization: Reference;
|
|
166
|
+
link: Link[];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export class OperationOutcome extends Resource {
|
|
170
|
+
issue: Issue[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export class Issue extends BackboneElement {
|
|
174
|
+
severity: string;
|
|
175
|
+
code: string;
|
|
176
|
+
details: CodeableConcept;
|
|
177
|
+
diagnostics: string;
|
|
178
|
+
location: string[];
|
|
179
|
+
}
|
package/src/FHIR-R3.ts
CHANGED
|
@@ -391,8 +391,14 @@ export class Participant extends BackboneElement {
|
|
|
391
391
|
actor: Reference;
|
|
392
392
|
required: string;
|
|
393
393
|
status: string;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export class EncounterParticipant extends BackboneElement {
|
|
397
|
+
type: CodeableConcept[];
|
|
398
|
+
individual: Reference;
|
|
394
399
|
period: Period;
|
|
395
400
|
}
|
|
401
|
+
|
|
396
402
|
export class Activity extends BackboneElement {
|
|
397
403
|
outcomeCodeableConcept: CodeableConcept[];
|
|
398
404
|
outcomeReference: Reference[];
|
|
@@ -810,7 +816,7 @@ export class Encounter extends Resource {
|
|
|
810
816
|
status: string;
|
|
811
817
|
episodeOfCare: Reference[];
|
|
812
818
|
subject: Reference;
|
|
813
|
-
participant:
|
|
819
|
+
participant: EncounterParticipant[];
|
|
814
820
|
}
|
|
815
821
|
|
|
816
822
|
export class CareTeamParticipant extends BackboneElement {
|
|
@@ -1151,4 +1157,38 @@ export class Slot extends Resource {
|
|
|
1151
1157
|
comment: string;
|
|
1152
1158
|
}
|
|
1153
1159
|
|
|
1160
|
+
export class ClinicalImpression extends Resource {
|
|
1161
|
+
identifier: Identifier[];
|
|
1162
|
+
status: string;
|
|
1163
|
+
code: CodeableConcept;
|
|
1164
|
+
description: string;
|
|
1165
|
+
subject: Reference;
|
|
1166
|
+
context: Reference;
|
|
1167
|
+
effectiveDateTime: string;
|
|
1168
|
+
effectivePeriod: Period;
|
|
1169
|
+
date: string;
|
|
1170
|
+
assessor: Reference;
|
|
1171
|
+
previous: Reference;
|
|
1172
|
+
problem: Reference[];
|
|
1173
|
+
investigation: ClinicalImpressionInvestigation[];
|
|
1174
|
+
protocol: string[];
|
|
1175
|
+
summary: string;
|
|
1176
|
+
finding: ClinicalImpressionFinding[];
|
|
1177
|
+
prognosisCodeableConcept: CodeableConcept[];
|
|
1178
|
+
prognosisReference: Reference[];
|
|
1179
|
+
action: Reference[];
|
|
1180
|
+
note: Annotation[];
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
export class ClinicalImpressionInvestigation extends BackboneElement {
|
|
1184
|
+
code: CodeableConcept;
|
|
1185
|
+
item: Reference[];
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
export class ClinicalImpressionFinding extends BackboneElement {
|
|
1189
|
+
basis: string;
|
|
1190
|
+
itemCodeableConcept: CodeableConcept;
|
|
1191
|
+
itemReference: Reference;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1154
1194
|
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as fhirR4 from './FHIR-R4/classes/models-r4';
|
|
2
2
|
import * as IfhirR4 from './FHIR-R4/interfaces/IModel';
|
|
3
3
|
import * as fhirR3 from './FHIR-R3';
|
|
4
|
-
|
|
4
|
+
import * as dstu2 from './FHIR-DSTU2';
|
|
5
|
+
export { fhirR4, fhirR3, IfhirR4, dstu2 };
|
|
5
6
|
|